@tonyclaw/agent-inspector 3.0.18 → 3.0.20
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 +1257 -506
- package/.output/nitro.json +3 -3
- package/.output/public/assets/CompareDrawer-CV7rBBty.js +1 -0
- package/.output/public/assets/ProxyViewerContainer-CqRfBWJ3.js +127 -0
- package/.output/public/assets/ReplayDialog-yDeF-z9y.js +1 -0
- package/.output/public/assets/RequestAnatomy-BXxKNdgk.js +1 -0
- package/.output/public/assets/ResponseView-BIYNgUNB.js +3 -0
- package/.output/public/assets/StreamingChunkSequence-C1faiChu.js +1 -0
- package/.output/public/assets/_sessionId-B34PrfCQ.js +1 -0
- package/.output/public/assets/index-B3YOj8-_.css +1 -0
- package/.output/public/assets/index-BLwqIxup.js +12 -0
- package/.output/public/assets/{index-ClQ7Vi3J.js → index-DOspyaW6.js} +1 -1
- package/.output/public/assets/index-DT476lno.js +1 -0
- package/.output/public/assets/json-viewer-C1S08J_2.js +1 -0
- package/.output/server/_chunks/ssr-renderer.mjs +18 -2
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +165 -31
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +1 -1
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +2 -2
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +28 -1
- package/.output/server/_libs/mistralai__mistralai.mjs +1 -1
- package/.output/server/_libs/modelcontextprotocol__server.mjs +11571 -8127
- package/.output/server/_libs/radix-ui__primitive.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-collection.mjs +8 -8
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-context.mjs +4 -18
- package/.output/server/_libs/radix-ui__react-dialog.mjs +41 -88
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +15 -5
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +6 -2
- package/.output/server/_libs/radix-ui__react-id.mjs +3 -3
- package/.output/server/_libs/radix-ui__react-popper.mjs +62 -8
- package/.output/server/_libs/radix-ui__react-portal.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-presence.mjs +50 -5
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +15 -4
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +30 -20
- package/.output/server/_libs/radix-ui__react-select.mjs +167 -123
- package/.output/server/_libs/radix-ui__react-slot.mjs +74 -41
- package/.output/server/_libs/radix-ui__react-tabs.mjs +6 -1
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -3
- package/.output/server/_libs/react-dom.mjs +13 -15
- package/.output/server/_libs/react.mjs +45 -45
- package/.output/server/_libs/srvx.mjs +409 -53
- package/.output/server/_libs/swr.mjs +10 -2
- package/.output/server/_libs/tailwind-merge.mjs +286 -41
- package/.output/server/_libs/tanstack__history.mjs +9 -13
- package/.output/server/_libs/tanstack__react-router.mjs +788 -1092
- package/.output/server/_libs/tanstack__react-store.mjs +1 -1
- package/.output/server/_libs/tanstack__react-virtual.mjs +82 -7
- package/.output/server/_libs/tanstack__router-core.mjs +1841 -2060
- package/.output/server/_libs/tanstack__virtual-core.mjs +116 -45
- package/.output/server/_libs/use-sync-external-store.mjs +1 -1
- package/.output/server/_libs/zod-to-json-schema.mjs +1 -1
- package/.output/server/_libs/zod.mjs +5085 -200
- package/.output/server/{_sessionId-Bi3ZIrqT.mjs → _sessionId-CmoBbtKT.mjs} +30 -32
- package/.output/server/_ssr/{CompareDrawer-BYZS_hCR.mjs → CompareDrawer-BsXnVK4e.mjs} +29 -31
- package/.output/server/_ssr/{ProxyViewerContainer-BE4umfVs.mjs → ProxyViewerContainer-D-_7pyfx.mjs} +54 -52
- package/.output/server/_ssr/{ReplayDialog-BlID2ZH4.mjs → ReplayDialog-deDQA2M5.mjs} +30 -32
- package/.output/server/_ssr/{RequestAnatomy-CGJ2lkzT.mjs → RequestAnatomy-CX-cCRdX.mjs} +29 -31
- package/.output/server/_ssr/{ResponseView-DDjcGf7M.mjs → ResponseView-D0LJR1qj.mjs} +29 -31
- package/.output/server/_ssr/{StreamingChunkSequence-G7B8M5G2.mjs → StreamingChunkSequence-CJRECetE.mjs} +29 -31
- package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +6 -0
- package/.output/server/_ssr/{index-ClQ9FvRJ.mjs → index-CYWOXS4d.mjs} +31 -33
- package/.output/server/_ssr/index.mjs +1102 -784
- package/.output/server/_ssr/{json-viewer-CFbpkiBJ.mjs → json-viewer-CCneYiCn.mjs} +29 -31
- package/.output/server/_ssr/{router-Cq8LEvhE.mjs → router-D-PAN8IK.mjs} +182 -67
- package/.output/server/_tanstack-start-manifest_v-CVZ9yh4R.mjs +4 -0
- package/.output/server/index.mjs +74 -92
- package/README.md +4 -4
- package/package.json +17 -8
- package/src/cli/onboard.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/components/clients/ClientLogo.tsx +5 -1
- package/src/components/proxy-viewer/RequestToolsPanel.tsx +1 -0
- package/src/components/proxy-viewer/ResponseView.tsx +1 -0
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +1 -0
- package/src/components/proxy-viewer/TurnGroup.tsx +1 -0
- package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +1 -0
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +4 -0
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +1 -0
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +2 -0
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/json-viewer.tsx +2 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/contracts/json.ts +7 -2
- package/src/lib/providerContract.ts +25 -5
- package/src/mcp/server.ts +12 -3
- package/src/mcp/toolHandlers.ts +6 -1
- package/src/proxy/handler.ts +17 -7
- package/src/proxy/logFinalizer.ts +76 -8
- package/src/proxy/logIndex.ts +16 -32
- package/src/proxy/providers.ts +22 -1
- package/src/proxy/sessionProcess.ts +15 -1
- package/src/proxy/upstream.ts +4 -2
- package/src/router.tsx +9 -0
- package/.output/public/assets/CompareDrawer-Daj03-RL.js +0 -1
- package/.output/public/assets/ProxyViewerContainer-BLCRQtU_.js +0 -106
- package/.output/public/assets/ReplayDialog-5FR5crdo.js +0 -1
- package/.output/public/assets/RequestAnatomy-DF0hHdQY.js +0 -1
- package/.output/public/assets/ResponseView-BwkMSsUa.js +0 -3
- package/.output/public/assets/StreamingChunkSequence-CKeUd58x.js +0 -1
- package/.output/public/assets/_sessionId-CThgXa41.js +0 -1
- package/.output/public/assets/index-BHXN1Fsx.css +0 -1
- package/.output/public/assets/index-gm3A0idN.js +0 -1
- package/.output/public/assets/json-viewer-BA-W-PZq.js +0 -1
- package/.output/public/assets/main-BnRC1932.js +0 -18
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +0 -17
- package/.output/server/_libs/cfworker__json-schema.mjs +0 -1
- package/.output/server/_libs/tiny-invariant.mjs +0 -12
- package/.output/server/_libs/tiny-warning.mjs +0 -5
- package/.output/server/_tanstack-start-manifest_v-p7J0QCMh.mjs +0 -4
package/.output/server/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
globalThis.__nitro_main__ = import.meta.url;
|
|
2
|
-
import {
|
|
2
|
+
import { c as NodeResponse, s as serve } from "./_libs/srvx.mjs";
|
|
3
3
|
import { d as defineHandler, H as HTTPError, t as toEventHandler, a as defineLazyEventHandler, b as H3Core } from "./_libs/h3.mjs";
|
|
4
4
|
import { d as decodePath, w as withLeadingSlash, a as withoutTrailingSlash, j as joinURL } from "./_libs/ufo.mjs";
|
|
5
5
|
import { promises } from "node:fs";
|
|
@@ -11,24 +11,6 @@ import "node:stream/promises";
|
|
|
11
11
|
import "node:https";
|
|
12
12
|
import "node:http2";
|
|
13
13
|
import "./_libs/rou3.mjs";
|
|
14
|
-
function lazyService(loader) {
|
|
15
|
-
let promise, mod;
|
|
16
|
-
return {
|
|
17
|
-
fetch(req) {
|
|
18
|
-
if (mod) {
|
|
19
|
-
return mod.fetch(req);
|
|
20
|
-
}
|
|
21
|
-
if (!promise) {
|
|
22
|
-
promise = loader().then((_mod) => mod = _mod.default || _mod);
|
|
23
|
-
}
|
|
24
|
-
return promise.then((mod2) => mod2.fetch(req));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const services = {
|
|
29
|
-
["ssr"]: lazyService(() => import("./_ssr/index.mjs"))
|
|
30
|
-
};
|
|
31
|
-
globalThis.__nitro_vite_envs__ = services;
|
|
32
14
|
const headers = ((m) => function headersRouteRule(event) {
|
|
33
15
|
for (const [key2, value] of Object.entries(m.options || {})) {
|
|
34
16
|
event.res.headers.set(key2, value);
|
|
@@ -38,121 +20,121 @@ const assets = {
|
|
|
38
20
|
"/assets/alibaba-TTwafVwX.svg": {
|
|
39
21
|
"type": "image/svg+xml",
|
|
40
22
|
"etag": '"171b-6dyV5K8QjiaY35sN9qNprh9zDIs"',
|
|
41
|
-
"mtime": "2026-07-
|
|
23
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
42
24
|
"size": 5915,
|
|
43
25
|
"path": "../public/assets/alibaba-TTwafVwX.svg"
|
|
44
26
|
},
|
|
45
27
|
"/assets/agent-inspector-58K1_MsC.ico": {
|
|
46
28
|
"type": "image/vnd.microsoft.icon",
|
|
47
29
|
"etag": '"38fa-ZD8kPABHYjPIkcH82FMY6iZM7fI"',
|
|
48
|
-
"mtime": "2026-07-
|
|
30
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
49
31
|
"size": 14586,
|
|
50
32
|
"path": "../public/assets/agent-inspector-58K1_MsC.ico"
|
|
51
33
|
},
|
|
52
|
-
"/assets/
|
|
34
|
+
"/assets/CompareDrawer-CV7rBBty.js": {
|
|
53
35
|
"type": "text/javascript; charset=utf-8",
|
|
54
|
-
"etag": '"
|
|
55
|
-
"mtime": "2026-07-
|
|
56
|
-
"size":
|
|
57
|
-
"path": "../public/assets/
|
|
36
|
+
"etag": '"4bc4-NeuRTrt7yHDOmT9FQIMZJsJttrg"',
|
|
37
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
38
|
+
"size": 19396,
|
|
39
|
+
"path": "../public/assets/CompareDrawer-CV7rBBty.js"
|
|
58
40
|
},
|
|
59
|
-
"/assets/index-
|
|
41
|
+
"/assets/index-DT476lno.js": {
|
|
60
42
|
"type": "text/javascript; charset=utf-8",
|
|
61
|
-
"etag": '"
|
|
62
|
-
"mtime": "2026-07-
|
|
63
|
-
"size":
|
|
64
|
-
"path": "../public/assets/index-
|
|
43
|
+
"etag": '"265-MUXBG+nWxX37u2jGqJqLxo+dQ58"',
|
|
44
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
45
|
+
"size": 613,
|
|
46
|
+
"path": "../public/assets/index-DT476lno.js"
|
|
47
|
+
},
|
|
48
|
+
"/assets/index-DOspyaW6.js": {
|
|
49
|
+
"type": "text/javascript; charset=utf-8",
|
|
50
|
+
"etag": '"1cd2d-wAQHK/XT8cmFNwY2u7tsp3R5u5E"',
|
|
51
|
+
"mtime": "2026-07-09T06:59:01.791Z",
|
|
52
|
+
"size": 118061,
|
|
53
|
+
"path": "../public/assets/index-DOspyaW6.js"
|
|
54
|
+
},
|
|
55
|
+
"/assets/index-B3YOj8-_.css": {
|
|
56
|
+
"type": "text/css; charset=utf-8",
|
|
57
|
+
"etag": '"25d7e-wT0HU4Abt/tuojN/MHx6/a/L3BA"',
|
|
58
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
59
|
+
"size": 155006,
|
|
60
|
+
"path": "../public/assets/index-B3YOj8-_.css"
|
|
65
61
|
},
|
|
66
62
|
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
67
63
|
"type": "image/jpeg",
|
|
68
64
|
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
69
|
-
"mtime": "2026-07-
|
|
65
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
70
66
|
"size": 6918,
|
|
71
67
|
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
72
68
|
},
|
|
73
|
-
"/assets/
|
|
69
|
+
"/assets/RequestAnatomy-BXxKNdgk.js": {
|
|
74
70
|
"type": "text/javascript; charset=utf-8",
|
|
75
|
-
"etag": '"
|
|
76
|
-
"mtime": "2026-07-
|
|
77
|
-
"size":
|
|
78
|
-
"path": "../public/assets/
|
|
71
|
+
"etag": '"43f3-xfqa2g7z/1x7C7SVZel7b8TpVPs"',
|
|
72
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
73
|
+
"size": 17395,
|
|
74
|
+
"path": "../public/assets/RequestAnatomy-BXxKNdgk.js"
|
|
79
75
|
},
|
|
80
|
-
"/assets/
|
|
76
|
+
"/assets/index-BLwqIxup.js": {
|
|
81
77
|
"type": "text/javascript; charset=utf-8",
|
|
82
|
-
"etag": '"
|
|
83
|
-
"mtime": "2026-07-
|
|
84
|
-
"size":
|
|
85
|
-
"path": "../public/assets/
|
|
78
|
+
"etag": '"5231f-HqTXsZ4wO12ASADoW2/b28qy0iU"',
|
|
79
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
80
|
+
"size": 336671,
|
|
81
|
+
"path": "../public/assets/index-BLwqIxup.js"
|
|
86
82
|
},
|
|
87
|
-
"/assets/
|
|
83
|
+
"/assets/ReplayDialog-yDeF-z9y.js": {
|
|
88
84
|
"type": "text/javascript; charset=utf-8",
|
|
89
|
-
"etag": '"
|
|
90
|
-
"mtime": "2026-07-
|
|
91
|
-
"size":
|
|
92
|
-
"path": "../public/assets/
|
|
85
|
+
"etag": '"3348-KuuPZ1nE8LYKQOTTGWkhFYGrHTE"',
|
|
86
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
87
|
+
"size": 13128,
|
|
88
|
+
"path": "../public/assets/ReplayDialog-yDeF-z9y.js"
|
|
93
89
|
},
|
|
94
|
-
"/assets/ResponseView-
|
|
90
|
+
"/assets/ResponseView-BIYNgUNB.js": {
|
|
95
91
|
"type": "text/javascript; charset=utf-8",
|
|
96
|
-
"etag": '"
|
|
97
|
-
"mtime": "2026-07-
|
|
98
|
-
"size":
|
|
99
|
-
"path": "../public/assets/ResponseView-
|
|
92
|
+
"etag": '"47fe-zKVqch7wCsmDgW7eCqN7M7CT6xc"',
|
|
93
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
94
|
+
"size": 18430,
|
|
95
|
+
"path": "../public/assets/ResponseView-BIYNgUNB.js"
|
|
100
96
|
},
|
|
101
|
-
"/assets/
|
|
97
|
+
"/assets/StreamingChunkSequence-C1faiChu.js": {
|
|
102
98
|
"type": "text/javascript; charset=utf-8",
|
|
103
|
-
"etag": '"
|
|
104
|
-
"mtime": "2026-07-
|
|
105
|
-
"size":
|
|
106
|
-
"path": "../public/assets/
|
|
99
|
+
"etag": '"e96-OFL3QQfpjl325p412ILsH/ND4Z0"',
|
|
100
|
+
"mtime": "2026-07-09T06:59:01.791Z",
|
|
101
|
+
"size": 3734,
|
|
102
|
+
"path": "../public/assets/StreamingChunkSequence-C1faiChu.js"
|
|
107
103
|
},
|
|
108
|
-
"/assets/
|
|
104
|
+
"/assets/_sessionId-B34PrfCQ.js": {
|
|
109
105
|
"type": "text/javascript; charset=utf-8",
|
|
110
|
-
"etag": '"
|
|
111
|
-
"mtime": "2026-07-
|
|
112
|
-
"size":
|
|
113
|
-
"path": "../public/assets/
|
|
114
|
-
},
|
|
115
|
-
"/assets/StreamingChunkSequence-CKeUd58x.js": {
|
|
116
|
-
"type": "text/javascript; charset=utf-8",
|
|
117
|
-
"etag": '"e95-aUcHwmSf3cNmuFqJIhMNTBPZwHQ"',
|
|
118
|
-
"mtime": "2026-07-08T09:20:47.300Z",
|
|
119
|
-
"size": 3733,
|
|
120
|
-
"path": "../public/assets/StreamingChunkSequence-CKeUd58x.js"
|
|
106
|
+
"etag": '"36d-UKHpMMKVTcaT/1x9Bgn6o8Jt+G8"',
|
|
107
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
108
|
+
"size": 877,
|
|
109
|
+
"path": "../public/assets/_sessionId-B34PrfCQ.js"
|
|
121
110
|
},
|
|
122
111
|
"/assets/zhipuai-BPNAnxo-.svg": {
|
|
123
112
|
"type": "image/svg+xml",
|
|
124
113
|
"etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
|
|
125
|
-
"mtime": "2026-07-
|
|
114
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
126
115
|
"size": 11256,
|
|
127
116
|
"path": "../public/assets/zhipuai-BPNAnxo-.svg"
|
|
128
117
|
},
|
|
129
|
-
"/assets/
|
|
130
|
-
"type": "text/css; charset=utf-8",
|
|
131
|
-
"etag": '"25b0d-UyzOlNKIaucQXEUHv/FUiQk9+WM"',
|
|
132
|
-
"mtime": "2026-07-08T09:20:47.299Z",
|
|
133
|
-
"size": 154381,
|
|
134
|
-
"path": "../public/assets/index-BHXN1Fsx.css"
|
|
135
|
-
},
|
|
136
|
-
"/assets/_sessionId-CThgXa41.js": {
|
|
118
|
+
"/assets/json-viewer-C1S08J_2.js": {
|
|
137
119
|
"type": "text/javascript; charset=utf-8",
|
|
138
|
-
"etag": '"
|
|
139
|
-
"mtime": "2026-07-
|
|
140
|
-
"size":
|
|
141
|
-
"path": "../public/assets/
|
|
120
|
+
"etag": '"1ae7-30vssKRdTL6PhsFp1e/RPJHIleA"',
|
|
121
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
122
|
+
"size": 6887,
|
|
123
|
+
"path": "../public/assets/json-viewer-C1S08J_2.js"
|
|
142
124
|
},
|
|
143
125
|
"/assets/qwen-CONDcHqt.png": {
|
|
144
126
|
"type": "image/png",
|
|
145
127
|
"etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
|
|
146
|
-
"mtime": "2026-07-
|
|
128
|
+
"mtime": "2026-07-09T06:59:01.790Z",
|
|
147
129
|
"size": 357059,
|
|
148
130
|
"path": "../public/assets/qwen-CONDcHqt.png"
|
|
149
131
|
},
|
|
150
|
-
"/assets/ProxyViewerContainer-
|
|
132
|
+
"/assets/ProxyViewerContainer-CqRfBWJ3.js": {
|
|
151
133
|
"type": "text/javascript; charset=utf-8",
|
|
152
|
-
"etag": '"
|
|
153
|
-
"mtime": "2026-07-
|
|
154
|
-
"size":
|
|
155
|
-
"path": "../public/assets/ProxyViewerContainer-
|
|
134
|
+
"etag": '"bd898-gg83MT9gqLxpBjOn+Tmh6I1/9N4"',
|
|
135
|
+
"mtime": "2026-07-09T06:59:01.791Z",
|
|
136
|
+
"size": 776344,
|
|
137
|
+
"path": "../public/assets/ProxyViewerContainer-CqRfBWJ3.js"
|
|
156
138
|
}
|
|
157
139
|
};
|
|
158
140
|
function readAsset(id) {
|
|
@@ -180,7 +162,7 @@ const EncodingMap = {
|
|
|
180
162
|
br: ".br",
|
|
181
163
|
zstd: ".zst"
|
|
182
164
|
};
|
|
183
|
-
const
|
|
165
|
+
const _TahAqH = defineHandler((event) => {
|
|
184
166
|
if (event.req.method && !METHODS.has(event.req.method)) {
|
|
185
167
|
return;
|
|
186
168
|
}
|
|
@@ -252,15 +234,15 @@ const findRouteRules = /* @__PURE__ */ (() => {
|
|
|
252
234
|
return r;
|
|
253
235
|
};
|
|
254
236
|
})();
|
|
255
|
-
const
|
|
237
|
+
const _lazy_9A6hFz = defineLazyEventHandler(() => import("./_chunks/ssr-renderer.mjs"));
|
|
256
238
|
const findRoute = /* @__PURE__ */ (() => {
|
|
257
|
-
const data = { route: "/**", handler:
|
|
239
|
+
const data = { route: "/**", handler: _lazy_9A6hFz };
|
|
258
240
|
return ((_m, p) => {
|
|
259
241
|
return { data, params: { "_": p.slice(1) } };
|
|
260
242
|
});
|
|
261
243
|
})();
|
|
262
244
|
const globalMiddleware = [
|
|
263
|
-
toEventHandler(
|
|
245
|
+
toEventHandler(_TahAqH)
|
|
264
246
|
].filter(Boolean);
|
|
265
247
|
const errorHandler$1 = (error, event) => {
|
|
266
248
|
const res = defaultHandler(error, event);
|
package/README.md
CHANGED
|
@@ -130,13 +130,13 @@ The web UI runs at http://localhost:9527. The public proxy endpoint is also
|
|
|
130
130
|
`http://localhost:9527/proxy`; internally Agent Inspector may run the app on a private helper port,
|
|
131
131
|
but AI tools should use the public URL printed by the CLI.
|
|
132
132
|
|
|
133
|
-
The legacy `http://localhost:
|
|
133
|
+
The legacy `http://localhost:9527` port is closed by default. If you need a temporary alias for
|
|
134
134
|
older AI tool or MCP configs, start with `agent-inspector --legacy-port`.
|
|
135
135
|
|
|
136
136
|
## v3.0 Port Migration
|
|
137
137
|
|
|
138
|
-
Agent Inspector v3.0 changes the default public port from `
|
|
139
|
-
opens only `9527` by default. Existing AI coding tool and MCP configs that still point at `
|
|
138
|
+
Agent Inspector v3.0 changes the default public port from `9527` to `9527`. The packaged CLI now
|
|
139
|
+
opens only `9527` by default. Existing AI coding tool and MCP configs that still point at `9527`
|
|
140
140
|
should be moved to `9527`, or you can temporarily start with `agent-inspector --legacy-port`.
|
|
141
141
|
|
|
142
142
|
Use these endpoints for new configs:
|
|
@@ -266,7 +266,7 @@ configure `http://localhost:9527/api/mcp` directly. If it only supports stdio, c
|
|
|
266
266
|
`agent-inspector-mcp stdio`; that command is only a bridge to `/api/mcp`, not a second Inspector
|
|
267
267
|
server.
|
|
268
268
|
|
|
269
|
-
Legacy MCP configs that still use `http://localhost:
|
|
269
|
+
Legacy MCP configs that still use `http://localhost:9527/api/mcp` require starting the CLI with
|
|
270
270
|
`agent-inspector --legacy-port`; new configs should use `http://localhost:9527/api/mcp`.
|
|
271
271
|
|
|
272
272
|
Coding agents can use the MCP surface in three ways:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonyclaw/agent-inspector",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent observability and knowledge capture layer for AI coding tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,10 +71,7 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@mariozechner/pi-agent-core": "^0.73.1",
|
|
73
73
|
"@mariozechner/pi-ai": "^0.73.1",
|
|
74
|
-
"@mariozechner/pi-coding-agent": "^0.73.1",
|
|
75
74
|
"@modelcontextprotocol/server": "^2.0.0-alpha.2",
|
|
76
|
-
"@radix-ui/react-dialog": "^1.1.14",
|
|
77
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
78
75
|
"@tailwindcss/typography": "^0.5.19",
|
|
79
76
|
"@tanstack/react-router": "^1.160.2",
|
|
80
77
|
"@tanstack/react-start": "^1.161.0",
|
|
@@ -104,24 +101,36 @@
|
|
|
104
101
|
"@eslint/js": "^10.0.1",
|
|
105
102
|
"@ladle/react": "^5.1.1",
|
|
106
103
|
"@tailwindcss/vite": "^4.1.18",
|
|
107
|
-
"@types/bun": "
|
|
104
|
+
"@types/bun": "1.3.8",
|
|
108
105
|
"@types/react": "^19",
|
|
109
106
|
"@types/react-dom": "^19",
|
|
110
107
|
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
111
108
|
"@typescript-eslint/parser": "^8.55.0",
|
|
112
109
|
"@vitejs/plugin-react": "^5.1.4",
|
|
113
|
-
"esbuild": "^0.
|
|
110
|
+
"esbuild": "^0.28.1",
|
|
114
111
|
"eslint": "^9.32.0",
|
|
115
112
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
116
113
|
"eslint-plugin-functional": "^9.0.2",
|
|
117
114
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
118
115
|
"husky": "^9.1.7",
|
|
119
116
|
"knip": "^5.83.1",
|
|
120
|
-
"nitro": "^3.0.
|
|
117
|
+
"nitro": "^3.0.260610-beta",
|
|
121
118
|
"playwright": "^1.60.0",
|
|
122
119
|
"tailwindcss": "^4.1.11",
|
|
123
120
|
"typescript": "^5.9.3",
|
|
124
|
-
"vite": "^7.3.
|
|
121
|
+
"vite": "^7.3.6",
|
|
125
122
|
"vite-tsconfig-paths": "^6.1.1"
|
|
123
|
+
},
|
|
124
|
+
"overrides": {
|
|
125
|
+
"undici": ">=7.24.0 <8.0.0",
|
|
126
|
+
"rollup": ">=4.59.0 <5.0.0",
|
|
127
|
+
"postcss": ">=8.5.10 <9.0.0",
|
|
128
|
+
"js-yaml": ">=4.1.2 <5.0.0",
|
|
129
|
+
"flatted": ">=3.4.0 <4.0.0",
|
|
130
|
+
"smol-toml": ">=1.6.1 <2.0.0",
|
|
131
|
+
"koa": ">=2.16.4 <3.0.0",
|
|
132
|
+
"@babel/core": ">=7.29.1 <8.0.0",
|
|
133
|
+
"@typescript-eslint/typescript-estree": "^8.63.0",
|
|
134
|
+
"vite": "^7.3.6"
|
|
126
135
|
}
|
|
127
136
|
}
|
package/src/cli/onboard.ts
CHANGED
|
@@ -37,7 +37,7 @@ const __dirname = dirname(__filename);
|
|
|
37
37
|
|
|
38
38
|
const DEFAULT_PORT = 9527;
|
|
39
39
|
const DEFAULT_MCP_URL = `http://localhost:${DEFAULT_PORT}/api/mcp`;
|
|
40
|
-
const LEGACY_MCP_URL = "http://localhost:
|
|
40
|
+
const LEGACY_MCP_URL = "http://localhost:9527/api/mcp";
|
|
41
41
|
const SKILL_DIR_NAME = "agent-inspector-onboard";
|
|
42
42
|
const SKILL_FILE_NAME = "SKILL.md";
|
|
43
43
|
// Windows reserves `:` for NTFS alternate data streams, so a file named
|
package/src/cli.ts
CHANGED
|
@@ -24,12 +24,12 @@ import { findPidsByPort, killPid, openUrlCommand } from "./proxy/platformCommand
|
|
|
24
24
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
25
|
const __dirname = dirname(__filename);
|
|
26
26
|
|
|
27
|
-
// v3 defaults the public entrypoint to 9527. The legacy
|
|
27
|
+
// v3 defaults the public entrypoint to 9527. The legacy 9527 alias can be
|
|
28
28
|
// enabled explicitly for older AI-tool and MCP configs. The TanStack Start
|
|
29
29
|
// runtime stays on a private upstream port and public ports reverse-proxy to
|
|
30
30
|
// that same runtime, so logs, sessions, and MCP state remain unified.
|
|
31
31
|
const DEFAULT_PORT = 9527;
|
|
32
|
-
const LEGACY_ALIAS_PORT =
|
|
32
|
+
const LEGACY_ALIAS_PORT = 9527;
|
|
33
33
|
const DEFAULT_UPSTREAM_PORT = 9529;
|
|
34
34
|
const LOCAL_PROBE_TIMEOUT_MS = 2000;
|
|
35
35
|
const BRANDED_WINDOWS_RUNTIME_EXE = "agent-inspector.exe";
|
|
@@ -51,7 +51,11 @@ export function detectClientApp(input: ClientAppDetectionInput): ClientApp {
|
|
|
51
51
|
}
|
|
52
52
|
if (matchesAny(haystack, ["mimocode", "mimo-code", "mimo code"])) return "mimo-code";
|
|
53
53
|
if (matchesAny(haystack, ["opencode", "open-code", "open code"])) return "opencode";
|
|
54
|
-
if (
|
|
54
|
+
if (
|
|
55
|
+
matchesAny(haystack, ["claude-code", "claude code", "claudecode", "claude-cli", "claude cli"])
|
|
56
|
+
) {
|
|
57
|
+
return "claude-code";
|
|
58
|
+
}
|
|
55
59
|
if (matchesAny(haystack, ["codex desktop", "codex-cli", "openai-codex", "codex"])) {
|
|
56
60
|
return "codex";
|
|
57
61
|
}
|
|
@@ -183,6 +183,7 @@ function matchesQuery(tool: RequestToolDefinition, query: string): boolean {
|
|
|
183
183
|
return haystack.includes(query);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
186
187
|
export const RequestTools = memo(function RequestTools({
|
|
187
188
|
summary,
|
|
188
189
|
calledToolNames,
|
|
@@ -66,6 +66,7 @@ function MarkdownFallbackView({ text }: { text: string }): JSX.Element {
|
|
|
66
66
|
return <AnswerMarkdown text={text} />;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
69
70
|
export const ResponseView = memo(function ResponseView({
|
|
70
71
|
responseText,
|
|
71
72
|
responseStatus,
|
|
@@ -30,6 +30,7 @@ const StreamingChunksResponseSchema = z.object({
|
|
|
30
30
|
|
|
31
31
|
const CHUNK_FETCH_TIMEOUT_MS = 10_000;
|
|
32
32
|
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
33
34
|
export const StreamingChunkSequence = memo(function StreamingChunkSequence({
|
|
34
35
|
logId,
|
|
35
36
|
truncated,
|
|
@@ -51,6 +51,7 @@ export type TurnGroupProps = {
|
|
|
51
51
|
showLogClientMetadata?: boolean;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
54
55
|
export const TurnGroup = memo(function TurnGroup({
|
|
55
56
|
entries,
|
|
56
57
|
viewMode,
|
|
@@ -54,6 +54,7 @@ export type SegmentBarProps = {
|
|
|
54
54
|
* context segment. Segment mode can activate a JSON path; aggregate modes stay
|
|
55
55
|
* static so they do not imply a misleading jump target.
|
|
56
56
|
*/
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
57
58
|
export const SegmentBar = memo(function SegmentBar({
|
|
58
59
|
segments,
|
|
59
60
|
totalTokens,
|
|
@@ -38,6 +38,7 @@ function SystemReminderBlock({ text }: { text: string }): JSX.Element {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
41
42
|
export const TextBlock = memo(function TextBlock({ text }: { text: string }): JSX.Element {
|
|
42
43
|
if (text.includes("<system-reminder>")) {
|
|
43
44
|
return <SystemReminderBlock text={text} />;
|
|
@@ -57,6 +58,7 @@ export const TextBlock = memo(function TextBlock({ text }: { text: string }): JS
|
|
|
57
58
|
);
|
|
58
59
|
});
|
|
59
60
|
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
60
62
|
export const ThinkingBlock = memo(function ThinkingBlock({
|
|
61
63
|
thinking,
|
|
62
64
|
}: {
|
|
@@ -97,6 +99,7 @@ export const ThinkingBlock = memo(function ThinkingBlock({
|
|
|
97
99
|
);
|
|
98
100
|
});
|
|
99
101
|
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
100
103
|
export const ToolUseBlock = memo(function ToolUseBlock({
|
|
101
104
|
name,
|
|
102
105
|
input,
|
|
@@ -160,6 +163,7 @@ export const ToolUseBlock = memo(function ToolUseBlock({
|
|
|
160
163
|
);
|
|
161
164
|
});
|
|
162
165
|
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
163
167
|
export const ResponseContentBlockRenderer = memo(function ResponseContentBlockRenderer({
|
|
164
168
|
block,
|
|
165
169
|
toolIndex,
|
|
@@ -7,6 +7,7 @@ import { Separator } from "../../../ui/separator";
|
|
|
7
7
|
import type { ResponseToolFocus } from "../index";
|
|
8
8
|
import { ResponseContentBlockRenderer } from "./ContentBlocks";
|
|
9
9
|
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
10
11
|
export const StructuredResponseViewAnthropic = memo(function StructuredResponseViewAnthropic({
|
|
11
12
|
response,
|
|
12
13
|
toolFocus,
|
|
@@ -283,6 +283,7 @@ function ResponsesFunctionCallBlock({
|
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
286
287
|
export const OpenAIResponseView = memo(function OpenAIResponseView({
|
|
287
288
|
response,
|
|
288
289
|
toolFocus,
|
|
@@ -378,6 +379,7 @@ export const OpenAIResponseView = memo(function OpenAIResponseView({
|
|
|
378
379
|
);
|
|
379
380
|
});
|
|
380
381
|
|
|
382
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
381
383
|
export const OpenAIResponsesResponseView = memo(function OpenAIResponsesResponseView({
|
|
382
384
|
response,
|
|
383
385
|
toolFocus,
|
|
@@ -220,6 +220,7 @@ function ExpandCollapseButton({
|
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
223
224
|
const JsonNode = memo(function JsonNode({
|
|
224
225
|
name,
|
|
225
226
|
value,
|
|
@@ -479,6 +480,7 @@ export type JsonViewerFromStringProps = {
|
|
|
479
480
|
bulkRevision?: number;
|
|
480
481
|
};
|
|
481
482
|
|
|
483
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow -- named function gives React DevTools a readable displayName
|
|
482
484
|
export const JsonViewerFromString = memo(function JsonViewerFromString({
|
|
483
485
|
text,
|
|
484
486
|
defaultExpandDepth = 0,
|
package/src/contracts/json.ts
CHANGED
|
@@ -23,10 +23,15 @@ export const JsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Re-types a value as `JsonValue` without
|
|
27
|
-
*
|
|
26
|
+
* Re-types a value as `JsonValue` without a full recursive walk. A lightweight
|
|
27
|
+
* runtime guard rejects the most dangerous non-JSON types (undefined, bigint,
|
|
28
|
+
* functions) that would crash JSON.stringify downstream. Use when the value
|
|
29
|
+
* has already been validated by Zod or originated from JSON.parse.
|
|
28
30
|
*/
|
|
29
31
|
export function trustAsJsonValue<T>(value: T): JsonValue {
|
|
32
|
+
if (value === undefined || typeof value === "bigint" || typeof value === "function") {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
30
35
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
31
36
|
return value as unknown as JsonValue;
|
|
32
37
|
}
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Validates that a string is a well-formed http(s) URL. Rejects non-HTTP
|
|
5
|
+
* schemes (file:, ftp:, etc.) that could be used for SSRF. Local/private
|
|
6
|
+
* addresses are allowed because this tool legitimately proxies to local LLM
|
|
7
|
+
* servers (Ollama, LM Studio, etc.).
|
|
8
|
+
*/
|
|
9
|
+
function httpUrl(): z.ZodString {
|
|
10
|
+
return z.string().refine((val) => {
|
|
11
|
+
// Treat empty strings as "unset" so legacy/in-flight providers that
|
|
12
|
+
// store empty placeholders instead of null can still round-trip.
|
|
13
|
+
if (val.length === 0) return true;
|
|
14
|
+
try {
|
|
15
|
+
const parsed = new URL(val);
|
|
16
|
+
return parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}, "Must be a valid http(s) URL");
|
|
21
|
+
}
|
|
22
|
+
|
|
3
23
|
export const ProviderModelMetadataSchema = z.object({
|
|
4
24
|
model: z.string().min(1),
|
|
5
25
|
contextWindow: z.number().int().positive().optional(),
|
|
@@ -20,12 +40,12 @@ export const ProviderConfigSchema = z.object({
|
|
|
20
40
|
name: z.string(),
|
|
21
41
|
apiKey: z.string(),
|
|
22
42
|
model: z.string().optional(),
|
|
23
|
-
models: z.array(z.string()).
|
|
43
|
+
models: z.array(z.string()).optional().default([]),
|
|
24
44
|
format: z.enum(["anthropic", "openai"]).optional(),
|
|
25
|
-
baseUrl:
|
|
26
|
-
anthropicBaseUrl:
|
|
27
|
-
openaiBaseUrl:
|
|
28
|
-
openaiResponsesBaseUrl:
|
|
45
|
+
baseUrl: httpUrl().optional(),
|
|
46
|
+
anthropicBaseUrl: httpUrl().optional(),
|
|
47
|
+
openaiBaseUrl: httpUrl().optional(),
|
|
48
|
+
openaiResponsesBaseUrl: httpUrl().optional(),
|
|
29
49
|
authHeader: z.enum(["bearer", "x-api-key"]).optional().default("bearer"),
|
|
30
50
|
apiDocsUrl: z.string().optional(),
|
|
31
51
|
modelMetadataUrl: z.string().optional(),
|
package/src/mcp/server.ts
CHANGED
|
@@ -99,6 +99,7 @@ import {
|
|
|
99
99
|
updateProviderImpl,
|
|
100
100
|
type ToolResult,
|
|
101
101
|
} from "./toolHandlers";
|
|
102
|
+
import { logger } from "../proxy/logger";
|
|
102
103
|
|
|
103
104
|
// ---------------------------------------------------------------------------
|
|
104
105
|
// Lazy singleton: build the McpServer + transport on first use.
|
|
@@ -122,9 +123,17 @@ function buildServer(): ServerPair {
|
|
|
122
123
|
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
123
124
|
sessionIdGenerator: undefined, // stateless — see module docstring
|
|
124
125
|
});
|
|
125
|
-
// The connect() call is async
|
|
126
|
-
//
|
|
127
|
-
void server.connect(transport)
|
|
126
|
+
// The connect() call is async — handle rejection so a failed transport
|
|
127
|
+
// setup doesn't leave a broken singleton that silently fails all requests.
|
|
128
|
+
void server.connect(transport).then(
|
|
129
|
+
() => {},
|
|
130
|
+
(err) => {
|
|
131
|
+
logger.error(
|
|
132
|
+
"[mcp] server.connect failed:",
|
|
133
|
+
err instanceof Error ? err.message : String(err),
|
|
134
|
+
);
|
|
135
|
+
},
|
|
136
|
+
);
|
|
128
137
|
return { server, transport };
|
|
129
138
|
}
|
|
130
139
|
|
package/src/mcp/toolHandlers.ts
CHANGED
|
@@ -777,7 +777,12 @@ export async function diagnoseCaptureImpl(
|
|
|
777
777
|
const runtime = await getRuntimeConfigImpl(callApi);
|
|
778
778
|
if (runtime.isError === true) return runtime;
|
|
779
779
|
const runtimeText = runtime.content[0]?.text ?? "{}";
|
|
780
|
-
|
|
780
|
+
let runtimePayload: unknown = {};
|
|
781
|
+
try {
|
|
782
|
+
runtimePayload = JSON.parse(runtimeText);
|
|
783
|
+
} catch {
|
|
784
|
+
// Non-JSON runtime config text — treat as empty config and continue diagnostics
|
|
785
|
+
}
|
|
781
786
|
const runtimeRecord = isRecord(runtimePayload) ? runtimePayload : {};
|
|
782
787
|
const configRecord = isRecord(runtimeRecord["config"]) ? runtimeRecord["config"] : {};
|
|
783
788
|
const captureMode = stringField(configRecord, "captureMode");
|