@tonyclaw/agent-inspector 2.0.17 → 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/cli.js +18 -38
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-DDg7Cs4N.js → CompareDrawer-CepU-dLW.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-DbbK1y7N.js → ProxyViewerContainer-BG7rc33d.js} +4 -4
- package/.output/public/assets/{ReplayDialog-C1zWNkoz.js → ReplayDialog-DK6SPv8X.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-DR8OICOJ.js → RequestAnatomy-C_C6ZU3T.js} +1 -1
- package/.output/public/assets/{ResponseView-Dh9iSj6h.js → ResponseView-Bqpra4Zw.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-B_xElyH3.js → StreamingChunkSequence-CdPbpprq.js} +1 -1
- package/.output/public/assets/_sessionId-CsNARHj5.js +1 -0
- package/.output/public/assets/index-37NfO0zx.js +1 -0
- package/.output/public/assets/{main-bwZlEXw2.js → main-BRXsrxtv.js} +2 -2
- package/.output/server/{_sessionId-BEuJJhqT.mjs → _sessionId-B8Bbfs-v.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-yTO93GMz.mjs → CompareDrawer-TgGZLf1J.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-C8qCkHGB.mjs → ProxyViewerContainer-B_ppaNmQ.mjs} +7 -7
- package/.output/server/_ssr/{ReplayDialog-DRF9PG7Z.mjs → ReplayDialog-BXlajnMC.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-DBcuV_jV.mjs → RequestAnatomy-CCrx09-i.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-JJm78HZT.mjs → ResponseView-BxtMJrov.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-DyGKjBYx.mjs → StreamingChunkSequence-BlpdSPb8.mjs} +2 -2
- package/.output/server/_ssr/{index-T7JG28t6.mjs → index-BeTMNSJy.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-BJob8RN3.mjs → router-Ddl1tuU7.mjs} +27 -11
- package/.output/server/{_tanstack-start-manifest_v-CuiFi3XC.mjs → _tanstack-start-manifest_v-Bvdz_U0f.mjs} +1 -1
- package/.output/server/index.mjs +55 -55
- package/README.md +15 -0
- package/package.json +1 -1
- package/src/cli/doctor.ts +12 -5
- package/src/cli/templates/skill-onboard.ts +2 -20
- package/src/proxy/dataDir.ts +35 -13
- package/.output/public/assets/_sessionId-gv1a_NNu.js +0 -1
- package/.output/public/assets/index-u-LwDaeH.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as createRouter, a as createRootRoute, b as createFileRoute, l as lazyRouteComponent, O as Outlet, H as HeadContent, S as Scripts } from "../_libs/tanstack__react-router.mjs";
|
|
2
2
|
import { j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
3
3
|
import { S as SWRConfig } from "../_libs/swr.mjs";
|
|
4
|
-
import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync, copyFileSync, unlinkSync } from "node:fs";
|
|
4
|
+
import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync, copyFileSync, unlinkSync, cpSync, rmSync } from "node:fs";
|
|
5
5
|
import fs, { mkdir, appendFile, readFile, open, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
import path, { join, isAbsolute, dirname } from "node:path";
|
|
@@ -92,7 +92,7 @@ function RootDocument({ children }) {
|
|
|
92
92
|
] })
|
|
93
93
|
] });
|
|
94
94
|
}
|
|
95
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
95
|
+
const $$splitComponentImporter$1 = () => import("./index-BeTMNSJy.mjs");
|
|
96
96
|
const Route$r = createFileRoute("/")({
|
|
97
97
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
98
98
|
});
|
|
@@ -135,7 +135,7 @@ function decodeSessionIdFromPath(encoded) {
|
|
|
135
135
|
function getSessionPath(sessionId) {
|
|
136
136
|
return `/session/${encodeSessionIdForPath(sessionId)}`;
|
|
137
137
|
}
|
|
138
|
-
const $$splitComponentImporter = () => import("../_sessionId-
|
|
138
|
+
const $$splitComponentImporter = () => import("../_sessionId-B8Bbfs-v.mjs");
|
|
139
139
|
const Route$q = createFileRoute("/session/$sessionId")({
|
|
140
140
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
141
141
|
parseParams: (params) => ({
|
|
@@ -146,16 +146,19 @@ const Route$q = createFileRoute("/session/$sessionId")({
|
|
|
146
146
|
})
|
|
147
147
|
});
|
|
148
148
|
const CURRENT_DATA_DIR_NAME = ".agent-inspector";
|
|
149
|
-
const
|
|
149
|
+
const LEGACY_DATA_DIR_NAMES = [".llm-inspector", ".llm-agent"];
|
|
150
150
|
function getDataDir() {
|
|
151
|
-
|
|
151
|
+
migrateLegacyDataDirs();
|
|
152
|
+
return resolveDataDir();
|
|
152
153
|
}
|
|
153
154
|
function hasDataDirState(pathExists, dir) {
|
|
154
155
|
return pathExists(join(dir, "providers.json")) || pathExists(join(dir, "config.json")) || pathExists(join(dir, "logs")) || pathExists(join(dir, "chunks"));
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
function defaultBaseDir(env = process.env, platform = process.platform) {
|
|
158
|
+
return platform === "win32" ? env["USERPROFILE"] ?? env["APPDATA"] ?? "C:\\" : env["HOME"] ?? "/tmp";
|
|
159
|
+
}
|
|
160
|
+
function resolveDataDir(_pathExists, env = process.env, platform = process.platform) {
|
|
161
|
+
const base = defaultBaseDir(env, platform);
|
|
159
162
|
const dirEnv = env["AGENT_INSPECTOR_DATA_DIR"];
|
|
160
163
|
if (dirEnv !== void 0 && dirEnv !== "") {
|
|
161
164
|
return isAbsolute(dirEnv) ? dirEnv : join(base, dirEnv);
|
|
@@ -164,13 +167,26 @@ function resolveDataDir(pathExists, env = process.env, platform = process.platfo
|
|
|
164
167
|
if (legacyDirEnv !== void 0 && legacyDirEnv !== "") {
|
|
165
168
|
return isAbsolute(legacyDirEnv) ? legacyDirEnv : join(base, legacyDirEnv);
|
|
166
169
|
}
|
|
167
|
-
|
|
168
|
-
const legacyDir = join(base, LEGACY_DATA_DIR_NAME);
|
|
169
|
-
return !hasDataDirState(pathExists, currentDir) && hasDataDirState(pathExists, legacyDir) ? legacyDir : currentDir;
|
|
170
|
+
return join(base, CURRENT_DATA_DIR_NAME);
|
|
170
171
|
}
|
|
171
172
|
function hasExplicitDataDir() {
|
|
172
173
|
return process.env["AGENT_INSPECTOR_DATA_DIR"] !== void 0 && process.env["AGENT_INSPECTOR_DATA_DIR"] !== "" || process.env["AGENT_INSPECTOR_CONFIG_DIR"] !== void 0 && process.env["AGENT_INSPECTOR_CONFIG_DIR"] !== "";
|
|
173
174
|
}
|
|
175
|
+
function migrateLegacyDataDirs() {
|
|
176
|
+
if (hasExplicitDataDir()) return;
|
|
177
|
+
const base = defaultBaseDir();
|
|
178
|
+
const currentDir = join(base, CURRENT_DATA_DIR_NAME);
|
|
179
|
+
if (hasDataDirState(existsSync, currentDir)) return;
|
|
180
|
+
for (const legacyName of LEGACY_DATA_DIR_NAMES) {
|
|
181
|
+
const legacyDir = join(base, legacyName);
|
|
182
|
+
if (!existsSync(legacyDir)) continue;
|
|
183
|
+
try {
|
|
184
|
+
cpSync(legacyDir, currentDir, { recursive: true, force: true });
|
|
185
|
+
rmSync(legacyDir, { recursive: true, force: true });
|
|
186
|
+
} catch {
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
174
190
|
const RETENTION_DAYS = Number(process.env["LOG_RETENTION_DAYS"] ?? "7");
|
|
175
191
|
function resolveLogDir() {
|
|
176
192
|
const logDirEnv = process.env["LOG_DIR"];
|
|
@@ -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-BRXsrxtv.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-37NfO0zx.js", "/assets/ProxyViewerContainer-BG7rc33d.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-CsNARHj5.js", "/assets/ProxyViewerContainer-BG7rc33d.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/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/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/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/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-BRXsrxtv.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-27T08:
|
|
41
|
+
"mtime": "2026-06-27T08:36:43.687Z",
|
|
42
42
|
"size": 5915,
|
|
43
43
|
"path": "../public/assets/alibaba-TTwafVwX.svg"
|
|
44
44
|
},
|
|
45
|
-
"/assets/CompareDrawer-
|
|
45
|
+
"/assets/CompareDrawer-CepU-dLW.js": {
|
|
46
46
|
"type": "text/javascript; charset=utf-8",
|
|
47
|
-
"etag": '"49fe-
|
|
48
|
-
"mtime": "2026-06-27T08:
|
|
47
|
+
"etag": '"49fe-tnwk5QP+MvW6xIiE1eKLYM0+8Nk"',
|
|
48
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
49
49
|
"size": 18942,
|
|
50
|
-
"path": "../public/assets/CompareDrawer-
|
|
50
|
+
"path": "../public/assets/CompareDrawer-CepU-dLW.js"
|
|
51
|
+
},
|
|
52
|
+
"/assets/index-37NfO0zx.js": {
|
|
53
|
+
"type": "text/javascript; charset=utf-8",
|
|
54
|
+
"etag": '"74-v4YTqp1BJEeiYpqdSM0kSIiMfRI"',
|
|
55
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
56
|
+
"size": 116,
|
|
57
|
+
"path": "../public/assets/index-37NfO0zx.js"
|
|
51
58
|
},
|
|
52
59
|
"/assets/index-D_nZj9Vt.css": {
|
|
53
60
|
"type": "text/css; charset=utf-8",
|
|
54
61
|
"etag": '"1a275-7T1iSNG2p6BSsqLwdpfky+9evLw"',
|
|
55
|
-
"mtime": "2026-06-27T08:
|
|
62
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
56
63
|
"size": 107125,
|
|
57
64
|
"path": "../public/assets/index-D_nZj9Vt.css"
|
|
58
65
|
},
|
|
59
|
-
"/assets/
|
|
60
|
-
"type": "
|
|
61
|
-
"etag": '"
|
|
62
|
-
"mtime": "2026-06-27T08:
|
|
63
|
-
"size":
|
|
64
|
-
"path": "../public/assets/
|
|
66
|
+
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
67
|
+
"type": "image/jpeg",
|
|
68
|
+
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
69
|
+
"mtime": "2026-06-27T08:36:43.689Z",
|
|
70
|
+
"size": 6918,
|
|
71
|
+
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
65
72
|
},
|
|
66
|
-
"/assets/ReplayDialog-
|
|
73
|
+
"/assets/ReplayDialog-DK6SPv8X.js": {
|
|
67
74
|
"type": "text/javascript; charset=utf-8",
|
|
68
|
-
"etag": '"2361-
|
|
69
|
-
"mtime": "2026-06-27T08:
|
|
75
|
+
"etag": '"2361-0dSXxS+yW+fQ1Hwob3rFIHG/8kQ"',
|
|
76
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
70
77
|
"size": 9057,
|
|
71
|
-
"path": "../public/assets/ReplayDialog-
|
|
78
|
+
"path": "../public/assets/ReplayDialog-DK6SPv8X.js"
|
|
72
79
|
},
|
|
73
|
-
"/assets/RequestAnatomy-
|
|
80
|
+
"/assets/RequestAnatomy-C_C6ZU3T.js": {
|
|
74
81
|
"type": "text/javascript; charset=utf-8",
|
|
75
|
-
"etag": '"4485-
|
|
76
|
-
"mtime": "2026-06-27T08:
|
|
82
|
+
"etag": '"4485-V13BHPKtOZXhurKshD6hPJdOMjM"',
|
|
83
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
77
84
|
"size": 17541,
|
|
78
|
-
"path": "../public/assets/RequestAnatomy-
|
|
79
|
-
},
|
|
80
|
-
"/assets/minimax-BPMzvuL-.jpeg": {
|
|
81
|
-
"type": "image/jpeg",
|
|
82
|
-
"etag": '"1b06-IwivU89ko5UTMUM1/t7hn4sQK9A"',
|
|
83
|
-
"mtime": "2026-06-27T08:05:44.395Z",
|
|
84
|
-
"size": 6918,
|
|
85
|
-
"path": "../public/assets/minimax-BPMzvuL-.jpeg"
|
|
85
|
+
"path": "../public/assets/RequestAnatomy-C_C6ZU3T.js"
|
|
86
86
|
},
|
|
87
|
-
"/assets/ResponseView-
|
|
87
|
+
"/assets/ResponseView-Bqpra4Zw.js": {
|
|
88
88
|
"type": "text/javascript; charset=utf-8",
|
|
89
|
-
"etag": '"30cd-
|
|
90
|
-
"mtime": "2026-06-27T08:
|
|
89
|
+
"etag": '"30cd-PKvvu6r831JLikIZLvwX2YM2ppo"',
|
|
90
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
91
91
|
"size": 12493,
|
|
92
|
-
"path": "../public/assets/ResponseView-
|
|
92
|
+
"path": "../public/assets/ResponseView-Bqpra4Zw.js"
|
|
93
|
+
},
|
|
94
|
+
"/assets/main-BRXsrxtv.js": {
|
|
95
|
+
"type": "text/javascript; charset=utf-8",
|
|
96
|
+
"etag": '"51726-Qo0oVA+vO57y3JomfqOlDMWH9Rw"',
|
|
97
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
98
|
+
"size": 333606,
|
|
99
|
+
"path": "../public/assets/main-BRXsrxtv.js"
|
|
100
|
+
},
|
|
101
|
+
"/assets/StreamingChunkSequence-CdPbpprq.js": {
|
|
102
|
+
"type": "text/javascript; charset=utf-8",
|
|
103
|
+
"etag": '"d5b-YkikdGZkub445VaoQLxeiOhJX2I"',
|
|
104
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
105
|
+
"size": 3419,
|
|
106
|
+
"path": "../public/assets/StreamingChunkSequence-CdPbpprq.js"
|
|
93
107
|
},
|
|
94
108
|
"/assets/zhipuai-BPNAnxo-.svg": {
|
|
95
109
|
"type": "image/svg+xml",
|
|
96
110
|
"etag": '"2bf8-hNaLCTi89nOFCsIIfWpP/jrfo0s"',
|
|
97
|
-
"mtime": "2026-06-27T08:
|
|
111
|
+
"mtime": "2026-06-27T08:36:43.689Z",
|
|
98
112
|
"size": 11256,
|
|
99
113
|
"path": "../public/assets/zhipuai-BPNAnxo-.svg"
|
|
100
114
|
},
|
|
101
|
-
"/assets/
|
|
102
|
-
"type": "text/javascript; charset=utf-8",
|
|
103
|
-
"etag": '"d5b-63IZqsXb3mHwoP35jfQARaDbClI"',
|
|
104
|
-
"mtime": "2026-06-27T08:05:44.396Z",
|
|
105
|
-
"size": 3419,
|
|
106
|
-
"path": "../public/assets/StreamingChunkSequence-B_xElyH3.js"
|
|
107
|
-
},
|
|
108
|
-
"/assets/_sessionId-gv1a_NNu.js": {
|
|
115
|
+
"/assets/_sessionId-CsNARHj5.js": {
|
|
109
116
|
"type": "text/javascript; charset=utf-8",
|
|
110
|
-
"etag": '"d2
|
|
111
|
-
"mtime": "2026-06-27T08:
|
|
117
|
+
"etag": '"d2-/1womMucNX0MQlv0PbfYhhW01rc"',
|
|
118
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
112
119
|
"size": 210,
|
|
113
|
-
"path": "../public/assets/_sessionId-
|
|
114
|
-
},
|
|
115
|
-
"/assets/main-bwZlEXw2.js": {
|
|
116
|
-
"type": "text/javascript; charset=utf-8",
|
|
117
|
-
"etag": '"51726-1SJJ0BJfAuGmylFZ/0OY4VxlOhE"',
|
|
118
|
-
"mtime": "2026-06-27T08:05:44.395Z",
|
|
119
|
-
"size": 333606,
|
|
120
|
-
"path": "../public/assets/main-bwZlEXw2.js"
|
|
120
|
+
"path": "../public/assets/_sessionId-CsNARHj5.js"
|
|
121
121
|
},
|
|
122
122
|
"/assets/qwen-CONDcHqt.png": {
|
|
123
123
|
"type": "image/png",
|
|
124
124
|
"etag": '"572c3-cdJAPaHdOvFCGzuaQjagdgOu6XE"',
|
|
125
|
-
"mtime": "2026-06-27T08:
|
|
125
|
+
"mtime": "2026-06-27T08:36:43.689Z",
|
|
126
126
|
"size": 357059,
|
|
127
127
|
"path": "../public/assets/qwen-CONDcHqt.png"
|
|
128
128
|
},
|
|
129
|
-
"/assets/ProxyViewerContainer-
|
|
129
|
+
"/assets/ProxyViewerContainer-BG7rc33d.js": {
|
|
130
130
|
"type": "text/javascript; charset=utf-8",
|
|
131
|
-
"etag": '"aa779-
|
|
132
|
-
"mtime": "2026-06-27T08:
|
|
131
|
+
"etag": '"aa779-KSDOFLdOzzw4sKAgeq6GqW/vv6k"',
|
|
132
|
+
"mtime": "2026-06-27T08:36:43.690Z",
|
|
133
133
|
"size": 698233,
|
|
134
|
-
"path": "../public/assets/ProxyViewerContainer-
|
|
134
|
+
"path": "../public/assets/ProxyViewerContainer-BG7rc33d.js"
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
function readAsset(id) {
|
package/README.md
CHANGED
|
@@ -80,6 +80,21 @@ bun install
|
|
|
80
80
|
bun run dev
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
Run a local health check when you need to verify the proxy and installed
|
|
84
|
+
configuration:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
agent-inspector doctor
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The default doctor check covers proxy health, provider configuration, and
|
|
91
|
+
package metadata. Chrome companion source and zip artifacts are optional and
|
|
92
|
+
only checked when you ask for them explicitly:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
agent-inspector doctor --chrome-extension
|
|
96
|
+
```
|
|
97
|
+
|
|
83
98
|
Then point an AI coding tool at the proxy:
|
|
84
99
|
|
|
85
100
|
```bash
|
package/package.json
CHANGED
package/src/cli/doctor.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type DoctorOptions = {
|
|
|
31
31
|
port: number;
|
|
32
32
|
configDir: string | null;
|
|
33
33
|
providersJson: string | null;
|
|
34
|
+
chromeExtension: boolean;
|
|
34
35
|
help: boolean;
|
|
35
36
|
};
|
|
36
37
|
|
|
@@ -87,6 +88,7 @@ export function parseDoctorArgs(
|
|
|
87
88
|
port: envPort ?? DEFAULT_PORT,
|
|
88
89
|
configDir: null,
|
|
89
90
|
providersJson: null,
|
|
91
|
+
chromeExtension: false,
|
|
90
92
|
help: false,
|
|
91
93
|
};
|
|
92
94
|
|
|
@@ -127,6 +129,9 @@ export function parseDoctorArgs(
|
|
|
127
129
|
i++;
|
|
128
130
|
break;
|
|
129
131
|
}
|
|
132
|
+
case "--chrome-extension":
|
|
133
|
+
options.chromeExtension = true;
|
|
134
|
+
break;
|
|
130
135
|
default:
|
|
131
136
|
return { kind: "error", message: `doctor: unknown option ${arg}` };
|
|
132
137
|
}
|
|
@@ -396,13 +401,14 @@ export async function buildDoctorReport(
|
|
|
396
401
|
deps: DoctorDeps = createDoctorDeps(),
|
|
397
402
|
): Promise<DoctorReport> {
|
|
398
403
|
const rootDir = findProjectRoot(deps.cwd, deps);
|
|
399
|
-
const
|
|
404
|
+
const coreChecks = [
|
|
400
405
|
await checkProxyHealth(options.port, deps),
|
|
401
406
|
checkProviderConfig(options, deps),
|
|
402
407
|
checkPackage(rootDir, deps),
|
|
403
|
-
checkExtensionSource(rootDir, deps),
|
|
404
|
-
checkExtensionPackage(rootDir, deps),
|
|
405
408
|
];
|
|
409
|
+
const checks = options.chromeExtension
|
|
410
|
+
? [...coreChecks, checkExtensionSource(rootDir, deps), checkExtensionPackage(rootDir, deps)]
|
|
411
|
+
: coreChecks;
|
|
406
412
|
|
|
407
413
|
const passCount = checks.filter((item) => item.severity === "pass").length;
|
|
408
414
|
const warnCount = checks.filter((item) => item.severity === "warn").length;
|
|
@@ -437,9 +443,10 @@ export function doctorHelp(): string {
|
|
|
437
443
|
"agent-inspector doctor",
|
|
438
444
|
"",
|
|
439
445
|
"Usage:",
|
|
440
|
-
" agent-inspector doctor [--port <port>] [--config-dir <dir>] [--providers <json>]",
|
|
446
|
+
" agent-inspector doctor [--port <port>] [--config-dir <dir>] [--providers <json>] [--chrome-extension]",
|
|
441
447
|
"",
|
|
442
|
-
"Checks local proxy health, provider config presence, package metadata
|
|
448
|
+
"Checks local proxy health, provider config presence, and package metadata.",
|
|
449
|
+
"Pass --chrome-extension to also check Chrome companion source and packaged artifacts.",
|
|
443
450
|
"",
|
|
444
451
|
].join("\n");
|
|
445
452
|
}
|
|
@@ -101,8 +101,6 @@ agent_inspector_data_dir() {
|
|
|
101
101
|
case "$AGENT_INSPECTOR_DATA_DIR" in /*) printf '%s\n' "$AGENT_INSPECTOR_DATA_DIR" ;; *) printf '%s\n' "$base/$AGENT_INSPECTOR_DATA_DIR" ;; esac
|
|
102
102
|
elif [ -n "\${AGENT_INSPECTOR_CONFIG_DIR:-}" ]; then
|
|
103
103
|
case "$AGENT_INSPECTOR_CONFIG_DIR" in /*) printf '%s\n' "$AGENT_INSPECTOR_CONFIG_DIR" ;; *) printf '%s\n' "$base/$AGENT_INSPECTOR_CONFIG_DIR" ;; esac
|
|
104
|
-
elif { [ ! -e "$base/.agent-inspector/providers.json" ] && [ ! -e "$base/.agent-inspector/config.json" ] && [ ! -e "$base/.agent-inspector/logs" ] && [ ! -e "$base/.agent-inspector/chunks" ]; } && { [ -e "$base/.llm-inspector/providers.json" ] || [ -e "$base/.llm-inspector/config.json" ] || [ -e "$base/.llm-inspector/logs" ] || [ -e "$base/.llm-inspector/chunks" ]; }; then
|
|
105
|
-
printf '%s\n' "$base/.llm-inspector"
|
|
106
104
|
else
|
|
107
105
|
printf '%s\n' "$base/.agent-inspector"
|
|
108
106
|
fi
|
|
@@ -149,14 +147,7 @@ function Resolve-AgentInspectorDataDir {
|
|
|
149
147
|
if ([System.IO.Path]::IsPathRooted($env:AGENT_INSPECTOR_CONFIG_DIR)) { return $env:AGENT_INSPECTOR_CONFIG_DIR }
|
|
150
148
|
return (Join-Path $base $env:AGENT_INSPECTOR_CONFIG_DIR)
|
|
151
149
|
}
|
|
152
|
-
|
|
153
|
-
$legacy = Join-Path $base '.llm-inspector'
|
|
154
|
-
$currentHasState = (Test-Path (Join-Path $current 'providers.json')) -or (Test-Path (Join-Path $current 'config.json')) -or (Test-Path (Join-Path $current 'logs')) -or (Test-Path (Join-Path $current 'chunks'))
|
|
155
|
-
$legacyHasState = (Test-Path (Join-Path $legacy 'providers.json')) -or (Test-Path (Join-Path $legacy 'config.json')) -or (Test-Path (Join-Path $legacy 'logs')) -or (Test-Path (Join-Path $legacy 'chunks'))
|
|
156
|
-
if (-not $currentHasState -and $legacyHasState) {
|
|
157
|
-
return $legacy
|
|
158
|
-
}
|
|
159
|
-
return $current
|
|
150
|
+
return (Join-Path $base '.agent-inspector')
|
|
160
151
|
}
|
|
161
152
|
$dataDir = Resolve-AgentInspectorDataDir
|
|
162
153
|
$providers = Join-Path $dataDir 'providers.json'
|
|
@@ -272,8 +263,6 @@ agent_inspector_data_dir() {
|
|
|
272
263
|
case "$AGENT_INSPECTOR_DATA_DIR" in /*) printf '%s\n' "$AGENT_INSPECTOR_DATA_DIR" ;; *) printf '%s\n' "$base/$AGENT_INSPECTOR_DATA_DIR" ;; esac
|
|
273
264
|
elif [ -n "\${AGENT_INSPECTOR_CONFIG_DIR:-}" ]; then
|
|
274
265
|
case "$AGENT_INSPECTOR_CONFIG_DIR" in /*) printf '%s\n' "$AGENT_INSPECTOR_CONFIG_DIR" ;; *) printf '%s\n' "$base/$AGENT_INSPECTOR_CONFIG_DIR" ;; esac
|
|
275
|
-
elif { [ ! -e "$base/.agent-inspector/providers.json" ] && [ ! -e "$base/.agent-inspector/config.json" ] && [ ! -e "$base/.agent-inspector/logs" ] && [ ! -e "$base/.agent-inspector/chunks" ]; } && { [ -e "$base/.llm-inspector/providers.json" ] || [ -e "$base/.llm-inspector/config.json" ] || [ -e "$base/.llm-inspector/logs" ] || [ -e "$base/.llm-inspector/chunks" ]; }; then
|
|
276
|
-
printf '%s\n' "$base/.llm-inspector"
|
|
277
266
|
else
|
|
278
267
|
printf '%s\n' "$base/.agent-inspector"
|
|
279
268
|
fi
|
|
@@ -317,14 +306,7 @@ function Resolve-AgentInspectorDataDir {
|
|
|
317
306
|
if ([System.IO.Path]::IsPathRooted($env:AGENT_INSPECTOR_CONFIG_DIR)) { return $env:AGENT_INSPECTOR_CONFIG_DIR }
|
|
318
307
|
return (Join-Path $base $env:AGENT_INSPECTOR_CONFIG_DIR)
|
|
319
308
|
}
|
|
320
|
-
|
|
321
|
-
$legacy = Join-Path $base '.llm-inspector'
|
|
322
|
-
$currentHasState = (Test-Path (Join-Path $current 'providers.json')) -or (Test-Path (Join-Path $current 'config.json')) -or (Test-Path (Join-Path $current 'logs')) -or (Test-Path (Join-Path $current 'chunks'))
|
|
323
|
-
$legacyHasState = (Test-Path (Join-Path $legacy 'providers.json')) -or (Test-Path (Join-Path $legacy 'config.json')) -or (Test-Path (Join-Path $legacy 'logs')) -or (Test-Path (Join-Path $legacy 'chunks'))
|
|
324
|
-
if (-not $currentHasState -and $legacyHasState) {
|
|
325
|
-
return $legacy
|
|
326
|
-
}
|
|
327
|
-
return $current
|
|
309
|
+
return (Join-Path $base '.agent-inspector')
|
|
328
310
|
}
|
|
329
311
|
$dir = Resolve-AgentInspectorDataDir
|
|
330
312
|
$file = Join-Path $dir 'providers.json'
|
package/src/proxy/dataDir.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
1
|
+
import { cpSync, existsSync, rmSync } from "node:fs";
|
|
2
2
|
import { isAbsolute, join } from "node:path";
|
|
3
3
|
|
|
4
4
|
const CURRENT_DATA_DIR_NAME = ".agent-inspector";
|
|
5
|
-
const
|
|
5
|
+
const LEGACY_DATA_DIR_NAMES = [".llm-inspector", ".llm-agent"];
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Compute the directory where agent-inspector stores its on-disk state
|
|
@@ -16,8 +16,6 @@ const LEGACY_DATA_DIR_NAME = ".llm-inspector";
|
|
|
16
16
|
* with the runtime config; treated as a directory *name* (relative
|
|
17
17
|
* to the OS-specific base) when not absolute.
|
|
18
18
|
* 3. OS-specific base + `.agent-inspector`.
|
|
19
|
-
* 4. Backward compatibility: if `.agent-inspector` has no known state
|
|
20
|
-
* files but `.llm-inspector` does, reuse `.llm-inspector`.
|
|
21
19
|
*
|
|
22
20
|
* Windows base is `%USERPROFILE%` (falling back to `%APPDATA%`, then `C:\`).
|
|
23
21
|
* macOS / Linux base is `$HOME` (falling back to `/tmp`).
|
|
@@ -26,6 +24,7 @@ const LEGACY_DATA_DIR_NAME = ".llm-inspector";
|
|
|
26
24
|
* directory after this module has been imported.
|
|
27
25
|
*/
|
|
28
26
|
export function getDataDir(): string {
|
|
27
|
+
migrateLegacyDataDirs();
|
|
29
28
|
return resolveDataDir(existsSync);
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -41,15 +40,21 @@ function hasDataDirState(pathExists: PathExists, dir: string): boolean {
|
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
pathExists: PathExists,
|
|
43
|
+
function defaultBaseDir(
|
|
46
44
|
env: DataDirEnv = process.env,
|
|
47
45
|
platform: typeof process.platform = process.platform,
|
|
48
46
|
): string {
|
|
49
|
-
|
|
50
|
-
const base = isWindows
|
|
47
|
+
return platform === "win32"
|
|
51
48
|
? (env["USERPROFILE"] ?? env["APPDATA"] ?? "C:\\")
|
|
52
49
|
: (env["HOME"] ?? "/tmp");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function resolveDataDir(
|
|
53
|
+
_pathExists: PathExists,
|
|
54
|
+
env: DataDirEnv = process.env,
|
|
55
|
+
platform: typeof process.platform = process.platform,
|
|
56
|
+
): string {
|
|
57
|
+
const base = defaultBaseDir(env, platform);
|
|
53
58
|
|
|
54
59
|
const dirEnv = env["AGENT_INSPECTOR_DATA_DIR"];
|
|
55
60
|
if (dirEnv !== undefined && dirEnv !== "") {
|
|
@@ -64,11 +69,7 @@ export function resolveDataDir(
|
|
|
64
69
|
return isAbsolute(legacyDirEnv) ? legacyDirEnv : join(base, legacyDirEnv);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
const legacyDir = join(base, LEGACY_DATA_DIR_NAME);
|
|
69
|
-
return !hasDataDirState(pathExists, currentDir) && hasDataDirState(pathExists, legacyDir)
|
|
70
|
-
? legacyDir
|
|
71
|
-
: currentDir;
|
|
72
|
+
return join(base, CURRENT_DATA_DIR_NAME);
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
/**
|
|
@@ -84,3 +85,24 @@ export function hasExplicitDataDir(): boolean {
|
|
|
84
85
|
process.env["AGENT_INSPECTOR_CONFIG_DIR"] !== "")
|
|
85
86
|
);
|
|
86
87
|
}
|
|
88
|
+
|
|
89
|
+
function migrateLegacyDataDirs(): void {
|
|
90
|
+
if (hasExplicitDataDir()) return;
|
|
91
|
+
|
|
92
|
+
const base = defaultBaseDir();
|
|
93
|
+
const currentDir = join(base, CURRENT_DATA_DIR_NAME);
|
|
94
|
+
if (hasDataDirState(existsSync, currentDir)) return;
|
|
95
|
+
|
|
96
|
+
for (const legacyName of LEGACY_DATA_DIR_NAMES) {
|
|
97
|
+
const legacyDir = join(base, legacyName);
|
|
98
|
+
if (!existsSync(legacyDir)) continue;
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
cpSync(legacyDir, currentDir, { recursive: true, force: true });
|
|
102
|
+
rmSync(legacyDir, { recursive: true, force: true });
|
|
103
|
+
} catch {
|
|
104
|
+
// Best-effort migration: startup must continue even when the old
|
|
105
|
+
// directory is locked or partially unreadable. The next call can retry.
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as s,j as e}from"./main-bwZlEXw2.js";import{P as i}from"./ProxyViewerContainer-DbbK1y7N.js";function t(){const{sessionId:o}=s.useParams();return e.jsx(i,{initialSessionId:o},o)}export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as o}from"./ProxyViewerContainer-DbbK1y7N.js";import"./main-bwZlEXw2.js";const r=o;export{r as component};
|