@tonyclaw/agent-inspector 2.0.26 → 2.0.28
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 +169 -13
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-DBTFzxG5.js → CompareDrawer-CicCP3Hb.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-ivZk8MgE.js → ProxyViewerContainer-BccuA6p5.js} +4 -4
- package/.output/public/assets/{ReplayDialog-syW2hDNE.js → ReplayDialog-Bc8q3ujm.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-BkuRtY9o.js → RequestAnatomy-Coyy3zcH.js} +1 -1
- package/.output/public/assets/{ResponseView-BwyvEvoE.js → ResponseView-BWJzgh0c.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-BY4MbPKg.js → StreamingChunkSequence-BSC3uuE5.js} +1 -1
- package/.output/public/assets/_sessionId-9rEF0uSE.js +1 -0
- package/.output/public/assets/index-B9_VaAWl.js +1 -0
- package/.output/public/assets/{main-DKRDRBdd.js → main-Brj0Gn91.js} +2 -2
- package/.output/server/_libs/modelcontextprotocol__server.mjs +228 -0
- package/.output/server/{_sessionId-VDd4N_1B.mjs → _sessionId-DDdyKVG-.mjs} +3 -3
- package/.output/server/_ssr/{CompareDrawer-BQZlxsOC.mjs → CompareDrawer-XSExe2ml.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-njY2oQCc.mjs → ProxyViewerContainer-B5pIiBZN.mjs} +7 -7
- package/.output/server/_ssr/{ReplayDialog-B8lkdAIh.mjs → ReplayDialog-BOAu0ric.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-CwOTfdwS.mjs → RequestAnatomy-C8Q5lozD.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-3Iz_mZpd.mjs → ResponseView-a_iJfPUF.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-hmJcQNW5.mjs → StreamingChunkSequence-YMKC0j8U.mjs} +2 -2
- package/.output/server/_ssr/{index-UuTKM4aC.mjs → index-CkDwBPzI.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-C7InHrxE.mjs → router-DXOXdFFM.mjs} +1816 -151
- package/.output/server/_tanstack-start-manifest_v-DPf3uJys.mjs +4 -0
- package/.output/server/index.mjs +64 -64
- package/README.md +55 -1
- package/package.json +1 -1
- package/src/cli/networkHints.ts +150 -0
- package/src/cli.ts +72 -13
- package/src/lib/runContract.ts +162 -0
- package/src/mcp/server.ts +554 -2
- package/src/mcp/toolHandlers.ts +154 -0
- package/src/proxy/evidenceAnalysis.ts +522 -0
- package/src/proxy/evidenceExporter.ts +215 -0
- package/src/proxy/logSearch.ts +118 -0
- package/src/proxy/runFailures.ts +100 -0
- package/src/proxy/runStore.ts +159 -0
- package/src/routes/api/logs.ts +16 -0
- package/src/routes/api/runs.$runId.evidence.ts +62 -0
- package/src/routes/api/runs.$runId.ts +50 -0
- package/src/routes/api/runs.ts +58 -0
- package/.output/public/assets/_sessionId-XlPUgIIb.js +0 -1
- package/.output/public/assets/index-By11a28-.js +0 -1
- package/.output/server/_tanstack-start-manifest_v-B6yfnMHA.mjs +0 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { UpdateInspectorRunInputSchema } from "../../lib/runContract";
|
|
3
|
+
import { getRun, updateRun } from "../../proxy/runStore";
|
|
4
|
+
|
|
5
|
+
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
6
|
+
|
|
7
|
+
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
8
|
+
try {
|
|
9
|
+
const raw = await request.text();
|
|
10
|
+
if (raw.trim().length === 0) return { ok: true, value: {} };
|
|
11
|
+
return { ok: true, value: JSON.parse(raw) };
|
|
12
|
+
} catch {
|
|
13
|
+
return { ok: false };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Route = createFileRoute("/api/runs/$runId")({
|
|
18
|
+
server: {
|
|
19
|
+
handlers: {
|
|
20
|
+
GET: ({ params }: { params: { runId: string } }) => {
|
|
21
|
+
const run = getRun(params.runId);
|
|
22
|
+
if (run === null) {
|
|
23
|
+
return Response.json({ error: "Run not found" }, { status: 404 });
|
|
24
|
+
}
|
|
25
|
+
return Response.json(run);
|
|
26
|
+
},
|
|
27
|
+
PATCH: async ({ params, request }: { params: { runId: string }; request: Request }) => {
|
|
28
|
+
const body = await readJsonBody(request);
|
|
29
|
+
if (!body.ok) {
|
|
30
|
+
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const parsed = UpdateInspectorRunInputSchema.safeParse(body.value);
|
|
34
|
+
if (!parsed.success) {
|
|
35
|
+
return Response.json(
|
|
36
|
+
{ error: "Invalid request body", details: parsed.error.format() },
|
|
37
|
+
{ status: 400 },
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const updated = updateRun(params.runId, parsed.data);
|
|
42
|
+
if (updated === null) {
|
|
43
|
+
return Response.json({ error: "Run not found" }, { status: 404 });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return Response.json(updated);
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { CreateInspectorRunInputSchema } from "../../lib/runContract";
|
|
3
|
+
import { RECENT_FAILURES_DEFAULT_LIMIT, listRecentFailures } from "../../proxy/runFailures";
|
|
4
|
+
import { createRun, listRuns } from "../../proxy/runStore";
|
|
5
|
+
|
|
6
|
+
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
7
|
+
|
|
8
|
+
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
9
|
+
try {
|
|
10
|
+
const raw = await request.text();
|
|
11
|
+
if (raw.trim().length === 0) return { ok: true, value: undefined };
|
|
12
|
+
return { ok: true, value: JSON.parse(raw) };
|
|
13
|
+
} catch {
|
|
14
|
+
return { ok: false };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parsePositiveInt(value: string | null, fallback: number): number {
|
|
19
|
+
if (value === null) return fallback;
|
|
20
|
+
const parsed = Number(value);
|
|
21
|
+
if (!Number.isInteger(parsed) || parsed < 1) return fallback;
|
|
22
|
+
return parsed;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Route = createFileRoute("/api/runs")({
|
|
26
|
+
server: {
|
|
27
|
+
handlers: {
|
|
28
|
+
GET: ({ request }: { request: Request }) => {
|
|
29
|
+
const url = new URL(request.url);
|
|
30
|
+
if (url.searchParams.get("failures") === "1") {
|
|
31
|
+
const limit = parsePositiveInt(
|
|
32
|
+
url.searchParams.get("limit"),
|
|
33
|
+
RECENT_FAILURES_DEFAULT_LIMIT,
|
|
34
|
+
);
|
|
35
|
+
return Response.json(listRecentFailures(limit));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return Response.json({ runs: listRuns() });
|
|
39
|
+
},
|
|
40
|
+
POST: async ({ request }: { request: Request }) => {
|
|
41
|
+
const body = await readJsonBody(request);
|
|
42
|
+
if (!body.ok) {
|
|
43
|
+
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const parsed = CreateInspectorRunInputSchema.safeParse(body.value);
|
|
47
|
+
if (!parsed.success) {
|
|
48
|
+
return Response.json(
|
|
49
|
+
{ error: "Invalid request body", details: parsed.error.format() },
|
|
50
|
+
{ status: 400 },
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return Response.json(createRun(parsed.data), { status: 201 });
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as s,j as e}from"./main-DKRDRBdd.js";import{P as i}from"./ProxyViewerContainer-ivZk8MgE.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-ivZk8MgE.js";import"./main-DKRDRBdd.js";const r=o;export{r as component};
|
|
@@ -1,4 +0,0 @@
|
|
|
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-DKRDRBdd.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-By11a28-.js", "/assets/ProxyViewerContainer-ivZk8MgE.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-XlPUgIIb.js", "/assets/ProxyViewerContainer-ivZk8MgE.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-DKRDRBdd.js" });
|
|
2
|
-
export {
|
|
3
|
-
tsrStartManifest
|
|
4
|
-
};
|