@tonyclaw/agent-inspector 3.0.27 → 3.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-BVCAAbbu.js → CompareDrawer-TghZr5t1.js} +1 -1
  3. package/.output/public/assets/{ProxyViewerContainer-CYOXB81n.js → ProxyViewerContainer-fShBAZjj.js} +198 -198
  4. package/.output/public/assets/{ReplayDialog-DMX23O5G.js → ReplayDialog-CZMApaF4.js} +1 -1
  5. package/.output/public/assets/{RequestAnatomy-S17pYDRc.js → RequestAnatomy-DNWccR7O.js} +1 -1
  6. package/.output/public/assets/{ResponseView-Cf1XrawD.js → ResponseView-d25MdFhY.js} +2 -2
  7. package/.output/public/assets/{StreamingChunkSequence-BdOrVlCi.js → StreamingChunkSequence-DIFZEnWe.js} +1 -1
  8. package/.output/public/assets/{_sessionId-BnKGmJrR.js → _sessionId-DRfvuE2k.js} +1 -1
  9. package/.output/public/assets/{index-9fMLCU4d.js → index-B3aAuqWq.js} +1 -1
  10. package/.output/public/assets/index-BsxAGqMA.css +1 -0
  11. package/.output/public/assets/{index-gY3I-7-D.js → index-D4HkS7Ct.js} +1 -1
  12. package/.output/public/assets/{index-B1atk19i.js → index-DzARL2Fi.js} +3 -3
  13. package/.output/public/assets/{json-viewer-CpyYpPjx.js → json-viewer-wuJSKaed.js} +1 -1
  14. package/.output/server/_libs/lucide-react.mjs +39 -39
  15. package/.output/server/{_sessionId-eA_h2_s6.mjs → _sessionId-BJTNiP_O.mjs} +2 -2
  16. package/.output/server/_ssr/{CompareDrawer-K2k9G7r1.mjs → CompareDrawer-BMRH3N97.mjs} +3 -3
  17. package/.output/server/_ssr/{ProxyViewerContainer-CbyBpCAj.mjs → ProxyViewerContainer-AFwcHAIR.mjs} +312 -172
  18. package/.output/server/_ssr/{ReplayDialog-DacI2Iv0.mjs → ReplayDialog-CbWvRHiN.mjs} +4 -4
  19. package/.output/server/_ssr/{RequestAnatomy-gh-pAdkO.mjs → RequestAnatomy-C4kcPyqN.mjs} +2 -2
  20. package/.output/server/_ssr/{ResponseView-BRJKN50-.mjs → ResponseView-D8VYt-gZ.mjs} +3 -3
  21. package/.output/server/_ssr/{StreamingChunkSequence-BQLVEuWY.mjs → StreamingChunkSequence-BUUo6vU0.mjs} +2 -2
  22. package/.output/server/_ssr/{index-DuSWrjbH.mjs → index-DTwMEEXO.mjs} +2 -2
  23. package/.output/server/_ssr/index.mjs +2 -2
  24. package/.output/server/_ssr/{json-viewer-DNs1ZjKI.mjs → json-viewer-BqF1pSQD.mjs} +3 -3
  25. package/.output/server/_ssr/{router-Dgx6-ot3.mjs → router-C8BOns7y.mjs} +138 -162
  26. package/.output/server/{_tanstack-start-manifest_v-CoGjnkQD.mjs → _tanstack-start-manifest_v-BBf2nRhb.mjs} +1 -1
  27. package/.output/server/index.mjs +74 -74
  28. package/package.json +1 -1
  29. package/src/components/ProxyViewer.tsx +57 -1
  30. package/src/components/clients/ClientLogo.tsx +43 -4
  31. package/src/components/inspector-pet/InspectorPet.tsx +0 -7
  32. package/src/components/proxy-viewer/ConversationGroup.tsx +1 -1
  33. package/src/components/proxy-viewer/ConversationGroupList.tsx +233 -152
  34. package/src/components/proxy-viewer/ConversationHeader.tsx +29 -13
  35. package/src/lib/jsonFile.ts +46 -0
  36. package/src/proxy/evidenceAnalysis.ts +116 -117
  37. package/src/proxy/groupEvidenceExporter.ts +4 -8
  38. package/src/proxy/groupStore.ts +3 -10
  39. package/src/proxy/providerSecretStore.ts +4 -8
  40. package/src/proxy/runFailures.ts +4 -10
  41. package/src/proxy/runStore.ts +4 -11
  42. package/.output/public/assets/index-CmeF5XXS.css +0 -1
