MCPcopy Create free account
hub / github.com/SethGammon/Citadel / hookOutput

Function hookOutput

hooks_src/external-action-gate.js:42–54  ·  view source on GitHub ↗
(hookName, action, message, data = {})

Source from the content-addressed store, hash-verified

40const CITADEL_UI = process.env.CITADEL_UI === 'true';
41
42// For CITADEL_UI (desktop app): structured JSON to stdout.
43// For CLI: human-readable message to stderr — Claude Code includes stderr in the
44// hook error that the agent reads, so this is what surfaces as the block reason.
45function hookOutput(hookName, action, message, data = {}) {
46 if (CITADEL_UI) {
47 process.stdout.write(JSON.stringify({
48 hook: hookName,
49 action,
50 message,
51 timestamp: new Date().toISOString(),
52 data,
53 }));
54 } else {
55 process.stderr.write(message);
56 }
57}

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected