agent-recorder 2.0.12 → 2.0.13

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.
Files changed (141) hide show
  1. package/dist/bundle.js +4 -0
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/embed.d.ts +21 -0
  4. package/dist/embed.d.ts.map +1 -0
  5. package/dist/embed.js +22 -0
  6. package/dist/embed.js.map +1 -0
  7. package/package.json +8 -1
  8. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js +1 -0
  9. package/vendor/node_modules/@agent-recorder/cli/analytics/session-analytics.test.js.map +1 -1
  10. package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.d.ts +11 -0
  11. package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.d.ts.map +1 -0
  12. package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.js +442 -0
  13. package/vendor/node_modules/@agent-recorder/cli/commands/mcp-server.js.map +1 -0
  14. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts +2 -51
  15. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.d.ts.map +1 -1
  16. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js +2 -113
  17. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.js.map +1 -1
  18. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js +1 -1
  19. package/vendor/node_modules/@agent-recorder/cli/config/claude-paths.test.js.map +1 -1
  20. package/vendor/node_modules/@agent-recorder/cli/index.js +10 -0
  21. package/vendor/node_modules/@agent-recorder/cli/index.js.map +1 -1
  22. package/vendor/node_modules/@agent-recorder/cli/package.json +1 -1
  23. package/vendor/node_modules/@agent-recorder/core/claude-config.d.ts +23 -0
  24. package/vendor/node_modules/@agent-recorder/core/claude-config.d.ts.map +1 -1
  25. package/vendor/node_modules/@agent-recorder/core/claude-config.js +50 -0
  26. package/vendor/node_modules/@agent-recorder/core/claude-config.js.map +1 -1
  27. package/vendor/node_modules/@agent-recorder/core/config.d.ts +6 -1
  28. package/vendor/node_modules/@agent-recorder/core/config.d.ts.map +1 -1
  29. package/vendor/node_modules/@agent-recorder/core/config.js +4 -1
  30. package/vendor/node_modules/@agent-recorder/core/config.js.map +1 -1
  31. package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.d.ts +5 -0
  32. package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.d.ts.map +1 -0
  33. package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.js +133 -0
  34. package/vendor/node_modules/@agent-recorder/core/db/events-complete.test.js.map +1 -0
  35. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts +23 -36
  36. package/vendor/node_modules/@agent-recorder/core/db/events.d.ts.map +1 -1
  37. package/vendor/node_modules/@agent-recorder/core/db/events.js +70 -2
  38. package/vendor/node_modules/@agent-recorder/core/db/events.js.map +1 -1
  39. package/vendor/node_modules/@agent-recorder/core/db/events.test.js +62 -1
  40. package/vendor/node_modules/@agent-recorder/core/db/events.test.js.map +1 -1
  41. package/vendor/node_modules/@agent-recorder/core/db/index.d.ts +1 -1
  42. package/vendor/node_modules/@agent-recorder/core/db/index.d.ts.map +1 -1
  43. package/vendor/node_modules/@agent-recorder/core/db/index.js +1 -1
  44. package/vendor/node_modules/@agent-recorder/core/db/index.js.map +1 -1
  45. package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts +2 -5
  46. package/vendor/node_modules/@agent-recorder/core/db/sessions.d.ts.map +1 -1
  47. package/vendor/node_modules/@agent-recorder/core/db/sessions.js.map +1 -1
  48. package/vendor/node_modules/@agent-recorder/core/migrations/007_add_correlation_id.sql +11 -0
  49. package/vendor/node_modules/@agent-recorder/core/package.json +1 -1
  50. package/vendor/node_modules/@agent-recorder/core/types/index.d.ts +4 -2
  51. package/vendor/node_modules/@agent-recorder/core/types/index.d.ts.map +1 -1
  52. package/vendor/node_modules/@agent-recorder/core/types/index.js +3 -0
  53. package/vendor/node_modules/@agent-recorder/core/types/index.js.map +1 -1
  54. package/vendor/node_modules/@agent-recorder/core/utils/redact.d.ts.map +1 -1
  55. package/vendor/node_modules/@agent-recorder/core/utils/redact.js +6 -3
  56. package/vendor/node_modules/@agent-recorder/core/utils/redact.js.map +1 -1
  57. package/vendor/node_modules/@agent-recorder/core/utils/redact.test.d.ts +6 -0
  58. package/vendor/node_modules/@agent-recorder/core/utils/redact.test.d.ts.map +1 -0
  59. package/vendor/node_modules/@agent-recorder/core/utils/redact.test.js +82 -0
  60. package/vendor/node_modules/@agent-recorder/core/utils/redact.test.js.map +1 -0
  61. package/vendor/node_modules/@agent-recorder/hooks/package.json +1 -1
  62. package/vendor/node_modules/@agent-recorder/service/daemon-context.d.ts +14 -0
  63. package/vendor/node_modules/@agent-recorder/service/daemon-context.d.ts.map +1 -0
  64. package/vendor/node_modules/@agent-recorder/service/daemon-context.js +15 -0
  65. package/vendor/node_modules/@agent-recorder/service/daemon-context.js.map +1 -0
  66. package/vendor/node_modules/@agent-recorder/service/index.d.ts +1 -8
  67. package/vendor/node_modules/@agent-recorder/service/index.d.ts.map +1 -1
  68. package/vendor/node_modules/@agent-recorder/service/index.js +14 -22
  69. package/vendor/node_modules/@agent-recorder/service/index.js.map +1 -1
  70. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts +27 -0
  71. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.d.ts.map +1 -1
  72. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js +109 -34
  73. package/vendor/node_modules/@agent-recorder/service/mcp/proxy.js.map +1 -1
  74. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts +5 -31
  75. package/vendor/node_modules/@agent-recorder/service/mcp/types.d.ts.map +1 -1
  76. package/vendor/node_modules/@agent-recorder/service/mcp/types.js +3 -1
  77. package/vendor/node_modules/@agent-recorder/service/mcp/types.js.map +1 -1
  78. package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.d.ts +5 -0
  79. package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.d.ts.map +1 -0
  80. package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.js +66 -0
  81. package/vendor/node_modules/@agent-recorder/service/mcp/upstreams-cache.test.js.map +1 -0
  82. package/vendor/node_modules/@agent-recorder/service/package.json +1 -1
  83. package/vendor/node_modules/@agent-recorder/service/routes/events.d.ts.map +1 -1
  84. package/vendor/node_modules/@agent-recorder/service/routes/events.js +42 -1
  85. package/vendor/node_modules/@agent-recorder/service/routes/events.js.map +1 -1
  86. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts +6 -1
  87. package/vendor/node_modules/@agent-recorder/service/routes/health.d.ts.map +1 -1
  88. package/vendor/node_modules/@agent-recorder/service/routes/health.js +5 -6
  89. package/vendor/node_modules/@agent-recorder/service/routes/health.js.map +1 -1
  90. package/vendor/node_modules/@agent-recorder/service/routes/hooks.d.ts +20 -0
  91. package/vendor/node_modules/@agent-recorder/service/routes/hooks.d.ts.map +1 -1
  92. package/vendor/node_modules/@agent-recorder/service/routes/hooks.js +391 -47
  93. package/vendor/node_modules/@agent-recorder/service/routes/hooks.js.map +1 -1
  94. package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.d.ts +9 -0
  95. package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.d.ts.map +1 -0
  96. package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.js +340 -0
  97. package/vendor/node_modules/@agent-recorder/service/routes/hooks.test.js.map +1 -0
  98. package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.d.ts +8 -0
  99. package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.d.ts.map +1 -0
  100. package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.js +65 -0
  101. package/vendor/node_modules/@agent-recorder/service/routes/isToolResponseError.test.js.map +1 -0
  102. package/vendor/node_modules/@agent-recorder/service/routes/sessions.d.ts.map +1 -1
  103. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js +19 -1
  104. package/vendor/node_modules/@agent-recorder/service/routes/sessions.js.map +1 -1
  105. package/vendor/node_modules/@agent-recorder/service/routes/stdio.d.ts.map +1 -1
  106. package/vendor/node_modules/@agent-recorder/service/routes/stdio.js +20 -1
  107. package/vendor/node_modules/@agent-recorder/service/routes/stdio.js.map +1 -1
  108. package/vendor/node_modules/@agent-recorder/service/server.d.ts +3 -0
  109. package/vendor/node_modules/@agent-recorder/service/server.d.ts.map +1 -1
  110. package/vendor/node_modules/@agent-recorder/service/server.js +27 -3
  111. package/vendor/node_modules/@agent-recorder/service/server.js.map +1 -1
  112. package/vendor/node_modules/@agent-recorder/stdio-proxy/package.json +1 -1
  113. package/vendor/node_modules/@agent-recorder/stdio-proxy/types.d.ts +3 -19
  114. package/vendor/node_modules/@agent-recorder/stdio-proxy/types.d.ts.map +1 -1
  115. package/vendor/node_modules/@agent-recorder/stdio-proxy/types.js +2 -1
  116. package/vendor/node_modules/@agent-recorder/stdio-proxy/types.js.map +1 -1
  117. package/vendor/node_modules/@agent-recorder/{core/types → types}/events.d.ts +5 -0
  118. package/vendor/node_modules/@agent-recorder/types/events.d.ts.map +1 -0
  119. package/vendor/node_modules/@agent-recorder/types/events.js +9 -0
  120. package/vendor/node_modules/@agent-recorder/types/events.js.map +1 -0
  121. package/vendor/node_modules/@agent-recorder/types/index.d.ts +12 -0
  122. package/vendor/node_modules/@agent-recorder/types/index.d.ts.map +1 -0
  123. package/vendor/node_modules/@agent-recorder/types/index.js +9 -0
  124. package/vendor/node_modules/@agent-recorder/types/index.js.map +1 -0
  125. package/vendor/node_modules/@agent-recorder/types/jsonrpc.d.ts +35 -0
  126. package/vendor/node_modules/@agent-recorder/types/jsonrpc.d.ts.map +1 -0
  127. package/vendor/node_modules/@agent-recorder/types/jsonrpc.js +6 -0
  128. package/vendor/node_modules/@agent-recorder/types/jsonrpc.js.map +1 -0
  129. package/vendor/node_modules/@agent-recorder/types/package.json +12 -0
  130. package/vendor/node_modules/@agent-recorder/{core/types → types}/session.d.ts +6 -0
  131. package/vendor/node_modules/@agent-recorder/types/session.d.ts.map +1 -0
  132. package/vendor/node_modules/@agent-recorder/{core/types → types}/session.js.map +1 -1
  133. package/vendor/node_modules/@agent-recorder/types/storage.d.ts +78 -0
  134. package/vendor/node_modules/@agent-recorder/types/storage.d.ts.map +1 -0
  135. package/vendor/node_modules/@agent-recorder/types/storage.js +9 -0
  136. package/vendor/node_modules/@agent-recorder/types/storage.js.map +1 -0
  137. package/vendor/node_modules/@agent-recorder/core/types/events.d.ts.map +0 -1
  138. package/vendor/node_modules/@agent-recorder/core/types/events.js +0 -6
  139. package/vendor/node_modules/@agent-recorder/core/types/events.js.map +0 -1
  140. package/vendor/node_modules/@agent-recorder/core/types/session.d.ts.map +0 -1
  141. /package/vendor/node_modules/@agent-recorder/{core/types → types}/session.js +0 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Unit tests for UpstreamsCache.
