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

Function main

hooks_src/elicitation.js:33–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31const KNOWN_SERVERS = new Set([]);
32
33function main() {
34 let input = '';
35 process.stdin.setEncoding('utf8');
36 process.stdin.on('data', (chunk) => { input += chunk; });
37 process.stdin.on('end', () => {
38 let event = {};
39 try { event = JSON.parse(input); } catch { /* partial input ok */ }
40
41 const hookEventName = event.hook_event_name || '';
42 const isResult = hookEventName === 'ElicitationResult' ||
43 event.accepted !== undefined;
44
45 const serverName = event.server_name || event.mcp_server || null;
46 const accepted = event.accepted !== undefined ? event.accepted : null;
47 const sessionId = event.session_id || null;
48
49 const eventLabel = isResult ? 'elicitation-result' : 'elicitation';
50
51 health.increment('elicitation', 'count');
52
53 health.logTiming('elicitation', 0, {
54 event: eventLabel,
55 server: serverName,
56 accepted: accepted,
57 known_server: serverName ? KNOWN_SERVERS.has(serverName) : false,
58 session_id: sessionId,
59 });
60
61 // No auto-response: exit 0 with no stdout = defer to user
62 process.exit(0);
63 });
64}
65
66main();

Callers 1

elicitation.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected