@tonyclaw/agent-inspector 3.0.43 → 3.0.45

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 (80) hide show
  1. package/.output/cli.js +20744 -16945
  2. package/.output/nitro.json +1 -1
  3. package/.output/public/assets/{CompareDrawer-BAXxwTwT.js → CompareDrawer-B3_TLTJh.js} +1 -1
  4. package/.output/public/assets/{InspectorPet-xYuGV4Qz.js → InspectorPet-Cpn6hv4P.js} +1 -1
  5. package/.output/public/assets/{ProxyViewerContainer-B6GZnUWi.js → ProxyViewerContainer-BEAhuGOJ.js} +27 -27
  6. package/.output/public/assets/{ReplayDialog-D73pyIg3.js → ReplayDialog-B3EKVdJk.js} +1 -1
  7. package/.output/public/assets/{RequestAnatomy-CSDta_nu.js → RequestAnatomy-COOQjyUC.js} +1 -1
  8. package/.output/public/assets/{ResponseView-C4aIUPby.js → ResponseView-DBCjkwye.js} +1 -1
  9. package/.output/public/assets/{StreamingChunkSequence-D4xxosLx.js → StreamingChunkSequence-CuXhDgMo.js} +1 -1
  10. package/.output/public/assets/{_sessionId-CZHbJyWO.js → _sessionId-BJlM3nmt.js} +1 -1
  11. package/.output/public/assets/{_sessionId-DvuNLzSE.js → _sessionId-zbgYl7ZJ.js} +1 -1
  12. package/.output/public/assets/{index-DZ_wpqQM.js → index-BIK4bPTv.js} +1 -1
  13. package/.output/public/assets/{index-B17u7JMC.js → index-BZo_8koU.js} +15 -15
  14. package/.output/public/assets/{index-C0g79BAs.js → index-D2Qw6Ri2.js} +1 -1
  15. package/.output/public/assets/{index-BWjeqxbk.css → index-ZWschkCh.css} +1 -1
  16. package/.output/public/assets/{index-CmEO8ykj.js → index-xF_NY8Yb.js} +5 -5
  17. package/.output/public/assets/{json-viewer-CuWU-H6K.js → json-viewer-B-Ao6pwW.js} +1 -1
  18. package/.output/public/assets/{jszip.min-DPJI_UKW.js → jszip.min-B_rfAUCe.js} +1 -1
  19. package/.output/server/_libs/modelcontextprotocol__core.mjs +25 -25
  20. package/.output/server/_libs/modelcontextprotocol__server.mjs +2 -2
  21. package/.output/server/_libs/zod.mjs +6 -6
  22. package/.output/server/{_sessionId-Cun21KZF.mjs → _sessionId-CJ99gZFV.mjs} +3 -1
  23. package/.output/server/{_sessionId-CoFyeOti.mjs → _sessionId-DEjScBpK.mjs} +5 -3
  24. package/.output/server/_ssr/{CompareDrawer-Bgc2TZh_.mjs → CompareDrawer-DtOIMeQB.mjs} +4 -2
  25. package/.output/server/_ssr/{InspectorPet-DyK2ojeh.mjs → InspectorPet-CXc4oCBQ.mjs} +3 -1
  26. package/.output/server/_ssr/{ProxyViewerContainer-hvn6oVWD.mjs → ProxyViewerContainer-DVPlwfkt.mjs} +52 -27
  27. package/.output/server/_ssr/{ReplayDialog-KpnrGtZ-.mjs → ReplayDialog-BQEA95qC.mjs} +6 -4
  28. package/.output/server/_ssr/{RequestAnatomy-uCsfucn8.mjs → RequestAnatomy-BMyd8B7Q.mjs} +4 -2
  29. package/.output/server/_ssr/{ResponseView-C8UPqoPO.mjs → ResponseView-qrTaEIM8.mjs} +4 -2
  30. package/.output/server/_ssr/{StreamingChunkSequence-BP28I9sh.mjs → StreamingChunkSequence-BFTL8mIy.mjs} +5 -3
  31. package/.output/server/_ssr/{index-Du3YNDKx.mjs → index-Bcj1Hcy4.mjs} +4 -2
  32. package/.output/server/_ssr/{index-BVwVoQlZ.mjs → index-DW-M7XUG.mjs} +3 -1
  33. package/.output/server/_ssr/index.mjs +4 -3
  34. package/.output/server/_ssr/{json-viewer-DrE0vtlB.mjs → json-viewer-DiI0Yjsn.mjs} +4 -2
  35. package/.output/server/_ssr/publicBasePathContext-5264L3rX.mjs +148 -0
  36. package/.output/server/_ssr/{router-C6nWUZHK.mjs → router-BJ_ltLim.mjs} +2432 -475
  37. package/.output/server/_ssr/start-C6MjPjxp.mjs +57 -0
  38. package/.output/server/_tanstack-start-manifest_v-C6pXXX9R.mjs +4 -0
  39. package/.output/server/index.mjs +99 -99
  40. package/.output/workers/logFinalizer.worker.js +4 -0
  41. package/.output/workers/sessionWorkerEntry.js +4 -0
  42. package/README.md +221 -25
  43. package/docs/instance-control.openapi.yaml +306 -0
  44. package/package.json +4 -1
  45. package/src/cli/alias.ts +440 -0
  46. package/src/cli/instance.ts +1037 -0
  47. package/src/cli/instanceArgs.ts +266 -0
  48. package/src/cli/instanceControl.ts +183 -0
  49. package/src/cli/instanceModel.ts +275 -0
  50. package/src/cli/instanceRegistry.ts +740 -0
  51. package/src/cli/onboard.ts +123 -35
  52. package/src/cli/onboardTarget.ts +179 -0
  53. package/src/cli/templates/codex-skill-onboard.ts +76 -28
  54. package/src/cli/templates/skill-onboard.ts +93 -59
  55. package/src/cli.ts +154 -16
  56. package/src/components/ProxyViewer.tsx +13 -5
  57. package/src/components/providers/SettingsDialog.tsx +13 -8
  58. package/src/lib/basePath.ts +8 -2
  59. package/src/lib/codingAgentEndpoints.ts +16 -0
  60. package/src/lib/instanceContract.ts +220 -0
  61. package/src/lib/managedInstance.ts +104 -0
  62. package/src/lib/publicBasePathContext.ts +107 -0
  63. package/src/mcp/instanceHandlers.ts +149 -0
  64. package/src/mcp/loopback.ts +16 -5
  65. package/src/mcp/mode.ts +25 -0
  66. package/src/mcp/server.ts +258 -18
  67. package/src/mcp/toolHandlers.ts +2 -2
  68. package/src/proxy/identityProxy.ts +656 -36
  69. package/src/proxy/runtimeShutdown.ts +73 -1
  70. package/src/proxy/sessionInfo.ts +5 -4
  71. package/src/routes/api/-instances.ts +109 -0
  72. package/src/routes/api/instances.$name.connection.ts +12 -0
  73. package/src/routes/api/instances.$name.restart.ts +23 -0
  74. package/src/routes/api/instances.$name.start.ts +18 -0
  75. package/src/routes/api/instances.$name.stop.ts +23 -0
  76. package/src/routes/api/instances.$name.ts +12 -0
  77. package/src/routes/api/instances.ts +16 -0
  78. package/src/start.ts +10 -0
  79. package/.output/server/_ssr/start-HYkvq4Ni.mjs +0 -4
  80. package/.output/server/_tanstack-start-manifest_v-rshlRaiN.mjs +0 -4
