agent-recorder 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +4 -0
- package/dist/bundle.js.map +1 -1
- package/dist/embed.d.ts +21 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +22 -0
- package/dist/embed.js.map +1 -0
- package/package.json +8 -1
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js +3 -0
- package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.d.ts +11 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.js +442 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js +8 -5
- package/vendor/node_modules/@agent-recorder/cli/commands/sessions.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts +2 -51
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js +2 -113
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js +1 -1
- package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/index.js +10 -0
- package/vendor/node_modules/@agent-recorder/cli/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/package.json +1 -1
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js +1 -1
- package/vendor/node_modules/@agent-recorder/cli/tui/components/EventInspectPanel.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/claude-config.d.ts +23 -0
- package/vendor/node_modules/@agent-recorder/core/claude-config.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/claude-config.js +50 -0
- package/vendor/node_modules/@agent-recorder/core/claude-config.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/config.d.ts +10 -1
- package/vendor/node_modules/@agent-recorder/core/config.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/config.js +11 -1
- package/vendor/node_modules/@agent-recorder/core/config.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.js +133 -0
- package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/events.d.ts +23 -36
- package/vendor/node_modules/@agent-recorder/core/db/events.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/events.js +74 -3
- package/vendor/node_modules/@agent-recorder/core/db/events.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/events.test.js +62 -1
- package/vendor/node_modules/@agent-recorder/core/db/events.test.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/index.d.ts +2 -1
- package/vendor/node_modules/@agent-recorder/core/db/index.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/index.js +2 -1
- package/vendor/node_modules/@agent-recorder/core/db/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts +2 -5
- package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/sessions.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.d.ts +33 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.js +88 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.test.js +167 -0
- package/vendor/node_modules/@agent-recorder/core/db/token-metrics.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/index.d.ts +1 -1
- package/vendor/node_modules/@agent-recorder/core/index.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/index.js +1 -1
- package/vendor/node_modules/@agent-recorder/core/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/migrations/007_add_correlation_id.sql +11 -0
- package/vendor/node_modules/@agent-recorder/core/migrations/007_add_token_columns.sql +19 -0
- package/vendor/node_modules/@agent-recorder/core/package.json +1 -1
- package/vendor/node_modules/@agent-recorder/core/types/index.d.ts +4 -2
- package/vendor/node_modules/@agent-recorder/core/types/index.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/types/index.js +3 -0
- package/vendor/node_modules/@agent-recorder/core/types/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/utils/index.js +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/utils/redact.js +6 -3
- package/vendor/node_modules/@agent-recorder/core/utils/redact.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/core/utils/redact.test.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.test.js +82 -0
- package/vendor/node_modules/@agent-recorder/core/utils/redact.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.d.ts +24 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.js +31 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.test.js +80 -0
- package/vendor/node_modules/@agent-recorder/core/utils/tokens.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/hooks/package.json +1 -1
- package/vendor/node_modules/@agent-recorder/service/daemon-context.d.ts +14 -0
- package/vendor/node_modules/@agent-recorder/service/daemon-context.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/daemon-context.js +15 -0
- package/vendor/node_modules/@agent-recorder/service/daemon-context.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/index.d.ts +1 -8
- package/vendor/node_modules/@agent-recorder/service/index.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/index.js +15 -22
- package/vendor/node_modules/@agent-recorder/service/index.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts +27 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js +141 -35
- package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts +4 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js +56 -14
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.test.js +143 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/recorder.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts +5 -31
- package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/types.js +3 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/types.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.js +66 -0
- package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/package.json +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/events.js +42 -1
- package/vendor/node_modules/@agent-recorder/service/routes/events.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts +6 -1
- package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/health.js +5 -6
- package/vendor/node_modules/@agent-recorder/service/routes/health.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.d.ts +20 -0
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.js +403 -49
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.d.ts +9 -0
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.js +406 -0
- package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.d.ts +8 -0
- package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.js +65 -0
- package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.js +19 -1
- package/vendor/node_modules/@agent-recorder/service/routes/sessions.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/stdio.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/stdio.js +20 -1
- package/vendor/node_modules/@agent-recorder/service/routes/stdio.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.d.ts +12 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.js +18 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.test.d.ts +5 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.test.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.test.js +88 -0
- package/vendor/node_modules/@agent-recorder/service/routes/tokens.test.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/service/server.d.ts +4 -0
- package/vendor/node_modules/@agent-recorder/service/server.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/service/server.js +33 -3
- package/vendor/node_modules/@agent-recorder/service/server.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/stdio-proxy/package.json +1 -1
- package/vendor/node_modules/@agent-recorder/stdio-proxy/types.d.ts +3 -19
- package/vendor/node_modules/@agent-recorder/stdio-proxy/types.d.ts.map +1 -1
- package/vendor/node_modules/@agent-recorder/stdio-proxy/types.js +2 -1
- package/vendor/node_modules/@agent-recorder/stdio-proxy/types.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/{core/types → types}/events.d.ts +9 -0
- package/vendor/node_modules/@agent-recorder/types/events.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/events.js +9 -0
- package/vendor/node_modules/@agent-recorder/types/events.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/index.d.ts +12 -0
- package/vendor/node_modules/@agent-recorder/types/index.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/index.js +9 -0
- package/vendor/node_modules/@agent-recorder/types/index.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/jsonrpc.d.ts +35 -0
- package/vendor/node_modules/@agent-recorder/types/jsonrpc.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/jsonrpc.js +6 -0
- package/vendor/node_modules/@agent-recorder/types/jsonrpc.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/package.json +12 -0
- package/vendor/node_modules/@agent-recorder/{core/types → types}/session.d.ts +6 -0
- package/vendor/node_modules/@agent-recorder/types/session.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/{core/types → types}/session.js.map +1 -1
- package/vendor/node_modules/@agent-recorder/types/storage.d.ts +80 -0
- package/vendor/node_modules/@agent-recorder/types/storage.d.ts.map +1 -0
- package/vendor/node_modules/@agent-recorder/types/storage.js +9 -0
- package/vendor/node_modules/@agent-recorder/types/storage.js.map +1 -0
- package/vendor/node_modules/@agent-recorder/core/types/events.d.ts.map +0 -1
- package/vendor/node_modules/@agent-recorder/core/types/events.js +0 -6
- package/vendor/node_modules/@agent-recorder/core/types/events.js.map +0 -1
- package/vendor/node_modules/@agent-recorder/core/types/session.d.ts.map +0 -1
- /package/vendor/node_modules/@agent-recorder/{core/types → types}/session.js +0 -0
|
@@ -3,9 +3,54 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This endpoint is called by the agent-recorder-hook handler script
|
|
5
5
|
* which is configured in Claude Code's .claude/settings.json.
|
|
6
|
+
*
|
|
7
|
+
* Implements hierarchical event tracking:
|
|
8
|
+
* - SessionStart → creates agent_call event (root of the tree)
|
|
9
|
+
* - PreToolUse → creates event with status "running" (captures start time)
|
|
10
|
+
* - PostToolUse → completes the running event with output and end time
|
|
11
|
+
* - SessionEnd → ends the agent_call event
|
|
6
12
|
*/
|
|
7
13
|
import { randomUUID } from "node:crypto";
|
|
8
|
-
import { insertEvent, createSession, getSessionById, allocateSequence, } from "@agent-recorder/core";
|
|
14
|
+
import { insertEvent, completeEvent, findRunningEvent, endSession, createSession, getSessionById, allocateSequence, redactAndTruncate, redactJson, deriveErrorCategory, estimateSerializedTokens, } from "@agent-recorder/core";
|
|
15
|
+
/** Max age for session contexts before TTL eviction (1 hour) */
|
|
16
|
+
const SESSION_CONTEXT_TTL_MS = 60 * 60 * 1000;
|
|
17
|
+
/** Maximum number of tracked sessions to prevent unbounded growth */
|
|
18
|
+
const SESSION_CONTEXT_MAX_SIZE = 500;
|
|
19
|
+
/** Fastify JSON schema for hook event validation (module-level constant) */
|
|
20
|
+
const hookEventSchema = {
|
|
21
|
+
body: {
|
|
22
|
+
type: "object",
|
|
23
|
+
required: ["hook_type", "session_id"],
|
|
24
|
+
properties: {
|
|
25
|
+
hook_type: { type: "string" },
|
|
26
|
+
session_id: { type: "string" },
|
|
27
|
+
transcript_path: { type: "string" },
|
|
28
|
+
tool_name: { type: "string" },
|
|
29
|
+
tool_input: { type: "object" },
|
|
30
|
+
// Empty schema: tool responses are arbitrary (strings, objects, arrays, etc.)
|
|
31
|
+
// so we intentionally accept any JSON value here.
|
|
32
|
+
tool_response: {},
|
|
33
|
+
subagent_type: { type: "string" },
|
|
34
|
+
message: { type: "string" },
|
|
35
|
+
start_source: { type: "string" },
|
|
36
|
+
end_reason: { type: "string" },
|
|
37
|
+
statistics: { type: "object" },
|
|
38
|
+
},
|
|
39
|
+
// No additionalProperties: false here — hook payloads must be forward-
|
|
40
|
+
// compatible. If Claude Code ships new fields (e.g. correlation_id),
|
|
41
|
+
// rejecting them would silently drop the entire payload via the
|
|
42
|
+
// fail-open error handler, with no recording and no warning.
|
|
43
|
+
// The required-fields check (["hook_type", "session_id"]) provides
|
|
44
|
+
// the meaningful validation.
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
/** Get the current parent event ID from the context stack */
|
|
48
|
+
function getCurrentParentId(ctx) {
|
|
49
|
+
if (ctx.parentStack.length > 0) {
|
|
50
|
+
return ctx.parentStack[ctx.parentStack.length - 1].id;
|
|
51
|
+
}
|
|
52
|
+
return ctx.agentCallEventId;
|
|
53
|
+
}
|
|
9
54
|
/** Truncate a string for logging */
|
|
10
55
|
function truncateForLog(value, maxLength = 100) {
|
|
11
56
|
if (value === null || value === undefined)
|
|
@@ -15,24 +60,52 @@ function truncateForLog(value, maxLength = 100) {
|
|
|
15
60
|
return str;
|
|
16
61
|
return str.slice(0, maxLength) + "...";
|
|
17
62
|
}
|
|
18
|
-
/** Format tool call for logging
|
|
19
|
-
|
|
63
|
+
/** Format tool call for logging, with redaction applied to prevent
|
|
64
|
+
* sensitive keys from appearing in daemon logs. */
|
|
65
|
+
function formatToolCallLog(toolName, upstreamKey, input, output, redactKeys) {
|
|
20
66
|
const server = upstreamKey ?? "builtin";
|
|
21
|
-
|
|
22
|
-
|
|
67
|
+
// Use redactJson (returns object) instead of redactAndTruncate (returns string)
|
|
68
|
+
// to avoid double-serialization when truncateForLog calls JSON.stringify.
|
|
69
|
+
const inputSummary = input
|
|
70
|
+
? truncateForLog(redactKeys.length > 0 ? redactJson(input, redactKeys) : input, 150)
|
|
71
|
+
: "(no input)";
|
|
72
|
+
const outputSummary = output
|
|
73
|
+
? truncateForLog(redactKeys.length > 0 ? redactJson(output, redactKeys) : output, 150)
|
|
74
|
+
: "(no output)";
|
|
23
75
|
return `[${server}] ${toolName}\n Input: ${inputSummary}\n Output: ${outputSummary}`;
|
|
24
76
|
}
|
|
25
77
|
/** Get or create a session by ID */
|
|
26
78
|
function getOrCreateSession(db, sessionId) {
|
|
27
|
-
// Check if session exists
|
|
28
79
|
const existing = getSessionById(db, sessionId);
|
|
29
80
|
if (existing) {
|
|
30
81
|
return existing;
|
|
31
82
|
}
|
|
32
|
-
// Create new session with the provided ID
|
|
33
83
|
const now = new Date().toISOString();
|
|
34
84
|
return createSession(db, sessionId, now);
|
|
35
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Detect if a tool response indicates an error.
|
|
88
|
+
* Only uses the MCP-standard `isError: true` field for status decisions.
|
|
89
|
+
*
|
|
90
|
+
* Previous versions also checked for a top-level `error` field (JSON-RPC
|
|
91
|
+
* style), but this produced false positives for tools that use `error` as
|
|
92
|
+
* a regular output field (e.g. `{ error: "none" }`). The `error` field is
|
|
93
|
+
* now treated as informational metadata only — it is still captured in
|
|
94
|
+
* outputJson for display but does not flip event status to "error".
|
|
95
|
+
*
|
|
96
|
+
* @internal Exported for unit testing only.
|
|
97
|
+
*/
|
|
98
|
+
export function isToolResponseError(response) {
|
|
99
|
+
if (response === null || response === undefined)
|
|
100
|
+
return false;
|
|
101
|
+
if (typeof response !== "object" || Array.isArray(response))
|
|
102
|
+
return false;
|
|
103
|
+
const obj = response;
|
|
104
|
+
// MCP tool result: { isError: true } — the only reliable signal
|
|
105
|
+
if (obj.isError === true)
|
|
106
|
+
return true;
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
36
109
|
/** Map Claude Code tool names to our event model */
|
|
37
110
|
function parseToolName(toolName) {
|
|
38
111
|
// MCP tool names are prefixed with "mcp__<server>__<tool>"
|
|
@@ -48,8 +121,8 @@ function parseToolName(toolName) {
|
|
|
48
121
|
};
|
|
49
122
|
}
|
|
50
123
|
}
|
|
51
|
-
//
|
|
52
|
-
if (toolName === "Task") {
|
|
124
|
+
// Agent tool = subagent call
|
|
125
|
+
if (toolName === "Task" || toolName === "Agent") {
|
|
53
126
|
return {
|
|
54
127
|
eventType: "subagent_call",
|
|
55
128
|
cleanName: toolName,
|
|
@@ -72,9 +145,90 @@ function parseToolName(toolName) {
|
|
|
72
145
|
};
|
|
73
146
|
}
|
|
74
147
|
export async function registerHooksRoutes(app, options) {
|
|
75
|
-
const { db, debug = false } = options;
|
|
148
|
+
const { db, debug = false, redactKeys = [] } = options;
|
|
149
|
+
// Session contexts are scoped to this registration — not a module-level global.
|
|
150
|
+
// Each call to registerHooksRoutes gets its own isolated map.
|
|
151
|
+
//
|
|
152
|
+
// Note: restart recovery is not supported. If the daemon restarts while a
|
|
153
|
+
// session is active, the in-memory context is lost. Subsequent hooks for
|
|
154
|
+
// the same session_id will create a fresh context with no parent chain,
|
|
155
|
+
// and tool events will appear as disconnected root events. The "before
|
|
156
|
+
// SessionStart" warning below covers this case.
|
|
157
|
+
const sessionContexts = new Map();
|
|
158
|
+
/**
|
|
159
|
+
* Complete orphaned running events when a session context is evicted.
|
|
160
|
+
* If SessionEnd never fires (process killed, crash), running events
|
|
161
|
+
* would remain in "running" status indefinitely. This sweeps them
|
|
162
|
+
* with status "error" so the timeline reflects the abnormal termination.
|
|
163
|
+
*/
|
|
164
|
+
function completeOrphanedEvents(ctx) {
|
|
165
|
+
const now = new Date().toISOString();
|
|
166
|
+
// Complete any events remaining on the parent stack
|
|
167
|
+
for (const entry of ctx.parentStack) {
|
|
168
|
+
completeEvent(db, entry.id, "error", now);
|
|
169
|
+
}
|
|
170
|
+
// Complete the root agent_call
|
|
171
|
+
if (ctx.agentCallEventId) {
|
|
172
|
+
completeEvent(db, ctx.agentCallEventId, "error", now);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** Evict stale session contexts that exceed TTL.
|
|
176
|
+
* Called periodically via setInterval to prevent stale entries from
|
|
177
|
+
* accumulating during idle periods. Orphaned running events in the DB
|
|
178
|
+
* are completed with "error" status before the context is discarded. */
|
|
179
|
+
function evictStaleContexts() {
|
|
180
|
+
const now = Date.now();
|
|
181
|
+
for (const [id, ctx] of sessionContexts) {
|
|
182
|
+
if (now - ctx.lastActivityAt > SESSION_CONTEXT_TTL_MS) {
|
|
183
|
+
completeOrphanedEvents(ctx);
|
|
184
|
+
sessionContexts.delete(id);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Hard cap: if still over max, remove oldest entries
|
|
188
|
+
if (sessionContexts.size > SESSION_CONTEXT_MAX_SIZE) {
|
|
189
|
+
const entries = [...sessionContexts.entries()].sort((a, b) => a[1].lastActivityAt - b[1].lastActivityAt);
|
|
190
|
+
const toRemove = entries.length - SESSION_CONTEXT_MAX_SIZE;
|
|
191
|
+
for (let i = 0; i < toRemove; i++) {
|
|
192
|
+
const entry = entries[i];
|
|
193
|
+
completeOrphanedEvents(entry[1]);
|
|
194
|
+
sessionContexts.delete(entry[0]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function getSessionContext(sessionId) {
|
|
199
|
+
let ctx = sessionContexts.get(sessionId);
|
|
200
|
+
if (!ctx) {
|
|
201
|
+
ctx = {
|
|
202
|
+
agentCallEventId: null,
|
|
203
|
+
parentStack: [],
|
|
204
|
+
lastActivityAt: Date.now(),
|
|
205
|
+
};
|
|
206
|
+
sessionContexts.set(sessionId, ctx);
|
|
207
|
+
// Evict if cap exceeded — prevents unbounded growth between
|
|
208
|
+
// periodic interval ticks under high session creation rates.
|
|
209
|
+
if (sessionContexts.size > SESSION_CONTEXT_MAX_SIZE) {
|
|
210
|
+
evictStaleContexts();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
ctx.lastActivityAt = Date.now();
|
|
215
|
+
}
|
|
216
|
+
return ctx;
|
|
217
|
+
}
|
|
218
|
+
// Periodic eviction prevents stale contexts from accumulating when
|
|
219
|
+
// the daemon is idle (no new sessions triggering on-demand eviction).
|
|
220
|
+
const evictionInterval = setInterval(evictStaleContexts, SESSION_CONTEXT_TTL_MS / 2);
|
|
221
|
+
app.addHook("onClose", () => {
|
|
222
|
+
clearInterval(evictionInterval);
|
|
223
|
+
// On graceful shutdown, complete any orphaned running events so they
|
|
224
|
+
// don't remain in "running" status permanently in the DB.
|
|
225
|
+
for (const ctx of sessionContexts.values()) {
|
|
226
|
+
completeOrphanedEvents(ctx);
|
|
227
|
+
}
|
|
228
|
+
sessionContexts.clear();
|
|
229
|
+
});
|
|
76
230
|
// Receive hook events from Claude Code
|
|
77
|
-
app.post("/api/hooks", async (request, reply) => {
|
|
231
|
+
app.post("/api/hooks", { schema: hookEventSchema }, async (request, reply) => {
|
|
78
232
|
const startTime = Date.now();
|
|
79
233
|
try {
|
|
80
234
|
const payload = request.body;
|
|
@@ -83,87 +237,287 @@ export async function registerHooksRoutes(app, options) {
|
|
|
83
237
|
}
|
|
84
238
|
// Ensure session exists
|
|
85
239
|
const session = getOrCreateSession(db, payload.session_id);
|
|
240
|
+
const ctx = getSessionContext(payload.session_id);
|
|
241
|
+
// Warn if a tool/end hook arrives before SessionStart.
|
|
242
|
+
// The session row exists (getOrCreateSession handles that) but
|
|
243
|
+
// ctx.agentCallEventId will be null, so tool events will have no
|
|
244
|
+
// parent and appear as disconnected root events.
|
|
245
|
+
if (!ctx.agentCallEventId &&
|
|
246
|
+
payload.hook_type !== "SessionStart" &&
|
|
247
|
+
payload.hook_type !== "Stop") {
|
|
248
|
+
console.warn(`[hooks] ${payload.hook_type} received for session ${payload.session_id} before SessionStart — tool events will lack parent context`);
|
|
249
|
+
}
|
|
86
250
|
// Handle different hook types
|
|
87
251
|
switch (payload.hook_type) {
|
|
88
|
-
case "
|
|
89
|
-
//
|
|
90
|
-
//
|
|
252
|
+
case "SessionStart": {
|
|
253
|
+
// If context already has an agent_call (double SessionStart, e.g.
|
|
254
|
+
// daemon restart where old context wasn't evicted), complete the
|
|
255
|
+
// old event so it doesn't stay "running" indefinitely in the DB.
|
|
256
|
+
if (ctx.agentCallEventId) {
|
|
257
|
+
completeOrphanedEvents(ctx);
|
|
258
|
+
ctx.parentStack = [];
|
|
259
|
+
if (debug) {
|
|
260
|
+
console.warn(`[hooks] SessionStart: completing orphaned agent_call ${ctx.agentCallEventId} from previous session start`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Create root agent_call event for this session
|
|
264
|
+
const sequence = allocateSequence(db, session.id);
|
|
265
|
+
const now = new Date().toISOString();
|
|
266
|
+
const agentCallId = randomUUID();
|
|
267
|
+
const eventInput = {
|
|
268
|
+
id: agentCallId,
|
|
269
|
+
sessionId: session.id,
|
|
270
|
+
parentEventId: null,
|
|
271
|
+
sequence,
|
|
272
|
+
eventType: "agent_call",
|
|
273
|
+
agentRole: "main",
|
|
274
|
+
agentName: "claude-code",
|
|
275
|
+
startedAt: now,
|
|
276
|
+
status: "running",
|
|
277
|
+
inputJson: payload.start_source
|
|
278
|
+
? JSON.stringify({ source: payload.start_source })
|
|
279
|
+
: null,
|
|
280
|
+
};
|
|
281
|
+
insertEvent(db, eventInput);
|
|
282
|
+
ctx.agentCallEventId = agentCallId;
|
|
91
283
|
if (debug) {
|
|
92
|
-
console.log(`[hooks]
|
|
284
|
+
console.log(`[hooks] SessionStart: created agent_call ${agentCallId} (${payload.start_source ?? "unknown"})`);
|
|
93
285
|
}
|
|
94
286
|
break;
|
|
95
287
|
}
|
|
96
|
-
case "
|
|
288
|
+
case "PreToolUse": {
|
|
97
289
|
if (!payload.tool_name) {
|
|
98
|
-
|
|
290
|
+
// Fail open — never block Claude with a 400
|
|
291
|
+
console.warn(`[hooks] PreToolUse missing tool_name for session ${payload.session_id}`);
|
|
292
|
+
return reply
|
|
293
|
+
.code(200)
|
|
294
|
+
.send({ ok: true, warning: "missing_tool_name" });
|
|
99
295
|
}
|
|
100
296
|
const { eventType, cleanName, upstreamKey } = parseToolName(payload.tool_name);
|
|
101
297
|
const now = new Date().toISOString();
|
|
102
298
|
const sequence = allocateSequence(db, session.id);
|
|
299
|
+
const eventId = randomUUID();
|
|
103
300
|
// Determine MCP method from tool input if available
|
|
104
301
|
let mcpMethod = "tools/call";
|
|
105
302
|
if (payload.tool_input?.method) {
|
|
106
303
|
mcpMethod = String(payload.tool_input.method);
|
|
107
304
|
}
|
|
305
|
+
const parentId = getCurrentParentId(ctx);
|
|
306
|
+
const inputJson = payload.tool_input
|
|
307
|
+
? redactAndTruncate(payload.tool_input, redactKeys)
|
|
308
|
+
: null;
|
|
108
309
|
const eventInput = {
|
|
109
|
-
id:
|
|
310
|
+
id: eventId,
|
|
110
311
|
sessionId: session.id,
|
|
111
|
-
parentEventId:
|
|
312
|
+
parentEventId: parentId,
|
|
112
313
|
sequence,
|
|
113
314
|
eventType,
|
|
114
315
|
agentRole: "main",
|
|
115
316
|
agentName: "claude-code",
|
|
116
317
|
toolName: cleanName,
|
|
117
318
|
mcpMethod,
|
|
118
|
-
upstreamKey
|
|
319
|
+
upstreamKey,
|
|
320
|
+
// correlationId: not yet populated — Claude Code's hook API
|
|
321
|
+
// does not expose a correlation ID. The DB column (migration 007)
|
|
322
|
+
// and findRunningEvent support are ready; set this field once
|
|
323
|
+
// the hook payload includes a correlation identifier.
|
|
119
324
|
startedAt: now,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
inputJson:
|
|
123
|
-
? JSON.stringify(payload.tool_input)
|
|
124
|
-
: null,
|
|
125
|
-
outputJson: payload.tool_response
|
|
126
|
-
? JSON.stringify(payload.tool_response)
|
|
127
|
-
: null,
|
|
325
|
+
status: "running",
|
|
326
|
+
inputJson,
|
|
327
|
+
inputTokens: inputJson != null ? estimateSerializedTokens(inputJson) : null,
|
|
128
328
|
};
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
console.log(`[hooks] ${formatToolCallLog(cleanName, upstreamKey, payload.tool_input, payload.tool_response)}`);
|
|
329
|
+
insertEvent(db, eventInput);
|
|
330
|
+
// Push subagent/skill calls onto the parent stack
|
|
331
|
+
if (eventType === "subagent_call" || eventType === "skill_call") {
|
|
332
|
+
ctx.parentStack.push({ id: eventId, toolName: cleanName });
|
|
134
333
|
}
|
|
135
334
|
if (debug) {
|
|
136
|
-
console.log(`[hooks]
|
|
335
|
+
console.log(`[hooks] PreToolUse: created ${eventType} ${cleanName} (${eventId}, parent: ${parentId ?? "root"})`);
|
|
137
336
|
}
|
|
138
337
|
break;
|
|
139
338
|
}
|
|
140
|
-
case "
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
console.
|
|
339
|
+
case "PostToolUse": {
|
|
340
|
+
if (!payload.tool_name) {
|
|
341
|
+
// Fail open — never block Claude with a 400
|
|
342
|
+
console.warn(`[hooks] PostToolUse missing tool_name for session ${payload.session_id}`);
|
|
343
|
+
return reply
|
|
344
|
+
.code(200)
|
|
345
|
+
.send({ ok: true, warning: "missing_tool_name" });
|
|
346
|
+
}
|
|
347
|
+
const { eventType, cleanName, upstreamKey } = parseToolName(payload.tool_name);
|
|
348
|
+
const now = new Date().toISOString();
|
|
349
|
+
// Determine status from tool response
|
|
350
|
+
const responseIsError = isToolResponseError(payload.tool_response);
|
|
351
|
+
const eventStatus = responseIsError
|
|
352
|
+
? "error"
|
|
353
|
+
: "success";
|
|
354
|
+
const outputJsonStr = payload.tool_response
|
|
355
|
+
? redactAndTruncate(payload.tool_response, redactKeys)
|
|
356
|
+
: null;
|
|
357
|
+
const errorCategory = responseIsError
|
|
358
|
+
? deriveErrorCategory(eventStatus, outputJsonStr)
|
|
359
|
+
: null;
|
|
360
|
+
// Try to find the matching "running" event from PreToolUse.
|
|
361
|
+
// Invariant: both PreToolUse and PostToolUse receive the same
|
|
362
|
+
// payload.tool_name, so parseToolName produces the same cleanName
|
|
363
|
+
// in both hooks. This holds for MCP namespaced tools too
|
|
364
|
+
// (e.g. "mcp__fs__read_file" → cleanName "read_file").
|
|
365
|
+
// Note: findRunningEvent returns the most recent match by toolName,
|
|
366
|
+
// which may be incorrect if parallel tools share the same name.
|
|
367
|
+
// See packages/core/src/db/events.ts for the caveat documentation.
|
|
368
|
+
const runningEvent = findRunningEvent(db, session.id, cleanName);
|
|
369
|
+
const outputTokens = outputJsonStr != null
|
|
370
|
+
? estimateSerializedTokens(outputJsonStr)
|
|
371
|
+
: null;
|
|
372
|
+
if (runningEvent) {
|
|
373
|
+
// Complete the existing running event
|
|
374
|
+
const completed = completeEvent(db, runningEvent.id, eventStatus, now, outputJsonStr, errorCategory, outputTokens);
|
|
375
|
+
if (!completed && debug) {
|
|
376
|
+
console.warn(`[hooks] PostToolUse: completeEvent returned null for ${runningEvent.id} — already completed?`);
|
|
377
|
+
}
|
|
378
|
+
// Pop from parent stack if still present. SubagentStop may
|
|
379
|
+
// have already removed this entry; the splice is a safe no-op
|
|
380
|
+
// if the entry is not found.
|
|
381
|
+
if (eventType === "subagent_call" || eventType === "skill_call") {
|
|
382
|
+
for (let i = ctx.parentStack.length - 1; i >= 0; i--) {
|
|
383
|
+
if (ctx.parentStack[i].id === runningEvent.id) {
|
|
384
|
+
ctx.parentStack.splice(i, 1);
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (debug) {
|
|
390
|
+
console.log(`[hooks] PostToolUse: completed ${eventType} ${cleanName} (${runningEvent.id}, status: ${eventStatus})`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
// No matching PreToolUse — create a standalone completed event (backwards compat)
|
|
395
|
+
const sequence = allocateSequence(db, session.id);
|
|
396
|
+
const parentId = getCurrentParentId(ctx);
|
|
397
|
+
let mcpMethod = "tools/call";
|
|
398
|
+
if (payload.tool_input?.method) {
|
|
399
|
+
mcpMethod = String(payload.tool_input.method);
|
|
400
|
+
}
|
|
401
|
+
const standaloneInputJson = payload.tool_input
|
|
402
|
+
? redactAndTruncate(payload.tool_input, redactKeys)
|
|
403
|
+
: null;
|
|
404
|
+
const eventInput = {
|
|
405
|
+
id: randomUUID(),
|
|
406
|
+
sessionId: session.id,
|
|
407
|
+
parentEventId: parentId,
|
|
408
|
+
sequence,
|
|
409
|
+
eventType,
|
|
410
|
+
agentRole: "main",
|
|
411
|
+
agentName: "claude-code",
|
|
412
|
+
toolName: cleanName,
|
|
413
|
+
mcpMethod,
|
|
414
|
+
upstreamKey,
|
|
415
|
+
startedAt: now,
|
|
416
|
+
endedAt: now,
|
|
417
|
+
status: eventStatus,
|
|
418
|
+
inputJson: standaloneInputJson,
|
|
419
|
+
outputJson: outputJsonStr,
|
|
420
|
+
errorCategory,
|
|
421
|
+
inputTokens: standaloneInputJson != null
|
|
422
|
+
? estimateSerializedTokens(standaloneInputJson)
|
|
423
|
+
: null,
|
|
424
|
+
outputTokens,
|
|
425
|
+
};
|
|
426
|
+
insertEvent(db, eventInput);
|
|
427
|
+
if (debug) {
|
|
428
|
+
console.log(`[hooks] PostToolUse: standalone ${eventType} ${cleanName} (no matching PreToolUse, status: ${eventStatus})`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
// Always log MCP tool calls with details
|
|
432
|
+
const isMcpTool = upstreamKey && upstreamKey !== "builtin";
|
|
433
|
+
if (isMcpTool || debug) {
|
|
434
|
+
console.log(`[hooks] ${formatToolCallLog(cleanName, upstreamKey, payload.tool_input, payload.tool_response, redactKeys)}`);
|
|
144
435
|
}
|
|
145
436
|
break;
|
|
146
437
|
}
|
|
147
|
-
case "
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
|
|
438
|
+
case "Stop": {
|
|
439
|
+
// Stop fires for both normal completions and user cancellations.
|
|
440
|
+
// It does not carry an end_reason, so we cannot determine the
|
|
441
|
+
// actual outcome here. SessionEnd always follows Stop and has the
|
|
442
|
+
// authoritative end_reason, so we defer agent_call completion to
|
|
443
|
+
// SessionEnd to avoid status inconsistency (e.g. "cancelled"
|
|
444
|
+
// agent_call with "completed" session).
|
|
445
|
+
//
|
|
446
|
+
// If SessionEnd never fires (e.g. Claude Code crash), running
|
|
447
|
+
// events and parent stack entries remain until TTL eviction,
|
|
448
|
+
// at which point completeOrphanedEvents() closes them with
|
|
449
|
+
// status "error". SessionEnd is the authoritative cleanup path.
|
|
450
|
+
if (debug && ctx.agentCallEventId) {
|
|
451
|
+
console.log(`[hooks] Stop: agent_call ${ctx.agentCallEventId} completion deferred to SessionEnd`);
|
|
151
452
|
}
|
|
152
453
|
break;
|
|
153
454
|
}
|
|
154
|
-
case "
|
|
155
|
-
|
|
156
|
-
|
|
455
|
+
case "SubagentStop": {
|
|
456
|
+
// Pop the matching subagent from the parent stack so that
|
|
457
|
+
// subsequent tool calls are no longer nested under it.
|
|
458
|
+
// Does NOT complete the event — PostToolUse handles completion
|
|
459
|
+
// with the actual output and error status from the tool response.
|
|
460
|
+
//
|
|
461
|
+
// Known limitation: matching is by tool name (e.g. "Agent").
|
|
462
|
+
// If two nested subagents share the same name, this pops the
|
|
463
|
+
// most-recent match, which may be the inner one when the outer
|
|
464
|
+
// one's SubagentStop fires first. Claude Code's hook API does
|
|
465
|
+
// not expose a correlation ID, so full correctness for this
|
|
466
|
+
// edge case is not achievable. See also the findRunningEvent
|
|
467
|
+
// caveat in packages/core/src/db/events.ts.
|
|
468
|
+
if (ctx.parentStack.length > 0) {
|
|
469
|
+
let matchIdx = ctx.parentStack.length - 1;
|
|
470
|
+
if (payload.tool_name) {
|
|
471
|
+
const { cleanName } = parseToolName(payload.tool_name);
|
|
472
|
+
for (let i = ctx.parentStack.length - 1; i >= 0; i--) {
|
|
473
|
+
if (ctx.parentStack[i].toolName === cleanName) {
|
|
474
|
+
matchIdx = i;
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const matchedEntry = ctx.parentStack[matchIdx];
|
|
480
|
+
ctx.parentStack.splice(matchIdx, 1);
|
|
481
|
+
if (debug) {
|
|
482
|
+
console.log(`[hooks] SubagentStop: popped ${matchedEntry.id} from parent stack (${payload.subagent_type ?? "unknown"}), completion deferred to PostToolUse`);
|
|
483
|
+
}
|
|
157
484
|
}
|
|
158
485
|
break;
|
|
159
486
|
}
|
|
160
487
|
case "SessionEnd": {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
488
|
+
const now = new Date().toISOString();
|
|
489
|
+
// Map end_reason to event and session status.
|
|
490
|
+
// Claude Code may send "completed", "error", or "cancelled" (Ctrl-C).
|
|
491
|
+
const eventStatus = payload.end_reason === "error"
|
|
492
|
+
? "error"
|
|
493
|
+
: payload.end_reason === "cancelled"
|
|
494
|
+
? "cancelled"
|
|
495
|
+
: "success";
|
|
496
|
+
const sessionStatus = payload.end_reason === "error"
|
|
497
|
+
? "error"
|
|
498
|
+
: payload.end_reason === "cancelled"
|
|
499
|
+
? "cancelled"
|
|
500
|
+
: "completed";
|
|
501
|
+
// Complete any events still on the parent stack (interrupted
|
|
502
|
+
// subagents/skills that never received PostToolUse).
|
|
503
|
+
for (const entry of ctx.parentStack) {
|
|
504
|
+
completeEvent(db, entry.id, eventStatus, now);
|
|
505
|
+
}
|
|
506
|
+
ctx.parentStack.length = 0;
|
|
507
|
+
// End the root agent_call and clean up
|
|
508
|
+
if (ctx.agentCallEventId) {
|
|
509
|
+
completeEvent(db, ctx.agentCallEventId, eventStatus, now);
|
|
510
|
+
if (debug) {
|
|
511
|
+
console.log(`[hooks] SessionEnd: ${payload.session_id} (${payload.end_reason ?? "unknown"})`);
|
|
512
|
+
if (payload.statistics) {
|
|
513
|
+
console.log(`[hooks] Statistics:`, payload.statistics);
|
|
514
|
+
}
|
|
165
515
|
}
|
|
166
516
|
}
|
|
517
|
+
// End the session in the database
|
|
518
|
+
endSession(db, session.id, now, sessionStatus);
|
|
519
|
+
// Clean up context
|
|
520
|
+
sessionContexts.delete(payload.session_id);
|
|
167
521
|
break;
|
|
168
522
|
}
|
|
169
523
|
default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/routes/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc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the hooks API endpoint.
|
|
3
|
+
*
|
|
4
|
+
* Tests the full lifecycle: SessionStart → PreToolUse → PostToolUse → SessionEnd,
|
|
5
|
+
* subagent handling, and isToolResponseError edge cases (tested indirectly via
|
|
6
|
+
* PostToolUse status derivation).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=hooks.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.test.d.ts","sourceRoot":"","sources":["../../src/routes/hooks.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|