@@ -1,7 +1,7 @@
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-CbyBpCAj.mjs";
3
- import { ResponseView } from "./ResponseView-BRJKN50-.mjs";
4
- import { C as CapturedLogSchema } from "./router-Dgx6-ot3.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-AFwcHAIR.mjs";
3
+ import { ResponseView } from "./ResponseView-D8VYt-gZ.mjs";
4
+ import { C as CapturedLogSchema } from "./router-C8BOns7y.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import "../_libs/react-dom.mjs";
7
7
  import "node:fs";
@@ -15,7 +15,7 @@ import "node:util";
15
15
  import "node:net";
16
16
  import "../_libs/modelcontextprotocol__server.mjs";
17
17
  import "node:os";
18
- import { aw as RotateCcw, aI as Braces, aJ as Minimize2 } from "../_libs/lucide-react.mjs";
18
+ import { ax as RotateCcw, aI as Braces, aJ as Minimize2 } from "../_libs/lucide-react.mjs";
19
19
  import { o as object, n as number, e as array, d as boolean, b as string } from "../_libs/zod.mjs";
20
20
  import "../_libs/swr.mjs";
21
21
  import "../_libs/use-sync-external-store.mjs";
@@ -1,6 +1,6 @@
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-CbyBpCAj.mjs";
3
- import "./router-Dgx6-ot3.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-AFwcHAIR.mjs";
3
+ import "./router-C8BOns7y.mjs";
4
4
  import "node:fs";
5
5
  import "node:buffer";
6
6
  import "node:path";
