@tonyclaw/agent-inspector 3.0.16 → 3.0.18

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 (88) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-BJmxAiM0.js → CompareDrawer-Daj03-RL.js} +1 -1
  3. package/.output/public/assets/ProxyViewerContainer-BLCRQtU_.js +106 -0
  4. package/.output/public/assets/{ReplayDialog-CkLdOMJr.js → ReplayDialog-5FR5crdo.js} +1 -1
  5. package/.output/public/assets/{RequestAnatomy-DemOFfSc.js → RequestAnatomy-DF0hHdQY.js} +1 -1
  6. package/.output/public/assets/{ResponseView-9LhpuDo7.js → ResponseView-BwkMSsUa.js} +2 -2
  7. package/.output/public/assets/{StreamingChunkSequence-RRWYBOdz.js → StreamingChunkSequence-CKeUd58x.js} +1 -1
  8. package/.output/public/assets/{_sessionId-CWEh2Jsn.js → _sessionId-CThgXa41.js} +1 -1
  9. package/.output/public/assets/index-BHXN1Fsx.css +1 -0
  10. package/.output/public/assets/{index-Lwir70Rs.js → index-ClQ7Vi3J.js} +1 -1
  11. package/.output/public/assets/{index-hjNWJZGE.js → index-gm3A0idN.js} +1 -1
  12. package/.output/public/assets/{json-viewer-D8gvbDlB.js → json-viewer-BA-W-PZq.js} +1 -1
  13. package/.output/public/assets/{main-ovrz0tyD.js → main-BnRC1932.js} +2 -2
  14. package/.output/server/_libs/@opentelemetry/semantic-conventions+[...].mjs +2658 -0
  15. package/.output/server/_libs/agent-base.mjs +234 -0
  16. package/.output/server/_libs/anthropic-ai__sdk.mjs +6042 -0
  17. package/.output/server/_libs/atomically.mjs +3 -0
  18. package/.output/server/_libs/base64-js.mjs +102 -0
  19. package/.output/server/_libs/bignumber.js.mjs +1353 -0
  20. package/.output/server/_libs/buffer-equal-constant-time.mjs +38 -0
  21. package/.output/server/_libs/data-uri-to-buffer.mjs +39 -0
  22. package/.output/server/_libs/debug.mjs +547 -0
  23. package/.output/server/_libs/ecdsa-sig-formatter.mjs +162 -0
  24. package/.output/server/_libs/extend.mjs +2 -1
  25. package/.output/server/_libs/fetch-blob.mjs +287 -0
  26. package/.output/server/_libs/formdata-polyfill.mjs +88 -0
  27. package/.output/server/_libs/gaxios.mjs +927 -0
  28. package/.output/server/_libs/gcp-metadata.mjs +322 -0
  29. package/.output/server/_libs/google-auth-library.mjs +6339 -0
  30. package/.output/server/_libs/google-logging-utils.mjs +385 -0
  31. package/.output/server/_libs/google__genai.mjs +18034 -0
  32. package/.output/server/_libs/has-flag.mjs +16 -0
  33. package/.output/server/_libs/https-proxy-agent.mjs +280 -0
  34. package/.output/server/_libs/json-bigint.mjs +413 -0
  35. package/.output/server/_libs/jwa.mjs +233 -0
  36. package/.output/server/_libs/jws.mjs +298 -0
  37. package/.output/server/_libs/lucide-react.mjs +261 -226
  38. package/.output/server/_libs/mariozechner__pi-agent-core.mjs +824 -0
  39. package/.output/server/_libs/mariozechner__pi-ai.mjs +22889 -0
  40. package/.output/server/_libs/mistralai__mistralai.mjs +32045 -0
  41. package/.output/server/_libs/ms.mjs +120 -0
  42. package/.output/server/_libs/node-domexception.mjs +17 -0
  43. package/.output/server/_libs/node-fetch.mjs +1578 -0
  44. package/.output/server/_libs/ohash.mjs +1 -1
  45. package/.output/server/_libs/openai.mjs +6766 -0
  46. package/.output/server/_libs/opentelemetry__api.mjs +1678 -0
  47. package/.output/server/_libs/p-retry.mjs +87 -0
  48. package/.output/server/_libs/partial-json.mjs +244 -0
  49. package/.output/server/_libs/react-dom.mjs +5 -5
  50. package/.output/server/_libs/react-markdown.mjs +2 -2
  51. package/.output/server/_libs/react.mjs +30 -0
  52. package/.output/server/_libs/readable-stream.mjs +5 -5
  53. package/.output/server/_libs/retry.mjs +236 -0
  54. package/.output/server/_libs/safe-buffer.mjs +63 -1
  55. package/.output/server/_libs/srvx.mjs +2 -2
  56. package/.output/server/_libs/supports-color.mjs +108 -0
  57. package/.output/server/_libs/tanstack__router-core.mjs +1 -1
  58. package/.output/server/_libs/typebox.mjs +6596 -0
  59. package/.output/server/_libs/util-deprecate.mjs +2 -2
  60. package/.output/server/_libs/vfile.mjs +2 -2
  61. package/.output/server/_libs/web-streams-polyfill.mjs +4282 -0
  62. package/.output/server/_libs/ws.mjs +3715 -0
  63. package/.output/server/_libs/zod-to-json-schema.mjs +1207 -0
  64. package/.output/server/_libs/zod.mjs +597 -9
  65. package/.output/server/{_sessionId-zI_GFX_7.mjs → _sessionId-Bi3ZIrqT.mjs} +14 -13
  66. package/.output/server/_ssr/{CompareDrawer-Ckcx1RVu.mjs → CompareDrawer-BYZS_hCR.mjs} +14 -13
  67. package/.output/server/_ssr/{ProxyViewerContainer-BgXewlIr.mjs → ProxyViewerContainer-BE4umfVs.mjs} +205 -106
  68. package/.output/server/_ssr/{ReplayDialog-wx3nDtZn.mjs → ReplayDialog-BlID2ZH4.mjs} +15 -14
  69. package/.output/server/_ssr/{RequestAnatomy-DN80zt0G.mjs → RequestAnatomy-CGJ2lkzT.mjs} +14 -13
  70. package/.output/server/_ssr/{ResponseView-DD7rTu_l.mjs → ResponseView-DDjcGf7M.mjs} +14 -13
  71. package/.output/server/_ssr/{StreamingChunkSequence-DAgz6Vvw.mjs → StreamingChunkSequence-G7B8M5G2.mjs} +14 -13
  72. package/.output/server/_ssr/{index-dcTjp8du.mjs → index-ClQ9FvRJ.mjs} +13 -12
  73. package/.output/server/_ssr/index.mjs +4 -4
  74. package/.output/server/_ssr/{json-viewer-N2cuzGWR.mjs → json-viewer-CFbpkiBJ.mjs} +14 -13
  75. package/.output/server/_ssr/{router-BfQ0QsD5.mjs → router-Cq8LEvhE.mjs} +523 -97
  76. package/.output/server/_tanstack-start-manifest_v-p7J0QCMh.mjs +4 -0
  77. package/.output/server/index.mjs +75 -75
  78. package/package.json +4 -1
  79. package/src/components/ProxyViewer.tsx +3 -0
  80. package/src/components/pi-agent/PiAgentPanel.tsx +204 -0
  81. package/src/components/proxy-viewer/LogEntry.tsx +54 -19
  82. package/src/components/proxy-viewer/logEntryVisibility.ts +22 -0
  83. package/src/lib/piAgentContract.ts +21 -0
  84. package/src/routes/api/pi-agent.ts +29 -0
  85. package/src/services/piAgent.ts +390 -0
  86. package/.output/public/assets/ProxyViewerContainer-C40Nig73.js +0 -106
  87. package/.output/public/assets/index-HRfrFVYw.css +0 -1
  88. package/.output/server/_tanstack-start-manifest_v-BXnYrbcJ.mjs +0 -4
