@tonyclaw/agent-inspector 2.0.41 → 2.0.42

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 (34) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-DCg6S2cl.js → CompareDrawer-Cfqxlo-U.js} +1 -1
  3. package/.output/public/assets/{ProxyViewerContainer-DsU6QETm.js → ProxyViewerContainer-CE9pAX4c.js} +26 -24
  4. package/.output/public/assets/{ReplayDialog-ClVgjSDE.js → ReplayDialog-daRidZo_.js} +1 -1
  5. package/.output/public/assets/{RequestAnatomy-BhqvLQp9.js → RequestAnatomy-CJ7EPQGQ.js} +1 -1
  6. package/.output/public/assets/{ResponseView-BZAJoK6B.js → ResponseView-xBmr54hB.js} +1 -1
  7. package/.output/public/assets/{StreamingChunkSequence-CaORmoKX.js → StreamingChunkSequence-nK-0LpbM.js} +1 -1
  8. package/.output/public/assets/_sessionId-CbWEG5ej.js +1 -0
  9. package/.output/public/assets/index-D1MkoT4l.js +1 -0
  10. package/.output/public/assets/{main-CI3HFEcV.js → main-DOy_Q96H.js} +2 -2
  11. package/.output/server/{_sessionId-DQ0ljHQ8.mjs → _sessionId-DtYRZHlM.mjs} +2 -2
  12. package/.output/server/_ssr/{CompareDrawer-nkVa9epn.mjs → CompareDrawer-fy1ARwtx.mjs} +2 -2
  13. package/.output/server/_ssr/{ProxyViewerContainer-CXA7iH3H.mjs → ProxyViewerContainer-9GJtCWCq.mjs} +131 -6
  14. package/.output/server/_ssr/{ReplayDialog-CK71-ucq.mjs → ReplayDialog-BrS7syOE.mjs} +3 -3
  15. package/.output/server/_ssr/{RequestAnatomy-DDCUJJ3X.mjs → RequestAnatomy-BtWt1cWY.mjs} +2 -2
  16. package/.output/server/_ssr/{ResponseView-C6ZA7V3B.mjs → ResponseView-CkKGYE6m.mjs} +2 -2
  17. package/.output/server/_ssr/{StreamingChunkSequence-DW5v_o6G.mjs → StreamingChunkSequence-C7rB3osr.mjs} +2 -2
  18. package/.output/server/_ssr/{index-Ckex98yq.mjs → index-D24WforP.mjs} +2 -2
  19. package/.output/server/_ssr/index.mjs +2 -2
  20. package/.output/server/_ssr/{router-ChJIVv7-.mjs → router-CVqVjBzJ.mjs} +1312 -467
  21. package/.output/server/{_tanstack-start-manifest_v-CJ4__weU.mjs → _tanstack-start-manifest_v-DSikvwru.mjs} +1 -1
  22. package/.output/server/index.mjs +57 -57
  23. package/README.md +36 -12
  24. package/package.json +1 -1
  25. package/src/components/providers/SettingsDialog.tsx +137 -0
  26. package/src/lib/runContract.ts +3 -0
  27. package/src/mcp/currentContext.ts +65 -0
  28. package/src/mcp/mode.ts +56 -0
  29. package/src/mcp/server.ts +466 -15
  30. package/src/mcp/toolHandlers.ts +372 -0
  31. package/src/proxy/evidenceExporter.ts +1 -0
  32. package/src/proxy/runStore.ts +74 -22
  33. package/.output/public/assets/_sessionId-BHqywvM3.js +0 -1
  34. package/.output/public/assets/index-B_LPYuM0.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports, a as React } from "../_libs/react.mjs";
2
- import { 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, v as packageJson, i as GroupEvidenceExportResultSchema, j as DeleteInspectorGroupResponseSchema, d as RuntimeConfigSchema, P as ProviderConfigSchema, f as apiFormatForPath, 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, m as maskApiKey, k as providerHasContextMetadata, l as findProviderModelMetadata, g as getSessionPath, p as parseOpenAIResponse, O as OpenAIRequestSchema, A as AnthropicResponseSchema$1, e as AnthropicRequestSchema, s as safeGetOwnProperty, t as resolveProviderContextWindow, K as KnowledgeCandidateSchema, h as stripClaudeCodeBillingHeader, u as isPlainRecord, G as GroupEvidenceReadResponseSchema, I as InspectorGroupsListResponseSchema } from "./router-ChJIVv7-.mjs";
2
+ import { 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, v as packageJson, i as GroupEvidenceExportResultSchema, j as DeleteInspectorGroupResponseSchema, d as RuntimeConfigSchema, P as ProviderConfigSchema, f as apiFormatForPath, 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, m as maskApiKey, k as providerHasContextMetadata, l as findProviderModelMetadata, g as getSessionPath, p as parseOpenAIResponse, O as OpenAIRequestSchema, A as AnthropicResponseSchema$1, e as AnthropicRequestSchema, s as safeGetOwnProperty, t as resolveProviderContextWindow, K as KnowledgeCandidateSchema, h as stripClaudeCodeBillingHeader, u as isPlainRecord, G as GroupEvidenceReadResponseSchema, I as InspectorGroupsListResponseSchema } from "./router-CVqVjBzJ.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";
@@ -1937,19 +1937,19 @@ function useCopyFeedback(text) {
1937
1937
  return { copied, copy };
1938
1938
  }