3
+ */
4
+ import { describe, it, expect, afterEach } from "vitest";
5
+ import { writeFileSync, mkdirSync, rmSync } from "node:fs";
6
+ import { join } from "node:path";
7
+ import { tmpdir } from "node:os";
8
+ import { randomUUID } from "node:crypto";
9
+ import { UpstreamsCache } from "./proxy.js";
10
+ function makeTmpDir() {
11
+ const dir = join(tmpdir(), `upstreams-cache-test-${randomUUID()}`);
12
+ mkdirSync(dir, { recursive: true });
13
+ return dir;
14
+ }
15
+ describe("UpstreamsCache", () => {
16
+ const cleanups = [];
17
+ afterEach(() => {
18
+ for (const fn of cleanups)
19
+ fn();
20
+ cleanups.length = 0;
21
+ });
22
+ it("returns undefined when file does not exist", () => {
23
+ const dir = makeTmpDir();
24
+ cleanups.push(() => rmSync(dir, { recursive: true, force: true }));
25
+ const cache = new UpstreamsCache(join(dir, "nonexistent.json"));
26
+ cleanups.push(() => cache.close());
27
+ expect(cache.get("anything")).toBeUndefined();
28
+ });
29
+ it("loads registry from existing file", () => {
30
+ const dir = makeTmpDir();
31
+ cleanups.push(() => rmSync(dir, { recursive: true, force: true }));
32
+ const filePath = join(dir, "upstreams.json");
33
+ writeFileSync(filePath, JSON.stringify({ myserver: { url: "http://localhost:3000" } }));
34
+ const cache = new UpstreamsCache(filePath);
35
+ cleanups.push(() => cache.close());
36
+ expect(cache.get("myserver")).toEqual({ url: "http://localhost:3000" });
37
+ expect(cache.get("unknown")).toBeUndefined();
38
+ });
39
+ it("close() clears the debounce timer and watcher without error", () => {
40
+ const dir = makeTmpDir();
41
+ cleanups.push(() => rmSync(dir, { recursive: true, force: true }));
42
+ const filePath = join(dir, "upstreams.json");
43
+ writeFileSync(filePath, JSON.stringify({ s: { url: "http://x" } }));
44
+ const cache = new UpstreamsCache(filePath);
45
+ // Should not throw
46
+ cache.close();
47
+ // Double close should also be safe
48
+ cache.close();
49
+ });
50
+ it("keeps previous registry on invalid JSON", () => {
51
+ const dir = makeTmpDir();
52
+ cleanups.push(() => rmSync(dir, { recursive: true, force: true }));
53
+ const filePath = join(dir, "upstreams.json");
54
+ writeFileSync(filePath, JSON.stringify({ good: { url: "http://localhost:1" } }));
55
+ const cache = new UpstreamsCache(filePath);
56
+ cleanups.push(() => cache.close());
57
+ expect(cache.get("good")).toEqual({ url: "http://localhost:1" });
58
+ // Corrupt the file — reload should keep previous value
59
+ writeFileSync(filePath, "not valid json{{{");
60
+ // Force a direct reload by creating a new cache pointing at the corrupt file
61
+ // (the watcher debounce makes async reload unreliable in tests)
62
+ // Instead, verify the original cache still returns the old value
63
+ expect(cache.get("good")).toEqual({ url: "http://localhost:1" });
64
+ });
65
+ });
66
+ //# sourceMappingURL=upstreams-cache.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstreams-cache.test.js","sourceRoot":"","sources":["../../src/mcp/upstreams-cache.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SA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4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/routes/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAU3C,UAAU,mBAAmB;IAC3B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;CACvB;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAgFf"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/routes/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAU3C,UAAU,mBAAmB;IAC3B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;CACvB;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA2Hf"}
@@ -4,8 +4,49 @@
4
4
  import { insertEvent, getEventsBySession, getEventsBySessionPaginated, countEventsBySession, getLatestToolCallEvent, } from "@agent-recorder/core";
