@tonyclaw/agent-inspector 2.1.0 → 2.1.2

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.
Files changed (37) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-VDpcSNGM.js → CompareDrawer-BULPis8W.js} +1 -1
  3. package/.output/public/assets/ProxyViewerContainer-YxtP1xBj.js +117 -0
  4. package/.output/public/assets/{ReplayDialog-CoDgTzHR.js → ReplayDialog-3ln-D7OS.js} +1 -1
  5. package/.output/public/assets/{RequestAnatomy-t3plgkPE.js → RequestAnatomy-D8d1xV8O.js} +1 -1
  6. package/.output/public/assets/{ResponseView-BYuKiNeG.js → ResponseView-CJijikn-.js} +1 -1
  7. package/.output/public/assets/{StreamingChunkSequence-DOdU38Is.js → StreamingChunkSequence-C-RCuOTp.js} +1 -1
  8. package/.output/public/assets/_sessionId-DGehOTux.js +1 -0
  9. package/.output/public/assets/index-B-MZ9lQM.css +1 -0
  10. package/.output/public/assets/index-DhsjXb_K.js +1 -0
  11. package/.output/public/assets/{main-DmzLt6ti.js → main-D3pBFhb_.js} +2 -2
  12. package/.output/server/{_sessionId-CCN1UoEf.mjs → _sessionId-BFMVfrw3.mjs} +2 -2
  13. package/.output/server/_ssr/{CompareDrawer-DkSY3vxP.mjs → CompareDrawer-CwNPZgc_.mjs} +2 -2
  14. package/.output/server/_ssr/{ProxyViewerContainer-OTh1V_Kh.mjs → ProxyViewerContainer-HpLc7F_J.mjs} +270 -240
  15. package/.output/server/_ssr/{ReplayDialog-DhI6yxrR.mjs → ReplayDialog-DBaFhSv6.mjs} +3 -3
  16. package/.output/server/_ssr/{RequestAnatomy-DN1SJVVL.mjs → RequestAnatomy-D0E0e2DT.mjs} +2 -2
  17. package/.output/server/_ssr/{ResponseView-DW-kpJL5.mjs → ResponseView-D2FFSRQ8.mjs} +2 -2
  18. package/.output/server/_ssr/{StreamingChunkSequence-BAE57Fae.mjs → StreamingChunkSequence-Cdu36-rL.mjs} +2 -2
  19. package/.output/server/_ssr/{index-C9ryJEna.mjs → index-CtBfmJYM.mjs} +2 -2
  20. package/.output/server/_ssr/index.mjs +2 -2
  21. package/.output/server/_ssr/{router-DIIJGyML.mjs → router-Dzx1sbAQ.mjs} +4 -4
  22. package/.output/server/{_tanstack-start-manifest_v-C_v9-E5d.mjs → _tanstack-start-manifest_v-VrssoWVE.mjs} +1 -1
  23. package/.output/server/index.mjs +68 -68
  24. package/package.json +1 -1
  25. package/src/components/OnboardingBanner.tsx +6 -22
  26. package/src/components/ProxyViewer.tsx +2 -36
  27. package/src/components/ProxyViewerContainer.tsx +1 -2
  28. package/src/components/providers/SettingsDialog.tsx +0 -13
  29. package/src/components/proxy-viewer/LogEntry.tsx +198 -89
  30. package/src/components/proxy-viewer/LogEntryHeader.tsx +11 -7
  31. package/src/components/proxy-viewer/RequestToolsPanel.tsx +8 -8
  32. package/src/components/ui/json-viewer.tsx +6 -0
  33. package/styles/globals.css +53 -8
  34. package/.output/public/assets/ProxyViewerContainer-fsXSjqtm.js +0 -117
  35. package/.output/public/assets/_sessionId-ew5QlyZ2.js +0 -1
  36. package/.output/public/assets/index-DFICWD6o.js +0 -1
  37. package/.output/public/assets/index-zLLCkAnF.css +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, a as React } from "../_libs/react.mjs";
2
- import { I as InspectorGroupsListResponseSchema, C as CapturedLogSchema, D as DEFAULT_CAPTURE_MODE, a as DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS, b as DEFAULT_PROVIDER_TEST_TIMEOUT_SECONDS, c as DEFAULT_TIME_DISPLAY_FORMAT, d as RuntimeConfigSchema, v as packageJson, P as ProviderConfigSchema, f as apiFormatForPath, i as GroupEvidenceExportResultSchema, j as DeleteInspectorGroupResponseSchema, n as createPendingProviderTestResults, o as ProviderTestResultsSchema, q as createFailedProviderTestResults, M as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, r as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, T as TimeDisplayFormatSchema, g as getSessionPath, p as parseOpenAIResponse, O as OpenAIRequestSchema, A as AnthropicResponseSchema$1, e as AnthropicRequestSchema, s as safeGetOwnProperty, t as resolveProviderContextWindow, m as maskApiKey, k as providerHasContextMetadata, l as findProviderModelMetadata, K as KnowledgeCandidateSchema, h as stripClaudeCodeBillingHeader, u as isPlainRecord, G as GroupEvidenceReadResponseSchema } from "./router-DIIJGyML.mjs";
2
+ import { I as InspectorGroupsListResponseSchema, C as CapturedLogSchema, D as DEFAULT_CAPTURE_MODE, a as DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS, b as DEFAULT_PROVIDER_TEST_TIMEOUT_SECONDS, c as DEFAULT_TIME_DISPLAY_FORMAT, d as RuntimeConfigSchema, v as packageJson, P as ProviderConfigSchema, f as apiFormatForPath, i as GroupEvidenceExportResultSchema, j as DeleteInspectorGroupResponseSchema, n as createPendingProviderTestResults, o as ProviderTestResultsSchema, q as createFailedProviderTestResults, M as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, r as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, T as TimeDisplayFormatSchema, g as getSessionPath, p as parseOpenAIResponse, O as OpenAIRequestSchema, A as AnthropicResponseSchema$1, e as AnthropicRequestSchema, s as safeGetOwnProperty, t as resolveProviderContextWindow, m as maskApiKey, k as providerHasContextMetadata, l as findProviderModelMetadata, K as KnowledgeCandidateSchema, h as stripClaudeCodeBillingHeader, u as isPlainRecord, G as GroupEvidenceReadResponseSchema } from "./router-Dzx1sbAQ.mjs";
3
3
  import { u as useSWR, a as useSWRConfig } from "../_libs/swr.mjs";
