@tonyclaw/agent-inspector 3.0.14 → 3.0.16
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/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-DDfwHQUi.js → CompareDrawer-BJmxAiM0.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-C40Nig73.js +106 -0
- package/.output/public/assets/{ReplayDialog-D-26DMBt.js → ReplayDialog-CkLdOMJr.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-B6zNFqNX.js → RequestAnatomy-DemOFfSc.js} +1 -1
- package/.output/public/assets/{ResponseView-Ccy95rWI.js → ResponseView-9LhpuDo7.js} +2 -2
- package/.output/public/assets/{StreamingChunkSequence-yIiscGuE.js → StreamingChunkSequence-RRWYBOdz.js} +1 -1
- package/.output/public/assets/{_sessionId-BnMB0zab.js → _sessionId-CWEh2Jsn.js} +1 -1
- package/.output/public/assets/index-HRfrFVYw.css +1 -0
- package/.output/public/assets/{index-BbtAIxbg.js → index-Lwir70Rs.js} +1 -1
- package/.output/public/assets/index-hjNWJZGE.js +1 -0
- package/.output/public/assets/{json-viewer-C838cVmD.js → json-viewer-D8gvbDlB.js} +1 -1
- package/.output/public/assets/{main-BfN4culo.js → main-ovrz0tyD.js} +7 -7
- package/.output/server/_libs/lucide-react.mjs +215 -201
- package/.output/server/{_sessionId-DoprmwZV.mjs → _sessionId-zI_GFX_7.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-YMLJNxXR.mjs → CompareDrawer-Ckcx1RVu.mjs} +3 -3
- package/.output/server/_ssr/{ProxyViewerContainer-C62eZnva.mjs → ProxyViewerContainer-BgXewlIr.mjs} +729 -378
- package/.output/server/_ssr/{ReplayDialog-NmN7Ukjo.mjs → ReplayDialog-wx3nDtZn.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-Dawm2qxe.mjs → RequestAnatomy-DN80zt0G.mjs} +3 -3
- package/.output/server/_ssr/{ResponseView-BHyAY83t.mjs → ResponseView-DD7rTu_l.mjs} +3 -3
- package/.output/server/_ssr/{StreamingChunkSequence-C4qgcJbg.mjs → StreamingChunkSequence-DAgz6Vvw.mjs} +3 -3
- package/.output/server/_ssr/{index-B2Pf6W_T.mjs → index-dcTjp8du.mjs} +14 -5
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-u67BASf8.mjs → json-viewer-N2cuzGWR.mjs} +3 -3
- package/.output/server/_ssr/{router-CZhFVMGN.mjs → router-BfQ0QsD5.mjs} +132 -17
- package/.output/server/{_tanstack-start-manifest_v-Dk2HfOoe.mjs → _tanstack-start-manifest_v-BXnYrbcJ.mjs} +1 -1
- package/.output/server/index.mjs +75 -75
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +475 -197
- package/src/components/ProxyViewerContainer.tsx +145 -17
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +36 -10
- package/src/components/proxy-viewer/TurnGroup.tsx +4 -1
- package/src/lib/chunkLoadRecovery.ts +83 -0
- package/src/proxy/formats/openai/codexMetadata.ts +61 -0
- package/src/proxy/formats/openai/handler.ts +8 -2
- package/src/routes/__root.tsx +6 -3
- package/src/routes/index.tsx +25 -1
- package/src/routes/session/$sessionId.tsx +1 -0
- package/styles/globals.css +54 -0
- package/.output/public/assets/ProxyViewerContainer-CbNsaoQw.js +0 -106
- package/.output/public/assets/index-49RC4dlD.js +0 -1
- package/.output/public/assets/index-DXKupW0r.css +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
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-
|
|
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-BgXewlIr.mjs";
|
|
3
|
+
import { ResponseView } from "./ResponseView-DD7rTu_l.mjs";
|
|
4
|
+
import { C as CapturedLogSchema } from "./router-BfQ0QsD5.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { ao as RotateCcw, aA as Braces, aB as Minimize2 } from "../_libs/lucide-react.mjs";
|
|
8
8
|
import { d as object, n as number, a as array, c as boolean, b as string } from "../_libs/zod.mjs";
|
|
9
9
|
import "../_libs/swr.mjs";
|
|
10
10
|
import "../_libs/use-sync-external-store.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
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-
|
|
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-BgXewlIr.mjs";
|
|
3
|
+
import "./router-BfQ0QsD5.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
|
-
import { I as Info, a as ChevronDown,
|
|
6
|
+
import { I as Info, a as ChevronDown, j as ChevronRight } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import "../_libs/swr.mjs";
|
|
8
8
|
import "../_libs/use-sync-external-store.mjs";
|
|
9
9
|
import "../_libs/dequal.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
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-
|
|
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-BgXewlIr.mjs";
|
|
3
|
+
import { s as safeGetOwnProperty } from "./router-BfQ0QsD5.mjs";
|
|
4
4
|
import "../_libs/jszip.mjs";
|
|
5
5
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { a2 as Zap, T as TriangleAlert, aC as CircleStop, a4 as Brain, a as ChevronDown, j as ChevronRight, t as Terminal } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import { R as Root } from "../_libs/radix-ui__react-separator.mjs";
|
|
8
8
|
import "../_libs/swr.mjs";
|
|
9
9
|
import "../_libs/use-sync-external-store.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.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-
|
|
3
|
-
import { S as StreamingChunkSchema$1 } from "./router-
|
|
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-BgXewlIr.mjs";
|
|
3
|
+
import { S as StreamingChunkSchema$1 } from "./router-BfQ0QsD5.mjs";
|
|
4
4
|
import "../_libs/jszip.mjs";
|
|
5
5
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
6
|
-
import { a as ChevronDown,
|
|
6
|
+
import { a as ChevronDown, j as ChevronRight, L as LoaderCircle } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import { d as object, c as boolean, a as array } from "../_libs/zod.mjs";
|
|
8
8
|
import "../_libs/swr.mjs";
|
|
9
9
|
import "../_libs/use-sync-external-store.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "./router-
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
+
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-BgXewlIr.mjs";
|
|
3
|
+
import "./router-BfQ0QsD5.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/swr.mjs";
|
|
@@ -115,7 +115,16 @@ import "../_libs/lie.mjs";
|
|
|
115
115
|
import "../_libs/immediate.mjs";
|
|
116
116
|
import "../_libs/setimmediate.mjs";
|
|
117
117
|
import "../_libs/pako.mjs";
|
|
118
|
-
|
|
118
|
+
function ClientOnlyProxyViewerRoute() {
|
|
119
|
+
const [mounted, setMounted] = reactExports.useState(false);
|
|
120
|
+
reactExports.useEffect(() => {
|
|
121
|
+
setMounted(true);
|
|
122
|
+
}, []);
|
|
123
|
+
if (!mounted) {
|
|
124
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("main", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mx-auto flex min-h-screen w-full max-w-2xl flex-col justify-center px-6 py-16 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-[8px] border border-border bg-card px-4 py-8 shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Loading Inspector..." }) }) }) });
|
|
125
|
+
}
|
|
126
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ProxyViewerContainer, {});
|
|
127
|
+
}
|
|
119
128
|
export {
|
|
120
|
-
|
|
129
|
+
ClientOnlyProxyViewerRoute as component
|
|
121
130
|
};
|
|
@@ -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-BXnYrbcJ.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-BfQ0QsD5.mjs").then((n) => n.N);
|
|
780
780
|
const startEntry = await import("./start-HYkvq4Ni.mjs");
|
|
781
781
|
return { startEntry, routerEntry };
|
|
782
782
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
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-
|
|
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-BgXewlIr.mjs";
|
|
3
|
+
import "./router-BfQ0QsD5.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
|
-
import { b as Check,
|
|
6
|
+
import { b as Check, g as Copy, a as ChevronDown, j as ChevronRight, am as ChevronsDown } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import "../_libs/swr.mjs";
|
|
8
8
|
import "../_libs/use-sync-external-store.mjs";
|
|
9
9
|
import "../_libs/dequal.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import { j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
+
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
3
3
|
import { S as SWRConfig } from "../_libs/swr.mjs";
|
|
4
4
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync, copyFileSync, unlinkSync, createReadStream, readdirSync, statSync, rmSync, cpSync, createWriteStream } from "node:fs";
|
|
5
5
|
import fs, { mkdir, appendFile, readFile, writeFile, readdir, open, stat, unlink, rm, rename } from "node:fs/promises";
|
|
@@ -65,7 +65,75 @@ import "../_libs/immediate.mjs";
|
|
|
65
65
|
import "../_libs/setimmediate.mjs";
|
|
66
66
|
import "../_libs/pako.mjs";
|
|
67
67
|
const faviconSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20role='img'%20aria-label='Agent%20Inspector'%3e%3cg%20fill='none'%20stroke='%23f59e0b'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20%3e%3cpath%20d='M5%2013%20C5%209%208%207%2012%207%20C16%207%2019%209%2019%2013%20C19%2016%2016%2018%2012%2018%20C8%2018%205%2016%205%2013%20Z'%20/%3e%3cpath%20d='M5%2011%20C3.5%209.5%201.5%2010%202%2012.5%20C2.5%2014%204%2013.5%205%2012.5'%20/%3e%3cpath%20d='M19%2011%20C20.5%209.5%2022.5%2010%2022%2012.5%20C21.5%2014%2020%2013.5%2019%2012.5'%20/%3e%3cline%20x1='10'%20y1='7'%20x2='9.5'%20y2='5'%20/%3e%3cline%20x1='14'%20y1='7'%20x2='14.5'%20y2='5'%20/%3e%3cline%20x1='6.5'%20y1='16'%20x2='4.5'%20y2='19.5'%20/%3e%3cline%20x1='9'%20y1='17.5'%20x2='8'%20y2='20.5'%20/%3e%3cline%20x1='15'%20y1='17.5'%20x2='16'%20y2='20.5'%20/%3e%3cline%20x1='17.5'%20y1='16'%20x2='19.5'%20y2='19.5'%20/%3e%3c/g%3e%3ccircle%20cx='9.5'%20cy='4.5'%20r='0.9'%20fill='%23f59e0b'%20/%3e%3ccircle%20cx='14.5'%20cy='4.5'%20r='0.9'%20fill='%23f59e0b'%20/%3e%3c/svg%3e";
|
|
68
|
-
const appCss = "/assets/index-
|
|
68
|
+
const appCss = "/assets/index-HRfrFVYw.css";
|
|
69
|
+
const CHUNK_LOAD_RELOAD_AT_KEY = "agent-inspector.chunkLoadReloadAt";
|
|
70
|
+
const CHUNK_LOAD_RELOAD_WINDOW_MS = 15e3;
|
|
71
|
+
const CHUNK_LOAD_FAILURE_PATTERNS = [
|
|
72
|
+
"failed to fetch dynamically imported module",
|
|
73
|
+
"failed to load module script",
|
|
74
|
+
"importing a module script failed",
|
|
75
|
+
"error loading dynamically imported module",
|
|
76
|
+
"loading chunk",
|
|
77
|
+
"unable to preload css"
|
|
78
|
+
];
|
|
79
|
+
function messageFromReason(reason) {
|
|
80
|
+
if (reason instanceof Error) {
|
|
81
|
+
return reason.message;
|
|
82
|
+
}
|
|
83
|
+
if (typeof reason === "string") {
|
|
84
|
+
return reason;
|
|
85
|
+
}
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
88
|
+
function isChunkLoadFailureMessage(message) {
|
|
89
|
+
const normalizedMessage = message.toLowerCase();
|
|
90
|
+
return CHUNK_LOAD_FAILURE_PATTERNS.some((pattern) => normalizedMessage.includes(pattern));
|
|
91
|
+
}
|
|
92
|
+
function readLastReloadAt() {
|
|
93
|
+
const storedValue = window.sessionStorage.getItem(CHUNK_LOAD_RELOAD_AT_KEY);
|
|
94
|
+
if (storedValue === null) {
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
const parsedValue = Number(storedValue);
|
|
98
|
+
return Number.isFinite(parsedValue) ? parsedValue : 0;
|
|
99
|
+
}
|
|
100
|
+
function reloadOnceForChunkFailure() {
|
|
101
|
+
const now = Date.now();
|
|
102
|
+
const lastReloadAt = readLastReloadAt();
|
|
103
|
+
if (now - lastReloadAt < CHUNK_LOAD_RELOAD_WINDOW_MS) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
window.sessionStorage.setItem(CHUNK_LOAD_RELOAD_AT_KEY, String(now));
|
|
107
|
+
window.location.reload();
|
|
108
|
+
}
|
|
109
|
+
function installChunkLoadRecovery() {
|
|
110
|
+
if (typeof window === "undefined") {
|
|
111
|
+
return () => {
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const handleUnhandledRejection = (event) => {
|
|
115
|
+
const message = messageFromReason(event.reason);
|
|
116
|
+
if (!isChunkLoadFailureMessage(message)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
reloadOnceForChunkFailure();
|
|
121
|
+
};
|
|
122
|
+
const handleError = (event) => {
|
|
123
|
+
const message = event.message !== "" ? event.message : messageFromReason(event.error);
|
|
124
|
+
if (!isChunkLoadFailureMessage(message)) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
reloadOnceForChunkFailure();
|
|
129
|
+
};
|
|
130
|
+
window.addEventListener("unhandledrejection", handleUnhandledRejection);
|
|
131
|
+
window.addEventListener("error", handleError);
|
|
132
|
+
return () => {
|
|
133
|
+
window.removeEventListener("unhandledrejection", handleUnhandledRejection);
|
|
134
|
+
window.removeEventListener("error", handleError);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
69
137
|
const Route$L = createRootRoute({
|
|
70
138
|
head: () => ({
|
|
71
139
|
meta: [
|
|
@@ -82,6 +150,7 @@ const Route$L = createRootRoute({
|
|
|
82
150
|
notFoundComponent: RootNotFoundComponent
|
|
83
151
|
});
|
|
84
152
|
function RootComponent() {
|
|
153
|
+
reactExports.useEffect(() => installChunkLoadRecovery(), []);
|
|
85
154
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(RootDocument, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) });
|
|
86
155
|
}
|
|
87
156
|
function RootNotFoundComponent() {
|
|
@@ -100,16 +169,17 @@ function RootNotFoundComponent() {
|
|
|
100
169
|
] }) }) }) });
|
|
101
170
|
}
|
|
102
171
|
function RootDocument({ children }) {
|
|
103
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("html", { lang: "en", className: "dark", children: [
|
|
172
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("html", { lang: "en", className: "dark", suppressHydrationWarning: true, children: [
|
|
104
173
|
/* @__PURE__ */ jsxRuntimeExports.jsx("head", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, {}) }),
|
|
105
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("body", { children: [
|
|
174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("body", { suppressHydrationWarning: true, children: [
|
|
106
175
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SWRConfig, { value: { revalidateOnFocus: false, revalidateIfStale: false }, children }),
|
|
107
176
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Scripts, {})
|
|
108
177
|
] })
|
|
109
178
|
] });
|
|
110
179
|
}
|
|
111
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
180
|
+
const $$splitComponentImporter$1 = () => import("./index-dcTjp8du.mjs");
|
|
112
181
|
const Route$K = createFileRoute("/")({
|
|
182
|
+
ssr: false,
|
|
113
183
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
114
184
|
});
|
|
115
185
|
const B64URL_RE = /^[A-Za-z0-9_-]+$/;
|
|
@@ -151,8 +221,9 @@ function decodeSessionIdFromPath(encoded) {
|
|
|
151
221
|
function getSessionPath(sessionId) {
|
|
152
222
|
return `/session/${encodeSessionIdForPath(sessionId)}`;
|
|
153
223
|
}
|
|
154
|
-
const $$splitComponentImporter = () => import("../_sessionId-
|
|
224
|
+
const $$splitComponentImporter = () => import("../_sessionId-zI_GFX_7.mjs");
|
|
155
225
|
const Route$J = createFileRoute("/session/$sessionId")({
|
|
226
|
+
ssr: false,
|
|
156
227
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
157
228
|
parseParams: (params) => ({
|
|
158
229
|
sessionId: decodeSessionIdFromPath(params.sessionId)
|
|
@@ -844,20 +915,20 @@ function extractSessionIdFromHeaders(headers) {
|
|
|
844
915
|
return headers.get("x-agent-inspector-session-id") ?? headers.get("x-session-affinity");
|
|
845
916
|
}
|
|
846
917
|
function extractRequestMetadata(body, headers) {
|
|
847
|
-
const
|
|
848
|
-
if (body === null) return { model: null, sessionId:
|
|
918
|
+
const headerSessionId2 = extractSessionIdFromHeaders(headers);
|
|
919
|
+
if (body === null) return { model: null, sessionId: headerSessionId2 };
|
|
849
920
|
try {
|
|
850
921
|
const json = JSON.parse(body);
|
|
851
922
|
const loose = LooseRequestSchema.safeParse(json);
|
|
852
923
|
if (loose.success) {
|
|
853
924
|
return {
|
|
854
925
|
model: loose.data.model ?? null,
|
|
855
|
-
sessionId: loose.data.metadata?.user_id ??
|
|
926
|
+
sessionId: loose.data.metadata?.user_id ?? headerSessionId2
|
|
856
927
|
};
|
|
857
928
|
}
|
|
858
929
|
} catch {
|
|
859
930
|
}
|
|
860
|
-
return { model: null, sessionId:
|
|
931
|
+
return { model: null, sessionId: headerSessionId2 };
|
|
861
932
|
}
|
|
862
933
|
const StreamingChunkSchema = object({
|
|
863
934
|
index: number(),
|
|
@@ -1625,7 +1696,7 @@ function readStringOrNullField(entry, field) {
|
|
|
1625
1696
|
if (typeof desc.value === "string") return desc.value;
|
|
1626
1697
|
return null;
|
|
1627
1698
|
}
|
|
1628
|
-
function readStringField(entry, field) {
|
|
1699
|
+
function readStringField$1(entry, field) {
|
|
1629
1700
|
return readStringOrNullField(entry, field) ?? "";
|
|
1630
1701
|
}
|
|
1631
1702
|
function readNumberOrNullField(entry, field) {
|
|
@@ -1670,9 +1741,9 @@ function readTextByteLength(entry, bytesField, textField) {
|
|
|
1670
1741
|
function readLogIndexSummary(entry, id) {
|
|
1671
1742
|
return {
|
|
1672
1743
|
id,
|
|
1673
|
-
timestamp: readStringField(entry, "timestamp"),
|
|
1674
|
-
method: readStringField(entry, "method"),
|
|
1675
|
-
path: readStringField(entry, "path"),
|
|
1744
|
+
timestamp: readStringField$1(entry, "timestamp"),
|
|
1745
|
+
method: readStringField$1(entry, "method"),
|
|
1746
|
+
path: readStringField$1(entry, "path"),
|
|
1676
1747
|
model: readStringOrNullField(entry, "model"),
|
|
1677
1748
|
sessionId: readStringOrNullField(entry, "sessionId"),
|
|
1678
1749
|
responseStatus: readNumberOrNullField(entry, "responseStatus"),
|
|
@@ -4551,6 +4622,46 @@ function extractOpenAIStream(raw, log, fallbackModel, collectChunks = true) {
|
|
|
4551
4622
|
}
|
|
4552
4623
|
return extractChatCompletionsStream(events, log, fallbackModel, collectChunks);
|
|
4553
4624
|
}
|
|
4625
|
+
const EMPTY_CODEX_CLIENT_METADATA = {
|
|
4626
|
+
sessionId: null,
|
|
4627
|
+
threadId: null,
|
|
4628
|
+
turnId: null,
|
|
4629
|
+
installationId: null,
|
|
4630
|
+
windowId: null
|
|
4631
|
+
};
|
|
4632
|
+
function readObjectField(value, field) {
|
|
4633
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
4634
|
+
return Object.getOwnPropertyDescriptor(value, field)?.value;
|
|
4635
|
+
}
|
|
4636
|
+
function readStringField(value, field) {
|
|
4637
|
+
const fieldValue = readObjectField(value, field);
|
|
4638
|
+
return typeof fieldValue === "string" && fieldValue.length > 0 ? fieldValue : null;
|
|
4639
|
+
}
|
|
4640
|
+
function parseNestedTurnMetadata(value) {
|
|
4641
|
+
if (typeof value !== "string" || value.length === 0) return null;
|
|
4642
|
+
try {
|
|
4643
|
+
return JSON.parse(value);
|
|
4644
|
+
} catch {
|
|
4645
|
+
return null;
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
function extractCodexClientMetadata(rawRequest) {
|
|
4649
|
+
const clientMetadata = readObjectField(rawRequest, "client_metadata");
|
|
4650
|
+
if (clientMetadata === void 0) return EMPTY_CODEX_CLIENT_METADATA;
|
|
4651
|
+
const turnMetadata = parseNestedTurnMetadata(
|
|
4652
|
+
readObjectField(clientMetadata, "x-codex-turn-metadata")
|
|
4653
|
+
);
|
|
4654
|
+
return {
|
|
4655
|
+
sessionId: readStringField(clientMetadata, "session_id") ?? readStringField(turnMetadata, "session_id"),
|
|
4656
|
+
threadId: readStringField(clientMetadata, "thread_id") ?? readStringField(turnMetadata, "thread_id"),
|
|
4657
|
+
turnId: readStringField(clientMetadata, "turn_id") ?? readStringField(turnMetadata, "turn_id"),
|
|
4658
|
+
installationId: readStringField(clientMetadata, "x-codex-installation-id") ?? readStringField(turnMetadata, "installation_id"),
|
|
4659
|
+
windowId: readStringField(clientMetadata, "x-codex-window-id") ?? readStringField(turnMetadata, "window_id")
|
|
4660
|
+
};
|
|
4661
|
+
}
|
|
4662
|
+
function extractCodexSessionId(rawRequest) {
|
|
4663
|
+
return extractCodexClientMetadata(rawRequest).sessionId;
|
|
4664
|
+
}
|
|
4554
4665
|
function emptyTokens() {
|
|
4555
4666
|
return {
|
|
4556
4667
|
inputTokens: null,
|
|
@@ -4559,6 +4670,10 @@ function emptyTokens() {
|
|
|
4559
4670
|
cacheReadInputTokens: null
|
|
4560
4671
|
};
|
|
4561
4672
|
}
|
|
4673
|
+
function headerSessionId(headers) {
|
|
4674
|
+
if (headers === void 0) return null;
|
|
4675
|
+
return headers.get("x-agent-inspector-session-id") ?? headers.get("x-session-affinity");
|
|
4676
|
+
}
|
|
4562
4677
|
const OpenAIFormatHandler = {
|
|
4563
4678
|
format: "openai",
|
|
4564
4679
|
parseRequest(rawBody, headers) {
|
|
@@ -4568,14 +4683,14 @@ const OpenAIFormatHandler = {
|
|
|
4568
4683
|
if (result.success) {
|
|
4569
4684
|
return {
|
|
4570
4685
|
model: result.data.model,
|
|
4571
|
-
sessionId:
|
|
4686
|
+
sessionId: extractCodexSessionId(json) ?? headerSessionId(headers)
|
|
4572
4687
|
};
|
|
4573
4688
|
}
|
|
4574
4689
|
const responsesResult = OpenAIResponsesRequestSchema.safeParse(json);
|
|
4575
4690
|
if (responsesResult.success) {
|
|
4576
4691
|
return {
|
|
4577
4692
|
model: responsesResult.data.model,
|
|
4578
|
-
sessionId:
|
|
4693
|
+
sessionId: extractCodexSessionId(json) ?? headerSessionId(headers)
|
|
4579
4694
|
};
|
|
4580
4695
|
}
|
|
4581
4696
|
return null;
|
|
@@ -9156,7 +9271,7 @@ const Route$E = createFileRoute("/api/models")({
|
|
|
9156
9271
|
}
|
|
9157
9272
|
});
|
|
9158
9273
|
const name = "@tonyclaw/agent-inspector";
|
|
9159
|
-
const version = "3.0.
|
|
9274
|
+
const version = "3.0.16";
|
|
9160
9275
|
const packageJson = {
|
|
9161
9276
|
name,
|
|
9162
9277
|
version
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/ecosystem/packages", "/api/ecosystem/tasks", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/ecosystem/recipes/$recipeId/run", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-
|
|
1
|
+
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/alerts", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/ecosystem/packages", "/api/ecosystem/tasks", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/ecosystem/recipes/$recipeId/run", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-ovrz0tyD.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-hjNWJZGE.js", "/assets/ProxyViewerContainer-C40Nig73.js"] }, "/api/alerts": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.ts", "children": ["/api/alerts/summary"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/api/groups": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.ts", "children": ["/api/groups/$groupId"] }, "/api/health": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/health.ts" }, "/api/logs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.ts", "children": ["/api/logs/$id", "/api/logs/import", "/api/logs/stream"] }, "/api/mcp": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/mcp.ts" }, "/api/models": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/models.ts" }, "/api/providers": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.ts", "children": ["/api/providers/$providerId", "/api/providers/export", "/api/providers/import", "/api/providers/scan"] }, "/api/runs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.ts", "children": ["/api/runs/$runId"] }, "/api/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/sessions.ts" }, "/proxy/$": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/proxy/$.ts" }, "/session/$sessionId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", "assets": [], "preloads": ["/assets/_sessionId-CWEh2Jsn.js", "/assets/ProxyViewerContainer-C40Nig73.js"] }, "/api/alerts/summary": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/alerts.summary.ts" }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/api/ecosystem/packages": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.ts", "children": ["/api/ecosystem/packages/$packageId/help", "/api/ecosystem/packages/$packageId/install", "/api/ecosystem/packages/$packageId/runner-presets", "/api/ecosystem/packages/$packageId/upgrade"] }, "/api/ecosystem/tasks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.tasks.ts", "children": ["/api/ecosystem/tasks/$taskId"] }, "/api/groups/$groupId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.ts", "children": ["/api/groups/$groupId/evidence", "/api/groups/$groupId/sessions"] }, "/api/knowledge/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.ts", "children": ["/api/knowledge/candidates/$candidateId"] }, "/api/knowledge/project-context": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.project-context.ts" }, "/api/knowledge/search": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.search.ts" }, "/api/logs/$id": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.ts", "children": ["/api/logs/$id/body", "/api/logs/$id/chunks", "/api/logs/$id/replay"] }, "/api/logs/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.import.ts" }, "/api/logs/stream": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.stream.ts" }, "/api/providers/$providerId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.ts", "children": ["/api/providers/$providerId/model-metadata", "/api/providers/$providerId/test"] }, "/api/providers/export": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.export.ts" }, "/api/providers/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.import.ts" }, "/api/providers/scan": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.scan.ts" }, "/api/runs/$runId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.ts", "children": ["/api/runs/$runId/evidence"] }, "/api/ecosystem/tasks/$taskId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.tasks.$taskId.ts" }, "/api/groups/$groupId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.evidence.ts" }, "/api/groups/$groupId/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/groups.$groupId.sessions.ts" }, "/api/knowledge/candidates/$candidateId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.ts", "children": ["/api/knowledge/candidates/$candidateId/promote"] }, "/api/logs/$id/body": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.body.ts" }, "/api/logs/$id/chunks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.chunks.ts" }, "/api/logs/$id/replay": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.replay.ts" }, "/api/providers/$providerId/model-metadata": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.model-metadata.ts" }, "/api/providers/$providerId/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/api/runs/$runId/evidence": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.evidence.ts" }, "/api/ecosystem/packages/$packageId/help": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.help.ts" }, "/api/ecosystem/packages/$packageId/install": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.install.ts" }, "/api/ecosystem/packages/$packageId/runner-presets": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.runner-presets.ts" }, "/api/ecosystem/packages/$packageId/upgrade": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.packages.$packageId.upgrade.ts" }, "/api/ecosystem/recipes/$recipeId/run": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/ecosystem.recipes.$recipeId.run.ts" }, "/api/knowledge/candidates/$candidateId/promote": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.promote.ts" }, "/api/knowledge/sessions/$sessionId/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.sessions.$sessionId.candidates.ts" }, "/api/providers/$providerId/test/log": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.log.ts" } }, "clientEntry": "/assets/main-ovrz0tyD.js" });
|
|
2
2
|
export {
|
|
3
3
|
tsrStartManifest
|
|
4
4
|
};
|