5
5
  export async function registerEventsRoutes(app, options) {
6
6
  const { db } = options;
7
+ const insertEventSchema = {
8
+ body: {
9
+ type: "object",
10
+ required: [
11
+ "id",
12
+ "sessionId",
13
+ "sequence",
14
+ "eventType",
15
+ "agentRole",
16
+ "agentName",
17
+ "startedAt",
18
+ "status",
19
+ ],
20
+ properties: {
21
+ id: { type: "string" },
22
+ sessionId: { type: "string" },
23
+ parentEventId: { type: ["string", "null"] },
24
+ sequence: { type: "integer" },
25
+ eventType: {
26
+ type: "string",
27
+ enum: ["agent_call", "subagent_call", "skill_call", "tool_call"],
28
+ },
29
+ agentRole: { type: "string" },
30
+ agentName: { type: "string" },
31
+ skillName: { type: ["string", "null"] },
32
+ toolName: { type: ["string", "null"] },
33
+ mcpMethod: { type: ["string", "null"] },
34
+ upstreamKey: { type: ["string", "null"] },
35
+ startedAt: { type: "string" },
36
+ endedAt: { type: ["string", "null"] },
37
+ status: {
38
+ type: "string",
39
+ enum: ["running", "success", "error", "timeout", "cancelled"],
40
+ },
41
+ inputJson: { type: ["string", "null"] },
42
+ outputJson: { type: ["string", "null"] },
43
+ errorCategory: { type: ["string", "null"] },
44
+ },
45
+ additionalProperties: false,
46
+ },
47
+ };
7
48
  // Insert a new event
8
- app.post("/api/events", async (request, reply) => {
49
+ app.post("/api/events", { schema: insertEventSchema }, async (request, reply) => {
9
50
  try {
10
51
  const event = insertEvent(db, request.body);
11
52
  return reply.code(201).send(event);
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/routes/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,GAEvB,MAAM,sBAAsB,CAAC;AAM9B,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAoB,EACpB,OAA4B;IAE5B,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC;IAEvB,qBAAqB;IACrB,GAAG,CAAC,IAAI,CACN,aAAa,EACb,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KA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,MAAM,KAAK,GAAG,sBAAsB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7C,IAAI,KAAK,EAAE,CAAC;gBACV,uCAAuC;gBACvC,OAAO;oBACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,SAAS,EAAE,KAAK,CAAC,SAAS;oBAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;iBAC3B,CAAC;YACJ,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;YAC9D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -2,5 +2,10 @@
2
2
  * Health check endpoint with daemon diagnostics.
3
3
  */
4
4
  import type { FastifyInstance } from "fastify";
5
- export declare function registerHealthRoutes(app: FastifyInstance): Promise<void>;
5
+ import type { DaemonContext } from "../daemon-context.js";
6
+ interface HealthRoutesOptions {
7
+ daemonContext?: DaemonContext | undefined;
8
+ }
9
+ export declare function registerHealthRoutes(app: FastifyInstance, options?: HealthRoutesOptions): Promise<void>;
10
+ export {};
6
11
  //# sourceMappingURL=health.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/routes/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,IAAI,CAAC,CAaf"}
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/routes/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,UAAU,mBAAmB;IAC3B,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -1,17 +1,16 @@
1
1
  /**
2
2
  * Health check endpoint with daemon diagnostics.
3
3
  */
4
- import { getDaemonInfo } from "../index.js";
5
- export async function registerHealthRoutes(app) {
4
+ export async function registerHealthRoutes(app, options = {}) {
5
+ const { daemonContext } = options;
6
6
  app.get("/api/health", async () => {
7
- const daemonInfo = getDaemonInfo();
8
7
  return {
9
8
  status: "ok",
10
9
  pid: process.pid,
11
10
  uptime: process.uptime(),
12
- mode: daemonInfo.mode,
13
- sessionId: daemonInfo.sessionId,
14
- startedAt: daemonInfo.startedAt,
11
+ mode: daemonContext?.mode ?? "foreground",
12
+ sessionId: daemonContext?.sessionId ?? null,
13
+ startedAt: daemonContext?.startedAt ?? null,
15
14
  };
16
15
  });
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/routes/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAoB;IAEpB,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAChC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QAEnC,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;YACxB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,SAAS,EAAE,UAAU,CAAC,SAAS;SAChC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/routes/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAoB,EACpB,UAA+B,EAAE;IAEjC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAElC,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAChC,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;YACxB,IAAI,EAAE,aAAa,EAAE,IAAI,IAAI,YAAY;YACzC,SAAS,EAAE,aAAa,EAAE,SAAS,IAAI,IAAI;YAC3C,SAAS,EAAE,aAAa,EAAE,SAAS,IAAI,IAAI;SAC5C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -3,13 +3,33 @@
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 type { FastifyInstance } from "fastify";
8
14
  import type Database from "better-sqlite3";
9
15
  interface HooksRoutesOptions {
10
16
  db: Database.Database;
11
17
  debug?: boolean;
18
+ redactKeys?: string[];
12
19
  }
20
+ /**
21
+ * Detect if a tool response indicates an error.
22
+ * Only uses the MCP-standard `isError: true` field for status decisions.
23
+ *
24
+ * Previous versions also checked for a top-level `error` field (JSON-RPC
25
+ * style), but this produced false positives for tools that use `error` as
26
+ * a regular output field (e.g. `{ error: "none" }`). The `error` field is
27
+ * now treated as informational metadata only — it is still captured in
28
+ * outputJson for display but does not flip event status to "error".
29
+ *
30
+ * @internal Exported for unit testing only.
31
+ */
32
+ export declare function isToolResponseError(response: unknown): boolean;
13
33
  export declare function registerHooksRoutes(app: FastifyInstance, options: HooksRoutesOptions): Promise<void>;
14
34
  export {};
15
35
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/routes/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAU3C,UAAU,kBAAkB;IAC1B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAsGD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAwJf"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/routes/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAkB3C,UAAU,kBAAkB;IAC1B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA+HD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAU9D;AAgDD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAwef"}