4
4
  import { J as JSZip } from "../_libs/jszip.mjs";
5
5
  import { c as clsx } from "../_libs/clsx.mjs";
@@ -195,11 +195,9 @@ function useOnboarding() {
195
195
  };
196
196
  }
197
197
  function OnboardingBanner() {
198
- const { hasSeenOnboarding, captureMode, isLoading, markSeen } = useOnboarding();
198
+ const { hasSeenOnboarding, isLoading, markSeen } = useOnboarding();
199
199
  const [expanded, setExpanded] = reactExports.useState(false);
200
200
  if (isLoading || hasSeenOnboarding) return null;
201
- const isFullMode = captureMode === "full";
202
- const modeLabel = isFullMode ? "Full" : "Simple";
203
201
  const detailClass = expanded ? "grid" : "hidden sm:grid";
204
202
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
205
203
  "div",
@@ -212,33 +210,23 @@ function OnboardingBanner() {
212
210
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [
213
211
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
214
212
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-amber-200", children: "Inspector ready" }),
215
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 font-mono text-[10px] uppercase text-amber-100", children: modeLabel }),
216
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden truncate text-xs text-muted-foreground sm:inline", children: isFullMode ? "Raw headers, raw response, and SSE chunks are being captured." : "Request, response, tool, timing, token, replay, and memory signals are active." })
213
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden truncate text-xs text-muted-foreground sm:inline", children: "Request, response, tool, timing, token, replay, and memory signals are active." })
217
214
  ] }),
218
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-xs leading-relaxed text-muted-foreground sm:hidden", children: isFullMode ? "Full diagnostics are active." : "Core capture is active with lower overhead." }),
215
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-xs leading-relaxed text-muted-foreground sm:hidden", children: "Core capture is active." }),
219
216
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
220
217
  "div",
221
218
  {
222
- className: `${detailClass} mt-2 gap-x-4 gap-y-1 text-xs leading-relaxed text-muted-foreground sm:grid-cols-3`,
219
+ className: `${detailClass} mt-2 gap-x-4 gap-y-1 text-xs leading-relaxed text-muted-foreground sm:grid-cols-2`,
223
220
  children: [
224
221
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
225
- /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Mode" }),
226
- ": ",
227
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: captureMode }),
228
- " is fixed until restart."
229
- ] }),
230
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
231
- /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Diagnostics" }),
232
- ": use",
233
- " ",
234
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: isFullMode ? "agent-inspector --mode simple" : "agent-inspector --mode full" }),
235
- "."
222
+ /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Evidence" }),
223
+ ": logs, sessions, groups, and MCP exports are available."
236
224
  ] }),
237
225
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
238
226
  /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Network" }),
239
227
  ": replace ",
240
228
  /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: "localhost" }),
241
- " when containers differ."
229
+ " if containers differ."
242
230
  ] })
243
231
  ]
244
232
  }
@@ -1938,19 +1926,19 @@ function useCopyFeedback(text) {
1938
1926
  return { copied, copy };
1939
1927
  }
1940
1928
  const LazyCompareDrawer = reactExports.lazy(
1941
- () => import("./CompareDrawer-DkSY3vxP.mjs").then((m) => ({ default: m.CompareDrawer }))
1929
+ () => import("./CompareDrawer-CwNPZgc_.mjs").then((m) => ({ default: m.CompareDrawer }))
1942
1930
  );
1943
1931
  const LazyReplayDialog = reactExports.lazy(
1944
- () => import("./ReplayDialog-DhI6yxrR.mjs").then((m) => ({ default: m.ReplayDialog }))
1932
+ () => import("./ReplayDialog-DBaFhSv6.mjs").then((m) => ({ default: m.ReplayDialog }))
1945
1933
  );
1946
1934
  const LazyRequestAnatomy = reactExports.lazy(
1947
- () => import("./RequestAnatomy-DN1SJVVL.mjs").then((m) => ({ default: m.RequestAnatomy }))
1935
+ () => import("./RequestAnatomy-D0E0e2DT.mjs").then((m) => ({ default: m.RequestAnatomy }))
1948
1936
  );
1949
1937
  const LazyResponseView = reactExports.lazy(
1950
- () => import("./ResponseView-DW-kpJL5.mjs").then((m) => ({ default: m.ResponseView }))
1938
+ () => import("./ResponseView-D2FFSRQ8.mjs").then((m) => ({ default: m.ResponseView }))
1951
1939
  );
