@tonyclaw/agent-inspector 2.0.7 → 2.0.8

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 (32) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-BhRYPp6T.js → CompareDrawer-Djb4XFZS.js} +1 -1
  3. package/.output/public/assets/{ProxyViewerContainer-BHq0dkQG.js → ProxyViewerContainer-CWdkPZsJ.js} +5 -5
  4. package/.output/public/assets/{ReplayDialog-Ch0gwg6B.js → ReplayDialog-DBPMIs2I.js} +1 -1
  5. package/.output/public/assets/RequestAnatomy-FBfRNQN7.js +1 -0
  6. package/.output/public/assets/{ResponseView-hRLar32x.js → ResponseView-Db4pJL7U.js} +1 -1
  7. package/.output/public/assets/{StreamingChunkSequence-DCJ_gUHa.js → StreamingChunkSequence-BH175O6R.js} +1 -1
  8. package/.output/public/assets/_sessionId-3ipVoQtW.js +1 -0
  9. package/.output/public/assets/index-Bo1dGS4R.css +1 -0
  10. package/.output/public/assets/index-CJgaCJo8.js +1 -0
  11. package/.output/public/assets/{main-BlDtK0Nn.js → main-CwhqfJqM.js} +8 -8
  12. package/.output/server/{_sessionId-Dy7rsLS4.mjs → _sessionId-DzBy9gLa.mjs} +2 -2
  13. package/.output/server/_ssr/{CompareDrawer-CkVX-ARV.mjs → CompareDrawer-C5NBvE2e.mjs} +2 -2
  14. package/.output/server/_ssr/{ProxyViewerContainer-B5a9p3j5.mjs → ProxyViewerContainer-DiZjOTQT.mjs} +9 -8
  15. package/.output/server/_ssr/{ReplayDialog-hXY6H9fB.mjs → ReplayDialog-EpvTwFvp.mjs} +3 -3
  16. package/.output/server/_ssr/{RequestAnatomy-B6MS7VvA.mjs → RequestAnatomy-DaQjhixp.mjs} +455 -3
  17. package/.output/server/_ssr/{ResponseView-ByjxwUnp.mjs → ResponseView-D8tGHCGY.mjs} +2 -2
  18. package/.output/server/_ssr/{StreamingChunkSequence-C5Kb8siT.mjs → StreamingChunkSequence-DGQnb1QE.mjs} +2 -2
  19. package/.output/server/_ssr/{index-BZXtj42m.mjs → index-N25hqa7t.mjs} +2 -2
  20. package/.output/server/_ssr/index.mjs +2 -2
  21. package/.output/server/_ssr/{router-CVQaVF_3.mjs → router-Bf0m6F0G.mjs} +20 -4
  22. package/.output/server/{_tanstack-start-manifest_v-Bpe5ZC56.mjs → _tanstack-start-manifest_v-DlAyJ5DB.mjs} +1 -1
  23. package/.output/server/index.mjs +59 -59
  24. package/package.json +1 -1
  25. package/src/components/proxy-viewer/LogEntry.tsx +2 -1
  26. package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +197 -1
  27. package/src/components/proxy-viewer/anatomy/contextIntelligence.ts +414 -0
  28. package/src/routes/__root.tsx +27 -0
  29. package/.output/public/assets/RequestAnatomy-CKbvIgaN.js +0 -1
  30. package/.output/public/assets/_sessionId-BJTz6t5l.js +0 -1
  31. package/.output/public/assets/index-Cf9U0Ekq.js +0 -1
  32. package/.output/public/assets/index-DTdv7nzl.css +0 -1
@@ -49,7 +49,7 @@ import "../_libs/mimic-function.mjs";
49
49
  import "../_libs/semver.mjs";
50
50
  import "../_libs/uint8array-extras.mjs";
