@tonyclaw/agent-inspector 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-BhRYPp6T.js → CompareDrawer-Cb4RH049.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-BHq0dkQG.js → ProxyViewerContainer-Cmr2TANl.js} +5 -5
- package/.output/public/assets/{ReplayDialog-Ch0gwg6B.js → ReplayDialog-B3y8E7IE.js} +1 -1
- package/.output/public/assets/RequestAnatomy-C7BQYj95.js +1 -0
- package/.output/public/assets/{ResponseView-hRLar32x.js → ResponseView-Bylsp4WJ.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-DCJ_gUHa.js → StreamingChunkSequence-CJH13VD3.js} +1 -1
- package/.output/public/assets/_sessionId-3e8W68GL.js +1 -0
- package/.output/public/assets/index-Bo1dGS4R.css +1 -0
- package/.output/public/assets/index-Cz5aqmzE.js +1 -0
- package/.output/public/assets/{main-BlDtK0Nn.js → main-Bww0Bc88.js} +8 -8
- package/.output/server/{_sessionId-Dy7rsLS4.mjs → _sessionId-BnCF8Ito.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-CkVX-ARV.mjs → CompareDrawer-jPU14EI3.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-B5a9p3j5.mjs → ProxyViewerContainer-xesEFppM.mjs} +9 -8
- package/.output/server/_ssr/{ReplayDialog-hXY6H9fB.mjs → ReplayDialog-DQvW2zoW.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-B6MS7VvA.mjs → RequestAnatomy-BilEphjP.mjs} +455 -3
- package/.output/server/_ssr/{ResponseView-ByjxwUnp.mjs → ResponseView-DB5PPcWf.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-C5Kb8siT.mjs → StreamingChunkSequence-Dnrgn2AP.mjs} +2 -2
- package/.output/server/_ssr/{index-BZXtj42m.mjs → index-YPp821bH.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-CVQaVF_3.mjs → router-BvuK0vQv.mjs} +20 -4
- package/.output/server/{_tanstack-start-manifest_v-Bpe5ZC56.mjs → _tanstack-start-manifest_v-DGw3vVOm.mjs} +1 -1
- package/.output/server/index.mjs +60 -60
- package/bin/agent-inspector.js +2 -0
- package/package.json +3 -2
- package/src/components/proxy-viewer/LogEntry.tsx +2 -1
- package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +197 -1
- package/src/components/proxy-viewer/anatomy/contextIntelligence.ts +414 -0
- package/src/routes/__root.tsx +27 -0
- package/.output/public/assets/RequestAnatomy-CKbvIgaN.js +0 -1
- package/.output/public/assets/_sessionId-BJTz6t5l.js +0 -1
- package/.output/public/assets/index-Cf9U0Ekq.js +0 -1
- 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-
|
|
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-
|
|
95
|
+
const $$splitComponentImporter$1 = () => import("./index-YPp821bH.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-
|
|
138
|
+
const $$splitComponentImporter = () => import("../_sessionId-BnCF8Ito.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-
|
|
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-Bww0Bc88.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-Cz5aqmzE.js", "/assets/ProxyViewerContainer-Cmr2TANl.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-3e8W68GL.js", "/assets/ProxyViewerContainer-Cmr2TANl.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-Bww0Bc88.js" });
|
|
2
2
|
export {
|
|
3
3
|
tsrStartManifest
|
|
4
4
|
};
|
package/.output/server/index.mjs
CHANGED
|
@@ -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-
|
|
41
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
42
42
|
"size": 5915,
|
|
43
43
|
"path": "../public/assets/alibaba-TTwafVwX.svg"
|
|
44
44
|
},
|
|
45
|
-
"/assets/
|
|
45
|
+
"/assets/CompareDrawer-Cb4RH049.js": {
|
|
46
46
|
"type": "text/javascript; charset=utf-8",
|
|
47
|
-
"etag": '"
|
|
48
|
-
"mtime": "2026-06-
|
|
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",
|
|
47
|
+
"etag": '"49fe-BHWkY/ee2/iRe37Xd4Z7Xs1cr7c"',
|
|
48
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
56
49
|
"size": 18942,
|
|
57
|
-
"path": "../public/assets/CompareDrawer-
|
|
50
|
+
"path": "../public/assets/CompareDrawer-Cb4RH049.js"
|
|
58
51
|
},
|
|
59
52
|
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
60
53
|
"type": "image/jpeg",
|
|
61
54
|
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
62
|
-
"mtime": "2026-06-
|
|
55
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
63
56
|
"size": 6918,
|
|
64
57
|
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
65
58
|
},
|
|
66
|
-
"/assets/index-
|
|
59
|
+
"/assets/index-Bo1dGS4R.css": {
|
|
67
60
|
"type": "text/css; charset=utf-8",
|
|
68
|
-
"etag": '"
|
|
69
|
-
"mtime": "2026-06-
|
|
70
|
-
"size":
|
|
71
|
-
"path": "../public/assets/index-
|
|
61
|
+
"etag": '"193d5-fkJLOBIU3M1KTA3n4iL7ijIR5tQ"',
|
|
62
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
63
|
+
"size": 103381,
|
|
64
|
+
"path": "../public/assets/index-Bo1dGS4R.css"
|
|
72
65
|
},
|
|
73
|
-
"/assets/
|
|
66
|
+
"/assets/ReplayDialog-B3y8E7IE.js": {
|
|
74
67
|
"type": "text/javascript; charset=utf-8",
|
|
75
|
-
"etag": '"
|
|
76
|
-
"mtime": "2026-06-
|
|
77
|
-
"size": 332684,
|
|
78
|
-
"path": "../public/assets/main-BlDtK0Nn.js"
|
|
79
|
-
},
|
|
80
|
-
"/assets/ReplayDialog-Ch0gwg6B.js": {
|
|
81
|
-
"type": "text/javascript; charset=utf-8",
|
|
82
|
-
"etag": '"2361-9kpJuXbOb9cGd0DdpQzWtIgsmxA"',
|
|
83
|
-
"mtime": "2026-06-22T08:00:19.451Z",
|
|
68
|
+
"etag": '"2361-cUD2a+yKechVwCIwtF2qs0OgrwE"',
|
|
69
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
84
70
|
"size": 9057,
|
|
85
|
-
"path": "../public/assets/ReplayDialog-
|
|
71
|
+
"path": "../public/assets/ReplayDialog-B3y8E7IE.js"
|
|
86
72
|
},
|
|
87
|
-
"/assets/
|
|
73
|
+
"/assets/index-Cz5aqmzE.js": {
|
|
88
74
|
"type": "text/javascript; charset=utf-8",
|
|
89
|
-
"etag": '"
|
|
90
|
-
"mtime": "2026-06-
|
|
91
|
-
"size":
|
|
92
|
-
"path": "../public/assets/
|
|
75
|
+
"etag": '"74-gxupRWR5bkeS7TR6nLfSIfxkTS0"',
|
|
76
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
77
|
+
"size": 116,
|
|
78
|
+
"path": "../public/assets/index-Cz5aqmzE.js"
|
|
79
|
+
},
|
|
80
|
+
"/assets/zhipuai-BPNAnxo-.svg": {
|
|
81
|
+
"type": "image/svg+xml",
|
|
82
|
+
"etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
|
|
83
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
84
|
+
"size": 11256,
|
|
85
|
+
"path": "../public/assets/zhipuai-BPNAnxo-.svg"
|
|
93
86
|
},
|
|
94
|
-
"/assets/RequestAnatomy-
|
|
87
|
+
"/assets/RequestAnatomy-C7BQYj95.js": {
|
|
95
88
|
"type": "text/javascript; charset=utf-8",
|
|
96
|
-
"etag": '"
|
|
97
|
-
"mtime": "2026-06-
|
|
98
|
-
"size":
|
|
99
|
-
"path": "../public/assets/RequestAnatomy-
|
|
89
|
+
"etag": '"438f-//IXpUPYqyXIOaxlYEcmr3B9sSQ"',
|
|
90
|
+
"mtime": "2026-06-23T02:52:08.198Z",
|
|
91
|
+
"size": 17295,
|
|
92
|
+
"path": "../public/assets/RequestAnatomy-C7BQYj95.js"
|
|
100
93
|
},
|
|
101
|
-
"/assets/
|
|
94
|
+
"/assets/StreamingChunkSequence-CJH13VD3.js": {
|
|
102
95
|
"type": "text/javascript; charset=utf-8",
|
|
103
|
-
"etag": '"
|
|
104
|
-
"mtime": "2026-06-
|
|
105
|
-
"size":
|
|
106
|
-
"path": "../public/assets/
|
|
96
|
+
"etag": '"d5a-IJI0ftkE6Zdp2mKtp0fz8ErTyGQ"',
|
|
97
|
+
"mtime": "2026-06-23T02:52:08.199Z",
|
|
98
|
+
"size": 3418,
|
|
99
|
+
"path": "../public/assets/StreamingChunkSequence-CJH13VD3.js"
|
|
107
100
|
},
|
|
108
|
-
"/assets/_sessionId-
|
|
101
|
+
"/assets/_sessionId-3e8W68GL.js": {
|
|
109
102
|
"type": "text/javascript; charset=utf-8",
|
|
110
|
-
"etag": '"d2-
|
|
111
|
-
"mtime": "2026-06-
|
|
103
|
+
"etag": '"d2-X7UemA9tjHEZuxovqbDmoGi9l7A"',
|
|
104
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
112
105
|
"size": 210,
|
|
113
|
-
"path": "../public/assets/_sessionId-
|
|
106
|
+
"path": "../public/assets/_sessionId-3e8W68GL.js"
|
|
114
107
|
},
|
|
115
108
|
"/assets/qwen-CONDcHqt.png": {
|
|
116
109
|
"type": "image/png",
|
|
117
110
|
"etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
|
|
118
|
-
"mtime": "2026-06-
|
|
111
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
119
112
|
"size": 357059,
|
|
120
113
|
"path": "../public/assets/qwen-CONDcHqt.png"
|
|
121
114
|
},
|
|
122
|
-
"/assets/
|
|
123
|
-
"type": "
|
|
124
|
-
"etag": '"
|
|
125
|
-
"mtime": "2026-06-
|
|
126
|
-
"size":
|
|
127
|
-
"path": "../public/assets/
|
|
115
|
+
"/assets/main-Bww0Bc88.js": {
|
|
116
|
+
"type": "text/javascript; charset=utf-8",
|
|
117
|
+
"etag": '"51726-MGmykf7Tv54PIfG+sYdLyEOvjgQ"',
|
|
118
|
+
"mtime": "2026-06-23T02:52:08.197Z",
|
|
119
|
+
"size": 333606,
|
|
120
|
+
"path": "../public/assets/main-Bww0Bc88.js"
|
|
121
|
+
},
|
|
122
|
+
"/assets/ResponseView-Bylsp4WJ.js": {
|
|
123
|
+
"type": "text/javascript; charset=utf-8",
|
|
124
|
+
"etag": '"30c5-wO9JHsOiKYGiu0JqAD3/0bb5J9c"',
|
|
125
|
+
"mtime": "2026-06-23T02:52:08.198Z",
|
|
126
|
+
"size": 12485,
|
|
127
|
+
"path": "../public/assets/ResponseView-Bylsp4WJ.js"
|
|
128
128
|
},
|
|
129
|
-
"/assets/ProxyViewerContainer-
|
|
129
|
+
"/assets/ProxyViewerContainer-Cmr2TANl.js": {
|
|
130
130
|
"type": "text/javascript; charset=utf-8",
|
|
131
|
-
"etag": '"
|
|
132
|
-
"mtime": "2026-06-
|
|
133
|
-
"size":
|
|
134
|
-
"path": "../public/assets/ProxyViewerContainer-
|
|
131
|
+
"etag": '"a2370-OAQ9ydT0IiDPCg5vnG6e21zyHQw"',
|
|
132
|
+
"mtime": "2026-06-23T02:52:08.198Z",
|
|
133
|
+
"size": 664432,
|
|
134
|
+
"path": "../public/assets/ProxyViewerContainer-Cmr2TANl.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.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent observability and knowledge capture layer for AI coding tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
"ai-coding-tools"
|
|
30
30
|
],
|
|
31
31
|
"bin": {
|
|
32
|
-
"agent-inspector": "
|
|
32
|
+
"agent-inspector": "bin/agent-inspector.js"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
|
+
"bin",
|
|
35
36
|
"src",
|
|
36
37
|
"!src/**/*.test.ts",
|
|
37
38
|
"!src/**/*.stories.tsx",
|
|
@@ -405,8 +405,9 @@ export const LogEntry = memo(function ({
|
|
|
405
405
|
{activeTab === "anatomy" && (
|
|
406
406
|
<Suspense fallback={<TabFallback />}>
|
|
407
407
|
<LazyRequestAnatomy
|
|
408
|
-
parsed={
|
|
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} | {
|
|
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}
|