1952
1940
  const LazyStreamingChunkSequence = reactExports.lazy(
1953
- () => import("./StreamingChunkSequence-BAE57Fae.mjs").then((m) => ({
1941
+ () => import("./StreamingChunkSequence-Cdu36-rL.mjs").then((m) => ({
1954
1942
  default: m.StreamingChunkSequence
1955
1943
  }))
1956
1944
  );
@@ -2352,6 +2340,7 @@ const STATUS_BADGE_CLASSES = {
2352
2340
  server_error: "bg-rose-500/15 text-rose-400 border-rose-500/25",
2353
2341
  pending: "bg-muted text-muted-foreground border-border"
2354
2342
  };
2343
+ const HEADER_ACTION_BUTTON_CLASS = "size-8 border-white/10 bg-[#0a0d11] text-muted-foreground shadow-none hover:border-cyan-300/30 hover:bg-cyan-400/10 hover:text-cyan-100";
2355
2344
  function formatElapsed$3(ms) {
2356
2345
  if (ms < 1e3) return `${ms}ms`;
2357
2346
  return `${(ms / 1e3).toFixed(1)}s`;
@@ -2404,7 +2393,7 @@ const LogEntryHeader = reactExports.memo(function({
2404
2393
  "data-nav-action": expanded ? "collapse" : "expand",
2405
2394
  className: cn(
2406
2395
  "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 px-3 py-1.5 cursor-pointer transition-colors",
2407
- "hover:bg-muted/50",
2396
+ expanded ? "bg-[#0c1015]" : "hover:bg-muted/30",
2408
2397
  "select-none",
2409
2398
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-none"
2410
2399
  ),
@@ -2589,7 +2578,7 @@ const LogEntryHeader = reactExports.memo(function({
2589
2578
  {
2590
2579
  variant: "outline",
2591
2580
  size: "icon",
2592
- className: "size-8",
2581
+ className: HEADER_ACTION_BUTTON_CLASS,
2593
2582
  onClick: action.expansion.onToggle,
2594
2583
  disabled: action.expansion.isPending,
2595
2584
  "aria-pressed": action.expansion.isExpanded,
@@ -2606,8 +2595,8 @@ const LogEntryHeader = reactExports.memo(function({
2606
2595
  variant: "outline",
2607
2596
  size: "icon",
2608
2597
  className: cn(
2609
- "size-8",
2610
- action.diffWithRaw.active && "bg-accent text-accent-foreground"
2598
+ HEADER_ACTION_BUTTON_CLASS,
2599
+ action.diffWithRaw.active && "border-cyan-300/35 bg-cyan-400/15 text-cyan-100"
2611
2600
  ),
2612
2601
  onClick: action.diffWithRaw.onToggle,
2613
2602
  "aria-pressed": action.diffWithRaw.active,
@@ -2623,7 +2612,7 @@ const LogEntryHeader = reactExports.memo(function({
2623
2612
  {
2624
2613
  variant: "outline",
2625
2614
  size: "icon",
2626
- className: "size-8",
2615
+ className: HEADER_ACTION_BUTTON_CLASS,
2627
2616
  onClick: action.diffWithPrevious,
2628
2617
  "aria-label": "Diff with previous",
2629
2618
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(History, { className: "size-3.5" })
@@ -2637,7 +2626,7 @@ const LogEntryHeader = reactExports.memo(function({
2637
2626
  {
2638
2627
  variant: "outline",
2639
2628
  size: "icon",
2640
- className: "size-8",
2629
+ className: HEADER_ACTION_BUTTON_CLASS,
2641
2630
  onClick: action.onCopy,
2642
2631
  "aria-label": action.copyCopied ? "Copied" : action.copyLabel,
2643
2632
  children: action.copyCopied ? /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-3.5 text-emerald-500" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-3.5" })
@@ -2653,7 +2642,7 @@ const LogEntryHeader = reactExports.memo(function({
2653
2642
  {
2654
2643
  variant: "outline",
2655
2644
  size: "icon",
2656
- className: "size-8",
2645
+ className: HEADER_ACTION_BUTTON_CLASS,
2657
2646
  onClick: onReplay,
2658
2647
  "aria-label": "Replay request",
2659
2648
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "size-3.5" })
@@ -2996,6 +2985,10 @@ function JsonViewer({
2996
2985
  const isArray = dataType === "array";
2997
2986
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("font-mono text-xs leading-relaxed", className), children: [
2998
2987
  showCopy && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 flex items-center justify-end gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyValueButton, { value: data }) }),
2988
+ entries.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-md border border-white/10 bg-black/20 px-3 py-2 text-muted-foreground", children: [
2989
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-cyan-300", children: isArray ? "[]" : "{}" }),
2990
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 text-[10px] uppercase", children: "0 items" })
2991
+ ] }),
2999
2992
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: entries.map(([key, childValue]) => /* @__PURE__ */ jsxRuntimeExports.jsx(
3000
2993
  JsonNode,
3001
2994
  {
@@ -3151,7 +3144,7 @@ function ToolRow({ tool, called }) {
3151
3144
  const [open, setOpen] = reactExports.useState(false);
3152
3145
  const nameCopy = useCopyFeedback(tool.name);
3153
3146
  const hasDetails = tool.description !== null || tool.requiredParameters.length > 0 || tool.schema !== null;
3154
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Collapsible, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-md border border-border/60 bg-background/40", children: [
3147
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Collapsible, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-md border border-white/10 bg-black/20 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]", children: [
3155
3148
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-center gap-2 px-2.5 py-2", children: [
3156
3149
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
3157
3150
  "button",
@@ -3193,10 +3186,10 @@ function ToolRow({ tool, called }) {
3193
3186
  }
3194
3187
  )
3195
3188
  ] }),
3196
- /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 border-t border-border/60 px-2.5 py-2", children: [
3189
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 border-t border-white/10 bg-white/[0.02] px-2.5 py-2", children: [
3197
3190
  tool.description !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs leading-relaxed text-muted-foreground", children: tool.description }),
3198
3191
  /* @__PURE__ */ jsxRuntimeExports.jsx(RequiredParameters, { names: tool.requiredParameters }),
3199
- tool.schema !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "max-h-64 rounded-md border border-border/60 bg-muted/20 p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonViewer, { data: safeJsonValue(tool.schema), defaultExpandDepth: 0 }) })
3192
+ tool.schema !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "max-h-64 rounded-md border border-white/10 bg-[#06080b] p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonViewer, { data: safeJsonValue(tool.schema), defaultExpandDepth: 0 }) })
3200
3193
  ] }) })
3201
3194
  ] }) });
3202
3195
  }
@@ -3220,7 +3213,7 @@ const RequestTools = reactExports.memo(function RequestTools2({
3220
3213
  if (summary === null) return null;
3221
3214
  const previewTools = summary.tools.slice(0, 6);
3222
3215
  const hiddenPreviewCount = summary.tools.length - previewTools.length;
3223
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mb-3 rounded-lg border border-border/70 bg-muted/20", children: [
3216
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mb-3 overflow-hidden rounded-md border border-white/10 bg-[#080b0f] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: [
3224
3217
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2 px-3 py-2", children: [
3225
3218
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
3226
3219
  /* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "size-4 shrink-0 text-sky-300/80" }),
@@ -3264,7 +3257,7 @@ const RequestTools = reactExports.memo(function RequestTools2({
3264
3257
  type: "button",
3265
3258
  variant: "ghost",
3266
3259
  size: "sm",
3267
- className: "h-7 px-2",
3260
+ className: "h-7 border border-white/10 bg-black/20 px-2 text-muted-foreground hover:border-cyan-300/30 hover:bg-cyan-400/10 hover:text-cyan-100",
3268
3261
  onClick: () => setExpanded((value) => !value),
3269
3262
  "aria-expanded": expanded,
3270
3263
  children: [
@@ -3274,7 +3267,7 @@ const RequestTools = reactExports.memo(function RequestTools2({
3274
3267
  }
3275
3268
  )
3276
3269
  ] }),
3277
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-wrap gap-1.5 border-t border-border/60 px-3 py-2", children: [
3270
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-wrap gap-1.5 border-t border-white/10 bg-black/10 px-3 py-2", children: [
3278
3271
  previewTools.map((tool) => /* @__PURE__ */ jsxRuntimeExports.jsx(
3279
3272
  Badge,
3280
3273
  {
@@ -3292,8 +3285,8 @@ const RequestTools = reactExports.memo(function RequestTools2({
3292
3285
  hiddenPreviewCount
3293
3286
  ] })
3294
3287
  ] }),
3295
- expanded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 border-t border-border/60 px-3 py-3", children: [
3296
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex h-8 items-center gap-2 rounded-md border border-border/70 bg-background/50 px-2 text-xs", children: [
3288
+ expanded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 border-t border-white/10 bg-black/15 px-3 py-3", children: [
3289
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex h-8 items-center gap-2 rounded-md border border-white/10 bg-[#06080b] px-2 text-xs", children: [
3297
3290
  /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "size-3.5 shrink-0 text-muted-foreground" }),
3298
3291
  /* @__PURE__ */ jsxRuntimeExports.jsx(
3299
3292
  "input",
@@ -3512,9 +3505,73 @@ function resolveFocusedTab(tab, anatomySegments) {
3512
3505
  return "request";
3513
3506
  }
3514
3507
  }
3508
+ const TAB_TRIGGER_CLASS = "h-9 flex-none rounded-none border-0 border-b-2 border-transparent bg-transparent px-3 text-xs font-semibold text-muted-foreground shadow-none hover:bg-cyan-400/[0.04] hover:text-foreground data-[state=active]:border-cyan-300 data-[state=active]:bg-transparent data-[state=active]:text-cyan-100 data-[state=active]:shadow-none";
3515
3509
  function shouldHydrateLogBody(log) {
3516
3510
  return log.bodyContentMode === "compact" || log.bodyContentMode === "truncated";
3517
3511
  }
3512
+ function ExpandedPanel({
3513
+ children,
3514
+ className
3515
+ }) {
3516
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
3517
+ "div",
3518
+ {
3519
+ className: cn(
3520
+ "inspector-scrollbar mx-3 mb-3 max-h-[72vh] overflow-auto rounded-md border border-white/10 bg-[#06080b] p-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",
3521
+ className
3522
+ ),
3523
+ children
3524
+ }
3525
+ );
3526
+ }
3527
+ function EmptyState({ children }) {
3528
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md border border-dashed border-white/10 bg-white/[0.02] px-3 py-5 text-center text-xs italic text-muted-foreground", children });
3529
+ }
3530
+ function RawTextBlock({ children }) {
3531
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "inspector-scrollbar max-h-[64vh] overflow-auto whitespace-pre-wrap break-words rounded-md border border-white/10 bg-black/30 p-3 font-mono text-xs leading-relaxed text-muted-foreground", children });
3532
+ }
3533
+ const NOTICE_TONE_CLASSES = {
3534
+ loading: "border-cyan-400/25 bg-cyan-400/[0.06] text-cyan-100",
3535
+ warning: "border-amber-400/25 bg-amber-400/[0.08] text-amber-100",
3536
+ danger: "border-rose-400/25 bg-rose-400/[0.08] text-rose-100"
3537
+ };
3538
+ function NoticeBlock({
3539
+ tone,
3540
+ title,
3541
+ children
3542
+ }) {
3543
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3544
+ "div",
3545
+ {
3546
+ className: cn(
3547
+ "mb-3 rounded-md border px-3 py-2 text-xs shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",
3548
+ NOTICE_TONE_CLASSES[tone]
3549
+ ),
3550
+ children: [
3551
+ title !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-1 font-semibold", children: title }),
3552
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "leading-relaxed text-muted-foreground", children })
3553
+ ]
3554
+ }
3555
+ );
3556
+ }
3557
+ function HeaderRows({
3558
+ headers,
3559
+ emptyLabel
3560
+ }) {
3561
+ const entries = headers === void 0 ? [] : Object.entries(headers).sort(([left], [right]) => left.localeCompare(right));
3562
+ if (entries.length === 0) return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState, { children: emptyLabel });
3563
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-hidden rounded-md border border-white/10 bg-black/20 font-mono text-xs", children: entries.map(([key, value]) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
3564
+ "div",
3565
+ {
3566
+ className: "grid min-w-0 grid-cols-[minmax(140px,0.32fr)_minmax(0,1fr)] border-b border-white/5 last:border-b-0",
3567
+ children: [
3568
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-0 truncate border-r border-white/5 bg-white/[0.03] px-2.5 py-2 font-semibold text-cyan-200", children: key }),
3569
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-0 truncate px-2.5 py-2 text-muted-foreground", title: value, children: value })
3570
+ ]
3571
+ },
3572
+ key
3573
+ )) });
3574
+ }
3518
3575
  function DiffToggleButton({
3519
3576
  active,
3520
3577
  onClick
@@ -3525,7 +3582,10 @@ function DiffToggleButton({
3525
3582
  {
3526
3583
  variant: active ? "default" : "outline",
3527
3584
  size: "sm",
3528
- className: "h-8 text-xs",
3585
+ className: cn(
3586
+ "h-8 border-white/10 text-xs shadow-none",
3587
+ active ? "bg-cyan-300 text-black hover:bg-cyan-200" : "bg-[#0a0d11] text-muted-foreground hover:border-cyan-300/30 hover:bg-cyan-400/10 hover:text-cyan-100"
3588
+ ),
3529
3589
  onClick,
3530
3590
  "aria-pressed": active,
3531
3591
  children: [
@@ -3756,162 +3816,177 @@ const LogEntry = reactExports.memo(function({
3756
3816
  };
3757
3817
  }, [anatomySegments, log.id]);
3758
3818
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { children: [
3759
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-border rounded-lg mb-1 overflow-hidden", children: [
3760
- /* @__PURE__ */ jsxRuntimeExports.jsx(
3761
- LogEntryHeader,
3762
- {
3763
- log: displayLog,
3764
- messageCount: requestAnalysis.messageCount,
3765
- toolCount: requestAnalysis.toolCount,
3766
- expanded,
3767
- onToggle: handleToggleExpanded,
3768
- cacheTrend,
3769
- slowResponseThresholdSeconds,
3770
- timeDisplayFormat,
3771
- activeTab,
3772
- tabActions,
3773
- onReplay: onCompareWithPrevious === void 0 ? void 0 : () => {
3774
- setReplayOpen(true);
3775
- }
3776
- }
3777
- ),
3778
- expanded && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, children: [
3779
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "mx-4 mt-2", children: [
3780
- viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "raw-headers", children: "Raw Headers" }),
3781
- viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "headers", children: "Headers" }),
3782
- anatomySegments !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "anatomy", children: "Context" }),
3783
- shouldShowRawRequestTab(resolvedFormat, viewMode, strip) && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "raw-request", children: "Raw Request" }),
3784
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "request", children: "Request" }),
3785
- viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "raw", children: "Raw Response" }),
3786
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "parsed", children: "Response" })
3787
- ] }),
3788
- shouldShowRawRequestTab(resolvedFormat, viewMode, strip) && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw-request", children: activeTab === "raw-request" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 pt-1 pb-3", children: displayLog.rawRequestBody === null ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No request body" }) : rawRequestExpansion.parsedData !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3789
- LazyJsonViewer,
3790
- {
3791
- data: rawRequestExpansion.parsedData,
3792
- bulkDepth: rawRequestExpansion.bulkDepth,
3793
- bulkRevision: rawRequestExpansion.bulkRevision
3794
- }
3795
- ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "font-mono text-xs whitespace-pre-wrap break-words", children: displayLog.rawRequestBody }) }) }),
3796
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "request", children: activeTab === "request" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 pt-1 pb-3", children: [
3797
- bodyHydrationState === "loading" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-3 rounded border border-border bg-muted/30 p-3 text-xs text-muted-foreground", children: "Loading full request and response bodies..." }),
3798
- bodyHydrationState === "failed" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-3 rounded border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-200", children: "Full request and response bodies could not be loaded. Compact metadata is still available." }),
3799
- warnings.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-3 rounded border border-amber-500/30 bg-amber-500/10 p-3 text-xs", children: [
3800
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 font-semibold text-amber-300", children: [
3801
- /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { className: "size-3.5" }),
3802
- "Tool schema warnings"
3803
- ] }),
3804
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "mt-2 space-y-1 text-muted-foreground", children: warnings.map((warning) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: warning }, warning)) })
3805
- ] }),
3819
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
3820
+ "div",
3821
+ {
3822
+ className: cn(
3823
+ "mb-2 overflow-hidden rounded-md border bg-[#090a0d] transition-[background-color,border-color,box-shadow]",
3824
+ expanded ? "border-cyan-300/20 shadow-[0_18px_60px_rgba(0,0,0,0.28),inset_0_1px_0_rgba(255,255,255,0.05)]" : "border-border/70 hover:border-border"
3825
+ ),
3826
+ children: [
3806
3827
  /* @__PURE__ */ jsxRuntimeExports.jsx(
3807
- RequestTools,
3828
+ LogEntryHeader,
3808
3829
  {
3809
- summary: requestTools,
3810
- calledToolNames: responseAnalysis.toolNames ?? []
3811
- }
3812
- ),
3813
- requestDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3814
- RequestDiffContent,
3815
- {
3816
- rawBody: displayLog.rawRequestBody,
3817
- displayedBody: displayedRequestBody,
3818
- emptyLabel: "No transformation applied; raw and sent request bodies are identical."
3819
- }
3820
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: requestJsonRef, children: displayedRequestBody === null ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No request body" }) : requestExpansion.parsedData !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3821
- LazyJsonViewer,
3822
- {
3823
- data: requestExpansion.parsedData,
3824
- bulkDepth: requestExpansion.bulkDepth,
3825
- bulkRevision: requestExpansion.bulkRevision,
3826
- anatomyPaths,
3827
- expandToPath
3828
- }
3829
- ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "font-mono text-xs whitespace-pre-wrap break-words", children: displayedRequestBody }) })
3830
- ] }) }),
3831
- anatomySegments !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "anatomy", children: activeTab === "anatomy" && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3832
- LazyRequestAnatomy,
3833
- {
3834
- parsed: requestExpansion.parsedData,
3835
- inputTokens: displayLog.inputTokens ?? null,
3836
- model: displayLog.model,
3837
- segments: anatomySegments,
3838
- onSegmentActivate: jumpToAnatomySegment
3839
- }
3840
- ) }) }),
3841
- viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "headers", children: activeTab === "headers" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 pt-1 pb-3", children: [
3842
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end gap-2 mb-2", children: shouldShowHeadersDiffButton(
3843
- viewMode,
3844
- displayLog.rawHeaders !== void 0 && Object.keys(displayLog.rawHeaders).length > 0
3845
- ) && /* @__PURE__ */ jsxRuntimeExports.jsx(
3846
- DiffToggleButton,
3847
- {
3848
- active: headersDiff,
3849
- onClick: (e) => {
3850
- e.stopPropagation();
3851
- setHeadersDiff(!headersDiff);
3830
+ log: displayLog,
3831
+ messageCount: requestAnalysis.messageCount,
3832
+ toolCount: requestAnalysis.toolCount,
3833
+ expanded,
3834
+ onToggle: handleToggleExpanded,
3835
+ cacheTrend,
3836
+ slowResponseThresholdSeconds,
3837
+ timeDisplayFormat,
3838
+ activeTab,
3839
+ tabActions,
3840
+ onReplay: onCompareWithPrevious === void 0 ? void 0 : () => {
3841
+ setReplayOpen(true);
3852
3842
  }
3853
3843
  }
3854
- ) }),
3855
- headersDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3856
- HeadersDiffContent,
3857
- {
3858
- rawHeaders: displayLog.rawHeaders,
3859
- headers: displayLog.headers,
3860
- emptyLabel: "No transformation applied; raw and processed headers are identical."
3861
- }
3862
- ) : displayLog.headers && Object.keys(displayLog.headers).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1 font-mono text-xs", children: Object.entries(displayLog.headers).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
3863
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-blue-600 dark:text-blue-400 font-semibold shrink-0", children: [
3864
- key,
3865
- ":"
3866
- ] }),
3867
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground truncate", title: value, children: value })
3868
- ] }, key)) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No headers captured" })
3869
- ] }) }),
3870
- viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw-headers", children: activeTab === "raw-headers" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 pt-1 pb-3", children: displayLog.rawHeaders && Object.keys(displayLog.rawHeaders).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1 font-mono text-xs", children: Object.entries(displayLog.rawHeaders).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
3871
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-blue-600 dark:text-blue-400 font-semibold shrink-0", children: [
3872
- key,
3873
- ":"
3874
- ] }),
3875
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground truncate", title: value, children: value })
3876
- ] }, key)) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No raw headers captured" }) }) }),
3877
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw", children: activeTab === "raw" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 pt-1 pb-3 space-y-3", children: [
3878
- displayLog.error !== void 0 && displayLog.error !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded border border-destructive/50 bg-destructive/10 p-3 text-xs", children: [
3879
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-destructive mb-1", children: "SSE Error" }),
3880
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-muted-foreground font-mono", children: displayLog.error })
3881
- ] }),
3882
- displayLog.responseText !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3883
- LazyJsonViewerFromString,
3884
- {
3885
- text: displayLog.responseText,
3886
- defaultExpandDepth: 0,
3887
- bulkDepth: responseExpansion.bulkDepth,
3888
- bulkRevision: responseExpansion.bulkRevision
3889
- }
3890
- ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "No response" }),
3891
- displayLog.streaming === true && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3892
- LazyStreamingChunkSequence,
3844
+ ),
3845
+ expanded && /* @__PURE__ */ jsxRuntimeExports.jsx(
3846
+ "div",
3893
3847
  {
3894
- logId: displayLog.id,
3895
- truncated: displayLog.streamingChunksPath !== null
3848
+ className: "border-t border-white/10 bg-[#050607]/80 pt-2",
3849
+ onClick: (e) => e.stopPropagation(),
3850
+ onKeyDown: (e) => e.stopPropagation(),
3851
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, className: "gap-2", children: [
3852
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
3853
+ TabsList,
3854
+ {
3855
+ variant: "line",
3856
+ className: "inspector-scrollbar mx-3 h-auto w-[calc(100%-1.5rem)] justify-start overflow-x-auto rounded-none border-b border-white/10 bg-transparent p-0",
3857
+ children: [
3858
+ viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "raw-headers", children: "Raw Headers" }),
3859
+ viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "headers", children: "Headers" }),
3860
+ anatomySegments !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "anatomy", children: "Context" }),
3861
+ shouldShowRawRequestTab(resolvedFormat, viewMode, strip) && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "raw-request", children: "Raw Request" }),
3862
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "request", children: "Request" }),
3863
+ viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "raw", children: "Raw Response" }),
3864
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { className: TAB_TRIGGER_CLASS, value: "parsed", children: "Response" })
3865
+ ]
3866
+ }
3867
+ ),
3868
+ shouldShowRawRequestTab(resolvedFormat, viewMode, strip) && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw-request", children: activeTab === "raw-request" && /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedPanel, { children: displayLog.rawRequestBody === null ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState, { children: "No request body" }) : rawRequestExpansion.parsedData !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3869
+ LazyJsonViewer,
3870
+ {
3871
+ data: rawRequestExpansion.parsedData,
3872
+ bulkDepth: rawRequestExpansion.bulkDepth,
3873
+ bulkRevision: rawRequestExpansion.bulkRevision
3874
+ }
3875
+ ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RawTextBlock, { children: displayLog.rawRequestBody }) }) }),
3876
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "request", children: activeTab === "request" && /* @__PURE__ */ jsxRuntimeExports.jsxs(ExpandedPanel, { children: [
3877
+ bodyHydrationState === "loading" && /* @__PURE__ */ jsxRuntimeExports.jsx(NoticeBlock, { tone: "loading", children: "Loading full request and response bodies..." }),
3878
+ bodyHydrationState === "failed" && /* @__PURE__ */ jsxRuntimeExports.jsx(NoticeBlock, { tone: "warning", children: "Full request and response bodies could not be loaded. Compact metadata is still available." }),
3879
+ warnings.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(NoticeBlock, { tone: "warning", children: [
3880
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 font-semibold text-amber-300", children: [
3881
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { className: "size-3.5" }),
3882
+ "Tool schema warnings"
3883
+ ] }),
3884
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "mt-2 space-y-1 text-muted-foreground", children: warnings.map((warning) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: warning }, warning)) })
3885
+ ] }),
3886
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
3887
+ RequestTools,
3888
+ {
3889
+ summary: requestTools,
3890
+ calledToolNames: responseAnalysis.toolNames ?? []
3891
+ }
3892
+ ),
3893
+ requestDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3894
+ RequestDiffContent,
3895
+ {
3896
+ rawBody: displayLog.rawRequestBody,
3897
+ displayedBody: displayedRequestBody,
3898
+ emptyLabel: "No transformation applied; raw and sent request bodies are identical."
3899
+ }
3900
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: requestJsonRef, children: displayedRequestBody === null ? /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState, { children: "No request body" }) : requestExpansion.parsedData !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3901
+ LazyJsonViewer,
3902
+ {
3903
+ data: requestExpansion.parsedData,
3904
+ bulkDepth: requestExpansion.bulkDepth,
3905
+ bulkRevision: requestExpansion.bulkRevision,
3906
+ anatomyPaths,
3907
+ expandToPath
3908
+ }
3909
+ ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RawTextBlock, { children: displayedRequestBody }) })
3910
+ ] }) }),
3911
+ anatomySegments !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "anatomy", children: activeTab === "anatomy" && /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedPanel, { className: "p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3912
+ LazyRequestAnatomy,
3913
+ {
3914
+ parsed: requestExpansion.parsedData,
3915
+ inputTokens: displayLog.inputTokens ?? null,
3916
+ model: displayLog.model,
3917
+ segments: anatomySegments,
3918
+ onSegmentActivate: jumpToAnatomySegment
3919
+ }
3920
+ ) }) }) }),
3921
+ viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "headers", children: activeTab === "headers" && /* @__PURE__ */ jsxRuntimeExports.jsxs(ExpandedPanel, { children: [
3922
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end gap-2 mb-2", children: shouldShowHeadersDiffButton(
3923
+ viewMode,
3924
+ displayLog.rawHeaders !== void 0 && Object.keys(displayLog.rawHeaders).length > 0
3925
+ ) && /* @__PURE__ */ jsxRuntimeExports.jsx(
3926
+ DiffToggleButton,
3927
+ {
3928
+ active: headersDiff,
3929
+ onClick: (e) => {
3930
+ e.stopPropagation();
3931
+ setHeadersDiff(!headersDiff);
3932
+ }
3933
+ }
3934
+ ) }),
3935
+ headersDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
3936
+ HeadersDiffContent,
3937
+ {
3938
+ rawHeaders: displayLog.rawHeaders,
3939
+ headers: displayLog.headers,
3940
+ emptyLabel: "No transformation applied; raw and processed headers are identical."
3941
+ }
3942
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderRows, { headers: displayLog.headers, emptyLabel: "No headers captured" })
3943
+ ] }) }),
3944
+ viewMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw-headers", children: activeTab === "raw-headers" && /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedPanel, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3945
+ HeaderRows,
3946
+ {
3947
+ headers: displayLog.rawHeaders,
3948
+ emptyLabel: "No raw headers captured"
3949
+ }
3950
+ ) }) }),
3951
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "raw", children: activeTab === "raw" && /* @__PURE__ */ jsxRuntimeExports.jsxs(ExpandedPanel, { className: "space-y-3", children: [
3952
+ displayLog.error !== void 0 && displayLog.error !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(NoticeBlock, { tone: "danger", title: "SSE Error", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: displayLog.error }) }),
3953
+ displayLog.responseText !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3954
+ LazyJsonViewerFromString,
3955
+ {
3956
+ text: displayLog.responseText,
3957
+ defaultExpandDepth: 0,
3958
+ bulkDepth: responseExpansion.bulkDepth,
3959
+ bulkRevision: responseExpansion.bulkRevision
3960
+ }
3961
+ ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyState, { children: "No response" }),
3962
+ displayLog.streaming === true && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3963
+ LazyStreamingChunkSequence,
3964
+ {
3965
+ logId: displayLog.id,
3966
+ truncated: displayLog.streamingChunksPath !== null
3967
+ }
3968
+ ) })
3969
+ ] }) }),
3970
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "parsed", children: activeTab === "parsed" && /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandedPanel, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3971
+ LazyResponseView,
3972
+ {
3973
+ responseText: displayLog.responseText,
3974
+ responseStatus: displayLog.responseStatus,
3975
+ streaming: displayLog.streaming,
3976
+ inputTokens: displayLog.inputTokens,
3977
+ outputTokens: displayLog.outputTokens,
3978
+ cacheCreationInputTokens: displayLog.cacheCreationInputTokens,
3979
+ cacheReadInputTokens: displayLog.cacheReadInputTokens,
3980
+ apiFormat: resolvedFormat,
3981
+ error: displayLog.error
3982
+ }
3983
+ ) }) }) })
3984
+ ] })
3896
3985
  }