1939
1939
  const LazyCompareDrawer = reactExports.lazy(
1940
- () => import("./CompareDrawer-nkVa9epn.mjs").then((m) => ({ default: m.CompareDrawer }))
1940
+ () => import("./CompareDrawer-fy1ARwtx.mjs").then((m) => ({ default: m.CompareDrawer }))
1941
1941
  );
1942
1942
  const LazyReplayDialog = reactExports.lazy(
1943
- () => import("./ReplayDialog-CK71-ucq.mjs").then((m) => ({ default: m.ReplayDialog }))
1943
+ () => import("./ReplayDialog-BrS7syOE.mjs").then((m) => ({ default: m.ReplayDialog }))
1944
1944
  );
1945
1945
  const LazyRequestAnatomy = reactExports.lazy(
1946
- () => import("./RequestAnatomy-DDCUJJ3X.mjs").then((m) => ({ default: m.RequestAnatomy }))
1946
+ () => import("./RequestAnatomy-BtWt1cWY.mjs").then((m) => ({ default: m.RequestAnatomy }))
1947
1947
  );
1948
1948
  const LazyResponseView = reactExports.lazy(
1949
- () => import("./ResponseView-C6ZA7V3B.mjs").then((m) => ({ default: m.ResponseView }))
1949
+ () => import("./ResponseView-CkKGYE6m.mjs").then((m) => ({ default: m.ResponseView }))
1950
1950
  );
1951
1951
  const LazyStreamingChunkSequence = reactExports.lazy(
1952
- () => import("./StreamingChunkSequence-DW5v_o6G.mjs").then((m) => ({
1952
+ () => import("./StreamingChunkSequence-C7rB3osr.mjs").then((m) => ({
1953
1953
  default: m.StreamingChunkSequence
1954
1954
  }))
1955
1955
  );
@@ -8450,6 +8450,7 @@ function SettingsDialog() {
8450
8450
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "providers", children: "Providers" }),
8451
8451
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "proxy", children: "Proxy" }),
8452
8452
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "storage", children: "Storage" }),
8453
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "mcp", children: "MCP" }),
8453
8454
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "onboarding", children: "Onboarding" })
8454
8455
  ] }),
8455
8456
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 flex-1 overflow-x-hidden overflow-y-auto pr-3", children: [
@@ -8471,6 +8472,7 @@ function SettingsDialog() {
8471
8472
  ) }),
8472
8473
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "proxy", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProxySettingsTab, {}) }),
8473
8474
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "storage", children: /* @__PURE__ */ jsxRuntimeExports.jsx(StorageSettingsTab, {}) }),
8475
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "mcp", children: /* @__PURE__ */ jsxRuntimeExports.jsx(McpSettingsTab, {}) }),
8474
8476
  /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "onboarding", children: /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingSettingsTab, {}) })
8475
8477
  ] })
8476
8478
  ] })
@@ -8720,6 +8722,129 @@ function OnboardingSettingsTab() {
8720
8722
  ] })
8721
8723
  ] });
8722
8724
  }
