@tonyclaw/agent-inspector 2.1.10 → 2.1.11
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/cli.js +14671 -397
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-BaGKK2R7.js → CompareDrawer-CcwXsZp3.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-Cxwizw8H.js → ProxyViewerContainer-DFFxBlvO.js} +17 -17
- package/.output/public/assets/{ReplayDialog-Io8Ufsif.js → ReplayDialog-XXiwmD5o.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-CiZE_fKZ.js → RequestAnatomy-DTCh37so.js} +1 -1
- package/.output/public/assets/{ResponseView-TJwxn-lh.js → ResponseView-CbFYw9xP.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-D-9ysFSG.js → StreamingChunkSequence-CTLMzUxV.js} +1 -1
- package/.output/public/assets/_sessionId-DAwcZWfu.js +1 -0
- package/.output/public/assets/index-B6sDoCll.js +1 -0
- package/.output/public/assets/{main-JvXpk_ov.js → main-C-lua4Uq.js} +2 -2
- package/.output/server/{_sessionId-DSZ76cjr.mjs → _sessionId-CO0WzOBc.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-BcUJ7lNL.mjs → CompareDrawer-_OnPOi0O.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-DEtSh7OB.mjs → ProxyViewerContainer-Bfy-cjD3.mjs} +23 -25
- package/.output/server/_ssr/{ReplayDialog-DwSynSXP.mjs → ReplayDialog-DBZyQFFR.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-C6LGadAw.mjs → RequestAnatomy-C7m6HJOG.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-Dr27DXbx.mjs → ResponseView-CM2nFoqa.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-CDTaUWjj.mjs → StreamingChunkSequence-Dj61jLHa.mjs} +2 -2
- package/.output/server/_ssr/{index-D803rHfz.mjs → index-BI_nCxdk.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-D7dDibPa.mjs → router-WBmANYRw.mjs} +3 -3
- package/.output/server/{_tanstack-start-manifest_v-P9lKyaOf.mjs → _tanstack-start-manifest_v-lODJPovZ.mjs} +1 -1
- package/.output/server/index.mjs +58 -58
- package/package.json +1 -1
- package/src/cli.ts +89 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +25 -26
- package/src/proxy/identityProxy.ts +193 -0
- package/src/proxy/socketTracker.ts +122 -0
- package/.output/public/assets/_sessionId-3JCekYV3.js +0 -1
- package/.output/public/assets/index-B3EOwfg7.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-Bfy-cjD3.mjs";
|
|
3
|
+
import "./router-WBmANYRw.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { C as ChevronDown, f as ChevronRight, L as LoaderCircle } from "../_libs/lucide-react.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-
|
|
1
|
+
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-Bfy-cjD3.mjs";
|
|
2
2
|
import "../_libs/react.mjs";
|
|
3
|
-
import "./router-
|
|
3
|
+
import "./router-WBmANYRw.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/swr.mjs";
|
|
@@ -198,7 +198,7 @@ function getResponse() {
|
|
|
198
198
|
return event.res;
|
|
199
199
|
}
|
|
200
200
|
async function getStartManifest(matchedRoutes) {
|
|
201
|
-
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-
|
|
201
|
+
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-lODJPovZ.mjs");
|
|
202
202
|
const startManifest = tsrStartManifest();
|
|
203
203
|
const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes[rootRouteId] || {};
|
|
204
204
|
rootRoute.assets = rootRoute.assets || [];
|
|
@@ -776,7 +776,7 @@ let entriesPromise;
|
|
|
776
776
|
let baseManifestPromise;
|
|
777
777
|
let cachedFinalManifestPromise;
|
|
778
778
|
async function loadEntries() {
|
|
779
|
-
const routerEntry = await import("./router-
|
|
779
|
+
const routerEntry = await import("./router-WBmANYRw.mjs").then((n) => n.y);
|
|
780
780
|
const startEntry = await import("./start-HYkvq4Ni.mjs");
|
|
781
781
|
return { startEntry, routerEntry };
|
|
782
782
|
}
|
|
@@ -108,7 +108,7 @@ function RootDocument({ children }) {
|
|
|
108
108
|
] })
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
111
|
+
const $$splitComponentImporter$1 = () => import("./index-BI_nCxdk.mjs");
|
|
112
112
|
const Route$C = createFileRoute("/")({
|
|
113
113
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
114
114
|
});
|
|
@@ -151,7 +151,7 @@ function decodeSessionIdFromPath(encoded) {
|
|
|
151
151
|
function getSessionPath(sessionId) {
|
|
152
152
|
return `/session/${encodeSessionIdForPath(sessionId)}`;
|
|
153
153
|
}
|
|
154
|
-
const $$splitComponentImporter = () => import("../_sessionId-
|
|
154
|
+
const $$splitComponentImporter = () => import("../_sessionId-CO0WzOBc.mjs");
|
|
155
155
|
const Route$B = createFileRoute("/session/$sessionId")({
|
|
156
156
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
157
157
|
parseParams: (params) => ({
|
|
@@ -8362,7 +8362,7 @@ const Route$w = createFileRoute("/api/models")({
|
|
|
8362
8362
|
}
|
|
8363
8363
|
}
|
|
8364
8364
|
});
|
|
8365
|
-
const version = "2.1.
|
|
8365
|
+
const version = "2.1.11";
|
|
8366
8366
|
const packageJson = {
|
|
8367
8367
|
version
|
|
8368
8368
|
};
|
|
@@ -1,4 +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/providers", "/api/runs", "/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/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-C-lua4Uq.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-B6sDoCll.js", "/assets/ProxyViewerContainer-DFFxBlvO.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/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-DAwcZWfu.js", "/assets/ProxyViewerContainer-DFFxBlvO.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/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/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/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-C-lua4Uq.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-07-
|
|
41
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
42
42
|
"size": 5915,
|
|
43
43
|
"path": "../public/assets/alibaba-TTwafVwX.svg"
|
|
44
44
|
},
|
|
45
|
-
"/assets/
|
|
45
|
+
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
46
|
+
"type": "image/jpeg",
|
|
47
|
+
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
48
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
49
|
+
"size": 6918,
|
|
50
|
+
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
51
|
+
},
|
|
52
|
+
"/assets/ReplayDialog-XXiwmD5o.js": {
|
|
46
53
|
"type": "text/javascript; charset=utf-8",
|
|
47
|
-
"etag": '"
|
|
48
|
-
"mtime": "2026-07-
|
|
49
|
-
"size":
|
|
50
|
-
"path": "../public/assets/
|
|
54
|
+
"etag": '"318c-RDtt/D/65RGPc7vXhKnGW3e11zE"',
|
|
55
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
56
|
+
"size": 12684,
|
|
57
|
+
"path": "../public/assets/ReplayDialog-XXiwmD5o.js"
|
|
51
58
|
},
|
|
52
|
-
"/assets/index-
|
|
59
|
+
"/assets/index-B6sDoCll.js": {
|
|
53
60
|
"type": "text/javascript; charset=utf-8",
|
|
54
|
-
"etag": '"74
|
|
55
|
-
"mtime": "2026-07-
|
|
61
|
+
"etag": '"74-Ln+63e8N+hLNQf5THoU5vD6nMyQ"',
|
|
62
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
56
63
|
"size": 116,
|
|
57
|
-
"path": "../public/assets/index-
|
|
64
|
+
"path": "../public/assets/index-B6sDoCll.js"
|
|
65
|
+
},
|
|
66
|
+
"/assets/CompareDrawer-CcwXsZp3.js": {
|
|
67
|
+
"type": "text/javascript; charset=utf-8",
|
|
68
|
+
"etag": '"49e8-Pph7DlYDe9TrUe9PrkCiMz3a6ac"',
|
|
69
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
70
|
+
"size": 18920,
|
|
71
|
+
"path": "../public/assets/CompareDrawer-CcwXsZp3.js"
|
|
58
72
|
},
|
|
59
73
|
"/assets/index-CmtfjQPv.css": {
|
|
60
74
|
"type": "text/css; charset=utf-8",
|
|
61
75
|
"etag": '"1e968-15dLAIs72Zhi4Qe/CRWBTVZ7MtI"',
|
|
62
|
-
"mtime": "2026-07-
|
|
76
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
63
77
|
"size": 125288,
|
|
64
78
|
"path": "../public/assets/index-CmtfjQPv.css"
|
|
65
79
|
},
|
|
66
|
-
"/assets/
|
|
80
|
+
"/assets/RequestAnatomy-DTCh37so.js": {
|
|
67
81
|
"type": "text/javascript; charset=utf-8",
|
|
68
|
-
"etag": '"
|
|
69
|
-
"mtime": "2026-07-
|
|
70
|
-
"size":
|
|
71
|
-
"path": "../public/assets/
|
|
82
|
+
"etag": '"43f2-lPC/O8E1xk6TYgDf0G4Fx0lyvco"',
|
|
83
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
84
|
+
"size": 17394,
|
|
85
|
+
"path": "../public/assets/RequestAnatomy-DTCh37so.js"
|
|
72
86
|
},
|
|
73
|
-
"/assets/
|
|
74
|
-
"type": "
|
|
75
|
-
"etag": '"
|
|
76
|
-
"mtime": "2026-07-
|
|
77
|
-
"size":
|
|
78
|
-
"path": "../public/assets/
|
|
87
|
+
"/assets/ResponseView-CbFYw9xP.js": {
|
|
88
|
+
"type": "text/javascript; charset=utf-8",
|
|
89
|
+
"etag": '"30d2-svUk7f5PmjliduYUzrp/Zrwq47g"',
|
|
90
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
91
|
+
"size": 12498,
|
|
92
|
+
"path": "../public/assets/ResponseView-CbFYw9xP.js"
|
|
79
93
|
},
|
|
80
|
-
"/assets/
|
|
94
|
+
"/assets/main-C-lua4Uq.js": {
|
|
81
95
|
"type": "text/javascript; charset=utf-8",
|
|
82
|
-
"etag": '"
|
|
83
|
-
"mtime": "2026-07-
|
|
84
|
-
"size":
|
|
85
|
-
"path": "../public/assets/
|
|
96
|
+
"etag": '"512fd-yKCnd6uJkOS+Vszty/xGtB0mfa0"',
|
|
97
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
98
|
+
"size": 332541,
|
|
99
|
+
"path": "../public/assets/main-C-lua4Uq.js"
|
|
86
100
|
},
|
|
87
|
-
"/assets/
|
|
101
|
+
"/assets/StreamingChunkSequence-CTLMzUxV.js": {
|
|
88
102
|
"type": "text/javascript; charset=utf-8",
|
|
89
|
-
"etag": '"
|
|
90
|
-
"mtime": "2026-07-
|
|
91
|
-
"size":
|
|
92
|
-
"path": "../public/assets/
|
|
103
|
+
"etag": '"d5c-FukyegE0s/rn1csDfhdqxNZuwzY"',
|
|
104
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
105
|
+
"size": 3420,
|
|
106
|
+
"path": "../public/assets/StreamingChunkSequence-CTLMzUxV.js"
|
|
93
107
|
},
|
|
94
|
-
"/assets/
|
|
108
|
+
"/assets/_sessionId-DAwcZWfu.js": {
|
|
95
109
|
"type": "text/javascript; charset=utf-8",
|
|
96
|
-
"etag": '"
|
|
97
|
-
"mtime": "2026-07-
|
|
98
|
-
"size":
|
|
99
|
-
"path": "../public/assets/
|
|
110
|
+
"etag": '"d2-XzO9iJI0+ubX6OxLXtO3jtsw2P8"',
|
|
111
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
112
|
+
"size": 210,
|
|
113
|
+
"path": "../public/assets/_sessionId-DAwcZWfu.js"
|
|
100
114
|
},
|
|
101
115
|
"/assets/zhipuai-BPNAnxo-.svg": {
|
|
102
116
|
"type": "image/svg+xml",
|
|
103
117
|
"etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
|
|
104
|
-
"mtime": "2026-07-
|
|
118
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
105
119
|
"size": 11256,
|
|
106
120
|
"path": "../public/assets/zhipuai-BPNAnxo-.svg"
|
|
107
121
|
},
|
|
108
|
-
"/assets/StreamingChunkSequence-D-9ysFSG.js": {
|
|
109
|
-
"type": "text/javascript; charset=utf-8",
|
|
110
|
-
"etag": '"d5c-Siu/PgtKfi5RvFy2DV5/y0lzSDU"',
|
|
111
|
-
"mtime": "2026-07-04T02:02:10.930Z",
|
|
112
|
-
"size": 3420,
|
|
113
|
-
"path": "../public/assets/StreamingChunkSequence-D-9ysFSG.js"
|
|
114
|
-
},
|
|
115
|
-
"/assets/_sessionId-3JCekYV3.js": {
|
|
116
|
-
"type": "text/javascript; charset=utf-8",
|
|
117
|
-
"etag": '"d2-Ck1cytNneSGYTerMobA/d7kU7E4"',
|
|
118
|
-
"mtime": "2026-07-04T02:02:10.929Z",
|
|
119
|
-
"size": 210,
|
|
120
|
-
"path": "../public/assets/_sessionId-3JCekYV3.js"
|
|
121
|
-
},
|
|
122
122
|
"/assets/qwen-CONDcHqt.png": {
|
|
123
123
|
"type": "image/png",
|
|
124
124
|
"etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
|
|
125
|
-
"mtime": "2026-07-
|
|
125
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
126
126
|
"size": 357059,
|
|
127
127
|
"path": "../public/assets/qwen-CONDcHqt.png"
|
|
128
128
|
},
|
|
129
|
-
"/assets/ProxyViewerContainer-
|
|
129
|
+
"/assets/ProxyViewerContainer-DFFxBlvO.js": {
|
|
130
130
|
"type": "text/javascript; charset=utf-8",
|
|
131
|
-
"etag": '"
|
|
132
|
-
"mtime": "2026-07-
|
|
133
|
-
"size":
|
|
134
|
-
"path": "../public/assets/ProxyViewerContainer-
|
|
131
|
+
"etag": '"c1c64-9hP+knZlrEdl706l5PYO4DOeFsA"',
|
|
132
|
+
"mtime": "2026-07-04T03:38:16.962Z",
|
|
133
|
+
"size": 793700,
|
|
134
|
+
"path": "../public/assets/ProxyViewerContainer-DFFxBlvO.js"
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
function readAsset(id) {
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -12,11 +12,13 @@ import {
|
|
|
12
12
|
probeHostForBindHost,
|
|
13
13
|
urlForHost,
|
|
14
14
|
} from "./cli/networkHints.js";
|
|
15
|
+
import { startIdentityProxy } from "./proxy/identityProxy.js";
|
|
15
16
|
|
|
16
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
17
18
|
const __dirname = dirname(__filename);
|
|
18
19
|
|
|
19
20
|
const DEFAULT_PORT = 25947;
|
|
21
|
+
const DEFAULT_IDENTITY_PORT = 25949;
|
|
20
22
|
const LOCAL_PROBE_TIMEOUT_MS = 2000;
|
|
21
23
|
const BRANDED_WINDOWS_RUNTIME_EXE = "agent-inspector.exe";
|
|
22
24
|
const DEFAULT_CAPTURE_MODE = "simple";
|
|
@@ -198,6 +200,34 @@ function printAccessHints(port: number, host?: string): void {
|
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
|
|
203
|
+
/** Try to start the identity proxy. Returns `null` (and prints a warning)
|
|
204
|
+
* if the listen port is already in use by another process — e.g. when
|
|
205
|
+
* restarting a previous instance that didn't shut down cleanly. The
|
|
206
|
+
* TanStack Start server keeps running either way; clients just lose the
|
|
207
|
+
* per-PID attribution until they fall back to direct port `port` access. */
|
|
208
|
+
async function tryStartIdentityProxy(
|
|
209
|
+
identityPort: number,
|
|
210
|
+
upstreamPort: number,
|
|
211
|
+
upstreamHost: string | undefined,
|
|
212
|
+
): Promise<import("node:http").Server | null> {
|
|
213
|
+
try {
|
|
214
|
+
const server = await startIdentityProxy({
|
|
215
|
+
listenPort: identityPort,
|
|
216
|
+
upstreamHost: upstreamHost ?? "127.0.0.1",
|
|
217
|
+
upstreamPort,
|
|
218
|
+
});
|
|
219
|
+
return server;
|
|
220
|
+
} catch (err) {
|
|
221
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
222
|
+
console.warn(
|
|
223
|
+
`[identity-proxy] Could not listen on port ${identityPort}: ${message}. ` +
|
|
224
|
+
`Falling back to OS-scan heuristic on port ${upstreamPort}. ` +
|
|
225
|
+
`Pass --identity-proxy-port <n> to choose another port, or --no-identity-proxy to disable.`,
|
|
226
|
+
);
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
201
231
|
async function runStart(args: string[]): Promise<void> {
|
|
202
232
|
const envPort = process.env["PORT"];
|
|
203
233
|
const portDefault = envPort !== undefined ? Number(envPort) : DEFAULT_PORT;
|
|
@@ -215,6 +245,11 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
215
245
|
let providersJson: string | undefined;
|
|
216
246
|
let captureMode = DEFAULT_CAPTURE_MODE;
|
|
217
247
|
let captureModeWasSpecified = false;
|
|
248
|
+
let enableIdentityProxy = true;
|
|
249
|
+
let identityProxyPort =
|
|
250
|
+
process.env["AGENT_INSPECTOR_IDENTITY_PORT"] !== undefined
|
|
251
|
+
? Number(process.env["AGENT_INSPECTOR_IDENTITY_PORT"])
|
|
252
|
+
: DEFAULT_IDENTITY_PORT;
|
|
218
253
|
|
|
219
254
|
if (envMode !== undefined && envMode !== "") {
|
|
220
255
|
const parsedMode = parseCaptureMode(envMode);
|
|
@@ -312,6 +347,21 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
312
347
|
i++;
|
|
313
348
|
break;
|
|
314
349
|
}
|
|
350
|
+
case "--no-identity-proxy":
|
|
351
|
+
enableIdentityProxy = false;
|
|
352
|
+
break;
|
|
353
|
+
case "--identity-proxy-port": {
|
|
354
|
+
const value = args[i + 1];
|
|
355
|
+
const parsed = Number(value);
|
|
356
|
+
if (!Number.isInteger(parsed) || parsed <= 0 || parsed > 65535) {
|
|
357
|
+
console.error(`Invalid identity-proxy port: ${String(value)}.`);
|
|
358
|
+
process.exitCode = 1;
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
identityProxyPort = parsed;
|
|
362
|
+
i++;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
315
365
|
default:
|
|
316
366
|
break;
|
|
317
367
|
}
|
|
@@ -425,6 +475,7 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
425
475
|
|
|
426
476
|
if (forceRestart) {
|
|
427
477
|
killProcessOnPort(port);
|
|
478
|
+
if (enableIdentityProxy) killProcessOnPort(identityProxyPort);
|
|
428
479
|
}
|
|
429
480
|
|
|
430
481
|
console.log(`Server running at ${url}`);
|
|
@@ -495,11 +546,34 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
495
546
|
windowsHide: background,
|
|
496
547
|
});
|
|
497
548
|
|
|
549
|
+
// Identity proxy — a native Node HTTP server that sits in front of
|
|
550
|
+
// TanStack Start and looks up each client's PID via the OS connection
|
|
551
|
+
// table, injecting the result as `X-Agent-Inspector-Client-*` headers.
|
|
552
|
+
// This lets AI tools (which can't easily set those headers themselves)
|
|
553
|
+
// still get accurate session attribution. Started only after TanStack
|
|
554
|
+
// Start is healthy, so the upstream is ready by the time clients connect.
|
|
555
|
+
const identityProxy = enableIdentityProxy
|
|
556
|
+
? await tryStartIdentityProxy(identityProxyPort, port, host)
|
|
557
|
+
: null;
|
|
558
|
+
|
|
498
559
|
if (background) {
|
|
499
560
|
serverProcess.unref();
|
|
500
561
|
if (await waitForInspectorHealthy(port, 5000, host)) {
|
|
501
562
|
console.log(`agent-inspector background server is ready at ${url}`);
|
|
563
|
+
if (identityProxy !== null) {
|
|
564
|
+
console.log(`Identity proxy ready on port ${identityProxyPort} (PID-attributing proxy).`);
|
|
565
|
+
}
|
|
502
566
|
printAccessHints(port, host);
|
|
567
|
+
if (identityProxy !== null) {
|
|
568
|
+
console.log(
|
|
569
|
+
``,
|
|
570
|
+
`Route AI coding tools through the identity proxy for accurate PID attribution:`,
|
|
571
|
+
` Claude Code: ANTHROPIC_BASE_URL=http://localhost:${identityProxyPort}/proxy claude`,
|
|
572
|
+
` OpenCode: LLM_BASE_URL=http://localhost:${identityProxyPort}/proxy opencode`,
|
|
573
|
+
` MiMo Code: OPENAI_BASE_URL=http://localhost:${identityProxyPort}/proxy mimo`,
|
|
574
|
+
` (Direct ${port} still works; it falls back to OS-scan heuristic.)`,
|
|
575
|
+
);
|
|
576
|
+
}
|
|
503
577
|
return;
|
|
504
578
|
}
|
|
505
579
|
console.error(`agent-inspector background server did not become ready at ${url}.`);
|
|
@@ -508,4 +582,19 @@ async function runStart(args: string[]): Promise<void> {
|
|
|
508
582
|
}
|
|
509
583
|
|
|
510
584
|
process.exitCode = await waitForProcessExit(serverProcess);
|
|
585
|
+
|
|
586
|
+
// Foreground path: print the smart-port hint now that the proxy is up,
|
|
587
|
+
// then keep the proxy alive until the server exits.
|
|
588
|
+
if (identityProxy !== null) {
|
|
589
|
+
console.log(
|
|
590
|
+
``,
|
|
591
|
+
`Identity proxy is listening on port ${identityProxyPort}:`,
|
|
592
|
+
` Route AI coding tools through the identity proxy for accurate PID attribution:`,
|
|
593
|
+
` Claude Code: ANTHROPIC_BASE_URL=http://localhost:${identityProxyPort}/proxy claude`,
|
|
594
|
+
` OpenCode: LLM_BASE_URL=http://localhost:${identityProxyPort}/proxy opencode`,
|
|
595
|
+
` MiMo Code: OPENAI_BASE_URL=http://localhost:${identityProxyPort}/proxy mimo`,
|
|
596
|
+
` Direct port ${port} still works (falls back to OS-scan heuristic).`,
|
|
597
|
+
);
|
|
598
|
+
await new Promise<void>((resolve) => identityProxy.close(() => resolve()));
|
|
599
|
+
}
|
|
511
600
|
}
|
|
@@ -243,32 +243,31 @@ export const LogEntryHeader = memo(function ({
|
|
|
243
243
|
</Tooltip>
|
|
244
244
|
)}
|
|
245
245
|
|
|
246
|
-
{/* Elapsed time
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
</
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
</
|
|
270
|
-
|
|
271
|
-
)}
|
|
246
|
+
{/* Elapsed time. Tooltip is only shown when this log exceeded the slow-
|
|
247
|
+
response threshold — for normal-speed logs the elapsed value is
|
|
248
|
+
self-explanatory, so we skip the tooltip wrapper to keep the row
|
|
249
|
+
quiet. */}
|
|
250
|
+
{log.elapsedMs !== null &&
|
|
251
|
+
(isSlowResponse ? (
|
|
252
|
+
<Tooltip>
|
|
253
|
+
<TooltipTrigger asChild>
|
|
254
|
+
<span className="flex items-center gap-1 text-xs text-amber-400 shrink-0">
|
|
255
|
+
<Clock className="size-3" />
|
|
256
|
+
<span className="font-mono tabular-nums">{formatElapsed(log.elapsedMs)}</span>
|
|
257
|
+
<AlertTriangle className="size-3" aria-label="Slow response" />
|
|
258
|
+
</span>
|
|
259
|
+
</TooltipTrigger>
|
|
260
|
+
<TooltipContent>
|
|
261
|
+
Slow response: {formatElapsed(log.elapsedMs)} exceeds{" "}
|
|
262
|
+
{formatElapsed(slowResponseThresholdSeconds * 1000)}
|
|
263
|
+
</TooltipContent>
|
|
264
|
+
</Tooltip>
|
|
265
|
+
) : (
|
|
266
|
+
<span className="flex items-center gap-1 text-xs text-muted-foreground shrink-0">
|
|
267
|
+
<Clock className="size-3" />
|
|
268
|
+
<span className="font-mono tabular-nums">{formatElapsed(log.elapsedMs)}</span>
|
|
269
|
+
</span>
|
|
270
|
+
))}
|
|
272
271
|
|
|
273
272
|
{/* Streaming timing */}
|
|
274
273
|
{log.streaming && firstChunkLabel !== null && (
|