@@ -1,11 +1,12 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, R as React } from "../_libs/react.mjs";
2
- import { w as withBasePath, C as CapturedLogSchema, N as DeleteInspectorGroupsResponseSchema, 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, m as cn, G as LazyFeatureBoundary, y as formatTokens, B as Button, d as RuntimeConfigSchema, g as readStoredUiScalePreference, h as persistUiScalePreference, j as applyUiScalePreference, ad as CrabLogo, p as packageJson, k as normalizeUiScalePreference, P as GroupEvidenceExportResultSchema, Q as DeleteInspectorGroupResponseSchema, z as copyTextToClipboard, l as RedactedProviderDtoSchema, U as UI_SCALE_STORAGE_KEY, v as apiFormatForPath, i as isRecord, a3 as createPendingProviderTestResults, a4 as ProviderTestResultsSchema, a5 as createFailedProviderTestResults, a6 as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, a7 as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, a8 as TimeDisplayFormatSchema, H as AlertSummarySchema, I as AlertListResponseSchema, r as readStoredThemeMode, e as applyThemeMode, f as persistThemeMode, ag as formatUiScale, M as InspectorGroupsListResponseSchema, J as GroupEvidenceReadResponseSchema, a9 as EcosystemPackagesResponseSchema, aa as EcosystemTaskResponseSchema, ab as EcosystemTasksResponseSchema, Z as PATH_V1_MESSAGES, _ as PATH_V1_CHAT_COMPLETIONS, $ as PATH_V1_RESPONSES, W as providerHasContextMetadata, V as ProviderScanResponseSchema, T as THEME_MODE_STORAGE_KEY, n as normalizeThemeMode, ac as EcosystemExecutionConfirmationResponseSchema, s as safeGetOwnProperty, a0 as formatContextWindowInput, X as findProviderModelMetadata, Y as formatContextWindowTokens, x as getSessionPath, q as parseOpenAIResponse, t as parseOpenAIResponsesResponse, O as OpenAIRequestSchema, u as OpenAIResponsesRequestSchema, A as AnthropicResponseSchema$1, o as AnthropicRequestSchema, ae as resolveProviderContextWindow, a1 as parseContextWindowTokensInput, a2 as previewUpstreamUrl, K as KnowledgeCandidateSchema, af as isPlainRecord, F as stripClaudeCodeBillingHeader, L as LogBodyChunkSchema, E as getStatusCategory } from "./router-C6nWUZHK.mjs";
2
+ import { C as CapturedLogSchema, M as DeleteInspectorGroupsResponseSchema, 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, m as cn, F as LazyFeatureBoundary, x as formatTokens, B as Button, d as RuntimeConfigSchema, g as readStoredUiScalePreference, h as persistUiScalePreference, j as applyUiScalePreference, ac as CrabLogo, p as packageJson, k as normalizeUiScalePreference, N as GroupEvidenceExportResultSchema, P as DeleteInspectorGroupResponseSchema, y as copyTextToClipboard, l as RedactedProviderDtoSchema, U as UI_SCALE_STORAGE_KEY, v as apiFormatForPath, i as isRecord$2, a2 as createPendingProviderTestResults, a3 as ProviderTestResultsSchema, a4 as createFailedProviderTestResults, a5 as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, a6 as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, a7 as TimeDisplayFormatSchema, G as AlertSummarySchema, H as AlertListResponseSchema, r as readStoredThemeMode, e as applyThemeMode, f as persistThemeMode, af as formatUiScale, J as InspectorGroupsListResponseSchema, I as GroupEvidenceReadResponseSchema, a8 as EcosystemPackagesResponseSchema, a9 as EcosystemTaskResponseSchema, aa as EcosystemTasksResponseSchema, Y as PATH_V1_MESSAGES, Z as PATH_V1_CHAT_COMPLETIONS, _ as PATH_V1_RESPONSES, V as providerHasContextMetadata, Q as ProviderScanResponseSchema, T as THEME_MODE_STORAGE_KEY, n as normalizeThemeMode, ab as EcosystemExecutionConfirmationResponseSchema, s as safeGetOwnProperty, $ as formatContextWindowInput, W as findProviderModelMetadata, X as formatContextWindowTokens, w as getSessionPath, q as parseOpenAIResponse, t as parseOpenAIResponsesResponse, O as OpenAIRequestSchema, u as OpenAIResponsesRequestSchema, A as AnthropicResponseSchema$1, o as AnthropicRequestSchema, ad as resolveProviderContextWindow, a0 as parseContextWindowTokensInput, a1 as previewUpstreamUrl, K as KnowledgeCandidateSchema, ae as isPlainRecord, E as stripClaudeCodeBillingHeader, L as LogBodyChunkSchema, z as getStatusCategory } from "./router-BJ_ltLim.mjs";
3
+ import { w as withBasePath, g as getConfiguredBasePath, e as appendBasePathToOrigin } from "./publicBasePathContext-5264L3rX.mjs";
3
4
  import { u as useSWR, a as useSWRConfig } from "../_libs/swr.mjs";