@@ -0,0 +1,4 @@
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/pi-agent", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/ecosystem/packages", "/api/ecosystem/tasks", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/ecosystem/recipes/$recipeId/run", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-BnRC1932.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-gm3A0idN.js", "/assets/ProxyViewerContainer-BLCRQtU_.js"] }, "/api/alerts": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.ts", "children": ["/api/alerts/summary"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/api/groups": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.ts", "children": ["/api/groups/$groupId"] }, "/api/health": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/health.ts" }, "/api/logs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.ts", "children": ["/api/logs/$id", "/api/logs/import", "/api/logs/stream"] }, "/api/mcp": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/mcp.ts" }, "/api/models": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/models.ts" }, "/api/pi-agent": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/pi-agent.ts" }, "/api/providers": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.ts", "children": ["/api/providers/$providerId", "/api/providers/export", "/api/providers/import", "/api/providers/scan"] }, "/api/runs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.ts", "children": ["/api/runs/$runId"] }, "/api/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/sessions.ts" }, "/proxy/$": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/proxy/$.ts" }, "/session/$sessionId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", "assets": [], "preloads": ["/assets/_sessionId-CThgXa41.js", "/assets/ProxyViewerContainer-BLCRQtU_.js"] }, "/api/alerts/summary": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.summary.ts" }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/api/ecosystem/packages": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.ts", "children": ["/api/ecosystem/packages/$packageId/help", "/api/ecosystem/packages/$packageId/install", "/api/ecosystem/packages/$packageId/runner-presets", "/api/ecosystem/packages/$packageId/upgrade"] }, "/api/ecosystem/tasks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.tasks.ts", "children": ["/api/ecosystem/tasks/$taskId"] }, "/api/groups/$groupId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.ts", "children": ["/api/groups/$groupId/evidence", "/api/groups/$groupId/sessions"] }, "/api/knowledge/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.ts", "children": ["/api/knowledge/candidates/$candidateId"] }, "/api/knowledge/project-context": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.project-context.ts" }, "/api/knowledge/search": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.search.ts" }, "/api/logs/$id": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.ts", "children": ["/api/logs/$id/body", "/api/logs/$id/chunks", "/api/logs/$id/replay"] }, "/api/logs/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.import.ts" }, "/api/logs/stream": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.stream.ts" }, "/api/providers/$providerId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.ts", "children": ["/api/providers/$providerId/model-metadata", "/api/providers/$providerId/test"] }, "/api/providers/export": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.export.ts" }, "/api/providers/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.import.ts" }, "/api/providers/scan": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.scan.ts" }, "/api/runs/$runId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.ts", "children": ["/api/runs/$runId/evidence"] }, "/api/ecosystem/tasks/$taskId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.tasks.$taskId.ts" }, "/api/groups/$groupId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.evidence.ts" }, "/api/groups/$groupId/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.sessions.ts" }, "/api/knowledge/candidates/$candidateId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.ts", "children": ["/api/knowledge/candidates/$candidateId/promote"] }, "/api/logs/$id/body": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.body.ts" }, "/api/logs/$id/chunks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.chunks.ts" }, "/api/logs/$id/replay": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.replay.ts" }, "/api/providers/$providerId/model-metadata": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.model-metadata.ts" }, "/api/providers/$providerId/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/api/runs/$runId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.evidence.ts" }, "/api/ecosystem/packages/$packageId/help": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.help.ts" }, "/api/ecosystem/packages/$packageId/install": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.install.ts" }, "/api/ecosystem/packages/$packageId/runner-presets": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.runner-presets.ts" }, "/api/ecosystem/packages/$packageId/upgrade": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.upgrade.ts" }, "/api/ecosystem/recipes/$recipeId/run": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.recipes.$recipeId.run.ts" }, "/api/knowledge/candidates/$candidateId/promote": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.promote.ts" }, "/api/knowledge/sessions/$sessionId/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.sessions.$sessionId.candidates.ts" }, "/api/providers/$providerId/test/log": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.log.ts" } }, "clientEntry": "/assets/main-BnRC1932.js" });
2
+ export {
3
+ tsrStartManifest
4
+ };
@@ -35,124 +35,124 @@ const headers = ((m) => function headersRouteRule(event) {
35
35
  }
36
36
  });
