@tonyclaw/agent-inspector 2.0.36 → 2.0.38
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-Bg2mo0NZ.js → CompareDrawer-hc5OoAls.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-C_Lq5T5V.js → ProxyViewerContainer-BMKBs8Qz.js} +35 -35
- package/.output/public/assets/{ReplayDialog-Bns-ayOg.js → ReplayDialog-CN-KM2nu.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-BBcPAIWx.js → RequestAnatomy-B1kTlAUk.js} +1 -1
- package/.output/public/assets/{ResponseView-DSRS3rHt.js → ResponseView-BchUjKjt.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-CzZxKE5-.js → StreamingChunkSequence-BQOxI9Hi.js} +1 -1
- package/.output/public/assets/_sessionId-CVw5e8TK.js +1 -0
- package/.output/public/assets/index-BdUTMQL6.js +1 -0
- package/.output/public/assets/{main-BVKRHBUl.js → main-Blykwzsn.js} +2 -2
- package/.output/server/_libs/lucide-react.mjs +114 -94
- package/.output/server/{_sessionId-Dsd36Yhc.mjs → _sessionId-BUNZz2zZ.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-BbJ5UdYD.mjs → CompareDrawer-VaDYPM5G.mjs} +3 -3
- package/.output/server/_ssr/{ProxyViewerContainer-7igCY291.mjs → ProxyViewerContainer-CpdWs7Pk.mjs} +801 -785
- package/.output/server/_ssr/{ReplayDialog-CgWweshq.mjs → ReplayDialog-DbfIjJhb.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-BAyM_j7a.mjs → RequestAnatomy-CrD8h6As.mjs} +3 -3
- package/.output/server/_ssr/{ResponseView-iZQH7EYu.mjs → ResponseView-BalvDwtU.mjs} +3 -3
- package/.output/server/_ssr/{StreamingChunkSequence-BU6hyHMg.mjs → StreamingChunkSequence-RxatDbPV.mjs} +2 -2
- package/.output/server/_ssr/{index-D7QF4E6v.mjs → index-11qAtV9d.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-DLLY6gv_.mjs → router-C4OdRnqX.mjs} +138 -138
- package/.output/server/{_tanstack-start-manifest_v-CHmIZaVV.mjs → _tanstack-start-manifest_v-F6bwcl33.mjs} +1 -1
- package/.output/server/index.mjs +60 -60
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +43 -9
- package/src/components/ProxyViewerContainer.tsx +1 -1
- package/src/components/providers/ProviderForm.tsx +2 -2
- package/src/components/proxy-viewer/AgentTraceSummary.tsx +1 -1
- package/src/components/proxy-viewer/CompareDrawer.tsx +1 -1
- package/src/components/proxy-viewer/ConversationGroup.tsx +1 -1
- package/src/components/proxy-viewer/ConversationGroupList.tsx +1 -1
- package/src/components/proxy-viewer/ConversationHeader.tsx +11 -7
- package/src/components/proxy-viewer/LogEntry.tsx +1 -1
- package/src/components/proxy-viewer/LogEntryHeader.tsx +1 -1
- package/src/components/proxy-viewer/ReplayDialog.tsx +1 -1
- package/src/components/proxy-viewer/ResponseView.tsx +2 -2
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +1 -1
- package/src/components/proxy-viewer/TurnGroup.tsx +1 -1
- package/src/components/proxy-viewer/anatomy/sessionContextSummary.ts +1 -1
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +1 -1
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +2 -2
- package/src/components/proxy-viewer/formats/index.tsx +5 -3
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +1 -1
- package/src/components/proxy-viewer/log-formats/anthropic.ts +1 -4
- package/src/components/proxy-viewer/log-formats/index.ts +6 -6
- package/src/components/proxy-viewer/log-formats/openai.ts +1 -1
- package/src/components/proxy-viewer/log-formats/types.ts +2 -2
- package/src/components/proxy-viewer/viewerState.ts +1 -1
- package/src/contracts/anthropic.ts +235 -0
- package/src/contracts/index.ts +27 -0
- package/src/contracts/json.ts +32 -0
- package/src/contracts/log.ts +72 -0
- package/src/contracts/openai.ts +176 -0
- package/src/knowledge/distiller.ts +1 -1
- package/src/lib/export-logs.ts +1 -1
- package/src/lib/groupContract.ts +1 -1
- package/src/lib/objectUtils.ts +3 -3
- package/src/lib/providerTestContract.ts +1 -1
- package/src/lib/runContract.ts +1 -1
- package/src/lib/stopReason.ts +1 -1
- package/src/mcp/previewExtractor.ts +4 -7
- package/src/mcp/server.ts +1 -1
- package/src/mcp/toolHandlers.ts +1 -1
- package/src/proxy/formats/anthropic/anthropicProvider.ts +2 -2
- package/src/proxy/formats/anthropic/schemas.ts +12 -235
- package/src/proxy/formats/handler.ts +2 -2
- package/src/proxy/formats/index.ts +1 -1
- package/src/proxy/formats/jsonSchema.ts +2 -36
- package/src/proxy/formats/openai/alibabaProvider.ts +2 -2
- package/src/proxy/formats/openai/provider.ts +2 -2
- package/src/proxy/formats/openai/schemas.ts +14 -187
- package/src/proxy/formats/openai/zhipuProvider.ts +2 -2
- package/src/proxy/formats/{protocol.ts → providerAdapter.ts} +5 -5
- package/src/proxy/formats/providerRegistry.ts +7 -7
- package/src/proxy/formats/providers/index.ts +1 -1
- package/src/proxy/formats/registry.ts +20 -11
- package/src/proxy/handler.ts +1 -1
- package/src/proxy/openaiOrphanToolStrip.ts +1 -1
- package/src/proxy/providers.ts +1 -1
- package/src/proxy/schemas.ts +18 -80
- package/src/proxy/store.ts +14 -11
- package/src/proxy/upstream.ts +1 -1
- package/src/routes/api/logs.stream.ts +1 -1
- package/.output/public/assets/_sessionId-DurHDwM1.js +0 -1
- package/.output/public/assets/index-sGphugFR.js +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 Dialog, b as DialogContent, d as DialogHeader, e as DialogTitle, T as Tabs, h as TabsList, i as TabsTrigger, j as TabsContent, k as Button, l as TooltipProvider, m as Tooltip, n as TooltipTrigger, o as TooltipContent, p as dispatchLogFocusRequest } from "./ProxyViewerContainer-
|
|
3
|
-
import { ResponseView } from "./ResponseView-
|
|
4
|
-
import { C as CapturedLogSchema } from "./router-
|
|
2
|
+
import { u as useProviders, D as Dialog, b as DialogContent, d as DialogHeader, e as DialogTitle, T as Tabs, h as TabsList, i as TabsTrigger, j as TabsContent, k as Button, l as TooltipProvider, m as Tooltip, n as TooltipTrigger, o as TooltipContent, p as dispatchLogFocusRequest } from "./ProxyViewerContainer-CpdWs7Pk.mjs";
|
|
3
|
+
import { ResponseView } from "./ResponseView-BalvDwtU.mjs";
|
|
4
|
+
import { C as CapturedLogSchema } from "./router-C4OdRnqX.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { V as RotateCcw, ae as Braces, af 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, q as analyzeContextIntelligence, f as formatTokens, l as TooltipProvider, c as cn, m as Tooltip, n as TooltipTrigger, o as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, A as ANATOMY_ROLE_LABELS, s as formatContextWindowTokens, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { u as useProviders, q as analyzeContextIntelligence, f as formatTokens, l as TooltipProvider, c as cn, m as Tooltip, n as TooltipTrigger, o as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, A as ANATOMY_ROLE_LABELS, s as formatContextWindowTokens, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-CpdWs7Pk.mjs";
|
|
3
|
+
import "./router-C4OdRnqX.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { ag as Info, c as ChevronDown, l 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, t as getStatusCategory, B as Badge, v as Collapsible, w as CollapsibleTrigger, x as CollapsibleContent, y as ScrollArea, z as JsonViewer, E as safeJsonValue } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { g as getLogFormatAdapter, f as formatTokens, c as cn, t as getStatusCategory, B as Badge, v as Collapsible, w as CollapsibleTrigger, x as CollapsibleContent, y as ScrollArea, z as JsonViewer, E as safeJsonValue } from "./ProxyViewerContainer-CpdWs7Pk.mjs";
|
|
3
|
+
import "./router-C4OdRnqX.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
|
-
import { Z as Zap, q as TriangleAlert,
|
|
6
|
+
import { Z as Zap, q as TriangleAlert, ah as CircleStop, B as Brain, c as ChevronDown, l as ChevronRight, f as Terminal } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import { M as Markdown } from "../_libs/react-markdown.mjs";
|
|
8
8
|
import { R as Root } from "../_libs/radix-ui__react-separator.mjs";
|
|
9
9
|
import "../_libs/swr.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
-
import { l as TooltipProvider, m as Tooltip, n as TooltipTrigger, B as Badge, o as TooltipContent, z as JsonViewer } from "./ProxyViewerContainer-
|
|
3
|
-
import "./router-
|
|
2
|
+
import { l as TooltipProvider, m as Tooltip, n as TooltipTrigger, B as Badge, o as TooltipContent, z as JsonViewer } from "./ProxyViewerContainer-CpdWs7Pk.mjs";
|
|
3
|
+
import "./router-C4OdRnqX.mjs";
|
|
4
4
|
import "../_libs/modelcontextprotocol__server.mjs";
|
|
5
5
|
import "../_libs/jszip.mjs";
|
|
6
6
|
import { c as ChevronDown, l as ChevronRight, a as LoaderCircle } from "../_libs/lucide-react.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-
|
|
1
|
+
import { P as ProxyViewerContainer } from "./ProxyViewerContainer-CpdWs7Pk.mjs";
|
|
2
2
|
import "../_libs/react.mjs";
|
|
3
|
-
import "./router-
|
|
3
|
+
import "./router-C4OdRnqX.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-F6bwcl33.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-C4OdRnqX.mjs").then((n) => n.w);
|
|
780
780
|
const startEntry = await import("./start-HYkvq4Ni.mjs");
|
|
781
781
|
return { startEntry, routerEntry };
|
|
782
782
|
}
|
|
@@ -93,7 +93,7 @@ function RootDocument({ children }) {
|
|
|
93
93
|
] })
|
|
94
94
|
] });
|
|
95
95
|
}
|
|
96
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
96
|
+
const $$splitComponentImporter$1 = () => import("./index-11qAtV9d.mjs");
|
|
97
97
|
const Route$y = createFileRoute("/")({
|
|
98
98
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
99
99
|
});
|
|
@@ -136,7 +136,7 @@ function decodeSessionIdFromPath(encoded) {
|
|
|
136
136
|
function getSessionPath(sessionId) {
|
|
137
137
|
return `/session/${encodeSessionIdForPath(sessionId)}`;
|
|
138
138
|
}
|
|
139
|
-
const $$splitComponentImporter = () => import("../_sessionId-
|
|
139
|
+
const $$splitComponentImporter = () => import("../_sessionId-BUNZz2zZ.mjs");
|
|
140
140
|
const Route$x = createFileRoute("/session/$sessionId")({
|
|
141
141
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
142
142
|
parseParams: (params) => ({
|
|
@@ -360,6 +360,56 @@ const JsonValueSchema = lazy(
|
|
|
360
360
|
function trustAsJsonValue(value) {
|
|
361
361
|
return value;
|
|
362
362
|
}
|
|
363
|
+
const StreamingChunkSchema$1 = object({
|
|
364
|
+
index: number(),
|
|
365
|
+
timestamp: number(),
|
|
366
|
+
type: string(),
|
|
367
|
+
data: JsonValueSchema
|
|
368
|
+
});
|
|
369
|
+
const StreamingChunksArraySchema = object({
|
|
370
|
+
chunks: array(StreamingChunkSchema$1),
|
|
371
|
+
truncated: boolean().optional().default(false)
|
|
372
|
+
});
|
|
373
|
+
const CapturedLogSchema = object({
|
|
374
|
+
id: number(),
|
|
375
|
+
timestamp: string(),
|
|
376
|
+
method: string(),
|
|
377
|
+
path: string(),
|
|
378
|
+
model: string().nullable(),
|
|
379
|
+
sessionId: string().nullable(),
|
|
380
|
+
rawRequestBody: string().nullable(),
|
|
381
|
+
responseStatus: number().nullable(),
|
|
382
|
+
responseText: string().nullable(),
|
|
383
|
+
inputTokens: number().nullable(),
|
|
384
|
+
outputTokens: number().nullable(),
|
|
385
|
+
cacheCreationInputTokens: number().nullable(),
|
|
386
|
+
cacheReadInputTokens: number().nullable(),
|
|
387
|
+
elapsedMs: number().nullable(),
|
|
388
|
+
firstChunkMs: number().nullable().optional(),
|
|
389
|
+
totalStreamMs: number().nullable().optional(),
|
|
390
|
+
tokensPerSecond: number().nullable().optional(),
|
|
391
|
+
streaming: boolean(),
|
|
392
|
+
userAgent: string().nullable(),
|
|
393
|
+
origin: string().nullable(),
|
|
394
|
+
rawHeaders: record(string(), string()).optional(),
|
|
395
|
+
/** Headers sent to the upstream LLM */
|
|
396
|
+
headers: record(string(), string()).optional(),
|
|
397
|
+
apiFormat: _enum(["anthropic", "openai", "unknown"]).default("unknown"),
|
|
398
|
+
isTest: boolean().optional().default(false),
|
|
399
|
+
replayOfLogId: number().nullable().optional(),
|
|
400
|
+
providerName: string().nullable().optional(),
|
|
401
|
+
clientPort: number().nullable().optional(),
|
|
402
|
+
clientPid: number().nullable().optional(),
|
|
403
|
+
clientCwd: string().nullable().optional(),
|
|
404
|
+
clientProjectFolder: string().nullable().optional(),
|
|
405
|
+
streamingChunks: StreamingChunksArraySchema.optional(),
|
|
406
|
+
streamingChunksPath: string().nullable().optional(),
|
|
407
|
+
rawRequestBodyBytes: number().int().nonnegative().nullable().optional(),
|
|
408
|
+
responseTextBytes: number().int().nonnegative().nullable().optional(),
|
|
409
|
+
bodyContentMode: _enum(["full", "compact", "truncated"]).optional(),
|
|
410
|
+
/** Error message from streaming response (e.g., SSE error event) */
|
|
411
|
+
error: string().nullable().optional()
|
|
412
|
+
});
|
|
363
413
|
const CacheControl = object({
|
|
364
414
|
type: string(),
|
|
365
415
|
ttl: string().optional(),
|
|
@@ -563,9 +613,7 @@ const OpenAIMessage = object({
|
|
|
563
613
|
name: string().optional(),
|
|
564
614
|
reasoning_content: string().optional(),
|
|
565
615
|
thinking: string().optional(),
|
|
566
|
-
// Some providers use 'thinking' field
|
|
567
616
|
think: string().optional()
|
|
568
|
-
// MiniMax uses 'think' field
|
|
569
617
|
});
|
|
570
618
|
const OpenAIFunctionCall = object({
|
|
571
619
|
name: string(),
|
|
@@ -613,9 +661,7 @@ const OpenAIChoiceDelta = object({
|
|
|
613
661
|
content: string().nullable().optional(),
|
|
614
662
|
reasoning_content: string().nullable().optional(),
|
|
615
663
|
thinking: string().nullable().optional(),
|
|
616
|
-
// Some providers use 'thinking' field
|
|
617
664
|
think: string().nullable().optional(),
|
|
618
|
-
// MiniMax uses 'think' field
|
|
619
665
|
function_call: object({ name: string().optional(), arguments: string().optional() }).nullable().optional(),
|
|
620
666
|
tool_calls: array(
|
|
621
667
|
object({
|
|
@@ -636,9 +682,7 @@ const OpenAIChoice = object({
|
|
|
636
682
|
content: string().nullable(),
|
|
637
683
|
reasoning_content: string().optional(),
|
|
638
684
|
thinking: string().optional(),
|
|
639
|
-
// Some providers use 'thinking' field in message
|
|
640
685
|
think: string().optional(),
|
|
641
|
-
// MiniMax uses 'think' field in message
|
|
642
686
|
function_call: object({ name: string(), arguments: string() }).nullable().optional(),
|
|
643
687
|
tool_calls: array(OpenAIToolCallSchema).optional()
|
|
644
688
|
}).optional(),
|
|
@@ -656,7 +700,6 @@ const OpenAIResponseSchema$1 = object({
|
|
|
656
700
|
completion_tokens: number().nullable().optional(),
|
|
657
701
|
total_tokens: number().nullable().optional()
|
|
658
702
|
}).passthrough(),
|
|
659
|
-
// Allow extra fields like prompt_tokens_details, completion_tokens_details
|
|
660
703
|
service_tier: string().nullable().optional(),
|
|
661
704
|
system_fingerprint: string().nullable().optional()
|
|
662
705
|
}).passthrough();
|
|
@@ -688,56 +731,6 @@ function parseOpenAIResponse(rawBody) {
|
|
|
688
731
|
return null;
|
|
689
732
|
}
|
|
690
733
|
}
|
|
691
|
-
const StreamingChunkSchema$1 = object({
|
|
692
|
-
index: number(),
|
|
693
|
-
timestamp: number(),
|
|
694
|
-
type: string(),
|
|
695
|
-
data: JsonValueSchema
|
|
696
|
-
});
|
|
697
|
-
const StreamingChunksArraySchema = object({
|
|
698
|
-
chunks: array(StreamingChunkSchema$1),
|
|
699
|
-
truncated: boolean().optional().default(false)
|
|
700
|
-
});
|
|
701
|
-
const CapturedLogSchema = object({
|
|
702
|
-
id: number(),
|
|
703
|
-
timestamp: string(),
|
|
704
|
-
method: string(),
|
|
705
|
-
path: string(),
|
|
706
|
-
model: string().nullable(),
|
|
707
|
-
sessionId: string().nullable(),
|
|
708
|
-
rawRequestBody: string().nullable(),
|
|
709
|
-
responseStatus: number().nullable(),
|
|
710
|
-
responseText: string().nullable(),
|
|
711
|
-
inputTokens: number().nullable(),
|
|
712
|
-
outputTokens: number().nullable(),
|
|
713
|
-
cacheCreationInputTokens: number().nullable(),
|
|
714
|
-
cacheReadInputTokens: number().nullable(),
|
|
715
|
-
elapsedMs: number().nullable(),
|
|
716
|
-
firstChunkMs: number().nullable().optional(),
|
|
717
|
-
totalStreamMs: number().nullable().optional(),
|
|
718
|
-
tokensPerSecond: number().nullable().optional(),
|
|
719
|
-
streaming: boolean(),
|
|
720
|
-
userAgent: string().nullable(),
|
|
721
|
-
origin: string().nullable(),
|
|
722
|
-
rawHeaders: record(string(), string()).optional(),
|
|
723
|
-
/** Headers sent to the upstream LLM */
|
|
724
|
-
headers: record(string(), string()).optional(),
|
|
725
|
-
apiFormat: _enum(["anthropic", "openai", "unknown"]).default("unknown"),
|
|
726
|
-
isTest: boolean().optional().default(false),
|
|
727
|
-
replayOfLogId: number().nullable().optional(),
|
|
728
|
-
providerName: string().nullable().optional(),
|
|
729
|
-
clientPort: number().nullable().optional(),
|
|
730
|
-
clientPid: number().nullable().optional(),
|
|
731
|
-
clientCwd: string().nullable().optional(),
|
|
732
|
-
clientProjectFolder: string().nullable().optional(),
|
|
733
|
-
streamingChunks: StreamingChunksArraySchema.optional(),
|
|
734
|
-
streamingChunksPath: string().nullable().optional(),
|
|
735
|
-
rawRequestBodyBytes: number().int().nonnegative().nullable().optional(),
|
|
736
|
-
responseTextBytes: number().int().nonnegative().nullable().optional(),
|
|
737
|
-
bodyContentMode: _enum(["full", "compact", "truncated"]).optional(),
|
|
738
|
-
/** Error message from streaming response (e.g., SSE error event) */
|
|
739
|
-
error: string().nullable().optional()
|
|
740
|
-
});
|
|
741
734
|
const RequestModelSchema = object({
|
|
742
735
|
model: string()
|
|
743
736
|
});
|
|
@@ -1214,6 +1207,68 @@ function buildSessionInfo(input) {
|
|
|
1214
1207
|
latestLogs: summaries.slice(0, latestLogLimit)
|
|
1215
1208
|
};
|
|
1216
1209
|
}
|
|
1210
|
+
const DEFAULT_UPSTREAM$1 = "https://api.anthropic.com";
|
|
1211
|
+
const DEFAULT_OPENAI_UPSTREAM$1 = "https://api.openai.com/v1";
|
|
1212
|
+
const PROXY_IDENTITY = process.env["PROXY_IDENTITY"] ?? "inspector9527@Tony";
|
|
1213
|
+
const PATH_V1_CHAT_COMPLETIONS = "/v1/chat/completions";
|
|
1214
|
+
const PATH_CHAT_COMPLETIONS = "/chat/completions";
|
|
1215
|
+
const PATH_V1_MESSAGES = "/v1/messages";
|
|
1216
|
+
const HEADER_CONTENT_TYPE = "content-type";
|
|
1217
|
+
const HEADER_USER_AGENT = "user-agent";
|
|
1218
|
+
const HEADER_X_PROXY_IDENTITY = "x-proxy-identity";
|
|
1219
|
+
const HEADER_AUTHORIZATION = "authorization";
|
|
1220
|
+
const HEADER_X_API_KEY = "x-api-key";
|
|
1221
|
+
const HEADER_CONTENT_ENCODING = "content-encoding";
|
|
1222
|
+
const HEADER_CONTENT_LENGTH = "content-length";
|
|
1223
|
+
const HEADER_HOST = "host";
|
|
1224
|
+
const AUTH_HEADER_X_API_KEY = "x-api-key";
|
|
1225
|
+
const CONTENT_TYPE_EVENT_STREAM = "text/event-stream";
|
|
1226
|
+
const STATUS_FORBIDDEN = 403;
|
|
1227
|
+
const STATUS_BAD_GATEWAY = 502;
|
|
1228
|
+
const PRESERVE_HEADERS = /* @__PURE__ */ new Set([HEADER_CONTENT_TYPE]);
|
|
1229
|
+
class FormatRegistryImpl {
|
|
1230
|
+
handlers = /* @__PURE__ */ new Map();
|
|
1231
|
+
pathMap = /* @__PURE__ */ new Map();
|
|
1232
|
+
register(handler) {
|
|
1233
|
+
this.handlers.set(handler.format, handler);
|
|
1234
|
+
}
|
|
1235
|
+
registerPath(path2, format) {
|
|
1236
|
+
this.pathMap.set(path2, format);
|
|
1237
|
+
}
|
|
1238
|
+
/** Get handler by format identifier */
|
|
1239
|
+
get(format) {
|
|
1240
|
+
return this.handlers.get(format);
|
|
1241
|
+
}
|
|
1242
|
+
/** Get handler matching a request path */
|
|
1243
|
+
getByPath(path2) {
|
|
1244
|
+
const messagesPath = path2.split("?")[0] ?? "";
|
|
1245
|
+
const format = this.pathMap.get(messagesPath);
|
|
1246
|
+
return format === void 0 ? void 0 : this.handlers.get(format);
|
|
1247
|
+
}
|
|
1248
|
+
/** Get the API format matching a request path without requiring handlers. */
|
|
1249
|
+
getApiFormatByPath(path2) {
|
|
1250
|
+
const messagesPath = path2.split("?")[0] ?? "";
|
|
1251
|
+
return this.pathMap.get(messagesPath);
|
|
1252
|
+
}
|
|
1253
|
+
/** Detect API format from request body content */
|
|
1254
|
+
detectFormat(rawBody) {
|
|
1255
|
+
if (rawBody === null) return "unknown";
|
|
1256
|
+
for (const handler of this.handlers.values()) {
|
|
1257
|
+
if (handler.detectFormat(rawBody)) return handler.format;
|
|
1258
|
+
}
|
|
1259
|
+
return "unknown";
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
const formatRegistry = new FormatRegistryImpl();
|
|
1263
|
+
function formatForPath(path2) {
|
|
1264
|
+
return formatRegistry.getByPath(path2) ?? null;
|
|
1265
|
+
}
|
|
1266
|
+
function apiFormatForPath(path2) {
|
|
1267
|
+
return formatRegistry.getApiFormatByPath(path2) ?? "unknown";
|
|
1268
|
+
}
|
|
1269
|
+
formatRegistry.registerPath(PATH_V1_MESSAGES, "anthropic");
|
|
1270
|
+
formatRegistry.registerPath(PATH_V1_CHAT_COMPLETIONS, "openai");
|
|
1271
|
+
formatRegistry.registerPath(PATH_CHAT_COMPLETIONS, "openai");
|
|
1217
1272
|
const IDLE_TIMEOUT_MS = Number(process.env["SESSION_PROCESS_IDLE_MS"]) || 5 * 60 * 1e3;
|
|
1218
1273
|
const MAX_RESTARTS = 3;
|
|
1219
1274
|
const _processes = /* @__PURE__ */ new Map();
|
|
@@ -1519,13 +1574,15 @@ function evictOldestIfNeeded() {
|
|
|
1519
1574
|
memoryCache.delete(oldestKey);
|
|
1520
1575
|
}
|
|
1521
1576
|
}
|
|
1522
|
-
function
|
|
1577
|
+
function normalizeLog(log) {
|
|
1523
1578
|
const sessionId = getLogSessionId(log);
|
|
1524
|
-
|
|
1525
|
-
|
|
1579
|
+
const pathFormat = apiFormatForPath(log.path);
|
|
1580
|
+
const apiFormat = pathFormat === "unknown" ? log.apiFormat : pathFormat;
|
|
1581
|
+
if (sessionId === log.sessionId && apiFormat === log.apiFormat) return log;
|
|
1582
|
+
return { ...log, sessionId, apiFormat };
|
|
1526
1583
|
}
|
|
1527
1584
|
function addToCache(log) {
|
|
1528
|
-
const cachedLog =
|
|
1585
|
+
const cachedLog = normalizeLog(log);
|
|
1529
1586
|
if (memoryCache.has(cachedLog.id)) {
|
|
1530
1587
|
memoryCache.delete(cachedLog.id);
|
|
1531
1588
|
}
|
|
@@ -1569,12 +1626,12 @@ async function addTestLogEntry(entry) {
|
|
|
1569
1626
|
explicitSessionId: entry.sessionId,
|
|
1570
1627
|
isTest: entry.isTest
|
|
1571
1628
|
});
|
|
1572
|
-
const log = {
|
|
1629
|
+
const log = normalizeLog({
|
|
1573
1630
|
id,
|
|
1574
1631
|
...entry,
|
|
1575
1632
|
sessionId: session.id,
|
|
1576
1633
|
streamingChunksPath
|
|
1577
|
-
};
|
|
1634
|
+
});
|
|
1578
1635
|
await runWithLogWriteLock(async () => {
|
|
1579
1636
|
const logFile = getCurrentLogFile();
|
|
1580
1637
|
appendLogEntry(log);
|
|
@@ -1593,7 +1650,7 @@ async function createLog(method, path2, requestBody, headers, clientInfo, rawHea
|
|
|
1593
1650
|
explicitSessionId: sessionId,
|
|
1594
1651
|
clientInfo
|
|
1595
1652
|
});
|
|
1596
|
-
const log = {
|
|
1653
|
+
const log = normalizeLog({
|
|
1597
1654
|
id,
|
|
1598
1655
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1599
1656
|
method,
|
|
@@ -1624,7 +1681,7 @@ async function createLog(method, path2, requestBody, headers, clientInfo, rawHea
|
|
|
1624
1681
|
clientCwd: clientInfo?.cwd ?? null,
|
|
1625
1682
|
clientProjectFolder: clientInfo?.projectFolder ?? null,
|
|
1626
1683
|
streamingChunksPath: null
|
|
1627
|
-
};
|
|
1684
|
+
});
|
|
1628
1685
|
await runWithLogWriteLock(async () => {
|
|
1629
1686
|
const logFile = getCurrentLogFile();
|
|
1630
1687
|
appendLogEntry(log);
|
|
@@ -1665,7 +1722,7 @@ async function getLogById(id) {
|
|
|
1665
1722
|
const parsed = JSON.parse(line);
|
|
1666
1723
|
const result = CapturedLogSchema.safeParse(parsed);
|
|
1667
1724
|
if (result.success) {
|
|
1668
|
-
const log =
|
|
1725
|
+
const log = normalizeLog(result.data);
|
|
1669
1726
|
addToCache(log);
|
|
1670
1727
|
observeSessionLog(log);
|
|
1671
1728
|
return log;
|
|
@@ -1701,7 +1758,7 @@ async function scanLogFileForId(filePath, id) {
|
|
|
1701
1758
|
if (desc !== void 0 && typeof desc.value === "number" && desc.value === id) {
|
|
1702
1759
|
const result = CapturedLogSchema.safeParse(parsed);
|
|
1703
1760
|
if (result.success) {
|
|
1704
|
-
lastMatch =
|
|
1761
|
+
lastMatch = normalizeLog(result.data);
|
|
1705
1762
|
if (result.data.responseStatus !== null) {
|
|
1706
1763
|
return lastMatch;
|
|
1707
1764
|
}
|
|
@@ -1749,7 +1806,7 @@ async function visitPersistedLogFile(filePath, visitor) {
|
|
|
1749
1806
|
const parsed = JSON.parse(line);
|
|
1750
1807
|
const result = CapturedLogSchema.safeParse(parsed);
|
|
1751
1808
|
if (result.success) {
|
|
1752
|
-
const log =
|
|
1809
|
+
const log = normalizeLog(result.data);
|
|
1753
1810
|
visitor(log);
|
|
1754
1811
|
}
|
|
1755
1812
|
} catch {
|
|
@@ -2197,63 +2254,6 @@ function emitLogUpdate(log) {
|
|
|
2197
2254
|
sseHandlers.delete(handler);
|
|
2198
2255
|
}
|
|
2199
2256
|
}
|
|
2200
|
-
const DEFAULT_UPSTREAM$1 = "https://api.anthropic.com";
|
|
2201
|
-
const DEFAULT_OPENAI_UPSTREAM$1 = "https://api.openai.com/v1";
|
|
2202
|
-
const PROXY_IDENTITY = process.env["PROXY_IDENTITY"] ?? "inspector9527@Tony";
|
|
2203
|
-
const PATH_V1_CHAT_COMPLETIONS = "/v1/chat/completions";
|
|
2204
|
-
const PATH_CHAT_COMPLETIONS = "/chat/completions";
|
|
2205
|
-
const PATH_V1_MESSAGES = "/v1/messages";
|
|
2206
|
-
const HEADER_CONTENT_TYPE = "content-type";
|
|
2207
|
-
const HEADER_USER_AGENT = "user-agent";
|
|
2208
|
-
const HEADER_X_PROXY_IDENTITY = "x-proxy-identity";
|
|
2209
|
-
const HEADER_AUTHORIZATION = "authorization";
|
|
2210
|
-
const HEADER_X_API_KEY = "x-api-key";
|
|
2211
|
-
const HEADER_CONTENT_ENCODING = "content-encoding";
|
|
2212
|
-
const HEADER_CONTENT_LENGTH = "content-length";
|
|
2213
|
-
const HEADER_HOST = "host";
|
|
2214
|
-
const AUTH_HEADER_X_API_KEY = "x-api-key";
|
|
2215
|
-
const CONTENT_TYPE_EVENT_STREAM = "text/event-stream";
|
|
2216
|
-
const STATUS_FORBIDDEN = 403;
|
|
2217
|
-
const STATUS_BAD_GATEWAY = 502;
|
|
2218
|
-
const PRESERVE_HEADERS = /* @__PURE__ */ new Set([HEADER_CONTENT_TYPE]);
|
|
2219
|
-
class FormatRegistryImpl {
|
|
2220
|
-
handlers = /* @__PURE__ */ new Map();
|
|
2221
|
-
pathMap = /* @__PURE__ */ new Map();
|
|
2222
|
-
register(handler) {
|
|
2223
|
-
this.handlers.set(handler.format, handler);
|
|
2224
|
-
}
|
|
2225
|
-
registerPath(path2, format) {
|
|
2226
|
-
this.pathMap.set(path2, format);
|
|
2227
|
-
}
|
|
2228
|
-
/** Get handler by format identifier */
|
|
2229
|
-
get(format) {
|
|
2230
|
-
return this.handlers.get(format);
|
|
2231
|
-
}
|
|
2232
|
-
/** Get handler matching a request path */
|
|
2233
|
-
getByPath(path2) {
|
|
2234
|
-
const messagesPath = path2.split("?")[0] ?? "";
|
|
2235
|
-
const format = this.pathMap.get(messagesPath);
|
|
2236
|
-
return format === void 0 ? void 0 : this.handlers.get(format);
|
|
2237
|
-
}
|
|
2238
|
-
/** Detect format from request body content */
|
|
2239
|
-
detectFormat(rawBody) {
|
|
2240
|
-
if (rawBody === null) return "unknown";
|
|
2241
|
-
for (const handler of this.handlers.values()) {
|
|
2242
|
-
if (handler.detectFormat(rawBody)) return handler.format;
|
|
2243
|
-
}
|
|
2244
|
-
return "unknown";
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
const formatRegistry = new FormatRegistryImpl();
|
|
2248
|
-
function formatForPath(path2) {
|
|
2249
|
-
return formatRegistry.getByPath(path2) ?? null;
|
|
2250
|
-
}
|
|
2251
|
-
function requestFormatForPath(path2) {
|
|
2252
|
-
return formatForPath(path2)?.format ?? "unknown";
|
|
2253
|
-
}
|
|
2254
|
-
formatRegistry.registerPath(PATH_V1_MESSAGES, "anthropic");
|
|
2255
|
-
formatRegistry.registerPath(PATH_V1_CHAT_COMPLETIONS, "openai");
|
|
2256
|
-
formatRegistry.registerPath(PATH_CHAT_COMPLETIONS, "openai");
|
|
2257
2257
|
function parseInputJson(json) {
|
|
2258
2258
|
if (json === "") return {};
|
|
2259
2259
|
try {
|
|
@@ -6096,7 +6096,7 @@ const Route$s = createFileRoute("/api/models")({
|
|
|
6096
6096
|
}
|
|
6097
6097
|
}
|
|
6098
6098
|
});
|
|
6099
|
-
const version = "2.0.
|
|
6099
|
+
const version = "2.0.38";
|
|
6100
6100
|
const packageJson = {
|
|
6101
6101
|
version
|
|
6102
6102
|
};
|
|
@@ -11731,19 +11731,19 @@ export {
|
|
|
11731
11731
|
DEFAULT_TIME_DISPLAY_FORMAT as c,
|
|
11732
11732
|
RuntimeConfigSchema as d,
|
|
11733
11733
|
AnthropicRequestSchema as e,
|
|
11734
|
-
|
|
11734
|
+
apiFormatForPath as f,
|
|
11735
11735
|
getSessionPath as g,
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11736
|
+
stripClaudeCodeBillingHeader as h,
|
|
11737
|
+
GroupEvidenceExportResultSchema as i,
|
|
11738
|
+
DeleteInspectorGroupResponseSchema as j,
|
|
11739
|
+
providerHasContextMetadata as k,
|
|
11740
|
+
findProviderModelMetadata as l,
|
|
11741
11741
|
maskApiKey as m,
|
|
11742
|
-
|
|
11743
|
-
|
|
11742
|
+
createPendingProviderTestResults as n,
|
|
11743
|
+
ProviderTestResultsSchema as o,
|
|
11744
11744
|
parseOpenAIResponse as p,
|
|
11745
|
-
|
|
11746
|
-
|
|
11745
|
+
createFailedProviderTestResults as q,
|
|
11746
|
+
MAX_PROVIDER_TEST_TIMEOUT_SECONDS as r,
|
|
11747
11747
|
safeGetOwnProperty as s,
|
|
11748
11748
|
resolveProviderContextWindow as t,
|
|
11749
11749
|
isPlainRecord as u,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/config", "/api/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/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/groups", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/runs", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-Blykwzsn.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-BdUTMQL6.js", "/assets/ProxyViewerContainer-BMKBs8Qz.js"] }, "/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/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-CVw5e8TK.js", "/assets/ProxyViewerContainer-BMKBs8Qz.js"] }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/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/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/runs/$runId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/runs.$runId.ts", "children": ["/api/runs/$runId/evidence"] }, "/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/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/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-Blykwzsn.js" });
|
|
2
2
|
export {
|
|
3
3
|
tsrStartManifest
|
|
4
4
|
};
|