Function
hookOutput
(hookName, action, message, data = {})
Source from the content-addressed store, hash-verified
| 21 | const CITADEL_UI = process.env.CITADEL_UI === 'true'; |
| 22 | |
| 23 | function hookOutput(hookName, action, message, data = {}) { |
| 24 | if (CITADEL_UI) { |
| 25 | process.stdout.write(JSON.stringify({ |
| 26 | hook: hookName, |
| 27 | action, |
| 28 | message, |
| 29 | timestamp: new Date().toISOString(), |
| 30 | data, |
| 31 | })); |
| 32 | } else { |
| 33 | process.stdout.write(message); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | function main() { |
| 38 | // Try PLUGIN_DATA_DIR first, fall back to legacy .claude/ location |
Tested by
no test coverage detected