51
51
  const faviconSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20role='img'%20aria-label='Agent%20Inspector'%3e%3crect%20width='64'%20height='64'%20rx='14'%20fill='%23111827'%20/%3e%3cg%20fill='none'%20stroke='%23f59e0b'%20stroke-width='4.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20fill='%23f59e0b'%20d='M15%2036c0-11%207-18%2017-18s17%207%2017%2018c0%208-7%2013-17%2013s-17-5-17-13z'%20/%3e%3cpath%20d='M16%2031c-6-5-12-3-12%204%200%205%206%206%2011%202'%20/%3e%3cpath%20d='M48%2031c6-5%2012-3%2012%204%200%205-6%206-11%202'%20/%3e%3cpath%20d='M27%2019l-3-7'%20/%3e%3cpath%20d='M37%2019l3-7'%20/%3e%3cpath%20d='M19%2045l-6%209'%20/%3e%3cpath%20d='M27%2048l-3%209'%20/%3e%3cpath%20d='M37%2048l3%209'%20/%3e%3cpath%20d='M45%2045l6%209'%20/%3e%3c/g%3e%3cpath%20d='M14%2047l9-8%208%209c-5%203.5-12%203-17-1z'%20fill='%232f6b3f'%20opacity='.95'%20/%3e%3cpath%20d='M18%2046l5-5%205%206c-3%201.6-7%201.4-10-1z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M23%2041v10'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='1.6'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='31'%20cy='48'%20r='1.8'%20fill='%23c2412d'%20/%3e%3cpath%20d='M24%2044l13-11%2014%2013c-8%205.8-18%205.3-27-2z'%20fill='%232f6b3f'%20opacity='.97'%20/%3e%3cpath%20d='M30%2043l7-7%209%209c-5%202.7-11%202.5-16-2z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M37%2036v14'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M30%2043c5-2%2011-1.5%2016%202'%20fill='none'%20stroke='%239fca78'%20stroke-width='1.8'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='51'%20cy='46'%20r='2'%20fill='%23c2412d'%20/%3e%3cpath%20d='M40%2050l8-8%207%208c-4.2%203.2-10%203-15%200z'%20fill='%232f6b3f'%20opacity='.95'%20/%3e%3cpath%20d='M43%2049l5-5%204.5%205.5c-3%201.5-6%201.2-9.5-.5z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M48%2044v9'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='1.5'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='55'%20cy='50'%20r='1.7'%20fill='%23c2412d'%20/%3e%3ccircle%20cx='24'%20cy='11'%20r='3.2'%20fill='%23f59e0b'%20/%3e%3ccircle%20cx='40'%20cy='11'%20r='3.2'%20fill='%23f59e0b'%20/%3e%3ccircle%20cx='25'%20cy='34'%20r='2.1'%20fill='%23111827'%20/%3e%3ccircle%20cx='39'%20cy='34'%20r='2.1'%20fill='%23111827'%20/%3e%3c/svg%3e";
52
- const appCss = "/assets/index-DTdv7nzl.css";
52
+ const appCss = "/assets/index-Bo1dGS4R.css";
53
53
  const Route$r = createRootRoute({
54
54
  head: () => ({
55
55
  meta: [
@@ -62,11 +62,27 @@ const Route$r = createRootRoute({
62
62
  { rel: "icon", type: "image/svg+xml", href: faviconSvg }
63
63
  ]
64
64
  }),
65
- component: RootComponent
65
+ component: RootComponent,
66
+ notFoundComponent: RootNotFoundComponent
66
67
  });
67
68
  function RootComponent() {
68
69
  return /* @__PURE__ */ jsxRuntimeExports.jsx(RootDocument, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) });
69
70
  }
71
+ function RootNotFoundComponent() {
72
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(RootDocument, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("main", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mx-auto flex min-h-screen w-full max-w-3xl flex-col justify-center px-6 py-16", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-border/70 bg-card/60 rounded-lg border p-8 shadow-sm", children: [
73
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-muted-foreground font-mono text-xs uppercase tracking-wider", children: "404" }),
74
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "mt-3 text-2xl font-semibold", children: "Page not found" }),
75
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground mt-3 max-w-xl text-sm leading-6", children: "This route is not part of the Agent Inspector UI or API surface." }),
76
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77
+ "a",
78
+ {
79
+ href: "/",
80
+ className: "bg-primary text-primary-foreground hover:bg-primary/90 mt-6 inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium transition-colors",
81
+ children: "Open Agent Inspector"
82
+ }
83
+ )
84
+ ] }) }) }) });
85
+ }
70
86
  function RootDocument({ children }) {
71
87
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("html", { lang: "en", className: "dark", children: [
72
88
  /* @__PURE__ */ jsxRuntimeExports.jsx("head", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, {}) }),
@@ -76,7 +92,7 @@ function RootDocument({ children }) {
76
92
  ] })