4
5
  import { u as useWindowVirtualizer, a as useVirtualizer } from "../_libs/tanstack__react-virtual.mjs";
5
6
  import { c as cva } from "../_libs/class-variance-authority.mjs";
6
7
  import { d as diffJson, a as diffLines } from "../_libs/diff.mjs";
7
8
  import { T as TriangleAlert, C as CircleCheck, X, P as PanelRightOpen, a as PanelRightClose, U as Upload, D as Download, F as FileBraces, R as RefreshCw, b as Trash2, I as Info, c as ChevronDown, d as Check, S as Settings, e as Siren, L as LoaderCircle, f as Sun, E as Eye, M as Moon, A as ALargeSmall, g as Layers, h as FlaskConical, i as Sparkles, j as Activity, B as Beaker, N as Network, k as Copy, l as Terminal, m as ArrowLeft, n as ChevronUp, o as BrainCircuit, p as RotateCcw, q as Send, r as ChevronsLeft, s as ChevronLeft, t as ChevronRight, u as ChevronsRight, v as CircleStop, w as Clapperboard, x as Flag, y as Timer, G as Gauge, z as Minimize2, H as Maximize2, J as Scan, K as Plus, O as CircleAlert, Q as Rocket, V as PackageCheck, W as History, Y as Monitor, Z as EyeOff, _ as ExternalLink, $ as Clock, a0 as RotateCw, a1 as CircleCheckBig, a2 as Pencil, a3 as Bell, a4 as Clock3, a5 as ShieldAlert, a6 as ArrowUpRight, a7 as ArrowDownRight, a8 as CodeXml, a9 as Cpu, aa as FolderOpen, ab as MessageSquare, ac as Zap, ad as Wrench, ae as Brain, af as Minus, ag as CircleQuestionMark, ah as Server, ai as Lock, aj as Wifi, ak as WifiOff, al as CircleX, am as ShieldCheck, an as Save, ao as FileSearch, ap as CloudUpload, aq as OctagonAlert, ar as Radio, as as Globe, at as FileTerminal, au as ChevronsUp, av as ChevronsDown, aw as FileDiff, ax as Search, ay as GitCompareArrows, az as ArrowUp, aA as ArrowDown, aB as Ellipsis, aC as Blocks, aD as MousePointerClick, aE as FileText, aF as Rows3, aG as Columns2 } from "../_libs/lucide-react.mjs";
8
- import { u as union, o as object, e as array, a as literal, n as number, d as boolean, c as string } from "../_libs/zod.mjs";
9
+ import { u as union, o as object, f as array, a as literal, n as number, e as boolean, c as string } from "../_libs/zod.mjs";
9
10
  import { D as Dialog$1, a as DialogContent$1, b as DialogClose, c as DialogTitle$1, d as DialogDescription$1, e as DialogTrigger$1, f as DialogPortal$1, g as DialogOverlay$1 } from "../_libs/radix-ui__react-dialog.mjs";
10
11
  import { R as Root2, C as Content, L as List, T as Trigger } from "../_libs/radix-ui__react-tabs.mjs";
11
12
  import { S as Slot } from "../_libs/radix-ui__react-slot.mjs";
@@ -418,7 +419,7 @@ async function fetchStreamingChunks(logId, signal) {
418
419
  }
