@tonyclaw/agent-inspector 3.0.7 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/cli.js +245 -171
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-C0Kbsm-Q.js → CompareDrawer-CJKL4LMm.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-DBUy29O-.js +106 -0
- package/.output/public/assets/ReplayDialog-BYanl-a_.js +1 -0
- package/.output/public/assets/{RequestAnatomy-fa0JXy5p.js → RequestAnatomy-DvPz1jqE.js} +1 -1
- package/.output/public/assets/ResponseView-sZnxp9GN.js +3 -0
- package/.output/public/assets/StreamingChunkSequence-G-tiYiBd.js +1 -0
- package/.output/public/assets/{_sessionId-D5fYH2C0.js → _sessionId-_hDcsmXq.js} +1 -1
- package/.output/public/assets/agent-inspector-58K1_MsC.ico +0 -0
- package/.output/public/assets/index-DAPAWsAd.js +1 -0
- package/.output/public/assets/index-DspnLqUW.css +1 -0
- package/.output/public/assets/{index-BEsqvywM.js → index-SuOSQb2_.js} +1 -1
- package/.output/public/assets/{json-viewer-B0QRbMSf.js → json-viewer-yQdhgjaw.js} +1 -1
- package/.output/public/assets/{main-CuKZD7n0.js → main-CgjcDxjR.js} +2 -2
- package/.output/server/_libs/radix-ui__react-dialog.mjs +2 -2
- package/.output/server/{_sessionId-DdBTK3qm.mjs → _sessionId-BGISf2En.mjs} +3 -3
- package/.output/server/_ssr/{CompareDrawer-m82cVZ73.mjs → CompareDrawer-s-UF9gW3.mjs} +2 -2
- package/.output/server/_ssr/{ProxyViewerContainer-7geuf78f.mjs → ProxyViewerContainer-C0Sbz9ED.mjs} +1033 -530
- package/.output/server/_ssr/{ReplayDialog-B8RlWLLH.mjs → ReplayDialog-DvS8gvJr.mjs} +58 -23
- package/.output/server/_ssr/{RequestAnatomy-BE7pmwpv.mjs → RequestAnatomy-BwhWglJL.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-D-sDsdQr.mjs → ResponseView-wBVreqQf.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-DU_hThJr.mjs → StreamingChunkSequence-Dr6eg-MJ.mjs} +30 -20
- package/.output/server/_ssr/{index-D0sV8UbE.mjs → index-B98Wia1X.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-CaDh1zrw.mjs → json-viewer-D7L8y0FH.mjs} +2 -2
- package/.output/server/_ssr/{router-Zh2iZ_u0.mjs → router-g9mo0nWT.mjs} +459 -196
- package/.output/server/_tanstack-start-manifest_v-CbGc-o50.mjs +4 -0
- package/.output/server/index.mjs +76 -69
- package/package.json +1 -1
- package/src/assets/IDE/opencode.svg +1 -1
- package/src/assets/IDE/xiaomimimo.svg +1 -1
- package/src/cli/detect-tools.ts +2 -27
- package/src/cli/templates/codex-skill-onboard.ts +1 -1
- package/src/cli/templates/skill-onboard.ts +2 -3
- package/src/cli.ts +9 -86
- package/src/components/ProxyViewer.tsx +249 -37
- package/src/components/ProxyViewerContainer.tsx +167 -22
- package/src/components/clients/ClientLogo.tsx +38 -3
- package/src/components/ecosystem/AgentLabDialog.tsx +204 -3
- package/src/components/groups/GroupsDialog.tsx +28 -40
- package/src/components/providers/ImportWizardDialog.tsx +51 -101
- package/src/components/providers/ProvidersPanel.tsx +82 -68
- package/src/components/providers/SettingsDialog.tsx +11 -12
- package/src/components/proxy-viewer/AgentTraceSummary.tsx +15 -23
- package/src/components/proxy-viewer/ReplayDialog.tsx +65 -22
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +33 -20
- package/src/components/proxy-viewer/TurnGroup.tsx +0 -16
- package/src/components/proxy-viewer/log-formats/anthropic.ts +5 -5
- package/src/components/proxy-viewer/log-formats/openai.ts +7 -10
- package/src/components/proxy-viewer/requestTools.ts +5 -2
- package/src/lib/apiClient.ts +43 -10
- package/src/lib/ecosystemContract.ts +32 -0
- package/src/lib/export-logs.ts +37 -3
- package/src/proxy/ecosystemRegistry.ts +244 -0
- package/src/proxy/ecosystemTasks.ts +153 -0
- package/src/proxy/platformCommands.ts +212 -0
- package/src/proxy/socketTracker.ts +84 -143
- package/src/routes/api/ecosystem.packages.$packageId.help.ts +16 -0
- package/src/routes/api/ecosystem.packages.$packageId.install.ts +16 -0
- package/src/routes/api/ecosystem.packages.$packageId.runner-presets.ts +19 -0
- package/src/routes/api/ecosystem.packages.$packageId.upgrade.ts +16 -0
- package/src/routes/api/ecosystem.packages.ts +1 -248
- package/src/routes/api/ecosystem.tasks.$taskId.ts +16 -0
- package/src/routes/api/ecosystem.tasks.ts +12 -0
- package/src/routes/api/providers.$providerId.test.log.ts +28 -24
- package/.output/public/assets/ProxyViewerContainer-p-rpYyiF.js +0 -106
- package/.output/public/assets/ReplayDialog-CM3dhP8v.js +0 -1
- package/.output/public/assets/ResponseView-Bq6sC7Ay.js +0 -3
- package/.output/public/assets/StreamingChunkSequence-CGOun3Df.js +0 -1
- package/.output/public/assets/index-C29Olfzt.js +0 -1
- package/.output/public/assets/index-DgANE0r3.css +0 -1
- package/.output/server/_tanstack-start-manifest_v-LCE-2AaF.mjs +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { u as useProviders, D as Dialog,
|
|
3
|
-
import { ResponseView } from "./ResponseView-
|
|
4
|
-
import { C as CapturedLogSchema } from "./router-
|
|
2
|
+
import { u as useProviders, d as fetchJsonWithTimeout, D as Dialog, e as DialogContent, h as DialogHeader, i as DialogTitle, T as Tabs, j as TabsList, k as TabsTrigger, l as TabsContent, m as Button, n as TooltipProvider, o as Tooltip, p as TooltipTrigger, q as TooltipContent, s as dispatchLogFocusRequest, A as ApiTimeoutError } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
3
|
+
import { ResponseView } from "./ResponseView-wBVreqQf.mjs";
|
|
4
|
+
import { C as CapturedLogSchema } from "./router-g9mo0nWT.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
7
7
|
import { am as RotateCcw, ay as Braces, az as Minimize2 } from "../_libs/lucide-react.mjs";
|
|
@@ -223,6 +223,8 @@ const ReplayHistorySchema = object({
|
|
|
223
223
|
logs: array(CapturedLogSchema),
|
|
224
224
|
total: number()
|
|
225
225
|
});
|
|
226
|
+
const REPLAY_TIMEOUT_MS = 6e4;
|
|
227
|
+
const REPLAY_HISTORY_TIMEOUT_MS = 1e4;
|
|
226
228
|
function formatJsonForEdit(value) {
|
|
227
229
|
try {
|
|
228
230
|
const parsed = JSON.parse(value);
|
|
@@ -330,56 +332,89 @@ function ReplayDialog({
|
|
|
330
332
|
const [replayHistory, setReplayHistory] = reactExports.useState([]);
|
|
331
333
|
const [loading, setLoading] = reactExports.useState(false);
|
|
332
334
|
const [error, setError] = reactExports.useState(null);
|
|
335
|
+
const replayAbortRef = reactExports.useRef(null);
|
|
336
|
+
const replayRequestIdRef = reactExports.useRef(0);
|
|
333
337
|
const jsonEditState = reactExports.useMemo(() => readJsonEditState(modifiedBody), [modifiedBody]);
|
|
338
|
+
const cancelReplay = reactExports.useCallback(() => {
|
|
339
|
+
replayRequestIdRef.current += 1;
|
|
340
|
+
replayAbortRef.current?.abort();
|
|
341
|
+
replayAbortRef.current = null;
|
|
342
|
+
setLoading(false);
|
|
343
|
+
}, []);
|
|
334
344
|
const refreshReplayHistory = reactExports.useCallback(async () => {
|
|
335
345
|
if (!open) return;
|
|
336
346
|
try {
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
setReplayHistory(
|
|
347
|
+
const data = await fetchJsonWithTimeout(
|
|
348
|
+
`/api/logs?replayOf=${String(log.id)}`,
|
|
349
|
+
ReplayHistorySchema,
|
|
350
|
+
REPLAY_HISTORY_TIMEOUT_MS
|
|
351
|
+
);
|
|
352
|
+
setReplayHistory(data.logs);
|
|
343
353
|
} catch {
|
|
344
354
|
}
|
|
345
355
|
}, [log.id, open]);
|
|
346
356
|
reactExports.useEffect(() => {
|
|
347
357
|
void refreshReplayHistory();
|
|
348
358
|
}, [refreshReplayHistory]);
|
|
359
|
+
reactExports.useEffect(() => {
|
|
360
|
+
if (open) return void 0;
|
|
361
|
+
cancelReplay();
|
|
362
|
+
return void 0;
|
|
363
|
+
}, [cancelReplay, open]);
|
|
364
|
+
reactExports.useEffect(() => {
|
|
365
|
+
return () => {
|
|
366
|
+
replayRequestIdRef.current += 1;
|
|
367
|
+
replayAbortRef.current?.abort();
|
|
368
|
+
replayAbortRef.current = null;
|
|
369
|
+
};
|
|
370
|
+
}, []);
|
|
349
371
|
async function handleReplay() {
|
|
350
372
|
if (!jsonEditState.valid) {
|
|
351
373
|
setError("Request body must be valid JSON before replay.");
|
|
352
374
|
return;
|
|
353
375
|
}
|
|
376
|
+
replayAbortRef.current?.abort();
|
|
377
|
+
const requestId = replayRequestIdRef.current + 1;
|
|
378
|
+
replayRequestIdRef.current = requestId;
|
|
379
|
+
const controller = new AbortController();
|
|
380
|
+
replayAbortRef.current = controller;
|
|
354
381
|
setLoading(true);
|
|
355
382
|
setError(null);
|
|
356
383
|
setReplayResult(null);
|
|
357
384
|
try {
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const data = parsed.data;
|
|
385
|
+
const data = await fetchJsonWithTimeout(
|
|
386
|
+
`/api/logs/${log.id}/replay`,
|
|
387
|
+
ReplayResultSchema,
|
|
388
|
+
REPLAY_TIMEOUT_MS,
|
|
389
|
+
{
|
|
390
|
+
method: "POST",
|
|
391
|
+
headers: { "Content-Type": "application/json" },
|
|
392
|
+
body: JSON.stringify({ modifiedBody }),
|
|
393
|
+
signal: controller.signal
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
if (replayRequestIdRef.current !== requestId) return;
|
|
371
397
|
setReplayResult(data);
|
|
372
398
|
await refreshReplayHistory();
|
|
373
399
|
if (!data.success) {
|
|
374
400
|
setError(data.error ?? "Replay failed");
|
|
375
401
|
}
|
|
376
402
|
} catch (err) {
|
|
403
|
+
if (replayRequestIdRef.current !== requestId) return;
|
|
404
|
+
if (err instanceof ApiTimeoutError || err instanceof DOMException && err.name === "AbortError") {
|
|
405
|
+
setError("Replay timed out or was canceled.");
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
377
408
|
setError(err instanceof Error ? err.message : "Network error");
|
|
378
409
|
} finally {
|
|
379
|
-
|
|
410
|
+
if (replayRequestIdRef.current === requestId) {
|
|
411
|
+
replayAbortRef.current = null;
|
|
412
|
+
setLoading(false);
|
|
413
|
+
}
|
|
380
414
|
}
|
|
381
415
|
}
|
|
382
416
|
function handleClose() {
|
|
417
|
+
cancelReplay();
|
|
383
418
|
setReplayResult(null);
|
|
384
419
|
setError(null);
|
|
385
420
|
onOpenChange(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { u as useProviders,
|
|
3
|
-
import "./router-
|
|
2
|
+
import { u as useProviders, t as analyzeContextIntelligence, f as formatTokens, n as TooltipProvider, c as cn, o as Tooltip, p as TooltipTrigger, q as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, v as ANATOMY_ROLE_LABELS, w as formatContextWindowTokens, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
3
|
+
import "./router-g9mo0nWT.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { I as Info, a as ChevronDown, h as ChevronRight } from "../_libs/lucide-react.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { g as getLogFormatAdapter, f as formatTokens, c as cn,
|
|
3
|
-
import { s as safeGetOwnProperty } from "./router-
|
|
2
|
+
import { g as getLogFormatAdapter, f as formatTokens, c as cn, x as getStatusCategory, B as Badge, y as Collapsible, z as CollapsibleTrigger, E as CollapsibleContent, F as ScrollArea, G as LazyJsonViewer, H as safeJsonValue } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
3
|
+
import { s as safeGetOwnProperty } from "./router-g9mo0nWT.mjs";
|
|
4
4
|
import "../_libs/jszip.mjs";
|
|
5
5
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
6
6
|
import { $ as Zap, T as TriangleAlert, aA as CircleStop, a1 as Brain, a as ChevronDown, h as ChevronRight, r as Terminal } from "../_libs/lucide-react.mjs";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "./router-
|
|
4
|
-
import "../_libs/modelcontextprotocol__server.mjs";
|
|
2
|
+
import { d as fetchJsonWithTimeout, n as TooltipProvider, o as Tooltip, p as TooltipTrigger, B as Badge, q as TooltipContent, G as LazyJsonViewer } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
3
|
+
import { S as StreamingChunkSchema$1 } from "./router-g9mo0nWT.mjs";
|
|
5
4
|
import "../_libs/jszip.mjs";
|
|
5
|
+
import "../_libs/modelcontextprotocol__server.mjs";
|
|
6
6
|
import { a as ChevronDown, h as ChevronRight, L as LoaderCircle } from "../_libs/lucide-react.mjs";
|
|
7
|
+
import { d as object, c as boolean, a as array } from "../_libs/zod.mjs";
|
|
7
8
|
import "../_libs/swr.mjs";
|
|
8
9
|
import "../_libs/use-sync-external-store.mjs";
|
|
9
10
|
import "../_libs/dequal.mjs";
|
|
@@ -55,7 +56,6 @@ import "../_libs/radix-ui__react-arrow.mjs";
|
|
|
55
56
|
import "../_libs/radix-ui__react-use-size.mjs";
|
|
56
57
|
import "../_libs/radix-ui__react-use-previous.mjs";
|
|
57
58
|
import "../_libs/@radix-ui/react-visually-hidden+[...].mjs";
|
|
58
|
-
import "../_libs/zod.mjs";
|
|
59
59
|
import "../_libs/radix-ui__react-tabs.mjs";
|
|
60
60
|
import "../_libs/radix-ui__react-roving-focus.mjs";
|
|
61
61
|
import "../_libs/radix-ui__react-tooltip.mjs";
|
|
@@ -115,6 +115,11 @@ import "../_libs/lie.mjs";
|
|
|
115
115
|
import "../_libs/immediate.mjs";
|
|
116
116
|
import "../_libs/setimmediate.mjs";
|
|
117
117
|
import "../_libs/pako.mjs";
|
|
118
|
+
const StreamingChunksResponseSchema = object({
|
|
119
|
+
chunks: array(StreamingChunkSchema$1),
|
|
120
|
+
truncated: boolean().optional()
|
|
121
|
+
});
|
|
122
|
+
const CHUNK_FETCH_TIMEOUT_MS = 1e4;
|
|
118
123
|
const StreamingChunkSequence = reactExports.memo(function StreamingChunkSequence2({
|
|
119
124
|
logId,
|
|
120
125
|
truncated
|
|
@@ -122,26 +127,31 @@ const StreamingChunkSequence = reactExports.memo(function StreamingChunkSequence
|
|
|
122
127
|
const [containerExpanded, setContainerExpanded] = reactExports.useState(false);
|
|
123
128
|
const [chunkState, setChunkState] = reactExports.useState({ status: "idle" });
|
|
124
129
|
const [expandedIndices, setExpandedIndices] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
130
|
+
const loadedLogIdRef = reactExports.useRef(null);
|
|
125
131
|
reactExports.useEffect(() => {
|
|
126
|
-
if (!containerExpanded
|
|
127
|
-
|
|
132
|
+
if (!containerExpanded) return;
|
|
133
|
+
if (loadedLogIdRef.current === logId) return;
|
|
134
|
+
const controller = new AbortController();
|
|
128
135
|
setChunkState({ status: "loading" });
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
}).catch(() => {
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
void fetchJsonWithTimeout(
|
|
137
|
+
`/api/logs/${logId}/chunks`,
|
|
138
|
+
StreamingChunksResponseSchema,
|
|
139
|
+
CHUNK_FETCH_TIMEOUT_MS,
|
|
140
|
+
{ signal: controller.signal },
|
|
141
|
+
() => "Chunks not found"
|
|
142
|
+
).then((data) => {
|
|
143
|
+
loadedLogIdRef.current = logId;
|
|
144
|
+
setChunkState({ status: "success", chunks: data.chunks });
|
|
145
|
+
}).catch((error) => {
|
|
146
|
+
if (error instanceof DOMException && error.name === "AbortError") return;
|
|
147
|
+
loadedLogIdRef.current = null;
|
|
148
|
+
setChunkState({
|
|
149
|
+
status: "error",
|
|
150
|
+
message: error instanceof Error ? error.message : "Chunk data unavailable"
|
|
151
|
+
});
|
|
142
152
|
});
|
|
143
153
|
return () => {
|
|
144
|
-
|
|
154
|
+
controller.abort();
|
|
145
155
|
};
|
|
146
156
|
}, [containerExpanded, logId]);
|
|
147
157
|
const groups = reactExports.useMemo(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-
|
|
1
|
+
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
2
2
|
import "../_libs/react.mjs";
|
|
3
|
-
import "./router-
|
|
3
|
+
import "./router-g9mo0nWT.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-CbGc-o50.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-g9mo0nWT.mjs").then((n) => n.N);
|
|
780
780
|
const startEntry = await import("./start-HYkvq4Ni.mjs");
|
|
781
781
|
return { startEntry, routerEntry };
|
|
782
782
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "./router-
|
|
2
|
+
import { I as parseJsonText, c as cn, n as TooltipProvider, o as Tooltip, p as TooltipTrigger, q as TooltipContent, b as copyTextToClipboard } from "./ProxyViewerContainer-C0Sbz9ED.mjs";
|
|
3
|
+
import "./router-g9mo0nWT.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { b as Check, e as Copy, a as ChevronDown, h as ChevronRight, aj as ChevronsDown } from "../_libs/lucide-react.mjs";
|