8725
+ function McpSettingsTab() {
8726
+ const [copiedId, setCopiedId] = reactExports.useState(null);
8727
+ const origin = reactExports.useMemo(() => {
8728
+ if (typeof window === "undefined") return "http://localhost:25947";
8729
+ return window.location.origin;
8730
+ }, []);
8731
+ const endpoint = `${origin}/api/mcp`;
8732
+ const values = reactExports.useMemo(
8733
+ () => [
8734
+ { id: "mcp-url", label: "Streamable HTTP MCP URL", value: endpoint },
8735
+ {
8736
+ id: "stdio",
8737
+ label: "Stdio bridge command",
8738
+ value: `agent-inspector-mcp stdio --url ${endpoint}`
8739
+ },
8740
+ {
8741
+ id: "doctor",
8742
+ label: "Bridge doctor",
8743
+ value: `agent-inspector-mcp doctor --url ${endpoint}`
8744
+ },
8745
+ {
8746
+ id: "readonly",
8747
+ label: "Readonly mode",
8748
+ value: "AGENT_INSPECTOR_MCP_READONLY=1 agent-inspector"
8749
+ },
8750
+ {
8751
+ id: "capabilities",
8752
+ label: "Capabilities resource",
8753
+ value: "inspector://mcp/capabilities"
8754
+ },
8755
+ {
8756
+ id: "context",
8757
+ label: "Current context resource",
8758
+ value: "inspector://context/current"
8759
+ },
8760
+ {
8761
+ id: "streamable-json",
8762
+ label: "Streamable HTTP JSON",
8763
+ value: JSON.stringify(
8764
+ {
8765
+ mcpServers: {
8766
+ "agent-inspector": {
8767
+ type: "streamableHttp",
8768
+ url: endpoint
8769
+ }
8770
+ }
8771
+ },
8772
+ null,
8773
+ 2
8774
+ )
8775
+ },
8776
+ {
8777
+ id: "stdio-json",
8778
+ label: "Stdio MCP JSON",
8779
+ value: JSON.stringify(
8780
+ {
8781
+ mcpServers: {
8782
+ "agent-inspector": {
8783
+ command: "agent-inspector-mcp",
8784
+ args: ["stdio", "--url", endpoint]
8785
+ }
8786
+ }
8787
+ },
8788
+ null,
8789
+ 2
8790
+ )
8791
+ },
8792
+ {
8793
+ id: "opencode-local",
8794
+ label: "OpenCode local MCP",
8795
+ value: JSON.stringify(
8796
+ {
8797
+ mcp: {
8798
+ "agent-inspector": {
8799
+ type: "local",
8800
+ command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
8801
+ enabled: true
8802
+ }
8803
+ }
8804
+ },
8805
+ null,
8806
+ 2
8807
+ )
8808
+ },
8809
+ {
8810
+ id: "codex-toml",
8811
+ label: "Codex TOML",
8812
+ value: `[mcp_servers.agent-inspector]
8813
+ command = "agent-inspector-mcp"
8814
+ args = ["stdio", "--url", "${endpoint}"]`
8815
+ }
8816
+ ],
8817
+ [endpoint]
8818
+ );
8819
+ const handleCopy = reactExports.useCallback((id, value) => {
8820
+ void copyTextToClipboard(value).then((success) => {
8821
+ if (!success) return;
8822
+ setCopiedId(id);
8823
+ setTimeout(() => setCopiedId(null), 1600);
8824
+ });
8825
+ }, []);
8826
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 space-y-4", children: [
8827
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
8828
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Terminal, { className: "size-4 text-muted-foreground" }),
8829
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold", children: "MCP access" })
8830
+ ] }),
8831
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 rounded-md border border-border bg-background px-3 py-2 text-xs text-muted-foreground", children: [
8832
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Use Streamable HTTP when the client supports URL-based MCP. Use the stdio bridge only for stdio-only clients. Configure one entry for the same Inspector instance." }),
8833
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "If the MCP client runs in another container or host, replace localhost with a reachable host/IP and verify the network path." })
8834
+ ] }),
8835
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid gap-2", children: values.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
8836
+ CopyableSetupValue,
8837
+ {
8838
+ id: item.id,
8839
+ label: item.label,
8840
+ value: item.value,
8841
+ copiedId,
8842
+ onCopy: handleCopy
8843
+ },
8844
+ item.id
8845
+ )) })
8846
+ ] });
8847
+ }
8723
8848
  function ProxySettingsTab() {
8724
8849
  const {
8725
8850
  strip,
@@ -1,7 +1,7 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { u as useProviders, D as Dialog, d as DialogContent, e as DialogHeader, h as DialogTitle, T as Tabs, i as TabsList, j as TabsTrigger, k as TabsContent, l as Button, m as TooltipProvider, n as Tooltip, o as TooltipTrigger, p as TooltipContent, q as dispatchLogFocusRequest } from "./ProxyViewerContainer-CXA7iH3H.mjs";
3
- import { ResponseView } from "./ResponseView-C6ZA7V3B.mjs";
4
- import { C as CapturedLogSchema } from "./router-ChJIVv7-.mjs";
2
+ import { u as useProviders, D as Dialog, d as DialogContent, e as DialogHeader, h as DialogTitle, T as Tabs, i as TabsList, j as TabsTrigger, k as TabsContent, l as Button, m as TooltipProvider, n as Tooltip, o as TooltipTrigger, p as TooltipContent, q as dispatchLogFocusRequest } from "./ProxyViewerContainer-9GJtCWCq.mjs";
3
+ import { ResponseView } from "./ResponseView-CkKGYE6m.mjs";
4
+ import { C as CapturedLogSchema } from "./router-CVqVjBzJ.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import "../_libs/modelcontextprotocol__server.mjs";
7
7
  import { V as RotateCcw, ae as Braces, af as Minimize2 } from "../_libs/lucide-react.mjs";
@@ -1,6 +1,6 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { u as useProviders, s as analyzeContextIntelligence, f as formatTokens, m as TooltipProvider, c as cn, n as Tooltip, o as TooltipTrigger, p as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, A as ANATOMY_ROLE_LABELS, t as formatContextWindowTokens, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-CXA7iH3H.mjs";
3
- import "./router-ChJIVv7-.mjs";
2
+ import { u as useProviders, s as analyzeContextIntelligence, f as formatTokens, m as TooltipProvider, c as cn, n as Tooltip, o as TooltipTrigger, p as TooltipContent, S as SegmentBar, R as ROLE_COLOR_CLASSES, A as ANATOMY_ROLE_LABELS, t as formatContextWindowTokens, C as CONTEXT_USAGE_THRESHOLDS } from "./ProxyViewerContainer-9GJtCWCq.mjs";
3
+ import "./router-CVqVjBzJ.mjs";
4
4
  import "../_libs/modelcontextprotocol__server.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import { ag as Info, c as ChevronDown, l as ChevronRight } from "../_libs/lucide-react.mjs";
@@ -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, v as getStatusCategory, B as Badge, w as Collapsible, x as CollapsibleTrigger, y as CollapsibleContent, z as ScrollArea, E as JsonViewer, F as safeJsonValue } from "./ProxyViewerContainer-CXA7iH3H.mjs";
3
- import "./router-ChJIVv7-.mjs";
2
+ import { g as getLogFormatAdapter, f as formatTokens, c as cn, v as getStatusCategory, B as Badge, w as Collapsible, x as CollapsibleTrigger, y as CollapsibleContent, z as ScrollArea, E as JsonViewer, F as safeJsonValue } from "./ProxyViewerContainer-9GJtCWCq.mjs";
3
+ import "./router-CVqVjBzJ.mjs";
4
4
  import "../_libs/modelcontextprotocol__server.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import { Z as Zap, q as TriangleAlert, ah as CircleStop, B as Brain, c as ChevronDown, l as ChevronRight, f as Terminal } from "../_libs/lucide-react.mjs";
@@ -1,6 +1,6 @@
1
1
  import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
2
- import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-CXA7iH3H.mjs";
3
- import "./router-ChJIVv7-.mjs";
2
+ import { m as TooltipProvider, n as Tooltip, o as TooltipTrigger, B as Badge, p as TooltipContent, E as JsonViewer } from "./ProxyViewerContainer-9GJtCWCq.mjs";
3
+ import "./router-CVqVjBzJ.mjs";
4
4
  import "../_libs/modelcontextprotocol__server.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import { c as ChevronDown, l as ChevronRight, a as LoaderCircle } from "../_libs/lucide-react.mjs";
@@ -1,6 +1,6 @@
1
- import { P as ProxyViewerContainer } from "./ProxyViewerContainer-CXA7iH3H.mjs";
1
+ import { P as ProxyViewerContainer } from "./ProxyViewerContainer-9GJtCWCq.mjs";
2
2
  import "../_libs/react.mjs";
3
- import "./router-ChJIVv7-.mjs";
3
+ import "./router-CVqVjBzJ.mjs";
4
4
  import "../_libs/modelcontextprotocol__server.mjs";
5
5
  import "../_libs/jszip.mjs";
6
6
  import "../_libs/swr.mjs";
@@ -198,7 +198,7 @@ function getResponse() {
198
198
  return event.res;
199
199
  }
200
200
  async function getStartManifest(matchedRoutes) {
201
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-CJ4__weU.mjs");
201
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-DSikvwru.mjs");
202
202
  const startManifest = tsrStartManifest();
203
203
  const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes[rootRouteId] || {};
204
204
  rootRoute.assets = rootRoute.assets || [];
@@ -776,7 +776,7 @@ let entriesPromise;
776
776
  let baseManifestPromise;
777
777
  let cachedFinalManifestPromise;
778
778
  async function loadEntries() {
779
- const routerEntry = await import("./router-ChJIVv7-.mjs").then((n) => n.w);
779
+ const routerEntry = await import("./router-CVqVjBzJ.mjs").then((n) => n.w);
780
780
  const startEntry = await import("./start-HYkvq4Ni.mjs");
781
781
  return { startEntry, routerEntry };
782
782
  }