Function
hookOutput
(hookName, action, message, data = {})
Source from the content-addressed store, hash-verified
| 17 | const CITADEL_UI = process.env.CITADEL_UI === 'true'; |
| 18 | |
| 19 | function hookOutput(hookName, action, message, data = {}) { |
| 20 | if (CITADEL_UI) { |
| 21 | process.stdout.write(JSON.stringify({ |
| 22 | hook: hookName, |
| 23 | action, |
| 24 | message, |
| 25 | timestamp: new Date().toISOString(), |
| 26 | data, |
| 27 | })); |
| 28 | } else { |
| 29 | process.stdout.write(message); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | function main() { |
| 34 | let input = ''; |
Tested by
no test coverage detected