@@ -1,6 +1,6 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { g as getLogFormatAdapter, f as formatTokens, c as cn, 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-CbyBpCAj.mjs";
3
- import { s as safeGetOwnProperty } from "./router-Dgx6-ot3.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-AFwcHAIR.mjs";
3
+ import { s as safeGetOwnProperty } from "./router-C8BOns7y.mjs";
4
4
  import "../_libs/jszip.mjs";
5
5
  import "../_libs/react-dom.mjs";
6
6
  import "node:fs";
@@ -14,7 +14,7 @@ import "node:util";
14
14
  import "node:net";
15
15
  import "../_libs/modelcontextprotocol__server.mjs";
16
16
  import "node:os";
17
- import { ab as Zap, T as TriangleAlert, aK as CircleStop, ad as Brain, a as ChevronDown, m as ChevronRight, z as Terminal } from "../_libs/lucide-react.mjs";
17
+ import { ac as Zap, T as TriangleAlert, aK as CircleStop, ae as Brain, a as ChevronDown, m as ChevronRight, z as Terminal } from "../_libs/lucide-react.mjs";
18
18
  import { R as Root } from "../_libs/radix-ui__react-separator.mjs";
19
19
  import "../_libs/swr.mjs";
20
20
  import "../_libs/use-sync-external-store.mjs";
@@ -1,6 +1,6 @@
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-CbyBpCAj.mjs";
3
- import { a3 as StreamingChunkSchema$1 } from "./router-Dgx6-ot3.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-AFwcHAIR.mjs";
3
+ import { a3 as StreamingChunkSchema$1 } from "./router-C8BOns7y.mjs";
4
4
  import "../_libs/jszip.mjs";
5
5
  import "../_libs/react-dom.mjs";
6
6
  import "node:fs";
@@ -1,6 +1,6 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { P as ProxyViewerContainer } from "./ProxyViewerContainer-CbyBpCAj.mjs";
3
- import "./router-Dgx6-ot3.mjs";
2
+ import { P as ProxyViewerContainer } from "./ProxyViewerContainer-AFwcHAIR.mjs";
3
+ import "./router-C8BOns7y.mjs";
4
4
  import "../_libs/jszip.mjs";
5
5
  import "../_libs/react-dom.mjs";
6
6
  import "node:fs";
@@ -85,7 +85,7 @@ function getResponse() {
85
85
  }
86
86
  var HEADERS = { TSS_SHELL: "X-TSS_SHELL" };
87
87
  async function getStartManifest(matchedRoutes) {
88
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-CoGjnkQD.mjs");
88
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-BBf2nRhb.mjs");
89
89
  const startManifest = tsrStartManifest();
90
90
  let routes = startManifest.routes;
91
91
  routes[rootRouteId];
@@ -1162,7 +1162,7 @@ var getBaseManifest = getProdBaseManifest;
1162
1162
  var createEarlyHintsForRequest = createEarlyHintsCollector;
1163
1163
  async function loadEntries() {
1164
1164
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
1165
- import("./router-Dgx6-ot3.mjs").then((n) => n.a4),
1165
+ import("./router-C8BOns7y.mjs").then((n) => n.a4),
1166
1166
  import("./start-HYkvq4Ni.mjs"),
1167
1167
  import("./empty-plugin-adapters-BFgPZ6_d.mjs")
1168
1168
  ]);
@@ -1,6 +1,6 @@
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-CbyBpCAj.mjs";
3
- import "./router-Dgx6-ot3.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-AFwcHAIR.mjs";
3
+ import "./router-C8BOns7y.mjs";
4
4
  import "node:fs";
5
5
  import "node:buffer";
6
6
  import "node:path";
@@ -14,7 +14,7 @@ import "../_libs/modelcontextprotocol__server.mjs";
14
14
  import "../_libs/jszip.mjs";
15
15
  import "node:os";
16
16
  import "../_libs/react-dom.mjs";
17
- import { b as Check, j as Copy, a as ChevronDown, m as ChevronRight, au as ChevronsDown } from "../_libs/lucide-react.mjs";
17
+ import { b as Check, j as Copy, a as ChevronDown, m as ChevronRight, av as ChevronsDown } from "../_libs/lucide-react.mjs";
18
18
  import "../_libs/swr.mjs";
19
19
  import "../_libs/use-sync-external-store.mjs";
20
20
  import "../_libs/dequal.mjs";
@@ -66,7 +66,7 @@ import "../_libs/immediate.mjs";
66
66
  import "../_libs/setimmediate.mjs";
67
67
  import "../_libs/pako.mjs";
68
68
  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";
69
- const appCss = "/assets/index-CmeF5XXS.css";
69
+ const appCss = "/assets/index-BsxAGqMA.css";
70
70
  const CHUNK_LOAD_RELOAD_AT_KEY = "agent-inspector.chunkLoadReloadAt";
71
71
  const CHUNK_LOAD_RELOAD_WINDOW_MS = 15e3;
72
72
  const CHUNK_LOAD_FAILURE_PATTERNS = [
@@ -372,7 +372,7 @@ function RootDocument({ children }) {
372
372
  ] })
373
373
  ] });
374
374
  }