77
93
  ] });
78
94
  }
79
- const $$splitComponentImporter$1 = () => import("./index-BZXtj42m.mjs");
95
+ const $$splitComponentImporter$1 = () => import("./index-N25hqa7t.mjs");
80
96
  const Route$q = createFileRoute("/")({
81
97
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
82
98
  });
@@ -119,7 +135,7 @@ function decodeSessionIdFromPath(encoded) {
119
135
  function getSessionPath(sessionId) {
120
136
  return `/session/${encodeSessionIdForPath(sessionId)}`;
121
137
  }
122
- const $$splitComponentImporter = () => import("../_sessionId-Dy7rsLS4.mjs");
138
+ const $$splitComponentImporter = () => import("../_sessionId-DzBy9gLa.mjs");
123
139
  const Route$p = createFileRoute("/session/$sessionId")({
124
140
  component: lazyRouteComponent($$splitComponentImporter, "component"),
125
141
  parseParams: (params) => ({
@@ -1,4 +1,4 @@
1
- const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/config", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-BlDtK0Nn.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-Cf9U0Ekq.js", "/assets/ProxyViewerContainer-BHq0dkQG.js"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/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/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/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/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-BJTz6t5l.js", "/assets/ProxyViewerContainer-BHq0dkQG.js"] }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/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/chunks", "/api/logs/$id/replay"] }, "/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/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/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/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/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/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-BlDtK0Nn.js" });
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/config", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-CwhqfJqM.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-CJgaCJo8.js", "/assets/ProxyViewerContainer-CWdkPZsJ.js"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/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/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/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/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-3ipVoQtW.js", "/assets/ProxyViewerContainer-CWdkPZsJ.js"] }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/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/chunks", "/api/logs/$id/replay"] }, "/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/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/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/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/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/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-CwhqfJqM.js" });
2
2
  export {
3
3
  tsrStartManifest
4
4
  };