3897
- ) })
3898
- ] }) }),
3899
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "parsed", children: activeTab === "parsed" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 pt-1 pb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(TabFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3900
- LazyResponseView,
3901
- {
3902
- responseText: displayLog.responseText,
3903
- responseStatus: displayLog.responseStatus,
3904
- streaming: displayLog.streaming,
3905
- inputTokens: displayLog.inputTokens,
3906
- outputTokens: displayLog.outputTokens,
3907
- cacheCreationInputTokens: displayLog.cacheCreationInputTokens,
3908
- cacheReadInputTokens: displayLog.cacheReadInputTokens,
3909
- apiFormat: resolvedFormat,
3910
- error: displayLog.error
3911
- }
3912
- ) }) }) })
3913
- ] }) })
3914
- ] }),
3986
+ )
3987
+ ]
3988
+ }
3989
+ ),
3915
3990
  /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LazyReplayDialog, { log: displayLog, open: replayOpen, onOpenChange: setReplayOpen }) })
3916
3991
  ] });
3917
3992
  });
@@ -8822,7 +8897,6 @@ args = ["stdio", "--url", "${endpoint}"]`
8822
8897
  function ProxySettingsTab() {
8823
8898
  const {
8824
8899
  strip,
8825
- captureMode,
8826
8900
  slowResponseThresholdSeconds,
8827
8901
  providerTestTimeoutSeconds,
8828
8902
  timeDisplayFormat,
@@ -8834,7 +8908,6 @@ function ProxySettingsTab() {
8834
8908
  } = useStripConfig();
8835
8909
  const [error, setError] = reactExports.useState(null);
8836
8910
  const [pending, setPending] = reactExports.useState(false);
8837
- const alternateCaptureMode = captureMode === "full" ? "simple" : "full";
8838
8911
  const handleToggle = reactExports.useCallback(
8839
8912
  async (next) => {
8840
8913
  setError(null);
@@ -8892,21 +8965,6 @@ function ProxySettingsTab() {
8892
8965
  [setTimeDisplayFormat]
8893
8966
  );
8894
8967
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
8895
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
8896
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold", children: "Capture mode" }),
8897
- /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-muted-foreground", children: [
8898
- "This process is running in ",
8899
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: captureMode }),
8900
- " mode. Restart with",
8901
- " ",
8902
- /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { children: [
8903
- "agent-inspector --mode ",
8904
- alternateCaptureMode
8905
- ] }),
8906
- " to change it.",
8907
- captureMode === "simple" ? " Simple mode keeps replay, parsed requests, responses, timing, tools, and token usage while skipping raw headers, raw response retention, and detailed SSE chunk retention." : " Full mode retains raw headers, raw responses, and SSE chunks for diagnostics; use simple mode for everyday lower-overhead capture."
8908
- ] })
8909
- ] }),
8910
8968
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
8911
8969
  /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold", children: "Claude Code billing header" }),
8912
8970
  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-muted-foreground", children: [
@@ -11123,7 +11181,6 @@ function ProxyViewer({
11123
11181
  onClearAll,
11124
11182
  onClearGroup,
11125
11183
  viewMode,
11126
- onViewModeChange,
11127
11184
  captureMode,
11128
11185
  strip,
11129
11186
  slowResponseThresholdSeconds,
@@ -11221,8 +11278,8 @@ function ProxyViewer({
11221
11278
  },
11222
11279
  [comparisonPredecessors]
11223
11280
  );
11224
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#070809] text-foreground", children: [
11225
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-auto grid min-h-screen max-w-[1920px] grid-cols-1 lg:grid-cols-[340px_minmax(0,1fr)] xl:grid-cols-[360px_minmax(0,1fr)]", children: [
11281
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen w-full bg-[#070809] text-foreground", children: [
11282
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid min-h-screen w-full grid-cols-1 lg:grid-cols-[340px_minmax(0,1fr)] xl:grid-cols-[360px_minmax(0,1fr)]", children: [
11226
11283
  /* @__PURE__ */ jsxRuntimeExports.jsx("aside", { className: "border-b border-border bg-[#090a0c] lg:sticky lg:top-0 lg:h-screen lg:overflow-y-auto lg:border-b-0 lg:border-r", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 p-4", children: [
11227
11284
  /* @__PURE__ */ jsxRuntimeExports.jsx(BrandHeader, { compact: true, crabEntrancePhase }),
11228
11285
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-3 gap-2 border-y border-border/70 py-3", children: [
@@ -11281,33 +11338,7 @@ function ProxyViewer({
11281
11338
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All models" }),
11282
11339
  models.map((m) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: m, children: m }, m))
11283
11340
  ] })
11284
- ] }),
11285
- captureMode === "full" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid h-9 grid-cols-2 overflow-hidden rounded-md border border-border", children: [
11286
- /* @__PURE__ */ jsxRuntimeExports.jsx(
11287
- "button",
11288
- {
11289
- type: "button",
11290
- onClick: () => onViewModeChange("simple"),
11291
- className: cn(
11292
- "text-xs transition-colors",
11293
- viewMode === "simple" ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/50"
11294
- ),
11295
- children: "Simple"
11296
- }
11297
- ),
11298
- /* @__PURE__ */ jsxRuntimeExports.jsx(
11299
- "button",
11300
- {
11301
- type: "button",
11302
- onClick: () => onViewModeChange("full"),
11303
- className: cn(
11304
- "text-xs transition-colors",
11305
- viewMode === "full" ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/50"
11306
- ),
11307
- children: "Full"
11308
- }
11309
- )
11310
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-9 items-center rounded-md border border-border bg-muted px-3 text-xs text-foreground", children: "Simple" })
11341
+ ] })
11311
11342
  ] })
11312
11343
  ] }) }),
11313
11344
  /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "min-w-0", children: [
@@ -11537,7 +11568,6 @@ function ProxyViewerContainer({
11537
11568
  const [allLogs, setAllLogs] = reactExports.useState([]);
11538
11569
  const [selectedSession, setSelectedSession] = reactExports.useState(initialSessionId ?? "__all__");
11539
11570
  const [selectedModel, setSelectedModel] = reactExports.useState("__all__");
11540
- const [viewMode, setViewMode] = reactExports.useState("simple");
11541
11571
  const [error, setError] = reactExports.useState(null);
11542
11572
  const [streamInitialized, setStreamInitialized] = reactExports.useState(initialSessionId === void 0);
11543
11573
  const [logPage, setLogPage] = reactExports.useState(null);
@@ -11798,6 +11828,7 @@ function ProxyViewerContainer({
11798
11828
  })();
11799
11829
  }, []);
11800
11830
  const { strip, captureMode, slowResponseThresholdSeconds, timeDisplayFormat } = useStripConfig();
11831
+ const viewMode = captureMode;
11801
11832
  const loadOldestPage = reactExports.useCallback(() => {
11802
11833
  loadSessionPage({ kind: "oldest" });
11803
11834
  }, [loadSessionPage]);
@@ -11859,7 +11890,6 @@ function ProxyViewerContainer({
11859
11890
  pagination,
11860
11891
  sessionMemberships,
11861
11892
  viewMode,
11862
- onViewModeChange: setViewMode,
11863
11893
  captureMode,
11864
11894
  strip,
11865
11895
  slowResponseThresholdSeconds,