419
420
  function redactValue(value) {
420
421
  if (Array.isArray(value)) return value.map((item) => redactValue(item));
421
- if (!isRecord(value)) return value;
422
+ if (!isRecord$2(value)) return value;
422
423
  const result = {};
423
424
  for (const [key, item] of Object.entries(value)) {
424
425
  result[key] = SECRET_KEY_PATTERN.test(key) ? REDACTED : redactValue(item);
@@ -520,6 +521,13 @@ async function exportLogsAsZip(logs, mode = "redacted", options = {}) {
520
521
  URL.revokeObjectURL(url);
521
522
  return { ok: true };
522
523
  }
524
+ function deriveCodingAgentEndpoints(origin, basePath) {
525
+ return {
526
+ proxy: appendBasePathToOrigin(origin, "/proxy", basePath),
527
+ openAiV1: appendBasePathToOrigin(origin, "/proxy/v1", basePath),
528
+ mcp: appendBasePathToOrigin(origin, "/api/mcp", basePath)
529
+ };
530
+ }
523
531
  function formatTimestamp$2(iso, format) {
524
532
  switch (format) {
525
533
  case "full":
@@ -1929,20 +1937,20 @@ function extractStopReason(log) {
1929
1937
  if (typeof json === "string") {
1930
1938
  json = JSON.parse(json);
1931
1939
  }
1932
- if (!isRecord(json)) return null;
1940
+ if (!isRecord$2(json)) return null;
1933
1941
  if (typeof json.stop_reason === "string") {
1934
1942
  return normalizeAnthropicStopReason(json.stop_reason);
1935
1943
  }
1936
1944
  if (Array.isArray(json.choices)) {
1937
1945
  for (const choice of json.choices) {
1938
- if (!isRecord(choice) || typeof choice.finish_reason !== "string") continue;
1946
+ if (!isRecord$2(choice) || typeof choice.finish_reason !== "string") continue;
1939
1947
  const reason = normalizeOpenAIFinishReason(choice.finish_reason);
1940
1948
  if (reason !== null) return reason;
1941
1949
  }
1942
1950
  }
1943
1951
  if (Array.isArray(json.output)) {
1944
1952
  for (const item of json.output) {
1945
- if (isRecord(item) && item.type === "function_call") {
1953
+ if (isRecord$2(item) && item.type === "function_call") {
1946
1954
  return "tool_use";
1947
1955
  }
1948
1956
  }
@@ -1950,7 +1958,7 @@ function extractStopReason(log) {
1950
1958
  return "stop";
1951
1959
  }
1952
1960
  }
1953
- if (json.status === "incomplete" && isRecord(json.incomplete_details)) {
1961
+ if (json.status === "incomplete" && isRecord$2(json.incomplete_details)) {
1954
1962
  const reason = json.incomplete_details.reason;
1955
1963
  if (typeof reason === "string" && isResponsesLengthLimitReason(reason)) {
1956
1964
  return "length";
@@ -2509,30 +2517,30 @@ function useCopyFeedback(text) {
2509
2517
  return { copied, copy };
2510
2518
  }
2511
2519
  const LazyCompareDrawer = reactExports.lazy(
2512
- () => import("./CompareDrawer-Bgc2TZh_.mjs").then((m) => ({ default: m.CompareDrawer }))
2520
+ () => import("./CompareDrawer-DtOIMeQB.mjs").then((m) => ({ default: m.CompareDrawer }))
2513
2521
  );
2514
2522
  const LazyInspectorPet = reactExports.lazy(
2515
- () => import("./InspectorPet-DyK2ojeh.mjs").then((m) => ({ default: m.InspectorPet }))
2523
+ () => import("./InspectorPet-CXc4oCBQ.mjs").then((m) => ({ default: m.InspectorPet }))
2516
2524
  );
2517
2525
  const LazyReplayDialog = reactExports.lazy(
2518
- () => import("./ReplayDialog-KpnrGtZ-.mjs").then((m) => ({ default: m.ReplayDialog }))
2526
+ () => import("./ReplayDialog-BQEA95qC.mjs").then((m) => ({ default: m.ReplayDialog }))
2519
2527
  );
2520
2528
  const LazyRequestAnatomy = reactExports.lazy(
2521
- () => import("./RequestAnatomy-uCsfucn8.mjs").then((m) => ({ default: m.RequestAnatomy }))
2529
+ () => import("./RequestAnatomy-BMyd8B7Q.mjs").then((m) => ({ default: m.RequestAnatomy }))
2522
2530
  );
2523
2531
  const LazyResponseView = reactExports.lazy(
2524
- () => import("./ResponseView-C8UPqoPO.mjs").then((m) => ({ default: m.ResponseView }))
2532
+ () => import("./ResponseView-qrTaEIM8.mjs").then((m) => ({ default: m.ResponseView }))
2525
2533
  );
2526
2534
  const LazyStreamingChunkSequence = reactExports.lazy(
2527
- () => import("./StreamingChunkSequence-BP28I9sh.mjs").then((m) => ({
2535
+ () => import("./StreamingChunkSequence-BFTL8mIy.mjs").then((m) => ({
2528
2536
  default: m.StreamingChunkSequence
2529
2537
  }))
2530
2538
  );
2531
2539
  const LazyJsonViewer = reactExports.lazy(
2532
- () => import("./json-viewer-DrE0vtlB.mjs").then((m) => ({ default: m.JsonViewer }))
2540
+ () => import("./json-viewer-DiI0Yjsn.mjs").then((m) => ({ default: m.JsonViewer }))
2533
2541
  );
2534
2542
  const LazyJsonViewerFromString = reactExports.lazy(
2535
- () => import("./json-viewer-DrE0vtlB.mjs").then((m) => ({ default: m.JsonViewerFromString }))
2543
+ () => import("./json-viewer-DiI0Yjsn.mjs").then((m) => ({ default: m.JsonViewerFromString }))
2536
2544
  );
2537
2545
  const HIGHLIGHT_DURATION_MS = 1200;
2538
2546
  const MAX_HIGHLIGHT_ATTEMPTS = 12;
@@ -11089,6 +11097,10 @@ function OnboardingSettingsTab() {
11089
11097
  if (typeof window === "undefined") return "http://localhost:9527";
11090
11098
  return window.location.origin;
11091
11099
  }, []);
11100
+ const endpoints = reactExports.useMemo(
11101
+ () => deriveCodingAgentEndpoints(origin, getConfiguredBasePath()),
11102
+ [origin]
11103
+ );
11092
11104
  const values = reactExports.useMemo(
11093
11105
  () => [
11094
11106
  { id: "status", label: "Check onboarding", value: "agent-inspector onboard --status" },
@@ -11123,7 +11135,7 @@ function OnboardingSettingsTab() {
11123
11135
  {
11124
11136
  id: "opencode-proxy",
11125
11137
  label: "OpenCode proxy",
11126
- value: `LLM_BASE_URL=${origin}${withBasePath("/proxy")}`
11138
+ value: `LLM_BASE_URL=${endpoints.proxy}`
11127
11139
  },
11128
11140
  {
11129
11141
  id: "mimo-config",
@@ -11139,22 +11151,22 @@ function OnboardingSettingsTab() {
11139
11151
  {
11140
11152
  id: "mimo-proxy",
11141
11153
  label: "MiMo Code proxy",
11142
- value: `OPENAI_BASE_URL=${origin}${withBasePath("/proxy")}`
11154
+ value: `OPENAI_BASE_URL=${endpoints.proxy}`
11143
11155
  },
11144
- { id: "mcp", label: "MCP URL", value: `${origin}${withBasePath("/api/mcp")}` },
11145
- { id: "proxy", label: "Proxy URL", value: `${origin}${withBasePath("/proxy")}` },
11156
+ { id: "mcp", label: "MCP URL", value: endpoints.mcp },
11157
+ { id: "proxy", label: "Proxy URL", value: endpoints.proxy },
11146
11158
  {
11147
11159
  id: "anthropic",
11148
11160
  label: "Anthropic base",
11149
- value: `ANTHROPIC_BASE_URL=${origin}${withBasePath("/proxy")}`
11161
+ value: `ANTHROPIC_BASE_URL=${endpoints.proxy}`
11150
11162
  },
11151
11163
  {
11152
11164
  id: "openai",
11153
11165
  label: "OpenAI base",
11154
- value: `OPENAI_BASE_URL=${origin}${withBasePath("/proxy")}`
11166
+ value: `OPENAI_BASE_URL=${endpoints.openAiV1}`
11155
11167
  }
11156
11168
  ],
11157
- [origin]
11169
+ [endpoints]
11158
11170
  );
11159
11171
  const handleCopy = reactExports.useCallback((id, value) => {
11160
11172
  void copyTextToClipboard(value).then((success) => {
@@ -15906,9 +15918,9 @@ function ProxyViewer({
15906
15918
  const exportRequestIdRef = reactExports.useRef(0);
15907
15919
  const detailsPanelResizeRef = reactExports.useRef(null);
15908
15920
  useKeyboardNavigation(logListRef, logListWrapperRef, { pageWide: true });
15909
- const proxyEndpoint = reactExports.useMemo(() => {
15921
+ const connectionEndpoints = reactExports.useMemo(() => {
15910
15922
  const origin = typeof window === "undefined" ? "http://localhost:9527" : window.location.origin;
15911
- return `${origin}${withBasePath("/proxy")}`;
15923
+ return deriveCodingAgentEndpoints(origin, getConfiguredBasePath());
15912
15924
  }, []);
15913
15925
  const cancelTransientTasks = reactExports.useCallback(() => {
15914
15926
  exportRequestIdRef.current += 1;
@@ -16581,15 +16593,28 @@ function ProxyViewer({
16581
16593
  /* @__PURE__ */ jsxRuntimeExports.jsx(
16582
16594
  CopyableCommand,
16583
16595
  {
16584
- command: `ANTHROPIC_BASE_URL=${proxyEndpoint} <your-tool>`
16596
+ command: `ANTHROPIC_BASE_URL=${connectionEndpoints.proxy} <your-tool>`
16585
16597
  }
16586
16598
  ),
16587
16599
  /* @__PURE__ */ jsxRuntimeExports.jsx(
16588
16600
  CopyableCommand,
16589
16601
  {
16590
- command: `OPENAI_BASE_URL=${proxyEndpoint} <your-tool>`
16602
+ command: `LLM_BASE_URL=${connectionEndpoints.proxy} opencode`
16591
16603
  }
16592
- )
16604
+ ),
16605
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
16606
+ CopyableCommand,
16607
+ {
16608
+ command: `OPENAI_BASE_URL=${connectionEndpoints.openAiV1} <your-tool>`
16609
+ }
16610
+ ),
16611
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
16612
+ CopyableCommand,
16613
+ {
16614
+ command: `base_url = "${connectionEndpoints.openAiV1}"`
16615
+ }
16616
+ ),
16617
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableCommand, { command: `MCP_URL=${connectionEndpoints.mcp}` })
16593
16618
  ] }),
16594
16619
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mx-auto max-w-xl text-xs leading-relaxed text-muted-foreground", children: "Container note: if your AI tool runs in a different container or host than Agent Inspector, replace localhost with an address reachable from that tool and verify the network/firewall path." })
16595
16620
  ] })
@@ -1,7 +1,8 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { u as useProviders, f as fetchJsonWithTimeout, D as Dialog, b as DialogContent, c as DialogHeader, d as DialogTitle, T as Tabs, e as TabsList, h as TabsTrigger, i as TabsContent, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent, n as dispatchLogFocusRequest, A as ApiTimeoutError } from "./ProxyViewerContainer-hvn6oVWD.mjs";
3
- import { B as Button, C as CapturedLogSchema } from "./router-C6nWUZHK.mjs";
4
- import { ResponseView } from "./ResponseView-C8UPqoPO.mjs";
2
+ import { u as useProviders, f as fetchJsonWithTimeout, D as Dialog, b as DialogContent, c as DialogHeader, d as DialogTitle, T as Tabs, e as TabsList, h as TabsTrigger, i as TabsContent, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent, n as dispatchLogFocusRequest, A as ApiTimeoutError } from "./ProxyViewerContainer-DVPlwfkt.mjs";
3
+ import { B as Button, C as CapturedLogSchema } from "./router-BJ_ltLim.mjs";
4
+ import { ResponseView } from "./ResponseView-qrTaEIM8.mjs";
5
+ import "./publicBasePathContext-5264L3rX.mjs";
5
6
  import "node:crypto";
6
7
  import "node:path";
7
8
  import "node:fs";
@@ -15,7 +16,7 @@ import "../_libs/modelcontextprotocol__server.mjs";
15
16
  import "../_libs/jszip.mjs";
16
17
  import "node:os";
17
18
  import { p as RotateCcw, aL as Braces, z as Minimize2 } from "../_libs/lucide-react.mjs";
18
- import { o as object, n as number, e as array, d as boolean, c as string } from "../_libs/zod.mjs";
19
+ import { o as object, n as number, f as array, e as boolean, c as string } from "../_libs/zod.mjs";
19
20
  import "../_libs/swr.mjs";
20
21
  import "../_libs/use-sync-external-store.mjs";
21
22
  import "../_libs/dequal.mjs";
@@ -104,6 +105,7 @@ import "../_libs/semver.mjs";
104
105
  import "../_libs/uint8array-extras.mjs";
105
106
  import "node:dns/promises";
106
107
  import "node:assert/strict";
108
+ import "node:async_hooks";
107
109
  import "../_libs/modelcontextprotocol__core.mjs";
108
110
  import "../_libs/readable-stream.mjs";
109
111
  import "events";
@@ -1,6 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { y as formatTokens, m as cn, Y as formatContextWindowTokens } from "./router-C6nWUZHK.mjs";
3
- import { u as useProviders, o as analyzeContextIntelligence, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, p as ANATOMY_ROLE_LABELS, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-hvn6oVWD.mjs";
2
+ import { x as formatTokens, m as cn, X as formatContextWindowTokens } from "./router-BJ_ltLim.mjs";
3
+ import { u as useProviders, o as analyzeContextIntelligence, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, p as ANATOMY_ROLE_LABELS, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-DVPlwfkt.mjs";
4
+ import "./publicBasePathContext-5264L3rX.mjs";
4
5
  import "node:crypto";
5
6
  import "node:path";
6
7
  import "node:fs";
@@ -58,6 +59,7 @@ import "../_libs/uint8array-extras.mjs";
58
59
  import "node:dns/promises";
59
60
  import "node:assert/strict";
60
61
  import "../_libs/zod.mjs";
62
+ import "node:async_hooks";
61
63
  import "../_libs/modelcontextprotocol__core.mjs";
62
64
  import "../_libs/readable-stream.mjs";
63
65
  import "events";
@@ -1,6 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { y as formatTokens, m as cn, E as getStatusCategory, s as safeGetOwnProperty } from "./router-C6nWUZHK.mjs";
3
- import { g as getLogFormatAdapter, q as AnswerMarkdown, B as Badge, s as Collapsible, t as CollapsibleTrigger, v as CollapsibleContent, w as ScrollArea, x as LazyJsonViewer, y as safeJsonValue } from "./ProxyViewerContainer-hvn6oVWD.mjs";
2
+ import { x as formatTokens, m as cn, z as getStatusCategory, s as safeGetOwnProperty } from "./router-BJ_ltLim.mjs";
3
+ import { g as getLogFormatAdapter, q as AnswerMarkdown, B as Badge, s as Collapsible, t as CollapsibleTrigger, v as CollapsibleContent, w as ScrollArea, x as LazyJsonViewer, y as safeJsonValue } from "./ProxyViewerContainer-DVPlwfkt.mjs";
4
+ import "./publicBasePathContext-5264L3rX.mjs";
4
5
  import "node:crypto";
5
6
  import "node:path";
6
7
  import "node:fs";
@@ -59,6 +60,7 @@ import "../_libs/uint8array-extras.mjs";
59
60
  import "node:dns/promises";
60
61
  import "node:assert/strict";
61
62
  import "../_libs/zod.mjs";
63
+ import "node:async_hooks";
62
64
  import "../_libs/modelcontextprotocol__core.mjs";
63
65
  import "../_libs/readable-stream.mjs";
64
66
  import "events";
@@ -1,6 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { f as fetchJsonWithTimeout, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, B as Badge, m as TooltipContent, x as LazyJsonViewer } from "./ProxyViewerContainer-hvn6oVWD.mjs";
3
- import { ah as StreamingChunkSchema$1 } from "./router-C6nWUZHK.mjs";
2
+ import { f as fetchJsonWithTimeout, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, B as Badge, m as TooltipContent, x as LazyJsonViewer } from "./ProxyViewerContainer-DVPlwfkt.mjs";
3
+ import { ag as StreamingChunkSchema$1 } from "./router-BJ_ltLim.mjs";
4
+ import "./publicBasePathContext-5264L3rX.mjs";
4
5
  import "node:crypto";
5
6
  import "node:path";
6
7
  import "node:fs";
@@ -14,7 +15,7 @@ import "../_libs/modelcontextprotocol__server.mjs";
14
15
  import "../_libs/jszip.mjs";
15
16
  import "node:os";
16
17
  import { c as ChevronDown, t as ChevronRight, L as LoaderCircle } from "../_libs/lucide-react.mjs";
17
- import { o as object, d as boolean, e as array } from "../_libs/zod.mjs";
18
+ import { o as object, e as boolean, f as array } from "../_libs/zod.mjs";
18
19
  import "../_libs/swr.mjs";
19
20
  import "../_libs/use-sync-external-store.mjs";
20
21
  import "../_libs/dequal.mjs";
@@ -103,6 +104,7 @@ import "../_libs/semver.mjs";
103
104
  import "../_libs/uint8array-extras.mjs";
104
105
  import "node:dns/promises";
105
106
  import "node:assert/strict";
107
+ import "node:async_hooks";
106
108
  import "../_libs/modelcontextprotocol__core.mjs";
107
109
  import "../_libs/readable-stream.mjs";
108
110
  import "events";
@@ -1,6 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { P as ProxyViewerContainer } from "./ProxyViewerContainer-hvn6oVWD.mjs";
3
- import "./router-C6nWUZHK.mjs";
2
+ import { P as ProxyViewerContainer } from "./ProxyViewerContainer-DVPlwfkt.mjs";
3
+ import "./router-BJ_ltLim.mjs";
4
+ import "./publicBasePathContext-5264L3rX.mjs";
4
5
  import "node:crypto";
5
6
  import "node:path";
6
7
  import "node:fs";
@@ -103,6 +104,7 @@ import "../_libs/semver.mjs";
103
104
  import "../_libs/uint8array-extras.mjs";
104
105
  import "node:dns/promises";
105
106
  import "node:assert/strict";
107
+ import "node:async_hooks";
106
108
  import "../_libs/modelcontextprotocol__core.mjs";
107
109
  import "../_libs/readable-stream.mjs";
108
110
  import "events";
@@ -1,5 +1,6 @@
1
1
  import { j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { S as SafeRouteError } from "./router-C6nWUZHK.mjs";
2
+ import { S as SafeRouteError } from "./router-BJ_ltLim.mjs";
3
+ import "./publicBasePathContext-5264L3rX.mjs";
3
4
  import "node:crypto";
4
5
  import "node:path";
5
6
  import "node:fs";
@@ -56,6 +57,7 @@ import "../_libs/uint8array-extras.mjs";
56
57
  import "node:dns/promises";
57
58
  import "node:assert/strict";
58
59
  import "../_libs/zod.mjs";
60
+ import "node:async_hooks";
59
61
  import "../_libs/modelcontextprotocol__core.mjs";
60
62
  import "../_libs/readable-stream.mjs";
61
63
  import "events";
@@ -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-rshlRaiN.mjs");
88
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-C6pXXX9R.mjs");
89
89
  const startManifest = tsrStartManifest();
90
90
  let routes = startManifest.routes;
91
91
  routes[rootRouteId];
@@ -1162,8 +1162,8 @@ 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-C6nWUZHK.mjs").then((n) => n.ai),
1166
- import("./start-HYkvq4Ni.mjs"),
1165
+ import("./router-BJ_ltLim.mjs").then((n) => n.ah),
1166
+ import("./start-C6MjPjxp.mjs"),
1167
1167
  import("./empty-plugin-adapters-BFgPZ6_d.mjs")
1168
1168
  ]);
1169
1169
  return {
@@ -1506,6 +1506,7 @@ function createServerEntry(entry) {
1506
1506
  }
1507
1507
  const server = createServerEntry({ fetch });
1508
1508
  export {
1509
+ createMiddleware as c,
1509
1510
  createServerEntry,
1510
1511
  server as default
1511
1512
  };
@@ -1,6 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { m as cn, z as copyTextToClipboard } from "./router-C6nWUZHK.mjs";
3
- import { z as parseJsonText, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent } from "./ProxyViewerContainer-hvn6oVWD.mjs";
2
+ import { m as cn, y as copyTextToClipboard } from "./router-BJ_ltLim.mjs";
3
+ import { z as parseJsonText, j as TooltipProvider, k as Tooltip, l as TooltipTrigger, m as TooltipContent } from "./ProxyViewerContainer-DVPlwfkt.mjs";
4
+ import "./publicBasePathContext-5264L3rX.mjs";
4
5
  import "node:crypto";
5
6
  import "node:path";
6
7
  import "node:fs";
@@ -58,6 +59,7 @@ import "../_libs/uint8array-extras.mjs";
58
59
  import "node:dns/promises";
59
60
  import "node:assert/strict";
60
61
  import "../_libs/zod.mjs";
62
+ import "node:async_hooks";
61
63
  import "../_libs/modelcontextprotocol__core.mjs";
62
64
  import "../_libs/readable-stream.mjs";
63
65
  import "events";
@@ -0,0 +1,148 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ const AGENT_INSPECTOR_BASE_PATH_ENV = "AGENT_INSPECTOR_BASE_PATH";
3
+ const AGENT_INSPECTOR_INTERNAL_STRIPPED_BASE_PATH_ENV = "AGENT_INSPECTOR_INTERNAL_STRIPPED_BASE_PATH";
4
+ const AGENT_INSPECTOR_BASE_PATH_META_NAME = "agent-inspector-base-path";
5
+ const AGENT_INSPECTOR_PUBLIC_BASE_PATH_HEADER = "x-agent-inspector-public-base-path";
6
+ const AGENT_INSPECTOR_PUBLIC_PORT_HEADER = "x-agent-inspector-public-port";
7
+ const DEFAULT_AGENT_INSPECTOR_BASE_PATH = "/inspector";
8
+ function trimSlashes(value) {
9
+ return value.replace(/^\/+/u, "").replace(/\/+$/u, "");
10
+ }
11
+ function normalizeBasePath(value) {
12
+ const trimmed = value?.trim();
13
+ if (trimmed === void 0 || trimmed.length === 0 || trimmed === "/") return "";
14
+ const path = trimSlashes(trimmed);
15
+ if (path.length === 0) return "";
16
+ return `/${path}`;
17
+ }
18
+ function readDocumentBasePath() {
19
+ if (typeof document === "undefined") return void 0;
20
+ return document.querySelector(`meta[name="${AGENT_INSPECTOR_BASE_PATH_META_NAME}"]`)?.getAttribute("content") ?? void 0;
21
+ }
22
+ function readProcessBasePath() {
23
+ if (typeof process === "undefined") return void 0;
24
+ return process.env[AGENT_INSPECTOR_BASE_PATH_ENV];
25
+ }
26
+ function getConfiguredBasePath(env) {
27
+ if (env !== void 0) {
28
+ return normalizeBasePath(
29
+ env[AGENT_INSPECTOR_BASE_PATH_ENV] ?? DEFAULT_AGENT_INSPECTOR_BASE_PATH
30
+ );
31
+ }
32
+ return normalizeBasePath(
33
+ readProcessBasePath() ?? readDocumentBasePath() ?? "/" ?? DEFAULT_AGENT_INSPECTOR_BASE_PATH
34
+ );
35
+ }
36
+ function getRouterBasePath(env) {
37
+ if (env?.[AGENT_INSPECTOR_INTERNAL_STRIPPED_BASE_PATH_ENV] === "1") return "";
38
+ return getConfiguredBasePath(env);
39
+ }
40
+ function withBasePath(path, basePath = getConfiguredBasePath()) {
41
+ const normalized = normalizeBasePath(basePath);
42
+ if (/^[a-z][a-z0-9+.-]*:/iu.test(path)) return path;
43
+ if (normalized.length === 0) return path;
44
+ if (path.length === 0 || path === "/") return normalized;
45
+ if (path.startsWith(`${normalized}/`) || path === normalized) return path;
46
+ return path.startsWith("/") ? `${normalized}${path}` : `${normalized}/${path}`;
47
+ }
48
+ function stripBasePath(pathname, basePath = getConfiguredBasePath()) {
49
+ const normalized = normalizeBasePath(basePath);
50
+ if (normalized.length === 0) return pathname;
51
+ if (pathname === normalized) return "/";
52
+ if (pathname.startsWith(`${normalized}/`)) return pathname.slice(normalized.length);
53
+ return pathname;
54
+ }
55
+ function appendBasePathToOrigin(origin, path, basePath) {
56
+ const normalized = normalizeBasePath(basePath);
57
+ if (normalized.length === 0 && path === "/") return origin;
58
+ return `${origin}${withBasePath(path, normalized)}`;
59
+ }
60
+ function getCurrentPort() {
61
+ const publicPort = process.env["AGENT_INSPECTOR_PUBLIC_PORT"];
62
+ if (publicPort !== void 0 && publicPort !== "") {
63
+ const n = Number(publicPort);
64
+ if (Number.isInteger(n) && n > 0 && n <= 65535) return n;
65
+ }
66
+ const envPort = process.env["PORT"];
67
+ if (envPort !== void 0 && envPort !== "") {
68
+ const n = Number(envPort);
69
+ if (Number.isInteger(n) && n > 0 && n <= 65535) return n;
70
+ }
71
+ throw new Error(
72
+ "Inspector server port not initialized: PORT env var is unset and setCurrentPort() has not been called"
73
+ );
74
+ }
75
+ const publicRequestStorage = new AsyncLocalStorage();
76
+ function isSafePublicBasePath(value) {
77
+ if (value.length === 0) return true;
78
+ if (!/^\/[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/u.test(value)) return false;
79
+ return !value.split("/").some((segment) => segment === "." || segment === "..");
80
+ }
81
+ function resolveRequestPublicBasePath(request, env) {
82
+ const rawValue = request.headers.get(AGENT_INSPECTOR_PUBLIC_BASE_PATH_HEADER);
83
+ if (rawValue !== null) {
84
+ const normalized = normalizeBasePath(rawValue);
85
+ if (isSafePublicBasePath(normalized)) return normalized;
86
+ }
87
+ return getConfiguredBasePath(process.env);
88
+ }
89
+ function resolveRequestPublicPort(request) {
90
+ const rawValue = request.headers.get(AGENT_INSPECTOR_PUBLIC_PORT_HEADER);
91
+ if (rawValue !== null && /^\d{1,5}$/u.test(rawValue)) {
92
+ const headerPort = Number(rawValue);
93
+ if (Number.isSafeInteger(headerPort) && headerPort > 0 && headerPort <= 65535) {
94
+ return headerPort;
95
+ }
96
+ }
97
+ try {
98
+ return getCurrentPort();
99
+ } catch {
100
+ }
101
+ try {
102
+ const urlPort = new URL(request.url).port;
103
+ if (!/^\d{1,5}$/u.test(urlPort)) return null;
104
+ const port = Number(urlPort);
105
+ return Number.isSafeInteger(port) && port > 0 && port <= 65535 ? port : null;
106
+ } catch {
107
+ return null;
108
+ }
109
+ }
110
+ function getPublicBasePath(env) {
111
+ return publicRequestStorage.getStore()?.basePath ?? getConfiguredBasePath(process.env);
112
+ }
113
+ function getPublicPort() {
114
+ return publicRequestStorage.getStore()?.publicPort ?? getCurrentPort();
115
+ }
116
+ function runWithRequestPublicBasePath(request, callback) {
117
+ return publicRequestStorage.run(
118
+ {
119
+ basePath: resolveRequestPublicBasePath(request),
120
+ publicPort: resolveRequestPublicPort(request)
121
+ },
122
+ callback
123
+ );
124
+ }
125
+ const publicBasePathContext = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
+ __proto__: null,
127
+ getPublicBasePath,
128
+ getPublicPort,
129
+ resolveRequestPublicBasePath,
130
+ resolveRequestPublicPort,
131
+ runWithRequestPublicBasePath
132
+ }, Symbol.toStringTag, { value: "Module" }));
133
+ export {
134
+ AGENT_INSPECTOR_BASE_PATH_META_NAME as A,
135
+ getPublicBasePath as a,
136
+ getPublicPort as b,
137
+ AGENT_INSPECTOR_PUBLIC_BASE_PATH_HEADER as c,
138
+ AGENT_INSPECTOR_PUBLIC_PORT_HEADER as d,
139
+ appendBasePathToOrigin as e,
140
+ AGENT_INSPECTOR_BASE_PATH_ENV as f,
141
+ getConfiguredBasePath as g,
142
+ getRouterBasePath as h,
143
+ normalizeBasePath as n,
144
+ publicBasePathContext as p,
145
+ runWithRequestPublicBasePath as r,
146
+ stripBasePath as s,
147
+ withBasePath as w
148
+ };