@@ -38,100 +38,100 @@ const assets = {
38
38
  "/assets/alibaba-TTwafVwX.svg": {
39
39
  "type": "image/svg+xml",
40
40
  "etag": '"171b-6dyV5K8QjiaY35sN9qNprh9zDIs"',
41
- "mtime": "2026-06-22T08:00:19.450Z",
41
+ "mtime": "2026-06-23T00:48:08.639Z",
42
42
  "size": 5915,
43
43
  "path": "../public/assets/alibaba-TTwafVwX.svg"
44
44
  },
45
- "/assets/index-Cf9U0Ekq.js": {
45
+ "/assets/index-CJgaCJo8.js": {
46
46
  "type": "text/javascript; charset=utf-8",
47
- "etag": '"74-xEOmMI8UrD1JoLsCUcOURuvg1RI"',
48
- "mtime": "2026-06-22T08:00:19.450Z",
47
+ "etag": '"74-6qvnmISkog5p5/pvGrwRvVnlQD4"',
48
+ "mtime": "2026-06-23T00:48:08.639Z",
49
49
  "size": 116,
50
- "path": "../public/assets/index-Cf9U0Ekq.js"
51
- },
52
- "/assets/CompareDrawer-BhRYPp6T.js": {
53
- "type": "text/javascript; charset=utf-8",
54
- "etag": '"49fe-PMQYhnaFlcJwZxqT6Vpg/f0JQTM"',
55
- "mtime": "2026-06-22T08:00:19.451Z",
56
- "size": 18942,
57
- "path": "../public/assets/CompareDrawer-BhRYPp6T.js"
50
+ "path": "../public/assets/index-CJgaCJo8.js"
58
51
  },
59
52
  "/assets/minimax-BPMzvuL-.jpeg": {
60
53
  "type": "image/jpeg",
61
54
  "etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
62
- "mtime": "2026-06-22T08:00:19.450Z",
55
+ "mtime": "2026-06-23T00:48:08.639Z",
63
56
  "size": 6918,
64
57
  "path": "../public/assets/minimax-BPMzvuL-.jpeg"
65
58
  },
66
- "/assets/index-DTdv7nzl.css": {
59
+ "/assets/index-Bo1dGS4R.css": {
67
60
  "type": "text/css; charset=utf-8",
68
- "etag": '"18983-TRWmqsHw7W8cvkbG8DLftLqrfdk"',
69
- "mtime": "2026-06-22T08:00:19.450Z",
70
- "size": 100739,
71
- "path": "../public/assets/index-DTdv7nzl.css"
61
+ "etag": '"193d5-fkJLOBIU3M1KTA3n4iL7ijIR5tQ"',
62
+ "mtime": "2026-06-23T00:48:08.639Z",
63
+ "size": 103381,
64
+ "path": "../public/assets/index-Bo1dGS4R.css"
72
65
  },
73
- "/assets/main-BlDtK0Nn.js": {
66
+ "/assets/CompareDrawer-Djb4XFZS.js": {
74
67
  "type": "text/javascript; charset=utf-8",
75
- "etag": '"5138c-ij2nRLRbIl6cPFBzJLHVSsai1cQ"',
76
- "mtime": "2026-06-22T08:00:19.450Z",
77
- "size": 332684,
78
- "path": "../public/assets/main-BlDtK0Nn.js"
68
+ "etag": '"49fe-pznTOv+MMFRbS/BX9TfHAnGiok0"',
69
+ "mtime": "2026-06-23T00:48:08.639Z",
70
+ "size": 18942,
71
+ "path": "../public/assets/CompareDrawer-Djb4XFZS.js"
79
72
  },
80
- "/assets/ReplayDialog-Ch0gwg6B.js": {
73
+ "/assets/main-CwhqfJqM.js": {
81
74
  "type": "text/javascript; charset=utf-8",
82
- "etag": '"2361-9kpJuXbOb9cGd0DdpQzWtIgsmxA"',
83
- "mtime": "2026-06-22T08:00:19.451Z",
84
- "size": 9057,
85
- "path": "../public/assets/ReplayDialog-Ch0gwg6B.js"
75
+ "etag": '"51726-qVbs2qbA513grk8p9/KMn4PGqgk"',
76
+ "mtime": "2026-06-23T00:48:08.639Z",
77
+ "size": 333606,
78
+ "path": "../public/assets/main-CwhqfJqM.js"
86
79
  },
87
- "/assets/StreamingChunkSequence-DCJ_gUHa.js": {
80
+ "/assets/ReplayDialog-DBPMIs2I.js": {
88
81
  "type": "text/javascript; charset=utf-8",
89
- "etag": '"d5a-6yxw99IEj6YNxQ5KDZBaoDdLnuc"',
90
- "mtime": "2026-06-22T08:00:19.452Z",
91
- "size": 3418,
92
- "path": "../public/assets/StreamingChunkSequence-DCJ_gUHa.js"
82
+ "etag": '"2361-5jth9isxe9qJDoue9YT48Duur+w"',
83
+ "mtime": "2026-06-23T00:48:08.639Z",
84
+ "size": 9057,
85
+ "path": "../public/assets/ReplayDialog-DBPMIs2I.js"
93
86
  },
94
- "/assets/RequestAnatomy-CKbvIgaN.js": {
87
+ "/assets/RequestAnatomy-FBfRNQN7.js": {
95
88
  "type": "text/javascript; charset=utf-8",
96
- "etag": '"21df-6Gc0zWlW2mnPWrccJEuLrGd6Dyc"',
97
- "mtime": "2026-06-22T08:00:19.451Z",
98
- "size": 8671,
99
- "path": "../public/assets/RequestAnatomy-CKbvIgaN.js"
89
+ "etag": '"438f-d1hToPfSWy/yglcTSVZmqhw6sPs"',
90
+ "mtime": "2026-06-23T00:48:08.639Z",
91
+ "size": 17295,
92
+ "path": "../public/assets/RequestAnatomy-FBfRNQN7.js"
100
93
  },
101
- "/assets/ResponseView-hRLar32x.js": {
94
+ "/assets/ResponseView-Db4pJL7U.js": {
102
95
  "type": "text/javascript; charset=utf-8",
103
- "etag": '"30c5-dfn2k+6jf56jyWWG5aOTnuM6tzM"',
104
- "mtime": "2026-06-22T08:00:19.452Z",
96
+ "etag": '"30c5-qy6J0XN6/3GV385DLW8wrRN5vmM"',
97
+ "mtime": "2026-06-23T00:48:08.639Z",
105
98
  "size": 12485,
106
- "path": "../public/assets/ResponseView-hRLar32x.js"
99
+ "path": "../public/assets/ResponseView-Db4pJL7U.js"
100
+ },
101
+ "/assets/zhipuai-BPNAnxo-.svg": {
102
+ "type": "image/svg+xml",
103
+ "etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
104
+ "mtime": "2026-06-23T00:48:08.639Z",
105
+ "size": 11256,
106
+ "path": "../public/assets/zhipuai-BPNAnxo-.svg"
107
107
  },
108
- "/assets/_sessionId-BJTz6t5l.js": {
108
+ "/assets/StreamingChunkSequence-BH175O6R.js": {
109
109
  "type": "text/javascript; charset=utf-8",
110
- "etag": '"d2-9Vn7vkBxIyXzmcuMuxvTdhm9y50"',
111
- "mtime": "2026-06-22T08:00:19.450Z",
112
- "size": 210,
113
- "path": "../public/assets/_sessionId-BJTz6t5l.js"
110
+ "etag": '"d5a-xXaxHLvuFWxj4Xuo8eT8wfx8vC4"',
111
+ "mtime": "2026-06-23T00:48:08.639Z",
112
+ "size": 3418,
113
+ "path": "../public/assets/StreamingChunkSequence-BH175O6R.js"
114
114
  },
115
115
  "/assets/qwen-CONDcHqt.png": {
116
116
  "type": "image/png",
117
117
  "etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
118
- "mtime": "2026-06-22T08:00:19.450Z",
118
+ "mtime": "2026-06-23T00:48:08.639Z",
119
119
  "size": 357059,
120
120
  "path": "../public/assets/qwen-CONDcHqt.png"
121
121
  },
122
- "/assets/zhipuai-BPNAnxo-.svg": {
123
- "type": "image/svg+xml",
124
- "etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
125
- "mtime": "2026-06-22T08:00:19.450Z",
126
- "size": 11256,
127
- "path": "../public/assets/zhipuai-BPNAnxo-.svg"
122
+ "/assets/_sessionId-3ipVoQtW.js": {
123
+ "type": "text/javascript; charset=utf-8",
124
+ "etag": '"d2-nFYnu19OBrYGuMoYXu2+NgVBGhw"',
125
+ "mtime": "2026-06-23T00:48:08.639Z",
126
+ "size": 210,
127
+ "path": "../public/assets/_sessionId-3ipVoQtW.js"
128
128
  },
129
- "/assets/ProxyViewerContainer-BHq0dkQG.js": {
129
+ "/assets/ProxyViewerContainer-CWdkPZsJ.js": {
130
130
  "type": "text/javascript; charset=utf-8",
131
- "etag": '"a2352-gdvRbHXbPGRttPU1DgQ7eHEkZDE"',
132
- "mtime": "2026-06-22T08:00:19.451Z",
133
- "size": 664402,
134
- "path": "../public/assets/ProxyViewerContainer-BHq0dkQG.js"
131
+ "etag": '"a2370-RA5+avpa6Zk/W44RGYNOrpe1PtI"',
132
+ "mtime": "2026-06-23T00:48:08.639Z",
133
+ "size": 664432,
134
+ "path": "../public/assets/ProxyViewerContainer-CWdkPZsJ.js"
135
135
  }
136
136
  };
137
137
  function readAsset(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonyclaw/agent-inspector",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "type": "module",
5
5
  "description": "Agent observability and knowledge capture layer for AI coding tools.",
6
6
  "license": "MIT",
@@ -405,8 +405,9 @@ export const LogEntry = memo(function ({
405
405
  {activeTab === "anatomy" && (
406
406
  <Suspense fallback={<TabFallback />}>
407
407
  <LazyRequestAnatomy
408
- parsed={null}
408
+ parsed={requestExpansion.parsedData}
409
409
  inputTokens={log.inputTokens ?? null}
410
+ model={log.model}
410
411
  segments={anatomySegments}
411
412
  onSegmentActivate={jumpToAnatomySegment}
412
413
  />
@@ -2,6 +2,13 @@ import { Info } from "lucide-react";
2
2
  import { type JSX, useMemo, useState } from "react";
3
3
  import { cn, formatTokens } from "../../../lib/utils";
4
4
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../ui/tooltip";
5
+ import {
6
+ analyzeContextIntelligence,
7
+ CONTEXT_USAGE_THRESHOLDS,
8
+ type ContextDiagnostic,
9
+ type ContextIntelligence,
10
+ type ContextRiskLevel,
11
+ } from "./contextIntelligence";
5
12
  import { ROLE_COLOR_CLASSES, SegmentBar } from "./SegmentBar";
6
13
  import { ANATOMY_ROLE_LABELS, type AnatomyRole, type AnatomySegment } from "./types";
7
14
 
@@ -10,6 +17,8 @@ export type RequestAnatomyProps = {
10
17
  parsed: unknown | null;
11
18
  /** Server-reported input token count, or `null` if unknown. */
12
19
  inputTokens: number | null;
20
+ /** Model name from the captured log; falls back to the parsed request body when omitted. */
21
+ model?: string | null;
13
22
  /** Optional callback fired when the user activates a concrete request segment. */
14
23
  onSegmentActivate?: (segment: AnatomySegment) => void;
15
24
  /** Pre-computed segments; if provided, `parsed` is ignored. */
@@ -35,6 +44,20 @@ const VIEW_MODE_OPTIONS: Array<{ value: ContextViewMode; label: string }> = [
35
44
  { value: "segment", label: "By Segment" },
36
45
  ];
37
46
 
47
+ const RISK_CLASS: Record<ContextRiskLevel, string> = {
48
+ unknown: "bg-muted-foreground/50",
49
+ ok: "bg-emerald-500/70",
50
+ watch: "bg-amber-400/75",
51
+ danger: "bg-red-500/80",
52
+ };
53
+
54
+ const RISK_TEXT_CLASS: Record<ContextRiskLevel, string> = {
55
+ unknown: "text-muted-foreground",
56
+ ok: "text-emerald-400",
57
+ watch: "text-amber-300",
58
+ danger: "text-red-300",
59
+ };
60
+
38
61
  function formatPercent(value: number): string {
39
62
  if (value >= 10) return `${value.toFixed(0)}%`;
40
63
  if (value >= 1) return `${value.toFixed(1)}%`;
@@ -42,6 +65,157 @@ function formatPercent(value: number): string {
42
65
  return "0%";
43
66
  }
44
67
 
68
+ function formatUsagePercent(value: number | null): string {
69
+ if (value === null) return "Unknown";
70
+ return formatPercent(value * 100);
71
+ }
72
+
73
+ function formatRemainingTokens(value: number | null): string {
74
+ if (value === null) return "Unknown";
75
+ if (value < 0) return `-${formatTokens(Math.abs(value))}`;
76
+ return formatTokens(value);
77
+ }
78
+
79
+ function formatContextLimit(intelligence: ContextIntelligence): string {
80
+ if (intelligence.contextWindow.tokens === null) return "Unknown";
81
+ return formatTokens(intelligence.contextWindow.tokens);
82
+ }
83
+
84
+ function formatContextSource(intelligence: ContextIntelligence): string {
85
+ switch (intelligence.contextWindow.source) {
86
+ case "request":
87
+ return intelligence.contextWindow.label;
88
+ case "model-rule":
89
+ return intelligence.contextWindow.label;
90
+ case "unknown":
91
+ return intelligence.model === null
92
+ ? intelligence.contextWindow.label
93
+ : `${intelligence.contextWindow.label}: ${intelligence.model}`;
94
+ }
95
+ }
96
+
97
+ function diagnosticTone(diagnostic: ContextDiagnostic): string {
98
+ switch (diagnostic.severity) {
99
+ case "watch":
100
+ return "border-amber-400/30 bg-amber-400/8 text-amber-100";
101
+ case "danger":
102
+ return "border-red-400/35 bg-red-500/10 text-red-100";
103
+ }
104
+ }
105
+
106
+ function ContextIntelligenceStrip({
107
+ intelligence,
108
+ }: {
109
+ intelligence: ContextIntelligence;
110
+ }): JSX.Element {
111
+ const usageWidth =
112
+ intelligence.usagePercent === null ? 0 : Math.max(1, intelligence.usagePercent * 100);
113
+ const outputReserveLabel =
114
+ intelligence.outputReserveTokens === null
115
+ ? "No output reserve"
116
+ : `Output reserve ${formatTokens(intelligence.outputReserveTokens)}`;
117
+ const largestRole = intelligence.largestRole;
118
+
119
+ return (
120
+ <div className="space-y-2">
121
+ <div className="grid gap-x-4 gap-y-2 border-y border-border/60 py-2 text-xs sm:grid-cols-4">
122
+ <div className="min-w-0">
123
+ <div className="text-[10px] font-medium uppercase text-muted-foreground">Window</div>
124
+ <div className="mt-0.5 truncate font-mono text-foreground">
125
+ {formatContextLimit(intelligence)}
126
+ </div>
127
+ <div className="truncate text-[11px] text-muted-foreground">
128
+ {formatContextSource(intelligence)}
129
+ </div>
130
+ </div>
131
+
132
+ <div className="min-w-0">
133
+ <div className="text-[10px] font-medium uppercase text-muted-foreground">Used</div>
134
+ <div className={cn("mt-0.5 font-mono", RISK_TEXT_CLASS[intelligence.riskLevel])}>
135
+ {formatUsagePercent(intelligence.usagePercent)}
136
+ </div>
137
+ <div className="truncate text-[11px] text-muted-foreground">{outputReserveLabel}</div>
138
+ </div>
139
+
140
+ <div className="min-w-0">
141
+ <div className="text-[10px] font-medium uppercase text-muted-foreground">Remaining</div>
142
+ <div className="mt-0.5 font-mono text-foreground">
143
+ {formatRemainingTokens(intelligence.remainingAfterReserveTokens)}
144
+ </div>
145
+ <div className="truncate text-[11px] text-muted-foreground">
146
+ Input only {formatRemainingTokens(intelligence.remainingInputTokens)}
147
+ </div>
148
+ </div>
149
+
150
+ <div className="min-w-0">
151
+ <div className="text-[10px] font-medium uppercase text-muted-foreground">Largest</div>
152
+ {largestRole === null ? (
153
+ <div className="mt-0.5 text-muted-foreground">Unknown</div>
154
+ ) : (
155
+ <>
156
+ <div className="mt-0.5 flex min-w-0 items-center gap-1.5">
157
+ <span
158
+ aria-hidden="true"
159
+ className={cn(
160
+ "size-2.5 shrink-0 rounded-[2px]",
161
+ ROLE_COLOR_CLASSES[largestRole.role],
162
+ )}
163
+ />
164
+ <span className="truncate text-foreground">{largestRole.label}</span>
165
+ </div>
166
+ <div className="truncate font-mono text-[11px] text-muted-foreground">
167
+ {formatPercent(largestRole.percent * 100)} | ~{formatTokens(largestRole.tokens)}
168
+ </div>
169
+ </>
170
+ )}
171
+ </div>
172
+ </div>
173
+
174
+ {intelligence.contextWindow.tokens !== null && (
175
+ <div className="space-y-1.5">
176
+ <div className="relative h-2 overflow-hidden rounded-full bg-muted/40">
177
+ <div
178
+ className={cn("h-full rounded-full", RISK_CLASS[intelligence.riskLevel])}
179
+ style={{ width: `${String(usageWidth)}%` }}
180
+ />
181
+ <div
182
+ aria-hidden="true"
183
+ className="absolute top-0 h-full w-px bg-amber-200/70"
184
+ style={{ left: `${String(CONTEXT_USAGE_THRESHOLDS.watch * 100)}%` }}
185
+ />
186
+ <div
187
+ aria-hidden="true"
188
+ className="absolute top-0 h-full w-px bg-red-200/80"
189
+ style={{ left: `${String(CONTEXT_USAGE_THRESHOLDS.danger * 100)}%` }}
190
+ />
191
+ </div>
192
+ <div className="flex justify-between text-[10px] text-muted-foreground">
193
+ <span>Context window</span>
194
+ <span>
195
+ Watch {formatUsagePercent(CONTEXT_USAGE_THRESHOLDS.watch)} / Danger{" "}
196
+ {formatUsagePercent(CONTEXT_USAGE_THRESHOLDS.danger)}
197
+ </span>
198
+ </div>
199
+ </div>
200
+ )}
201
+
202
+ {intelligence.diagnostics.length > 0 && (
203
+ <div className="grid gap-1.5 sm:grid-cols-2">
204
+ {intelligence.diagnostics.map((diagnostic) => (
205
+ <div
206
+ key={`${diagnostic.kind}-${diagnostic.title}`}
207
+ className={cn("rounded border px-2 py-1.5 text-xs", diagnosticTone(diagnostic))}
208
+ >
209
+ <div className="font-medium">{diagnostic.title}</div>
210
+ <div className="mt-0.5 text-[11px] text-muted-foreground">{diagnostic.detail}</div>
211
+ </div>
212
+ ))}
213
+ </div>
214
+ )}
215
+ </div>
216
+ );
217
+ }
218
+
45
219
  function aggregateByRole(segments: AnatomySegment[]): AnatomySegment[] {
46
220
  const result: AnatomySegment[] = [];
47
221
  for (const role of ROLE_ORDER) {
@@ -76,6 +250,7 @@ function topContributors(segments: AnatomySegment[]): AnatomySegment[] {
76
250
  export function RequestAnatomy({
77
251
  parsed,
78
252
  inputTokens,
253
+ model = null,
79
254
  onSegmentActivate,
80
255
  segments: providedSegments,
81
256
  }: RequestAnatomyProps): JSX.Element | null {
@@ -93,6 +268,18 @@ export function RequestAnatomy({
93
268
  () => (segments === null ? [] : topContributors(segments)),
94
269
  [segments],
95
270
  );
271
+ const intelligence = useMemo(
272
+ () =>
273
+ segments === null
274
+ ? null
275
+ : analyzeContextIntelligence({
276
+ segments,
277
+ inputTokens,
278
+ parsed,
279
+ model,
280
+ }),
281
+ [inputTokens, model, parsed, segments],
282
+ );
96
283
 
97
284
  const showDivergenceWarning = useMemo(() => {
98
285
  if (segments === null) return false;
@@ -115,6 +302,12 @@ export function RequestAnatomy({
115
302
  const segmentCountLabel = `${String(segments.length)} segment${segments.length === 1 ? "" : "s"}`;
116
303
  const providerInputLabel =
117
304
  inputTokens === null ? "Provider input unknown" : `Provider input ${formatTokens(inputTokens)}`;
305
+ const contextLimitLabel =
306
+ intelligence === null ? "Limit unknown" : `Limit ${formatContextLimit(intelligence)}`;
307
+ const usageLabel =
308
+ intelligence === null
309
+ ? "Usage unknown"
310
+ : `${formatUsagePercent(intelligence.usagePercent)} used`;
118
311
 
119
312
  return (
120
313
  <TooltipProvider delayDuration={150}>
@@ -123,7 +316,8 @@ export function RequestAnatomy({
123
316
  <div className="min-w-0">
124
317
  <div className="text-sm font-semibold text-foreground">Request Context</div>
125
318
  <div className={cn("mt-0.5 text-xs font-mono tabular-nums", summaryColorClass)}>
126
- Estimated ~{formatTokens(total)} tokens | {providerInputLabel} | {segmentCountLabel}
319
+ Estimated ~{formatTokens(total)} tokens | {providerInputLabel} | {contextLimitLabel} |{" "}
320
+ {usageLabel} | {segmentCountLabel}
127
321
  </div>
128
322
  </div>
129
323
 
@@ -172,6 +366,8 @@ export function RequestAnatomy({
172
366
  </div>
173
367
  )}
174
368
 
369
+ {intelligence !== null && <ContextIntelligenceStrip intelligence={intelligence} />}
370
+
175
371
  <SegmentBar
176
372
  segments={displayedSegments}
177
373
  totalTokens={displayedTotal}