375
- const $$splitComponentImporter$1 = () => import("./index-DuSWrjbH.mjs");
375
+ const $$splitComponentImporter$1 = () => import("./index-DTwMEEXO.mjs");
376
376
  const Route$L = createFileRoute("/")({
377
377
  ssr: false,
378
378
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
@@ -416,7 +416,7 @@ function decodeSessionIdFromPath(encoded) {
416
416
  function getSessionPath(sessionId) {
417
417
  return `/session/${encodeSessionIdForPath(sessionId)}`;
418
418
  }
419
- const $$splitComponentImporter = () => import("../_sessionId-eA_h2_s6.mjs");
419
+ const $$splitComponentImporter = () => import("../_sessionId-BJTNiP_O.mjs");
420
420
  const Route$K = createFileRoute("/session/$sessionId")({
421
421
  ssr: false,
422
422
  component: lazyRouteComponent($$splitComponentImporter, "component"),
@@ -5432,6 +5432,27 @@ function withBuiltinProviderModelMetadata(provider, updatedAt) {
5432
5432
  modelMetadata: result.modelMetadata
5433
5433
  };
5434
5434
  }
5435
+ function readJsonFile(path2, schema) {
5436
+ let raw;
5437
+ try {
5438
+ raw = readFileSync(path2, "utf8");
5439
+ } catch (error) {
5440
+ if (isEnoent(error)) return { ok: false, reason: "missing" };
5441
+ return { ok: false, reason: "io-error" };
5442
+ }
5443
+ let parsed;
5444
+ try {
5445
+ parsed = JSON.parse(raw);
5446
+ } catch {
5447
+ return { ok: false, reason: "parse-error" };
5448
+ }
5449
+ const result = schema.safeParse(parsed);
5450
+ if (!result.success) return { ok: false, reason: "schema-mismatch" };
5451
+ return { ok: true, data: result.data };
5452
+ }
5453
+ function isEnoent(error) {
5454
+ return readProperty$5(error, "code") === "ENOENT";
5455
+ }
5435
5456
  const SECRET_REFERENCE_PREFIX = "secret:provider:";
5436
5457
  const SECRET_FILE_VERSION = 1;
5437
5458
  const KEY_BYTES = 32;
@@ -5446,14 +5467,9 @@ function emptySecretFile() {
5446
5467
  }
5447
5468
  function readSecretFile(path2) {
5448
5469
  if (!existsSync(path2)) return emptySecretFile();
5449
- try {
5450
- const parsed = JSON.parse(readFileSync(path2, "utf8"));
5451
- const result = SecretFileSchema.safeParse(parsed);
5452
- if (result.success) return result.data;
5453
- logger.warn(`[provider-secrets] Ignoring invalid secret file ${path2}`);
5454
- } catch (error) {
5455
- logger.warn(`[provider-secrets] Could not read ${path2}: ${String(error)}`);
5456
- }
5470
+ const result = readJsonFile(path2, SecretFileSchema);
5471
+ if (result.ok) return result.data;
5472
+ logger.warn(`[provider-secrets] Ignoring invalid secret file ${path2} (${result.reason})`);
5457
5473
  return emptySecretFile();
5458
5474
  }
5459
5475
  function writePrivateFile(path2, content) {
@@ -8689,85 +8705,99 @@ function hasStreamingMismatch(session) {
8689
8705
  }
8690
8706
  return false;
8691
8707
  }
8692
- function categorySummary(category) {
8693
- switch (category) {
8694
- case "none":
8695
- return "Session completed without captured errors.";
8696
- case "active":
8697
- return "Session still has active requests or running tasks.";
8698
- case "provider-timeout":
8699
- return "Provider call appears to have timed out.";
8700
- case "provider-http-error":
8701
- return "Provider returned an HTTP error.";
8702
- case "provider-auth-error":
8703
- return "Provider authentication or API key configuration appears invalid.";
8704
- case "provider-rate-limit":
8705
- return "Provider rejected the request because of rate limit or quota pressure.";
8706
- case "network-or-container":
8707
- return "Network connectivity looks suspicious; check container boundaries and localhost use.";
8708
- case "streaming-mismatch":
8709
- return "Streaming and non-streaming behavior differ for the same provider/model.";
8710
- case "context-pressure":
8711
- return "The failure looks related to context window or token pressure.";
8712
- case "runtime-task-error":
8713
- return "Inspector session runtime reported a task error.";
8714
- case "model-output-error":
8715
- return "The model output or upstream payload shape appears invalid.";
8716
- case "unknown-failure":
8717
- return "Inspector captured errors, but the root cause is not yet classified.";
8718
- case "no-session-data":
8719
- return "No Inspector session data was available for this run.";
8720
- }
8721
- }
8722
- function categoryHints(category) {
8723
- switch (category) {
8724
- case "none":
8725
- return ["Keep the evidence pack as the success proof for CI or release notes."];
8726
- case "active":
8727
- return ["Wait for the session to settle, then export evidence again."];
8728
- case "provider-timeout":
8729
- return [
8730
- "Increase the provider test timeout for slow models.",
8731
- "Compare streaming and non-streaming probes for the same model."
8732
- ];
8733
- case "provider-http-error":
8734
- return [
8735
- "Open the cited log ids and inspect upstream status, response body, and provider URL."
8736
- ];
8737
- case "provider-auth-error":
8738
- return ["Verify the provider API key, auth header mode, and configured base URL."];
8739
- case "provider-rate-limit":
8740
- return [
8741
- "Retry after provider quota recovers or switch to a less constrained provider/model."
8742
- ];
8743
- case "network-or-container":
8744
- return [
8745
- "If the coding agent and Inspector are in different containers, replace localhost with a reachable host.",
8746
- "Check DNS, proxy, firewall, and container network routes."
8747
- ];
8748
- case "streaming-mismatch":
8749
- return [
8750
- "Compare the streaming and non-streaming captured logs side by side.",
8751
- "Check whether the provider's OpenAI-compatible endpoint handles stream=false differently."
8752
- ];
8753
- case "context-pressure":
8754
- return [
8755
- "Reduce prompt/tool schema/history size or configure the model context window metadata."
8756
- ];
8757
- case "runtime-task-error":
8758
- return ["Inspect the session runtime error and retry after clearing stuck session tasks."];
8759
- case "model-output-error":
8760
- return ["Inspect the raw response and schema parsing details for the cited log ids."];
8761
- case "unknown-failure":
8762
- return [
8763
- "Open the cited logs and inspect error/status/latency fields to refine the diagnosis."
8764
- ];
8765
- case "no-session-data":
8766
- return [
8767
- "Confirm the run's sessionId matches captured traffic and that history scanning is enabled when needed."
8768
- ];
8708
+ const FAILURE_CATEGORY_INFO = {
8709
+ none: {
8710
+ summary: "Session completed without captured errors.",
8711
+ hints: ["Keep the evidence pack as the success proof for CI or release notes."],
8712
+ severity: "none",
8713
+ outcome: "success"
8714
+ },
8715
+ active: {
8716
+ summary: "Session still has active requests or running tasks.",
8717
+ hints: ["Wait for the session to settle, then export evidence again."],
8718
+ severity: "low",
8719
+ outcome: "active"
8720
+ },
8721
+ "provider-timeout": {
8722
+ summary: "Provider call appears to have timed out.",
8723
+ hints: [
8724
+ "Increase the provider test timeout for slow models.",
8725
+ "Compare streaming and non-streaming probes for the same model."
8726
+ ],
8727
+ severity: "high",
8728
+ outcome: "failure"
8729
+ },
8730
+ "provider-http-error": {
8731
+ summary: "Provider returned an HTTP error.",
8732
+ hints: ["Open the cited log ids and inspect upstream status, response body, and provider URL."],
8733
+ severity: "high",
8734
+ outcome: "failure"
8735
+ },
8736
+ "provider-auth-error": {
8737
+ summary: "Provider authentication or API key configuration appears invalid.",
8738
+ hints: ["Verify the provider API key, auth header mode, and configured base URL."],
8739
+ severity: "high",
8740
+ outcome: "failure"
8741
+ },
8742
+ "provider-rate-limit": {
8743
+ summary: "Provider rejected the request because of rate limit or quota pressure.",
8744
+ hints: ["Retry after provider quota recovers or switch to a less constrained provider/model."],
8745
+ severity: "high",
8746
+ outcome: "failure"
8747
+ },
8748
+ "network-or-container": {
8749
+ summary: "Network connectivity looks suspicious; check container boundaries and localhost use.",
8750
+ hints: [
8751
+ "If the coding agent and Inspector are in different containers, replace localhost with a reachable host.",
8752
+ "Check DNS, proxy, firewall, and container network routes."
8753
+ ],
8754
+ severity: "high",
8755
+ outcome: "failure"
8756
+ },
8757
+ "streaming-mismatch": {
8758
+ summary: "Streaming and non-streaming behavior differ for the same provider/model.",
8759
+ hints: [
8760
+ "Compare the streaming and non-streaming captured logs side by side.",
8761
+ "Check whether the provider's OpenAI-compatible endpoint handles stream=false differently."
8762
+ ],
8763
+ severity: "high",
8764
+ outcome: "failure"
8765
+ },
8766
+ "context-pressure": {
8767
+ summary: "The failure looks related to context window or token pressure.",
8768
+ hints: [
8769
+ "Reduce prompt/tool schema/history size or configure the model context window metadata."
8770
+ ],
8771
+ severity: "medium",
8772
+ outcome: "failure"
8773
+ },
8774
+ "runtime-task-error": {
8775
+ summary: "Inspector session runtime reported a task error.",
8776
+ hints: ["Inspect the session runtime error and retry after clearing stuck session tasks."],
8777
+ severity: "high",
8778
+ outcome: "failure"
8779
+ },
8780
+ "model-output-error": {
8781
+ summary: "The model output or upstream payload shape appears invalid.",
8782
+ hints: ["Inspect the raw response and schema parsing details for the cited log ids."],
8783
+ severity: "medium",
8784
+ outcome: "failure"
8785
+ },
8786
+ "unknown-failure": {
8787
+ summary: "Inspector captured errors, but the root cause is not yet classified.",
8788
+ hints: ["Open the cited logs and inspect error/status/latency fields to refine the diagnosis."],
8789
+ severity: "medium",
8790
+ outcome: "failure"
8791
+ },
8792
+ "no-session-data": {
8793
+ summary: "No Inspector session data was available for this run.",
8794
+ hints: [
8795
+ "Confirm the run's sessionId matches captured traffic and that history scanning is enabled when needed."
8796
+ ],
8797
+ severity: "medium",
8798
+ outcome: "unknown"
8769
8799
  }
8770
- }
8800
+ };
8771
8801
  function classifyCategory(session, candidates2) {
8772
8802
  if (session.status === "active") return "active";
8773
8803
  if (session.errorCount === 0 && session.failedRequests === 0 && session.lastTaskError === null) {
@@ -8806,46 +8836,16 @@ function classifyCategory(session, candidates2) {
8806
8836
  return "unknown-failure";
8807
8837
  }
8808
8838
  function severityFor(category) {
8809
- switch (category) {
8810
- case "none":
8811
- return "none";
8812
- case "active":
8813
- return "low";
8814
- case "provider-timeout":
8815
- case "provider-http-error":
8816
- case "provider-auth-error":
8817
- case "provider-rate-limit":
8818
- case "network-or-container":
8819
- case "streaming-mismatch":
8820
- case "runtime-task-error":
8821
- return "high";
8822
- case "context-pressure":
8823
- case "model-output-error":
8824
- case "unknown-failure":
8825
- case "no-session-data":
8826
- return "medium";
8827
- }
8839
+ return FAILURE_CATEGORY_INFO[category].severity;
8828
8840
  }
8829
8841
  function outcomeFor$1(category) {
8830
- switch (category) {
8831
- case "none":
8832
- return "success";
8833
- case "active":
8834
- return "active";
8835
- case "no-session-data":
8836
- return "unknown";
8837
- case "provider-timeout":
8838
- case "provider-http-error":
8839
- case "provider-auth-error":
8840
- case "provider-rate-limit":
8841
- case "network-or-container":
8842
- case "streaming-mismatch":
8843
- case "context-pressure":
8844
- case "runtime-task-error":
8845
- case "model-output-error":
8846
- case "unknown-failure":
8847
- return "failure";
8848
- }
8842
+ return FAILURE_CATEGORY_INFO[category].outcome;
8843
+ }
8844
+ function categorySummary(category) {
8845
+ return FAILURE_CATEGORY_INFO[category].summary;
8846
+ }
8847
+ function categoryHints(category) {
8848
+ return FAILURE_CATEGORY_INFO[category].hints;
8849
8849
  }
8850
8850
  function classifyRunFailure(run, session) {
8851
8851
  if (session === null) {
@@ -9226,15 +9226,8 @@ function nullableText(value) {
9226
9226
  return trimmed.length > 0 ? trimmed : null;
9227
9227
  }
9228
9228
  function readGroups() {
9229
- const filePath = groupsFilePath();
9230
- if (!existsSync(filePath)) return [];
9231
- try {
9232
- const parsed = JSON.parse(readFileSync(filePath, "utf8"));
9233
- const result = GroupsFileSchema.safeParse(parsed);
9234
- return result.success ? result.data.groups : [];
9235
- } catch {
9236
- return [];
9237
- }
9229
+ const result = readJsonFile(groupsFilePath(), GroupsFileSchema);
9230
+ return result.ok ? result.data.groups : [];
9238
9231
  }
9239
9232
  function writeGroups(groups) {
9240
9233
  const filePath = groupsFilePath();
@@ -9486,15 +9479,8 @@ function syncRunGroupMember(run, createIfMissing) {
9486
9479
  });
9487
9480
  }
9488
9481
  function readRuns() {
9489
- const filePath = runsFilePath();
9490
- if (!existsSync(filePath)) return [];
9491
- try {
9492
- const parsed = JSON.parse(readFileSync(filePath, "utf8"));
9493
- const result = RunsFileSchema.safeParse(parsed);
9494
- return result.success ? result.data.runs : [];
9495
- } catch {
9496
- return [];
9497
- }
9482
+ const result = readJsonFile(runsFilePath(), RunsFileSchema);
9483
+ return result.ok ? result.data.runs : [];
9498
9484
  }
9499
9485
  function writeRuns(runs) {
9500
9486
  const filePath = runsFilePath();
@@ -9762,14 +9748,9 @@ function clampRecentFailuresLimit(value) {
9762
9748
  }
9763
9749
  function readEvidenceDocument(run) {
9764
9750
  const path2 = run.evidence?.jsonPath;
9765
- if (path2 === void 0 || !existsSync(path2)) return null;
9766
- try {
9767
- const parsed = JSON.parse(readFileSync(path2, "utf8"));
9768
- const result = EvidenceExportResultSchema.safeParse(parsed);
9769
- return result.success ? result.data : null;
9770
- } catch {
9771
- return null;
9772
- }
9751
+ if (path2 === void 0) return null;
9752
+ const result = readJsonFile(path2, EvidenceExportResultSchema);
9753
+ return result.ok ? result.data : null;
9773
9754
  }
9774
9755
  function syntheticFailedClassification(run) {
9775
9756
  return {
@@ -10385,7 +10366,7 @@ const Route$E = createFileRoute("/api/models")({
10385
10366
  }
10386
10367
  });
10387
10368
  const name = "@tonyclaw/agent-inspector";
10388
- const version = "3.0.27";
10369
+ const version = "3.0.28";
10389
10370
  const packageJson = {
10390
10371
  name,
10391
10372
  version
@@ -10760,14 +10741,9 @@ function readGroupEvidenceMarkdown(group) {
10760
10741
  }
10761
10742
  function readGroupEvidenceDocument(group) {
10762
10743
  const path2 = group.evidence?.jsonPath;
10763
- if (path2 === void 0 || !existsSync(path2)) return null;
10764
- try {
10765
- const raw = JSON.parse(readFileSync(path2, "utf8"));
10766
- const parsed = GroupEvidenceExportResultSchema.safeParse(raw);
10767
- return parsed.success ? parsed.data : null;
10768
- } catch {
10769
- return null;
10770
- }
10744
+ if (path2 === void 0) return null;
10745
+ const result = readJsonFile(path2, GroupEvidenceExportResultSchema);
10746
+ return result.ok ? result.data : null;
10771
10747
  }
10772
10748
  function listInspectorGroups() {
10773
10749
  return { groups: listGroups() };
@@ -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/pi-agent", "/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/index-B1atk19i.js"], scripts: [{ attrs: { type: "module", async: true, src: "/assets/index-B1atk19i.js" } }] }, "/": { filePath: "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", children: void 0, preloads: ["/assets/index-gY3I-7-D.js", "/assets/ProxyViewerContainer-CYOXB81n.js"] }, "/session/$sessionId": { filePath: "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", children: void 0, preloads: ["/assets/_sessionId-BnKGmJrR.js", "/assets/ProxyViewerContainer-CYOXB81n.js"] } } });
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/pi-agent", "/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/index-DzARL2Fi.js"], scripts: [{ attrs: { type: "module", async: true, src: "/assets/index-DzARL2Fi.js" } }] }, "/": { filePath: "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", children: void 0, preloads: ["/assets/index-D4HkS7Ct.js", "/assets/ProxyViewerContainer-fShBAZjj.js"] }, "/session/$sessionId": { filePath: "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", children: void 0, preloads: ["/assets/_sessionId-DRfvuE2k.js", "/assets/ProxyViewerContainer-fShBAZjj.js"] } } });
2
2
  export {
3
3
  tsrStartManifest
4
4
  };