37
37
  const assets = {
38
- "/assets/agent-inspector-58K1_MsC.ico": {
39
- "type": "image/vnd.microsoft.icon",
40
- "etag": '"38fa-ZD8kPABHYjPIkcH82FMY6iZM7fI"',
41
- "mtime": "2026-07-08T07:49:36.366Z",
42
- "size": 14586,
43
- "path": "../public/assets/agent-inspector-58K1_MsC.ico"
44
- },
45
38
  "/assets/alibaba-TTwafVwX.svg": {
46
39
  "type": "image/svg+xml",
47
40
  "etag": '"171b-6dyV5K8QjiaY35sN9qNprh9zDIs"',
48
- "mtime": "2026-07-08T07:49:36.366Z",
41
+ "mtime": "2026-07-08T09:20:47.299Z",
49
42
  "size": 5915,
50
43
  "path": "../public/assets/alibaba-TTwafVwX.svg"
51
44
  },
52
- "/assets/CompareDrawer-BJmxAiM0.js": {
45
+ "/assets/agent-inspector-58K1_MsC.ico": {
46
+ "type": "image/vnd.microsoft.icon",
47
+ "etag": '"38fa-ZD8kPABHYjPIkcH82FMY6iZM7fI"',
48
+ "mtime": "2026-07-08T09:20:47.299Z",
49
+ "size": 14586,
50
+ "path": "../public/assets/agent-inspector-58K1_MsC.ico"
51
+ },
52
+ "/assets/json-viewer-BA-W-PZq.js": {
53
53
  "type": "text/javascript; charset=utf-8",
54
- "etag": '"4bc3-0wNiqSedtdnKziZpUMnGfe9RDIg"',
55
- "mtime": "2026-07-08T07:49:36.366Z",
56
- "size": 19395,
57
- "path": "../public/assets/CompareDrawer-BJmxAiM0.js"
54
+ "etag": '"1ae6-dvP4VHmxfaubFfn7DjIy5LP2VDM"',
55
+ "mtime": "2026-07-08T09:20:47.300Z",
56
+ "size": 6886,
57
+ "path": "../public/assets/json-viewer-BA-W-PZq.js"
58
58
  },
59
- "/assets/index-hjNWJZGE.js": {
59
+ "/assets/index-gm3A0idN.js": {
60
60
  "type": "text/javascript; charset=utf-8",
61
- "etag": '"264-F7Ue2VftEtRHLW5sYg77WtMLlaY"',
62
- "mtime": "2026-07-08T07:49:36.366Z",
61
+ "etag": '"264-bUtHugGp38xTQ/556OOmW4cTb30"',
62
+ "mtime": "2026-07-08T09:20:47.299Z",
63
63
  "size": 612,
64
- "path": "../public/assets/index-hjNWJZGE.js"
64
+ "path": "../public/assets/index-gm3A0idN.js"
65
65
  },
66
66
  "/assets/minimax-BPMzvuL-.jpeg": {
67
67
  "type": "image/jpeg",
68
68
  "etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
69
- "mtime": "2026-07-08T07:49:36.366Z",
69
+ "mtime": "2026-07-08T09:20:47.299Z",
70
70
  "size": 6918,
71
71
  "path": "../public/assets/minimax-BPMzvuL-.jpeg"
72
72
  },
73
- "/assets/json-viewer-D8gvbDlB.js": {
74
- "type": "text/javascript; charset=utf-8",
75
- "etag": '"1ae6-3l17L5m8Gkm6hdHoj4wm+hPh1pE"',
76
- "mtime": "2026-07-08T07:49:36.368Z",
77
- "size": 6886,
78
- "path": "../public/assets/json-viewer-D8gvbDlB.js"
79
- },
80
- "/assets/index-Lwir70Rs.js": {
73
+ "/assets/index-ClQ7Vi3J.js": {
81
74
  "type": "text/javascript; charset=utf-8",
82
- "etag": '"1cd2c-uOY1+bLxcnzq9lK94Y24ff4tgfg"',
83
- "mtime": "2026-07-08T07:49:36.368Z",
75
+ "etag": '"1cd2c-4zCEbVXrILXYj2zEV1+iKezgPds"',
76
+ "mtime": "2026-07-08T09:20:47.300Z",
84
77
  "size": 118060,
85
- "path": "../public/assets/index-Lwir70Rs.js"
78
+ "path": "../public/assets/index-ClQ7Vi3J.js"
86
79
  },
87
- "/assets/main-ovrz0tyD.js": {
80
+ "/assets/main-BnRC1932.js": {
88
81
  "type": "text/javascript; charset=utf-8",
89
- "etag": '"51754-iAsbeZP/dvE+sTlxwVbBwpE2OCs"',
90
- "mtime": "2026-07-08T07:49:36.366Z",
82
+ "etag": '"51754-C+GxW6/FcQjEc3T50yvdt1wbC+Q"',
83
+ "mtime": "2026-07-08T09:20:47.300Z",
91
84
  "size": 333652,
92
- "path": "../public/assets/main-ovrz0tyD.js"
85
+ "path": "../public/assets/main-BnRC1932.js"
93
86
  },
94
- "/assets/RequestAnatomy-DemOFfSc.js": {
87
+ "/assets/CompareDrawer-Daj03-RL.js": {
95
88
  "type": "text/javascript; charset=utf-8",
96
- "etag": '"43f2-9HUxPv82UBTGS/J+/q248fOiJxw"',
97
- "mtime": "2026-07-08T07:49:36.366Z",
98
- "size": 17394,
99
- "path": "../public/assets/RequestAnatomy-DemOFfSc.js"
89
+ "etag": '"4bc3-br2IcvOX80Rt2Ihi0wTncTxpsjQ"',
90
+ "mtime": "2026-07-08T09:20:47.300Z",
91
+ "size": 19395,
92
+ "path": "../public/assets/CompareDrawer-Daj03-RL.js"
100
93
  },
101
- "/assets/ResponseView-9LhpuDo7.js": {
94
+ "/assets/ResponseView-BwkMSsUa.js": {
102
95
  "type": "text/javascript; charset=utf-8",
103
- "etag": '"47fc-bHHyCeRZHr2EkGyCARjoaoqYgYg"',
104
- "mtime": "2026-07-08T07:49:36.366Z",
96
+ "etag": '"47fc-0qG8LO4aEdS/plOjflbM11UR8Ow"',
97
+ "mtime": "2026-07-08T09:20:47.300Z",
105
98
  "size": 18428,
106
- "path": "../public/assets/ResponseView-9LhpuDo7.js"
99
+ "path": "../public/assets/ResponseView-BwkMSsUa.js"
107
100
  },
108
- "/assets/StreamingChunkSequence-RRWYBOdz.js": {
101
+ "/assets/RequestAnatomy-DF0hHdQY.js": {
109
102
  "type": "text/javascript; charset=utf-8",
110
- "etag": '"e95-UCuCI5JEd/d2GeEjk1HjYYShDFA"',
111
- "mtime": "2026-07-08T07:49:36.368Z",
112
- "size": 3733,
113
- "path": "../public/assets/StreamingChunkSequence-RRWYBOdz.js"
103
+ "etag": '"43f2-Mtz9JWVo1c1JlS8OqgcPSXmE3lQ"',
104
+ "mtime": "2026-07-08T09:20:47.300Z",
105
+ "size": 17394,
106
+ "path": "../public/assets/RequestAnatomy-DF0hHdQY.js"
114
107
  },
115
- "/assets/index-HRfrFVYw.css": {
116
- "type": "text/css; charset=utf-8",
117
- "etag": '"256cc-1u+nmxaQWLqCgRpu+RY8lHvN/Rw"',
118
- "mtime": "2026-07-08T07:49:36.366Z",
119
- "size": 153292,
120
- "path": "../public/assets/index-HRfrFVYw.css"
108
+ "/assets/ReplayDialog-5FR5crdo.js": {
109
+ "type": "text/javascript; charset=utf-8",
110
+ "etag": '"3347-a97u4d282w761H2y42rBEmcN128"',
111
+ "mtime": "2026-07-08T09:20:47.300Z",
112
+ "size": 13127,
113
+ "path": "../public/assets/ReplayDialog-5FR5crdo.js"
114
+ },
115
+ "/assets/StreamingChunkSequence-CKeUd58x.js": {
116
+ "type": "text/javascript; charset=utf-8",
117
+ "etag": '"e95-aUcHwmSf3cNmuFqJIhMNTBPZwHQ"',
118
+ "mtime": "2026-07-08T09:20:47.300Z",
119
+ "size": 3733,
120
+ "path": "../public/assets/StreamingChunkSequence-CKeUd58x.js"
121
121
  },
122
122
  "/assets/zhipuai-BPNAnxo-.svg": {
123
123
  "type": "image/svg+xml",
124
124
  "etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
125
- "mtime": "2026-07-08T07:49:36.366Z",
125
+ "mtime": "2026-07-08T09:20:47.299Z",
126
126
  "size": 11256,
127
127
  "path": "../public/assets/zhipuai-BPNAnxo-.svg"
128
128
  },
129
- "/assets/_sessionId-CWEh2Jsn.js": {
129
+ "/assets/index-BHXN1Fsx.css": {
130
+ "type": "text/css; charset=utf-8",
131
+ "etag": '"25b0d-UyzOlNKIaucQXEUHv/FUiQk9+WM"',
132
+ "mtime": "2026-07-08T09:20:47.299Z",
133
+ "size": 154381,
134
+ "path": "../public/assets/index-BHXN1Fsx.css"
135
+ },
136
+ "/assets/_sessionId-CThgXa41.js": {
130
137
  "type": "text/javascript; charset=utf-8",
131
- "etag": '"36c-oFVb0kCzpHPGDXYQVoJ9vz+KOkM"',
132
- "mtime": "2026-07-08T07:49:36.366Z",
138
+ "etag": '"36c-LhEJ0XDKnu7ufvoZ93ll2DTfzsE"',
139
+ "mtime": "2026-07-08T09:20:47.299Z",
133
140
  "size": 876,
134
- "path": "../public/assets/_sessionId-CWEh2Jsn.js"
141
+ "path": "../public/assets/_sessionId-CThgXa41.js"
135
142
  },
136
143
  "/assets/qwen-CONDcHqt.png": {
137
144
  "type": "image/png",
138
145
  "etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
139
- "mtime": "2026-07-08T07:49:36.366Z",
146
+ "mtime": "2026-07-08T09:20:47.299Z",
140
147
  "size": 357059,
141
148
  "path": "../public/assets/qwen-CONDcHqt.png"
142
149
  },
143
- "/assets/ReplayDialog-CkLdOMJr.js": {
144
- "type": "text/javascript; charset=utf-8",
145
- "etag": '"3347-6HbaYA2frlBjkCZbszV4OozM1vA"',
146
- "mtime": "2026-07-08T07:49:36.366Z",
147
- "size": 13127,
148
- "path": "../public/assets/ReplayDialog-CkLdOMJr.js"
149
- },
150
- "/assets/ProxyViewerContainer-C40Nig73.js": {
150
+ "/assets/ProxyViewerContainer-BLCRQtU_.js": {
151
151
  "type": "text/javascript; charset=utf-8",
152
- "etag": '"b9507-EVmqSsSCJV0ZRsDaOUA+xF8g3+E"',
153
- "mtime": "2026-07-08T07:49:36.368Z",
154
- "size": 759047,
155
- "path": "../public/assets/ProxyViewerContainer-C40Nig73.js"
152
+ "etag": '"bacfa-YqZ58vQYU45MNm0p7H9WPhfdV4M"',
153
+ "mtime": "2026-07-08T09:20:47.300Z",
154
+ "size": 765178,
155
+ "path": "../public/assets/ProxyViewerContainer-BLCRQtU_.js"
156
156
  }
157
157
  };
158
158
  function readAsset(id) {
@@ -180,7 +180,7 @@ const EncodingMap = {
180
180
  br: ".br",
181
181
  zstd: ".zst"
182
182
  };
183
- const _9o1BXV = defineHandler((event) => {
183
+ const _aYWmx5 = defineHandler((event) => {
184
184
  if (event.req.method && !METHODS.has(event.req.method)) {
185
185
  return;
186
186
  }
@@ -252,15 +252,15 @@ const findRouteRules = /* @__PURE__ */ (() => {
252
252
  return r;
253
253
  };
254
254
  })();
255
- const _lazy_c5_ocM = defineLazyEventHandler(() => import("./_chunks/ssr-renderer.mjs"));
255
+ const _lazy_bRSXJB = defineLazyEventHandler(() => import("./_chunks/ssr-renderer.mjs"));
256
256
  const findRoute = /* @__PURE__ */ (() => {
257
- const data = { route: "/**", handler: _lazy_c5_ocM };
257
+ const data = { route: "/**", handler: _lazy_bRSXJB };
258
258
  return ((_m, p) => {
259
259
  return { data, params: { "_": p.slice(1) } };
260
260
  });
261
261
  })();
262
262
  const globalMiddleware = [
263
- toEventHandler(_9o1BXV)
263
+ toEventHandler(_aYWmx5)
264
264
  ].filter(Boolean);
265
265
  const errorHandler$1 = (error, event) => {
266
266
  const res = defaultHandler(error, event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonyclaw/agent-inspector",
3
- "version": "3.0.16",
3
+ "version": "3.0.18",
4
4
  "type": "module",
5
5
  "description": "Agent observability and knowledge capture layer for AI coding tools.",
6
6
  "license": "MIT",
@@ -69,6 +69,9 @@
69
69
  "ladle:build": "ladle build"
70
70
  },
71
71
  "dependencies": {
72
+ "@mariozechner/pi-agent-core": "^0.73.1",
73
+ "@mariozechner/pi-ai": "^0.73.1",
74
+ "@mariozechner/pi-coding-agent": "^0.73.1",
72
75
  "@modelcontextprotocol/server": "^2.0.0-alpha.2",
73
76
  "@radix-ui/react-dialog": "^1.1.14",
74
77
  "@radix-ui/react-select": "^2.2.6",
@@ -65,6 +65,7 @@ import { AlertsDialog } from "./alerts/AlertsDialog";
65
65
  import { GroupsDialog } from "./groups/GroupsDialog";
66
66
  import { SettingsDialog } from "./providers/SettingsDialog";
67
67
  import { AgentLabDialog } from "./ecosystem/AgentLabDialog";
68
+ import { PiAgentPanel } from "./pi-agent/PiAgentPanel";
68
69
  import { computeCacheTrends } from "./proxy-viewer/cacheTrend";
69
70
  import { LazyCompareDrawer } from "./proxy-viewer/lazy";
70
71
  import { dispatchLogFocusRequest } from "./proxy-viewer/logFocus";
@@ -2398,6 +2399,8 @@ export function ProxyViewer({
2398
2399
  </div>
2399
2400
  </SidebarPanel>
2400
2401
 
2402
+ <PiAgentPanel currentSessionId={labSessionId} logCount={logs.length} />
2403
+
2401
2404
  {hasSessionContext && sessionContextScope !== null && (
2402
2405
  <SessionContextBar
2403
2406
  label={sessionContextScope.label}
@@ -0,0 +1,204 @@
1
+ import { BrainCircuit, Loader2, Send } from "lucide-react";
2
+ import { useMemo, useState, type ChangeEvent, type JSX } from "react";
3
+ import { PiAgentResponseSchema } from "../../lib/piAgentContract";
4
+ import { useProviders } from "../../lib/useProviders";
5
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
6
+
7
+ type PiAgentPanelProps = {
8
+ currentSessionId: string | null;
9
+ logCount: number;
10
+ };
11
+
12
+ const DEFAULT_QUESTION =
13
+ "Analyze the current Inspector session. What looks abnormal, slow, or likely to hang?";
14
+
15
+ function providerSupportsPiAgent(provider: {
16
+ anthropicBaseUrl?: string;
17
+ openaiBaseUrl?: string;
18
+ openaiResponsesBaseUrl?: string;
19
+ }): boolean {
20
+ return (
21
+ provider.openaiResponsesBaseUrl !== undefined ||
22
+ provider.openaiBaseUrl !== undefined ||
23
+ provider.anthropicBaseUrl !== undefined
24
+ );
25
+ }
26
+
27
+ function providerProtocolLabel(provider: {
28
+ anthropicBaseUrl?: string;
29
+ openaiBaseUrl?: string;
30
+ openaiResponsesBaseUrl?: string;
31
+ }): string {
32
+ if (provider.openaiResponsesBaseUrl !== undefined && provider.openaiResponsesBaseUrl !== "") {
33
+ return "Responses";
34
+ }
35
+ if (provider.openaiBaseUrl !== undefined && provider.openaiBaseUrl !== "") {
36
+ return "Chat";
37
+ }
38
+ return "Anthropic";
39
+ }
40
+
41
+ function sortProviderBySource<T extends { name: string; source?: "company" | "personal" }>(
42
+ providers: readonly T[],
43
+ ): T[] {
44
+ return providers.toSorted((left, right) => {
45
+ const leftCompanyRank = left.source === "company" ? 0 : 1;
46
+ const rightCompanyRank = right.source === "company" ? 0 : 1;
47
+ if (leftCompanyRank !== rightCompanyRank) return leftCompanyRank - rightCompanyRank;
48
+ return left.name.localeCompare(right.name);
49
+ });
50
+ }
51
+
52
+ export function PiAgentPanel({ currentSessionId, logCount }: PiAgentPanelProps): JSX.Element {
53
+ const { providers } = useProviders();
54
+ const piProviders = useMemo(
55
+ () => sortProviderBySource(providers.filter(providerSupportsPiAgent)),
56
+ [providers],
57
+ );
58
+ const [question, setQuestion] = useState(DEFAULT_QUESTION);
59
+ const [providerId, setProviderId] = useState<string>("__auto__");
60
+ const [model, setModel] = useState<string>("__auto__");
61
+ const [answer, setAnswer] = useState<string>("");
62
+ const [status, setStatus] = useState<string>("");
63
+ const [loading, setLoading] = useState(false);
64
+
65
+ const selectedProvider = piProviders.find((provider) => provider.id === providerId);
66
+ const modelOptions = selectedProvider?.models ?? [];
67
+ const canAsk = question.trim() !== "" && piProviders.length > 0 && !loading;
68
+
69
+ const handleQuestionChange = (event: ChangeEvent<HTMLTextAreaElement>): void => {
70
+ setQuestion(event.currentTarget.value);
71
+ };
72
+
73
+ const handleProviderChange = (value: string): void => {
74
+ setProviderId(value);
75
+ setModel("__auto__");
76
+ };
77
+
78
+ const askPiAgent = (): void => {
79
+ if (!canAsk) return;
80
+ setLoading(true);
81
+ setStatus("");
82
+ setAnswer("");
83
+
84
+ const body = {
85
+ question: question.trim(),
86
+ ...(currentSessionId !== null ? { sessionId: currentSessionId } : {}),
87
+ ...(providerId !== "__auto__" ? { providerId } : {}),
88
+ ...(model !== "__auto__" ? { model } : {}),
89
+ logLimit: 24,
90
+ };
91
+
92
+ void fetch("/api/pi-agent", {
93
+ method: "POST",
94
+ headers: { "content-type": "application/json" },
95
+ body: JSON.stringify(body),
96
+ })
97
+ .then(async (response) => {
98
+ const raw = await response.text();
99
+ if (!response.ok) {
100
+ setStatus(`Pi Agent failed: HTTP ${String(response.status)}`);
101
+ setAnswer(raw);
102
+ return;
103
+ }
104
+ const parsedJson: unknown = JSON.parse(raw);
105
+ const parsed = PiAgentResponseSchema.safeParse(parsedJson);
106
+ if (!parsed.success) {
107
+ setStatus("Pi Agent returned an unexpected response.");
108
+ setAnswer(raw);
109
+ return;
110
+ }
111
+ setStatus(
112
+ `${parsed.data.providerName} / ${parsed.data.model} / ${parsed.data.protocol} / ${String(
113
+ parsed.data.logCount,
114
+ )} logs`,
115
+ );
116
+ setAnswer(parsed.data.answer);
117
+ })
118
+ .catch((err: unknown) => {
119
+ setStatus(err instanceof Error ? err.message : "Pi Agent request failed.");
120
+ })
121
+ .finally(() => {
122
+ setLoading(false);
123
+ });
124
+ };
125
+
126
+ return (
127
+ <section className="rounded-md bg-black/20 px-3 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]">
128
+ <div className="flex items-center gap-2">
129
+ <BrainCircuit className="size-4 text-cyan-200" />
130
+ <div className="min-w-0 flex-1">
131
+ <div className="text-xs font-semibold text-foreground">Pi Agent</div>
132
+ <div className="text-[11px] text-muted-foreground">
133
+ {currentSessionId === null ? "Inspector-wide analysis" : "Session analysis"}
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+ <div className="mt-3 grid grid-cols-2 gap-2">
139
+ <Select value={providerId} onValueChange={handleProviderChange}>
140
+ <SelectTrigger className="h-8 border-0 bg-black/25 text-xs shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]">
141
+ <SelectValue placeholder="Provider" />
142
+ </SelectTrigger>
143
+ <SelectContent>
144
+ <SelectItem value="__auto__">Auto provider</SelectItem>
145
+ {piProviders.map((provider) => (
146
+ <SelectItem key={provider.id} value={provider.id}>
147
+ {provider.name} / {providerProtocolLabel(provider)}
148
+ </SelectItem>
149
+ ))}
150
+ </SelectContent>
151
+ </Select>
152
+ <Select value={model} onValueChange={setModel}>
153
+ <SelectTrigger className="h-8 border-0 bg-black/25 text-xs shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]">
154
+ <SelectValue placeholder="Model" />
155
+ </SelectTrigger>
156
+ <SelectContent>
157
+ <SelectItem value="__auto__">Auto model</SelectItem>
158
+ {modelOptions.map((modelName) => (
159
+ <SelectItem key={modelName} value={modelName}>
160
+ {modelName}
161
+ </SelectItem>
162
+ ))}
163
+ </SelectContent>
164
+ </Select>
165
+ </div>
166
+
167
+ <textarea
168
+ value={question}
169
+ onChange={handleQuestionChange}
170
+ className="mt-2 min-h-24 w-full resize-y rounded-md bg-black/25 px-3 py-2 text-xs leading-5 text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring"
171
+ placeholder="Ask Pi Agent about this session..."
172
+ />
173
+
174
+ <button
175
+ type="button"
176
+ onClick={askPiAgent}
177
+ disabled={!canAsk}
178
+ className="mt-2 inline-flex h-8 w-full items-center justify-center gap-2 rounded-md bg-cyan-400/12 px-3 text-xs font-medium text-cyan-100 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.18)] transition-colors hover:bg-cyan-400/18 disabled:cursor-not-allowed disabled:opacity-50"
179
+ >
180
+ {loading ? <Loader2 className="size-3.5 animate-spin" /> : <Send className="size-3.5" />}
181
+ <span>{loading ? "Thinking..." : "Ask Pi"}</span>
182
+ </button>
183
+
184
+ {piProviders.length === 0 && (
185
+ <p className="mt-2 text-[11px] leading-5 text-muted-foreground">
186
+ Configure a Provider with Responses, Chat, or Anthropic URL to enable Pi Agent.
187
+ </p>
188
+ )}
189
+ {status !== "" && (
190
+ <p className="mt-2 break-words font-mono text-[10px] text-cyan-100/70">{status}</p>
191
+ )}
192
+ {answer !== "" && (
193
+ <div className="mt-3 max-h-64 overflow-y-auto whitespace-pre-wrap rounded-md bg-black/25 p-3 text-xs leading-5 text-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]">
194
+ {answer}
195
+ </div>
196
+ )}
197
+ {logCount === 0 && (
198
+ <p className="mt-2 text-[11px] leading-5 text-muted-foreground">
199
+ No logs are visible in this scope yet; Pi Agent can still answer Provider setup questions.
200
+ </p>
201
+ )}
202
+ </section>
203
+ );
204
+ }
@@ -41,6 +41,8 @@ import { getLogFormatAdapter, resolveLogFormat } from "./log-formats";
41
41
  import { LOG_FOCUS_REQUEST_EVENT, readLogFocusRequest, type LogFocusTab } from "./logFocus";
42
42
  import {
43
43
  shouldShowHeadersDiffButton,
44
+ shouldShowHeadersTab,
45
+ shouldShowRawHeadersTab,
44
46
  shouldShowRawRequestTab,
45
47
  shouldShowRequestDiffButton,
46
48
  } from "./logEntryVisibility";
@@ -568,21 +570,40 @@ export const LogEntry = memo(function ({
568
570
  }
569
571
  : null,
570
572
  },
571
- headers: {
572
- copyLabel: "Copy headers",
573
- copyText: headersText,
574
- copyCopied: headersCopy.copied,
575
- onCopy: headersCopy.copy,
576
- // Headers are a flat dict, no JSON tree to expand.
577
- expansion: null,
578
- },
579
- "raw-headers": {
580
- copyLabel: "Copy raw headers",
581
- copyText: rawHeadersText,
582
- copyCopied: rawHeadersCopy.copied,
583
- onCopy: rawHeadersCopy.copy,
584
- expansion: null,
585
- },
573
+ // Tab-level actions mirror the visibility rules in logEntryVisibility:
574
+ // when the corresponding tab is hidden because the log has no captured
575
+ // headers, the header bar must not surface a Copy button either. We
576
+ // therefore omit the key entirely (header renders no actions) instead
577
+ // of returning a bundle with `copyText: null`.
578
+ ...(shouldShowHeadersTab(
579
+ viewMode,
580
+ displayLog.headers !== undefined && Object.keys(displayLog.headers).length > 0,
581
+ )
582
+ ? {
583
+ headers: {
584
+ copyLabel: "Copy headers",
585
+ copyText: headersText,
586
+ copyCopied: headersCopy.copied,
587
+ onCopy: headersCopy.copy,
588
+ // Headers are a flat dict, no JSON tree to expand.
589
+ expansion: null,
590
+ },
591
+ }
592
+ : {}),
593
+ ...(shouldShowRawHeadersTab(
594
+ viewMode,
595
+ displayLog.rawHeaders !== undefined && Object.keys(displayLog.rawHeaders).length > 0,
596
+ )
597
+ ? {
598
+ "raw-headers": {
599
+ copyLabel: "Copy raw headers",
600
+ copyText: rawHeadersText,
601
+ copyCopied: rawHeadersCopy.copied,
602
+ onCopy: rawHeadersCopy.copy,
603
+ expansion: null,
604
+ },
605
+ }
606
+ : {}),
586
607
  raw: {
587
608
  copyLabel: responsePreviewIsActive ? "Copy loaded response preview" : "Copy response",
588
609
  copyText: responseTextForView,
@@ -842,12 +863,19 @@ export const LogEntry = memo(function ({
842
863
  variant="line"
843
864
  className="bg-white/[0.04] inspector-scrollbar relative mx-3 h-auto w-[calc(100%-1.5rem)] justify-start overflow-x-auto rounded-[8px] p-1"
844
865
  >
845
- {viewMode === "full" && (
866
+ {shouldShowRawHeadersTab(
867
+ viewMode,
868
+ displayLog.rawHeaders !== undefined &&
869
+ Object.keys(displayLog.rawHeaders).length > 0,
870
+ ) && (
846
871
  <TabsTrigger className={TAB_TRIGGER_CLASS} value="raw-headers">
847
872
  Raw Headers
848
873
  </TabsTrigger>
849
874
  )}
850
- {viewMode === "full" && (
875
+ {shouldShowHeadersTab(
876
+ viewMode,
877
+ displayLog.headers !== undefined && Object.keys(displayLog.headers).length > 0,
878
+ ) && (
851
879
  <TabsTrigger className={TAB_TRIGGER_CLASS} value="headers">
852
880
  Headers
853
881
  </TabsTrigger>
@@ -999,7 +1027,10 @@ export const LogEntry = memo(function ({
999
1027
  </TabsContent>
1000
1028
  )}
1001
1029
 
1002
- {viewMode === "full" && (
1030
+ {shouldShowHeadersTab(
1031
+ viewMode,
1032
+ displayLog.headers !== undefined && Object.keys(displayLog.headers).length > 0,
1033
+ ) && (
1003
1034
  <TabsContent value="headers">
1004
1035
  {activeTab === "headers" && (
1005
1036
  <ExpandedPanel>
@@ -1033,7 +1064,11 @@ export const LogEntry = memo(function ({
1033
1064
  </TabsContent>
1034
1065
  )}
1035
1066
 
1036
- {viewMode === "full" && (
1067
+ {shouldShowRawHeadersTab(
1068
+ viewMode,
1069
+ displayLog.rawHeaders !== undefined &&
1070
+ Object.keys(displayLog.rawHeaders).length > 0,
1071
+ ) && (
1037
1072
  <TabsContent value="raw-headers">
1038
1073
  {activeTab === "raw-headers" && (
1039
1074
  <ExpandedPanel>
@@ -23,6 +23,28 @@ export function shouldShowHeadersDiffButton(
23
23
  return viewMode === "full" && hasRawHeaders;
24
24
  }
25
25
 
26
+ /**
27
+ * Pure visibility rule for the `Raw Headers` tab. Inherits the same mode
28
+ * constraint as `shouldShowHeadersDiffButton` (full mode required to surface
29
+ * raw capture data), and additionally requires that the log actually has at
30
+ * least one captured header — otherwise the tab would render an empty panel.
31
+ */
32
+ export function shouldShowRawHeadersTab(
33
+ viewMode: "simple" | "full",
34
+ hasRawHeaders: boolean,
35
+ ): boolean {
36
+ return viewMode === "full" && hasRawHeaders;
37
+ }
38
+
39
+ /**
40
+ * Pure visibility rule for the `Headers` tab. Mirrors `shouldShowRawHeadersTab`
41
+ * but against the processed outgoing headers (rather than the raw inbound
42
+ * headers). Like its sibling it requires full mode AND a non-empty capture.
43
+ */
44
+ export function shouldShowHeadersTab(viewMode: "simple" | "full", hasHeaders: boolean): boolean {
45
+ return viewMode === "full" && hasHeaders;
46
+ }
47
+
26
48
  /**
27
49
  * Pure visibility rule for the "Diff with Raw" button in the Request tab.
28
50
  * Mirrors the conditions for the `Raw Request` tab itself: full mode plus