@mcpjam/inspector 0.1.0 → 0.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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-D9GEIvKa.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-zUpX3mpm.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-kC0-8Fug.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-BpNrhMCC.js"])))=>i.map(i=>d[i]);
2
2
  function _mergeNamespaces(n, m2) {
3
3
  for (var i = 0; i < m2.length; i++) {
4
4
  const e = m2[i];
@@ -23932,9 +23932,9 @@ class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
23932
23932
  );
23933
23933
  }
23934
23934
  }
23935
- const version$1 = "0.1.0";
23935
+ const version = "0.1.2";
23936
23936
  const packageJson = {
23937
- version: version$1
23937
+ version
23938
23938
  };
23939
23939
  const getMCPProxyAddress = (config) => {
23940
23940
  const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
@@ -24358,52 +24358,6 @@ function useConnection({
24358
24358
  disconnect
24359
24359
  };
24360
24360
  }
24361
- function useDraggablePane(initialHeight) {
24362
- const [height, setHeight] = reactExports.useState(initialHeight);
24363
- const [isDragging, setIsDragging] = reactExports.useState(false);
24364
- const dragStartY = reactExports.useRef(0);
24365
- const dragStartHeight = reactExports.useRef(0);
24366
- const handleDragStart = reactExports.useCallback(
24367
- (e) => {
24368
- setIsDragging(true);
24369
- dragStartY.current = e.clientY;
24370
- dragStartHeight.current = height;
24371
- document.body.style.userSelect = "none";
24372
- },
24373
- [height]
24374
- );
24375
- const handleDragMove = reactExports.useCallback(
24376
- (e) => {
24377
- if (!isDragging) return;
24378
- const deltaY = dragStartY.current - e.clientY;
24379
- const newHeight = Math.max(
24380
- 100,
24381
- Math.min(800, dragStartHeight.current + deltaY)
24382
- );
24383
- setHeight(newHeight);
24384
- },
24385
- [isDragging]
24386
- );
24387
- const handleDragEnd = reactExports.useCallback(() => {
24388
- setIsDragging(false);
24389
- document.body.style.userSelect = "";
24390
- }, []);
24391
- reactExports.useEffect(() => {
24392
- if (isDragging) {
24393
- window.addEventListener("mousemove", handleDragMove);
24394
- window.addEventListener("mouseup", handleDragEnd);
24395
- return () => {
24396
- window.removeEventListener("mousemove", handleDragMove);
24397
- window.removeEventListener("mouseup", handleDragEnd);
24398
- };
24399
- }
24400
- }, [isDragging, handleDragMove, handleDragEnd]);
24401
- return {
24402
- height,
24403
- isDragging,
24404
- handleDragStart
24405
- };
24406
- }
24407
24361
  var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
24408
24362
  var count$1 = 0;
24409
24363
  function useId(deterministicId) {
@@ -24838,45 +24792,6 @@ const TabsContent = reactExports.forwardRef(({ className, ...props }, ref2) => /
24838
24792
  }
24839
24793
  ));
24840
24794
  TabsContent.displayName = Content$2.displayName;
24841
- const buttonVariants = cva(
24842
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
24843
- {
24844
- variants: {
24845
- variant: {
24846
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700",
24847
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
24848
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
24849
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
24850
- ghost: "hover:bg-accent hover:text-accent-foreground",
24851
- link: "text-primary underline-offset-4 hover:underline"
24852
- },
24853
- size: {
24854
- default: "h-9 px-4 py-2",
24855
- sm: "h-8 rounded-md px-3 text-xs",
24856
- lg: "h-10 rounded-md px-8",
24857
- icon: "h-9 w-9"
24858
- }
24859
- },
24860
- defaultVariants: {
24861
- variant: "default",
24862
- size: "default"
24863
- }
24864
- }
24865
- );
24866
- const Button = reactExports.forwardRef(
24867
- ({ className, variant, size: size2, asChild = false, ...props }, ref2) => {
24868
- const Comp = asChild ? Slot$3 : "button";
24869
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
24870
- Comp,
24871
- {
24872
- className: cn(buttonVariants({ variant, size: size2, className })),
24873
- ref: ref2,
24874
- ...props
24875
- }
24876
- );
24877
- }
24878
- );
24879
- Button.displayName = "Button";
24880
24795
  /**
24881
24796
  * @license lucide-react v0.447.0 - ISC
24882
24797
  *
@@ -24964,9 +24879,14 @@ const createLucideIcon = (iconName, iconNode) => {
24964
24879
  * This source code is licensed under the ISC license.
24965
24880
  * See the LICENSE file in the root directory of this source tree.
24966
24881
  */
24967
- const Bell = createLucideIcon("Bell", [
24968
- ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
24969
- ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
24882
+ const Activity = createLucideIcon("Activity", [
24883
+ [
24884
+ "path",
24885
+ {
24886
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
24887
+ key: "169zse"
24888
+ }
24889
+ ]
24970
24890
  ]);
24971
24891
  /**
24972
24892
  * @license lucide-react v0.447.0 - ISC
@@ -24974,24 +24894,9 @@ const Bell = createLucideIcon("Bell", [
24974
24894
  * This source code is licensed under the ISC license.
24975
24895
  * See the LICENSE file in the root directory of this source tree.
24976
24896
  */
24977
- const Bug = createLucideIcon("Bug", [
24978
- ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
24979
- ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
24980
- ["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
24981
- [
24982
- "path",
24983
- {
24984
- d: "M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",
24985
- key: "xs1cw7"
24986
- }
24987
- ],
24988
- ["path", { d: "M12 20v-9", key: "1qisl0" }],
24989
- ["path", { d: "M6.53 9C4.6 8.8 3 7.1 3 5", key: "32zzws" }],
24990
- ["path", { d: "M6 13H2", key: "82j7cp" }],
24991
- ["path", { d: "M3 21c0-2.1 1.7-3.9 3.8-4", key: "4p0ekp" }],
24992
- ["path", { d: "M20.97 5c0 2.1-1.6 3.8-3.5 4", key: "18gb23" }],
24993
- ["path", { d: "M22 13h-4", key: "1jl80f" }],
24994
- ["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
24897
+ const Bell = createLucideIcon("Bell", [
24898
+ ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
24899
+ ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
24995
24900
  ]);
24996
24901
  /**
24997
24902
  * @license lucide-react v0.447.0 - ISC
@@ -25079,6 +24984,17 @@ const CircleHelp = createLucideIcon("CircleHelp", [
25079
24984
  const Circle = createLucideIcon("Circle", [
25080
24985
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
25081
24986
  ]);
24987
+ /**
24988
+ * @license lucide-react v0.447.0 - ISC
24989
+ *
24990
+ * This source code is licensed under the ISC license.
24991
+ * See the LICENSE file in the root directory of this source tree.
24992
+ */
24993
+ const CodeXml = createLucideIcon("CodeXml", [
24994
+ ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
24995
+ ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
24996
+ ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
24997
+ ]);
25082
24998
  /**
25083
24999
  * @license lucide-react v0.447.0 - ISC
25084
25000
  *
@@ -25188,22 +25104,6 @@ const FolderTree = createLucideIcon("FolderTree", [
25188
25104
  ["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
25189
25105
  ["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
25190
25106
  ]);
25191
- /**
25192
- * @license lucide-react v0.447.0 - ISC
25193
- *
25194
- * This source code is licensed under the ISC license.
25195
- * See the LICENSE file in the root directory of this source tree.
25196
- */
25197
- const Github = createLucideIcon("Github", [
25198
- [
25199
- "path",
25200
- {
25201
- d: "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",
25202
- key: "tonef"
25203
- }
25204
- ],
25205
- ["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
25206
- ]);
25207
25107
  /**
25208
25108
  * @license lucide-react v0.447.0 - ISC
25209
25109
  *
@@ -25233,6 +25133,17 @@ const Hash = createLucideIcon("Hash", [
25233
25133
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
25234
25134
  ["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
25235
25135
  ]);
25136
+ /**
25137
+ * @license lucide-react v0.447.0 - ISC
25138
+ *
25139
+ * This source code is licensed under the ISC license.
25140
+ * See the LICENSE file in the root directory of this source tree.
25141
+ */
25142
+ const History = createLucideIcon("History", [
25143
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
25144
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
25145
+ ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
25146
+ ]);
25236
25147
  /**
25237
25148
  * @license lucide-react v0.447.0 - ISC
25238
25149
  *
@@ -25358,22 +25269,45 @@ const Send = createLucideIcon("Send", [
25358
25269
  ],
25359
25270
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
25360
25271
  ]);
25361
- /**
25362
- * @license lucide-react v0.447.0 - ISC
25363
- *
25364
- * This source code is licensed under the ISC license.
25365
- * See the LICENSE file in the root directory of this source tree.
25366
- */
25367
- const Settings = createLucideIcon("Settings", [
25368
- [
25369
- "path",
25370
- {
25371
- d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
25372
- key: "1qme2f"
25272
+ const buttonVariants = cva(
25273
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
25274
+ {
25275
+ variants: {
25276
+ variant: {
25277
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700",
25278
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
25279
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
25280
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
25281
+ ghost: "hover:bg-accent hover:text-accent-foreground",
25282
+ link: "text-primary underline-offset-4 hover:underline"
25283
+ },
25284
+ size: {
25285
+ default: "h-9 px-4 py-2",
25286
+ sm: "h-8 rounded-md px-3 text-xs",
25287
+ lg: "h-10 rounded-md px-8",
25288
+ icon: "h-9 w-9"
25289
+ }
25290
+ },
25291
+ defaultVariants: {
25292
+ variant: "default",
25293
+ size: "default"
25373
25294
  }
25374
- ],
25375
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
25376
- ]);
25295
+ }
25296
+ );
25297
+ const Button = reactExports.forwardRef(
25298
+ ({ className, variant, size: size2, asChild = false, ...props }, ref2) => {
25299
+ const Comp = asChild ? Slot$3 : "button";
25300
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
25301
+ Comp,
25302
+ {
25303
+ className: cn(buttonVariants({ variant, size: size2, className })),
25304
+ ref: ref2,
25305
+ ...props
25306
+ }
25307
+ );
25308
+ }
25309
+ );
25310
+ Button.displayName = "Button";
25377
25311
  const OAuthStepDetails = ({
25378
25312
  label,
25379
25313
  isComplete,
@@ -26177,108 +26111,259 @@ const JsonNode = reactExports.memo(
26177
26111
  }
26178
26112
  );
26179
26113
  JsonNode.displayName = "JsonNode";
26114
+ function useDraggablePane(initialHeight) {
26115
+ const [height, setHeight] = reactExports.useState(initialHeight);
26116
+ const [isDragging, setIsDragging] = reactExports.useState(false);
26117
+ const dragStartY = reactExports.useRef(0);
26118
+ const dragStartHeight = reactExports.useRef(0);
26119
+ const handleDragStart = reactExports.useCallback(
26120
+ (e) => {
26121
+ setIsDragging(true);
26122
+ dragStartY.current = e.clientY;
26123
+ dragStartHeight.current = height;
26124
+ document.body.style.userSelect = "none";
26125
+ },
26126
+ [height]
26127
+ );
26128
+ const handleDragMove = reactExports.useCallback(
26129
+ (e) => {
26130
+ if (!isDragging) return;
26131
+ const deltaY = dragStartY.current - e.clientY;
26132
+ const newHeight = Math.max(
26133
+ 100,
26134
+ Math.min(800, dragStartHeight.current + deltaY)
26135
+ );
26136
+ setHeight(newHeight);
26137
+ },
26138
+ [isDragging]
26139
+ );
26140
+ const handleDragEnd = reactExports.useCallback(() => {
26141
+ setIsDragging(false);
26142
+ document.body.style.userSelect = "";
26143
+ }, []);
26144
+ const resetHeight = reactExports.useCallback(() => {
26145
+ setHeight(initialHeight);
26146
+ }, [initialHeight]);
26147
+ reactExports.useEffect(() => {
26148
+ if (!isDragging) {
26149
+ setHeight(initialHeight);
26150
+ }
26151
+ }, [initialHeight, isDragging]);
26152
+ reactExports.useEffect(() => {
26153
+ if (isDragging) {
26154
+ window.addEventListener("mousemove", handleDragMove);
26155
+ window.addEventListener("mouseup", handleDragEnd);
26156
+ return () => {
26157
+ window.removeEventListener("mousemove", handleDragMove);
26158
+ window.removeEventListener("mouseup", handleDragEnd);
26159
+ };
26160
+ }
26161
+ }, [isDragging, handleDragMove, handleDragEnd]);
26162
+ return {
26163
+ height,
26164
+ isDragging,
26165
+ handleDragStart,
26166
+ resetHeight
26167
+ };
26168
+ }
26180
26169
  const HistoryAndNotifications = ({
26181
26170
  requestHistory,
26182
- serverNotifications
26171
+ toolResult
26183
26172
  }) => {
26184
26173
  const [expandedRequests, setExpandedRequests] = reactExports.useState({});
26185
- const [expandedNotifications, setExpandedNotifications] = reactExports.useState({});
26174
+ const [isHistoryCollapsed, setIsHistoryCollapsed] = reactExports.useState(false);
26175
+ const {
26176
+ height: historyPaneHeight,
26177
+ handleDragStart,
26178
+ resetHeight
26179
+ } = useDraggablePane(isHistoryCollapsed ? 60 : 500);
26186
26180
  const toggleRequestExpansion = (index2) => {
26187
26181
  setExpandedRequests((prev) => ({ ...prev, [index2]: !prev[index2] }));
26188
26182
  };
26189
- const toggleNotificationExpansion = (index2) => {
26190
- setExpandedNotifications((prev) => ({ ...prev, [index2]: !prev[index2] }));
26191
- };
26192
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card overflow-hidden flex h-full", children: [
26193
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4 border-r", children: [
26194
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-4", children: "History" }),
26195
- requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 italic", children: "No history yet" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-3", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26196
- "li",
26197
- {
26198
- className: "text-sm text-foreground bg-secondary p-2 rounded",
26199
- children: [
26200
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26201
- "div",
26183
+ reactExports.useEffect(() => {
26184
+ if (toolResult) {
26185
+ resetHeight();
26186
+ setIsHistoryCollapsed(false);
26187
+ }
26188
+ }, [toolResult]);
26189
+ const renderToolResult = () => {
26190
+ if (!toolResult) return null;
26191
+ if ("content" in toolResult) {
26192
+ const parsedResult = CallToolResultSchema.safeParse(toolResult);
26193
+ if (!parsedResult.success) {
26194
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26195
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Invalid Tool Result:" }),
26196
+ /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult }),
26197
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Errors:" }),
26198
+ parsedResult.error.errors.map((error, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: error }, idx))
26199
+ ] });
26200
+ }
26201
+ const structuredResult = parsedResult.data;
26202
+ const isError = structuredResult.isError ?? false;
26203
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26204
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "font-semibold mb-2", children: [
26205
+ "Tool Result:",
26206
+ " ",
26207
+ isError ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 font-semibold", children: "Error" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: "Success" })
26208
+ ] }),
26209
+ structuredResult.content.map((item, index2) => {
26210
+ var _a, _b;
26211
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
26212
+ item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
26213
+ item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
26214
+ "img",
26202
26215
  {
26203
- className: "flex justify-between items-center cursor-pointer",
26204
- onClick: () => toggleRequestExpansion(requestHistory.length - 1 - index2),
26205
- children: [
26206
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-mono", children: [
26207
- requestHistory.length - index2,
26208
- ".",
26209
- " ",
26210
- JSON.parse(request.request).method
26211
- ] }),
26212
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: expandedRequests[requestHistory.length - 1 - index2] ? "▼" : "▶" })
26213
- ]
26216
+ src: `data:${item.mimeType};base64,${item.data}`,
26217
+ alt: "Tool result image",
26218
+ className: "max-w-full h-auto"
26214
26219
  }
26215
26220
  ),
26216
- expandedRequests[requestHistory.length - 1 - index2] && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26217
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
26218
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between items-center mb-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-blue-600", children: "Request:" }) }),
26219
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26220
- JsonView,
26221
- {
26222
- data: request.request,
26223
- className: "bg-background"
26224
- }
26225
- )
26221
+ item.type === "resource" && (((_b = (_a = item.resource) == null ? void 0 : _a.mimeType) == null ? void 0 : _b.startsWith("audio/")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
26222
+ "audio",
26223
+ {
26224
+ controls: true,
26225
+ src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
26226
+ className: "w-full",
26227
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
26228
+ }
26229
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource }))
26230
+ ] }, index2);
26231
+ })
26232
+ ] });
26233
+ } else if ("toolResult" in toolResult) {
26234
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26235
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Tool Result (Legacy):" }),
26236
+ /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult.toolResult })
26237
+ ] });
26238
+ }
26239
+ };
26240
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
26241
+ "div",
26242
+ {
26243
+ className: `relative bg-gradient-to-r from-card/95 via-card to-card/95 backdrop-blur-md border-t border-border/30 transition-all duration-500 ease-out ${isHistoryCollapsed ? "shadow-lg shadow-black/5" : "shadow-2xl shadow-black/10"}`,
26244
+ style: {
26245
+ height: `${isHistoryCollapsed ? 60 : historyPaneHeight}px`
26246
+ },
26247
+ children: [
26248
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26249
+ "div",
26250
+ {
26251
+ className: "absolute w-full h-2 -top-1 cursor-row-resize",
26252
+ onMouseDown: handleDragStart
26253
+ }
26254
+ ),
26255
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-hidden", children: !isHistoryCollapsed ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-transparent flex h-full", children: [
26256
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-6 border-r border-border/20", children: [
26257
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
26258
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
26259
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-5 h-5 text-primary" }),
26260
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All Activity" })
26226
26261
  ] }),
26227
- request.response && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
26228
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between items-center mb-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-green-600", children: "Response:" }) }),
26262
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
26263
+ requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-muted-foreground bg-muted/50 px-3 py-1 rounded-full", children: [
26264
+ requestHistory.length,
26265
+ " request",
26266
+ requestHistory.length !== 1 ? "s" : ""
26267
+ ] }),
26229
26268
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26230
- JsonView,
26269
+ "button",
26231
26270
  {
26232
- data: request.response,
26233
- className: "bg-background"
26271
+ onClick: () => setIsHistoryCollapsed(!isHistoryCollapsed),
26272
+ className: "p-2 rounded-lg hover:bg-accent/50 transition-all duration-200",
26273
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-muted-foreground hover:text-foreground" })
26234
26274
  }
26235
26275
  )
26236
26276
  ] })
26237
- ] })
26238
- ]
26239
- },
26240
- index2
26241
- )) })
26242
- ] }),
26243
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
26244
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-4", children: "Server Notifications" }),
26245
- serverNotifications.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 italic", children: "No notifications yet" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-3", children: serverNotifications.slice().reverse().map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26246
- "li",
26247
- {
26248
- className: "text-sm text-foreground bg-secondary p-2 rounded",
26249
- children: [
26250
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
26251
- "div",
26277
+ ] }),
26278
+ requestHistory.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
26279
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-12 h-12 text-muted-foreground/40 mb-4" }),
26280
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-lg font-medium mb-2", children: "No activity yet" }),
26281
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground/60 text-sm", children: "MCP requests and responses will appear here" })
26282
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-4", children: requestHistory.slice().reverse().map((request, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
26283
+ "li",
26252
26284
  {
26253
- className: "flex justify-between items-center cursor-pointer",
26254
- onClick: () => toggleNotificationExpansion(index2),
26285
+ className: "text-sm bg-gradient-to-r from-secondary/50 via-secondary/70 to-secondary/50 backdrop-blur-sm p-4 rounded-xl border border-border/30 hover:border-border/60 transition-all duration-200 hover:shadow-lg",
26255
26286
  children: [
26256
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-mono", children: [
26257
- serverNotifications.length - index2,
26258
- ".",
26259
- " ",
26260
- notification.method
26261
- ] }),
26262
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: expandedNotifications[index2] ? "▼" : "▶" })
26287
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
26288
+ "div",
26289
+ {
26290
+ className: "flex justify-between items-center cursor-pointer group",
26291
+ onClick: () => toggleRequestExpansion(
26292
+ requestHistory.length - 1 - index2
26293
+ ),
26294
+ children: [
26295
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
26296
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center justify-center w-6 h-6 bg-primary/10 text-primary text-xs font-bold rounded-full", children: requestHistory.length - index2 }),
26297
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono font-semibold text-foreground", children: JSON.parse(request.request).method })
26298
+ ] }),
26299
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground group-hover:text-foreground transition-colors duration-200", children: expandedRequests[requestHistory.length - 1 - index2] ? "▼" : "▶" })
26300
+ ]
26301
+ }
26302
+ ),
26303
+ expandedRequests[requestHistory.length - 1 - index2] && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-4", children: [
26304
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
26305
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-foreground text-sm", children: "Request" }) }),
26306
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26307
+ JsonView,
26308
+ {
26309
+ data: request.request,
26310
+ className: "bg-background/80 backdrop-blur-sm border border-border/20 rounded-lg"
26311
+ }
26312
+ )
26313
+ ] }),
26314
+ request.response && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
26315
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-foreground text-sm", children: "Response" }) }),
26316
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26317
+ JsonView,
26318
+ {
26319
+ data: request.response,
26320
+ className: "bg-background/80 backdrop-blur-sm border border-border/20 rounded-lg"
26321
+ }
26322
+ )
26323
+ ] })
26324
+ ] })
26263
26325
  ]
26264
- }
26265
- ),
26266
- expandedNotifications[index2] && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
26267
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between items-center mb-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-purple-600", children: "Details:" }) }),
26326
+ },
26327
+ index2
26328
+ )) })
26329
+ ] }),
26330
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [
26331
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
26332
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold text-foreground flex items-center space-x-2", children: [
26333
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 rounded bg-gradient-to-br from-green-400 to-green-600 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-xs", children: "✓" }) }),
26334
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Results" })
26335
+ ] }),
26268
26336
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26269
- JsonView,
26337
+ "button",
26270
26338
  {
26271
- data: JSON.stringify(notification, null, 2),
26272
- className: "bg-background"
26339
+ onClick: () => setIsHistoryCollapsed(!isHistoryCollapsed),
26340
+ className: "p-2 rounded-lg hover:bg-accent/50 transition-all duration-200",
26341
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-muted-foreground hover:text-foreground" })
26273
26342
  }
26274
26343
  )
26344
+ ] }),
26345
+ !toolResult ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
26346
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-12 h-12 rounded-full bg-muted/20 flex items-center justify-center mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-2xl", children: "🎯" }) }),
26347
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-lg font-medium mb-2", children: "No results yet" }),
26348
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground/60 text-sm", children: "Tool execution results will appear here" })
26349
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-br from-background/80 to-background/60 backdrop-blur-sm p-4 rounded-xl border border-border/30", children: renderToolResult() })
26350
+ ] })
26351
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
26352
+ "div",
26353
+ {
26354
+ className: "h-full flex items-center justify-center bg-gradient-to-r from-muted/20 via-muted/30 to-muted/20 cursor-pointer hover:bg-gradient-to-r hover:from-muted/30 hover:via-muted/40 hover:to-muted/30 transition-all duration-200",
26355
+ onClick: () => setIsHistoryCollapsed(!isHistoryCollapsed),
26356
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-4 text-muted-foreground", children: [
26357
+ /* @__PURE__ */ jsxRuntimeExports.jsx(History, { className: "w-5 h-5" }),
26358
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: "History & Results" }),
26359
+ requestHistory.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 text-xs bg-primary/10 text-primary rounded-full", children: requestHistory.length }),
26360
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 rotate-180" })
26275
26361
  ] })
26276
- ]
26277
- },
26278
- index2
26279
- )) })
26280
- ] })
26281
- ] });
26362
+ }
26363
+ ) })
26364
+ ]
26365
+ }
26366
+ );
26282
26367
  };
26283
26368
  const PingTab = ({ onPingClick }) => {
26284
26369
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "ping", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -30652,41 +30737,42 @@ const ListPane = ({
30652
30737
  setSelectedItem,
30653
30738
  renderItem,
30654
30739
  title: title2,
30655
- buttonText,
30656
30740
  isButtonDisabled
30657
30741
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
30658
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white", children: title2 }) }),
30659
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
30660
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30661
- Button,
30662
- {
30663
- variant: "outline",
30664
- className: "w-full mb-4",
30665
- onClick: listItems,
30666
- disabled: isButtonDisabled,
30667
- children: buttonText
30668
- }
30669
- ),
30670
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30671
- Button,
30672
- {
30673
- variant: "outline",
30674
- className: "w-full mb-4",
30675
- onClick: clearItems,
30676
- disabled: items2.length === 0,
30677
- children: "Clear"
30678
- }
30679
- ),
30680
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 overflow-y-auto max-h-96", children: items2.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
30681
- "div",
30682
- {
30683
- className: "flex items-center p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer",
30684
- onClick: () => setSelectedItem(item),
30685
- children: renderItem(item)
30686
- },
30687
- index2
30688
- )) })
30689
- ] })
30742
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800 flex items-center justify-between", children: [
30743
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white", children: title2 }),
30744
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-1", children: [
30745
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
30746
+ Button,
30747
+ {
30748
+ variant: "outline",
30749
+ onClick: listItems,
30750
+ disabled: isButtonDisabled,
30751
+ className: "h-7 px-2 text-xs",
30752
+ children: "Load Tools"
30753
+ }
30754
+ ),
30755
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
30756
+ Button,
30757
+ {
30758
+ variant: "outline",
30759
+ onClick: clearItems,
30760
+ disabled: items2.length === 0,
30761
+ className: "h-7 px-2 text-xs",
30762
+ children: "Clear"
30763
+ }
30764
+ )
30765
+ ] })
30766
+ ] }),
30767
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 overflow-y-auto max-h-96", children: items2.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
30768
+ "div",
30769
+ {
30770
+ className: "cursor-pointer",
30771
+ onClick: () => setSelectedItem(item),
30772
+ children: renderItem(item)
30773
+ },
30774
+ index2
30775
+ )) }) })
30690
30776
  ] });
30691
30777
  function debounce(func, wait) {
30692
30778
  let timeout;
@@ -30776,9 +30862,9 @@ function useCompletionState(handleCompletion, completionsSupported = true, debou
30776
30862
  }
30777
30863
  const PromptsTab = ({
30778
30864
  prompts,
30779
- listPrompts,
30865
+ listPrompts: listPrompts2,
30780
30866
  clearPrompts,
30781
- getPrompt,
30867
+ getPrompt: getPrompt2,
30782
30868
  selectedPrompt,
30783
30869
  setSelectedPrompt,
30784
30870
  handleCompletion,
@@ -30808,7 +30894,7 @@ const PromptsTab = ({
30808
30894
  };
30809
30895
  const handleGetPrompt = () => {
30810
30896
  if (selectedPrompt) {
30811
- getPrompt(selectedPrompt.name, promptArgs);
30897
+ getPrompt2(selectedPrompt.name, promptArgs);
30812
30898
  }
30813
30899
  };
30814
30900
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "prompts", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
@@ -30816,7 +30902,7 @@ const PromptsTab = ({
30816
30902
  ListPane,
30817
30903
  {
30818
30904
  items: prompts,
30819
- listItems: listPrompts,
30905
+ listItems: listPrompts2,
30820
30906
  clearItems: () => {
30821
30907
  clearPrompts();
30822
30908
  setSelectedPrompt(null);
@@ -30830,7 +30916,6 @@ const PromptsTab = ({
30830
30916
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500", children: prompt.description })
30831
30917
  ] }),
30832
30918
  title: "Prompts",
30833
- buttonText: nextCursor ? "List More Prompts" : "List Prompts",
30834
30919
  isButtonDisabled: !nextCursor && prompts.length > 0
30835
30920
  }
30836
30921
  ),
@@ -30869,17 +30954,17 @@ const PromptsTab = ({
30869
30954
  const ResourcesTab = ({
30870
30955
  resources,
30871
30956
  resourceTemplates,
30872
- listResources,
30957
+ listResources: listResources2,
30873
30958
  clearResources,
30874
- listResourceTemplates,
30959
+ listResourceTemplates: listResourceTemplates2,
30875
30960
  clearResourceTemplates,
30876
- readResource,
30961
+ readResource: readResource2,
30877
30962
  selectedResource,
30878
30963
  setSelectedResource,
30879
30964
  resourceSubscriptionsSupported,
30880
30965
  resourceSubscriptions,
30881
- subscribeToResource,
30882
- unsubscribeFromResource,
30966
+ subscribeToResource: subscribeToResource2,
30967
+ unsubscribeFromResource: unsubscribeFromResource2,
30883
30968
  handleCompletion,
30884
30969
  completionsSupported,
30885
30970
  resourceContent,
@@ -30918,7 +31003,7 @@ const ResourcesTab = ({
30918
31003
  const handleReadTemplateResource = () => {
30919
31004
  if (selectedTemplate) {
30920
31005
  const uri = fillTemplate(selectedTemplate.uriTemplate, templateValues);
30921
- readResource(uri);
31006
+ readResource2(uri);
30922
31007
  setSelectedResource({ uri, name: uri });
30923
31008
  }
30924
31009
  };
@@ -30927,7 +31012,7 @@ const ResourcesTab = ({
30927
31012
  ListPane,
30928
31013
  {
30929
31014
  items: resources,
30930
- listItems: listResources,
31015
+ listItems: listResources2,
30931
31016
  clearItems: () => {
30932
31017
  clearResources();
30933
31018
  if (!selectedTemplate) {
@@ -30936,7 +31021,7 @@ const ResourcesTab = ({
30936
31021
  },
30937
31022
  setSelectedItem: (resource) => {
30938
31023
  setSelectedResource(resource);
30939
- readResource(resource.uri);
31024
+ readResource2(resource.uri);
30940
31025
  setSelectedTemplate(null);
30941
31026
  },
30942
31027
  renderItem: (resource) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center w-full", children: [
@@ -30945,7 +31030,6 @@ const ResourcesTab = ({
30945
31030
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 flex-shrink-0 text-gray-400" })
30946
31031
  ] }),
30947
31032
  title: "Resources",
30948
- buttonText: nextCursor ? "List More Resources" : "List Resources",
30949
31033
  isButtonDisabled: !nextCursor && resources.length > 0
30950
31034
  }
30951
31035
  ),
@@ -30953,7 +31037,7 @@ const ResourcesTab = ({
30953
31037
  ListPane,
30954
31038
  {
30955
31039
  items: resourceTemplates,
30956
- listItems: listResourceTemplates,
31040
+ listItems: listResourceTemplates2,
30957
31041
  clearItems: () => {
30958
31042
  clearResourceTemplates();
30959
31043
  if (selectedTemplate) {
@@ -30972,7 +31056,6 @@ const ResourcesTab = ({
30972
31056
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 flex-shrink-0 text-gray-400" })
30973
31057
  ] }),
30974
31058
  title: "Resource Templates",
30975
- buttonText: nextTemplateCursor ? "List More Templates" : "List Templates",
30976
31059
  isButtonDisabled: !nextTemplateCursor && resourceTemplates.length > 0
30977
31060
  }
30978
31061
  ),
@@ -30992,7 +31075,7 @@ const ResourcesTab = ({
30992
31075
  {
30993
31076
  variant: "outline",
30994
31077
  size: "sm",
30995
- onClick: () => subscribeToResource(selectedResource.uri),
31078
+ onClick: () => subscribeToResource2(selectedResource.uri),
30996
31079
  children: "Subscribe"
30997
31080
  }
30998
31081
  ),
@@ -31001,7 +31084,7 @@ const ResourcesTab = ({
31001
31084
  {
31002
31085
  variant: "outline",
31003
31086
  size: "sm",
31004
- onClick: () => unsubscribeFromResource(selectedResource.uri),
31087
+ onClick: () => unsubscribeFromResource2(selectedResource.uri),
31005
31088
  children: "Unsubscribe"
31006
31089
  }
31007
31090
  ),
@@ -31010,7 +31093,7 @@ const ResourcesTab = ({
31010
31093
  {
31011
31094
  variant: "outline",
31012
31095
  size: "sm",
31013
- onClick: () => readResource(selectedResource.uri),
31096
+ onClick: () => readResource2(selectedResource.uri),
31014
31097
  children: [
31015
31098
  /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-4 h-4 mr-2" }),
31016
31099
  "Refresh"
@@ -33480,9 +33563,6 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
33480
33563
  ] })
33481
33564
  ] }) });
33482
33565
  };
33483
- function clamp(value, [min2, max2]) {
33484
- return Math.min(max2, Math.max(min2, value));
33485
- }
33486
33566
  function usePrevious(value) {
33487
33567
  const ref2 = reactExports.useRef({ value, previous: value });
33488
33568
  return reactExports.useMemo(() => {
@@ -33493,6 +33573,695 @@ function usePrevious(value) {
33493
33573
  return ref2.current.previous;
33494
33574
  }, [value]);
33495
33575
  }
33576
+ var CHECKBOX_NAME = "Checkbox";
33577
+ var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
33578
+ var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
33579
+ function CheckboxProvider(props) {
33580
+ const {
33581
+ __scopeCheckbox,
33582
+ checked: checkedProp,
33583
+ children,
33584
+ defaultChecked,
33585
+ disabled,
33586
+ form,
33587
+ name,
33588
+ onCheckedChange,
33589
+ required: required2,
33590
+ value = "on",
33591
+ // @ts-expect-error
33592
+ internal_do_not_use_render
33593
+ } = props;
33594
+ const [checked, setChecked] = useControllableState({
33595
+ prop: checkedProp,
33596
+ defaultProp: defaultChecked ?? false,
33597
+ onChange: onCheckedChange,
33598
+ caller: CHECKBOX_NAME
33599
+ });
33600
+ const [control, setControl] = reactExports.useState(null);
33601
+ const [bubbleInput, setBubbleInput] = reactExports.useState(null);
33602
+ const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
33603
+ const isFormControl = control ? !!form || !!control.closest("form") : (
33604
+ // We set this to true by default so that events bubble to forms without JS (SSR)
33605
+ true
33606
+ );
33607
+ const context = {
33608
+ checked,
33609
+ disabled,
33610
+ setChecked,
33611
+ control,
33612
+ setControl,
33613
+ name,
33614
+ form,
33615
+ value,
33616
+ hasConsumerStoppedPropagationRef,
33617
+ required: required2,
33618
+ defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
33619
+ isFormControl,
33620
+ bubbleInput,
33621
+ setBubbleInput
33622
+ };
33623
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33624
+ CheckboxProviderImpl,
33625
+ {
33626
+ scope: __scopeCheckbox,
33627
+ ...context,
33628
+ children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
33629
+ }
33630
+ );
33631
+ }
33632
+ var TRIGGER_NAME$2 = "CheckboxTrigger";
33633
+ var CheckboxTrigger = reactExports.forwardRef(
33634
+ ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
33635
+ const {
33636
+ control,
33637
+ value,
33638
+ disabled,
33639
+ checked,
33640
+ required: required2,
33641
+ setControl,
33642
+ setChecked,
33643
+ hasConsumerStoppedPropagationRef,
33644
+ isFormControl,
33645
+ bubbleInput
33646
+ } = useCheckboxContext(TRIGGER_NAME$2, __scopeCheckbox);
33647
+ const composedRefs = useComposedRefs(forwardedRef, setControl);
33648
+ const initialCheckedStateRef = reactExports.useRef(checked);
33649
+ reactExports.useEffect(() => {
33650
+ const form = control == null ? void 0 : control.form;
33651
+ if (form) {
33652
+ const reset = () => setChecked(initialCheckedStateRef.current);
33653
+ form.addEventListener("reset", reset);
33654
+ return () => form.removeEventListener("reset", reset);
33655
+ }
33656
+ }, [control, setChecked]);
33657
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33658
+ Primitive.button,
33659
+ {
33660
+ type: "button",
33661
+ role: "checkbox",
33662
+ "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
33663
+ "aria-required": required2,
33664
+ "data-state": getState(checked),
33665
+ "data-disabled": disabled ? "" : void 0,
33666
+ disabled,
33667
+ value,
33668
+ ...checkboxProps,
33669
+ ref: composedRefs,
33670
+ onKeyDown: composeEventHandlers(onKeyDown, (event) => {
33671
+ if (event.key === "Enter") event.preventDefault();
33672
+ }),
33673
+ onClick: composeEventHandlers(onClick, (event) => {
33674
+ setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
33675
+ if (bubbleInput && isFormControl) {
33676
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
33677
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
33678
+ }
33679
+ })
33680
+ }
33681
+ );
33682
+ }
33683
+ );
33684
+ CheckboxTrigger.displayName = TRIGGER_NAME$2;
33685
+ var Checkbox$1 = reactExports.forwardRef(
33686
+ (props, forwardedRef) => {
33687
+ const {
33688
+ __scopeCheckbox,
33689
+ name,
33690
+ checked,
33691
+ defaultChecked,
33692
+ required: required2,
33693
+ disabled,
33694
+ value,
33695
+ onCheckedChange,
33696
+ form,
33697
+ ...checkboxProps
33698
+ } = props;
33699
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33700
+ CheckboxProvider,
33701
+ {
33702
+ __scopeCheckbox,
33703
+ checked,
33704
+ defaultChecked,
33705
+ disabled,
33706
+ required: required2,
33707
+ onCheckedChange,
33708
+ name,
33709
+ form,
33710
+ value,
33711
+ internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
33712
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
33713
+ CheckboxTrigger,
33714
+ {
33715
+ ...checkboxProps,
33716
+ ref: forwardedRef,
33717
+ __scopeCheckbox
33718
+ }
33719
+ ),
33720
+ isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
33721
+ CheckboxBubbleInput,
33722
+ {
33723
+ __scopeCheckbox
33724
+ }
33725
+ )
33726
+ ] })
33727
+ }
33728
+ );
33729
+ }
33730
+ );
33731
+ Checkbox$1.displayName = CHECKBOX_NAME;
33732
+ var INDICATOR_NAME = "CheckboxIndicator";
33733
+ var CheckboxIndicator = reactExports.forwardRef(
33734
+ (props, forwardedRef) => {
33735
+ const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
33736
+ const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
33737
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33738
+ Presence,
33739
+ {
33740
+ present: forceMount || isIndeterminate(context.checked) || context.checked === true,
33741
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33742
+ Primitive.span,
33743
+ {
33744
+ "data-state": getState(context.checked),
33745
+ "data-disabled": context.disabled ? "" : void 0,
33746
+ ...indicatorProps,
33747
+ ref: forwardedRef,
33748
+ style: { pointerEvents: "none", ...props.style }
33749
+ }
33750
+ )
33751
+ }
33752
+ );
33753
+ }
33754
+ );
33755
+ CheckboxIndicator.displayName = INDICATOR_NAME;
33756
+ var BUBBLE_INPUT_NAME$1 = "CheckboxBubbleInput";
33757
+ var CheckboxBubbleInput = reactExports.forwardRef(
33758
+ ({ __scopeCheckbox, ...props }, forwardedRef) => {
33759
+ const {
33760
+ control,
33761
+ hasConsumerStoppedPropagationRef,
33762
+ checked,
33763
+ defaultChecked,
33764
+ required: required2,
33765
+ disabled,
33766
+ name,
33767
+ value,
33768
+ form,
33769
+ bubbleInput,
33770
+ setBubbleInput
33771
+ } = useCheckboxContext(BUBBLE_INPUT_NAME$1, __scopeCheckbox);
33772
+ const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
33773
+ const prevChecked = usePrevious(checked);
33774
+ const controlSize = useSize(control);
33775
+ reactExports.useEffect(() => {
33776
+ const input = bubbleInput;
33777
+ if (!input) return;
33778
+ const inputProto = window.HTMLInputElement.prototype;
33779
+ const descriptor = Object.getOwnPropertyDescriptor(
33780
+ inputProto,
33781
+ "checked"
33782
+ );
33783
+ const setChecked = descriptor.set;
33784
+ const bubbles = !hasConsumerStoppedPropagationRef.current;
33785
+ if (prevChecked !== checked && setChecked) {
33786
+ const event = new Event("click", { bubbles });
33787
+ input.indeterminate = isIndeterminate(checked);
33788
+ setChecked.call(input, isIndeterminate(checked) ? false : checked);
33789
+ input.dispatchEvent(event);
33790
+ }
33791
+ }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
33792
+ const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
33793
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33794
+ Primitive.input,
33795
+ {
33796
+ type: "checkbox",
33797
+ "aria-hidden": true,
33798
+ defaultChecked: defaultChecked ?? defaultCheckedRef.current,
33799
+ required: required2,
33800
+ disabled,
33801
+ name,
33802
+ value,
33803
+ form,
33804
+ ...props,
33805
+ tabIndex: -1,
33806
+ ref: composedRefs,
33807
+ style: {
33808
+ ...props.style,
33809
+ ...controlSize,
33810
+ position: "absolute",
33811
+ pointerEvents: "none",
33812
+ opacity: 0,
33813
+ margin: 0,
33814
+ // We transform because the input is absolutely positioned but we have
33815
+ // rendered it **after** the button. This pulls it back to sit on top
33816
+ // of the button.
33817
+ transform: "translateX(-100%)"
33818
+ }
33819
+ }
33820
+ );
33821
+ }
33822
+ );
33823
+ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
33824
+ function isFunction(value) {
33825
+ return typeof value === "function";
33826
+ }
33827
+ function isIndeterminate(checked) {
33828
+ return checked === "indeterminate";
33829
+ }
33830
+ function getState(checked) {
33831
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
33832
+ }
33833
+ const Checkbox = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
33834
+ Checkbox$1,
33835
+ {
33836
+ ref: ref2,
33837
+ className: cn(
33838
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
33839
+ className
33840
+ ),
33841
+ ...props,
33842
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33843
+ CheckboxIndicator,
33844
+ {
33845
+ className: cn("flex items-center justify-center text-current"),
33846
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "h-4 w-4" })
33847
+ }
33848
+ )
33849
+ }
33850
+ ));
33851
+ Checkbox.displayName = Checkbox$1.displayName;
33852
+ const Textarea = reactExports.forwardRef(
33853
+ ({ className, ...props }, ref2) => {
33854
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
33855
+ "textarea",
33856
+ {
33857
+ className: cn(
33858
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
33859
+ className
33860
+ ),
33861
+ ref: ref2,
33862
+ ...props
33863
+ }
33864
+ );
33865
+ }
33866
+ );
33867
+ Textarea.displayName = "Textarea";
33868
+ const ToolRunCard = ({ selectedTool, callTool: callTool2 }) => {
33869
+ const [params, setParams] = reactExports.useState({});
33870
+ const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
33871
+ reactExports.useEffect(() => {
33872
+ const params2 = Object.entries(
33873
+ (selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
33874
+ ).map(([key, value]) => [
33875
+ key,
33876
+ generateDefaultValue(value)
33877
+ ]);
33878
+ setParams(Object.fromEntries(params2));
33879
+ }, [selectedTool]);
33880
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gradient-to-br from-card/95 via-card to-card/95 backdrop-blur-sm rounded-xl shadow-lg border border-border/40 overflow-hidden transition-all duration-300 hover:shadow-xl hover:border-border/60", children: [
33881
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-r from-muted/50 via-muted/30 to-muted/50 backdrop-blur-sm p-3 border-b border-border/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
33882
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "font-mono text-sm bg-gradient-to-r from-secondary/70 to-secondary/50 px-3 py-1.5 rounded-lg border border-border/30 text-foreground font-semibold shadow-sm inline-block", children: selectedTool ? selectedTool.name : "Select a tool" }),
33883
+ selectedTool && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground/80 mt-0.5 line-clamp-1", children: selectedTool.description })
33884
+ ] }) }) }),
33885
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
33886
+ Object.keys(selectedTool.inputSchema.properties ?? {}).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
33887
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-1.5 pb-1.5 border-b border-border/20", children: [
33888
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CodeXml, { className: "w-3 h-3 text-muted-foreground" }),
33889
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: "Parameters" })
33890
+ ] }),
33891
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2.5", children: Object.entries(
33892
+ selectedTool.inputSchema.properties ?? []
33893
+ ).map(([key, value]) => {
33894
+ const prop = value;
33895
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group", children: [
33896
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-1.5 mb-1.5", children: [
33897
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-xs bg-gradient-to-r from-secondary/80 to-secondary/60 px-2 py-1 rounded-md border border-border/30 text-foreground font-medium shadow-sm", children: key }),
33898
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded font-medium", children: prop.type })
33899
+ ] }),
33900
+ prop.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground/80 mb-1.5 ml-0.5 italic line-clamp-1", children: prop.description }),
33901
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative", children: prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 p-2.5 bg-gradient-to-r from-background/50 to-background/30 border border-border/30 rounded-lg hover:border-border/50 transition-all duration-200", children: [
33902
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
33903
+ Checkbox,
33904
+ {
33905
+ id: key,
33906
+ name: key,
33907
+ checked: !!params[key],
33908
+ onCheckedChange: (checked) => setParams({
33909
+ ...params,
33910
+ [key]: checked
33911
+ }),
33912
+ className: "data-[state=checked]:bg-primary data-[state=checked]:border-primary h-3.5 w-3.5"
33913
+ }
33914
+ ),
33915
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
33916
+ "label",
33917
+ {
33918
+ htmlFor: key,
33919
+ className: "text-xs font-medium text-foreground cursor-pointer flex-1",
33920
+ children: prop.description || "Toggle this option"
33921
+ }
33922
+ )
33923
+ ] }) : prop.type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
33924
+ Textarea,
33925
+ {
33926
+ id: key,
33927
+ name: key,
33928
+ placeholder: prop.description || `Enter ${key}...`,
33929
+ value: params[key] ?? "",
33930
+ onChange: (e) => setParams({
33931
+ ...params,
33932
+ [key]: e.target.value
33933
+ }),
33934
+ className: "font-mono text-xs bg-gradient-to-br from-background/80 to-background/60 border-border/40 rounded-lg focus:border-primary/50 focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-h-[60px] resize-none p-2"
33935
+ }
33936
+ ) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-br from-background/80 to-background/60 border border-border/40 rounded-lg p-2.5 hover:border-border/60 transition-all duration-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33937
+ DynamicJsonForm,
33938
+ {
33939
+ schema: {
33940
+ type: prop.type,
33941
+ properties: prop.properties,
33942
+ description: prop.description,
33943
+ items: prop.items
33944
+ },
33945
+ value: params[key] ?? generateDefaultValue(prop),
33946
+ onChange: (newValue) => {
33947
+ setParams({
33948
+ ...params,
33949
+ [key]: newValue
33950
+ });
33951
+ }
33952
+ }
33953
+ ) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
33954
+ Input,
33955
+ {
33956
+ type: "number",
33957
+ id: key,
33958
+ name: key,
33959
+ placeholder: prop.description || `Enter ${key}...`,
33960
+ value: params[key] ?? "",
33961
+ onChange: (e) => setParams({
33962
+ ...params,
33963
+ [key]: Number(e.target.value)
33964
+ }),
33965
+ className: "font-mono text-xs bg-gradient-to-br from-background/80 to-background/60 border-border/40 rounded-lg focus:border-primary/50 focus:ring-1 focus:ring-primary/20 transition-all duration-200 h-8"
33966
+ }
33967
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-br from-background/80 to-background/60 border border-border/40 rounded-lg p-2.5 hover:border-border/60 transition-all duration-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33968
+ DynamicJsonForm,
33969
+ {
33970
+ schema: {
33971
+ type: prop.type,
33972
+ properties: prop.properties,
33973
+ description: prop.description,
33974
+ items: prop.items
33975
+ },
33976
+ value: params[key],
33977
+ onChange: (newValue) => {
33978
+ setParams({
33979
+ ...params,
33980
+ [key]: newValue
33981
+ });
33982
+ }
33983
+ }
33984
+ ) }) })
33985
+ ] }, key);
33986
+ }) })
33987
+ ] }),
33988
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-2 border-t border-border/20", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
33989
+ Button,
33990
+ {
33991
+ onClick: async () => {
33992
+ try {
33993
+ setIsToolRunning(true);
33994
+ await callTool2(selectedTool.name, params);
33995
+ } finally {
33996
+ setIsToolRunning(false);
33997
+ }
33998
+ },
33999
+ disabled: isToolRunning,
34000
+ className: "w-full h-8 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 text-primary-foreground font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-300 transform hover:scale-[1.01] active:scale-[0.99] text-xs",
34001
+ children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
34002
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-3.5 h-3.5 mr-2 animate-spin" }),
34003
+ "Executing..."
34004
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
34005
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-3.5 h-3.5 mr-2" }),
34006
+ "Run Tool"
34007
+ ] })
34008
+ }
34009
+ ) })
34010
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6 text-center", children: [
34011
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-gradient-to-br from-muted/30 to-muted/50 flex items-center justify-center mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeXml, { className: "w-5 h-5 text-muted-foreground/60" }) }),
34012
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold text-foreground mb-1", children: "Ready to Execute" }),
34013
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-xs max-w-sm", children: "Select a tool from the list to configure its parameters and execute it" })
34014
+ ] }) })
34015
+ ] });
34016
+ };
34017
+ const ToolsTab = ({
34018
+ tools,
34019
+ listTools: listTools2,
34020
+ clearTools,
34021
+ callTool: callTool2,
34022
+ selectedTool,
34023
+ setSelectedTool,
34024
+ nextCursor,
34025
+ connectionStatus
34026
+ }) => {
34027
+ reactExports.useEffect(() => {
34028
+ if (connectionStatus === "connected") {
34029
+ listTools2();
34030
+ }
34031
+ }, [connectionStatus]);
34032
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
34033
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
34034
+ ListPane,
34035
+ {
34036
+ items: tools,
34037
+ listItems: listTools2,
34038
+ clearItems: () => {
34039
+ clearTools();
34040
+ setSelectedTool(null);
34041
+ },
34042
+ setSelectedItem: setSelectedTool,
34043
+ renderItem: (tool) => {
34044
+ const parameters = tool.inputSchema.properties ? Object.keys(tool.inputSchema.properties) : [];
34045
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white dark:bg-gray-900 rounded-lg p-3 shadow-sm border border-gray-100 dark:border-gray-800 hover:shadow-md hover:border-blue-200 dark:hover:border-blue-800 transition-all duration-200 group", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col space-y-2.5", children: [
34046
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
34047
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
34048
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg", children: "🛠️" }),
34049
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-xs bg-gradient-to-r from-slate-100 to-gray-100 dark:from-slate-800 dark:to-gray-800 px-2.5 py-1 rounded-md border border-slate-300 dark:border-slate-600 text-slate-800 dark:text-slate-200 font-medium shadow-sm", children: tool.name })
34050
+ ] }),
34051
+ parameters.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-gray-400 dark:text-gray-600 font-medium", children: [
34052
+ parameters.length,
34053
+ " param",
34054
+ parameters.length !== 1 ? "s" : ""
34055
+ ] })
34056
+ ] }),
34057
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600 dark:text-gray-400 leading-relaxed line-clamp-2", children: tool.description })
34058
+ ] }) });
34059
+ },
34060
+ title: "Tools",
34061
+ isButtonDisabled: !nextCursor && tools.length > 0
34062
+ }
34063
+ ),
34064
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ToolRunCard, { selectedTool, callTool: callTool2 })
34065
+ ] }) });
34066
+ };
34067
+ const clearError = (tabKey, setErrors) => {
34068
+ setErrors((prev) => ({ ...prev, [tabKey]: null }));
34069
+ };
34070
+ const sendMCPRequest = async (request, schema, dependencies2, tabKey) => {
34071
+ try {
34072
+ const response = await dependencies2.makeRequest(request, schema);
34073
+ if (tabKey !== void 0) {
34074
+ clearError(tabKey, dependencies2.setErrors);
34075
+ }
34076
+ return response;
34077
+ } catch (e) {
34078
+ const errorString = e.message ?? String(e);
34079
+ if (tabKey !== void 0) {
34080
+ dependencies2.setErrors((prev) => ({
34081
+ ...prev,
34082
+ [tabKey]: errorString
34083
+ }));
34084
+ }
34085
+ throw e;
34086
+ }
34087
+ };
34088
+ const handleApproveSampling = (id, result, setPendingSampleRequests) => {
34089
+ setPendingSampleRequests((prev) => {
34090
+ const request = prev.find((r2) => r2.id === id);
34091
+ request == null ? void 0 : request.resolve(result);
34092
+ return prev.filter((r2) => r2.id !== id);
34093
+ });
34094
+ };
34095
+ const handleRejectSampling = (id, setPendingSampleRequests) => {
34096
+ setPendingSampleRequests((prev) => {
34097
+ const request = prev.find((r2) => r2.id === id);
34098
+ request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
34099
+ return prev.filter((r2) => r2.id !== id);
34100
+ });
34101
+ };
34102
+ const listResources = async (state, dependencies2) => {
34103
+ const response = await sendMCPRequest(
34104
+ {
34105
+ method: "resources/list",
34106
+ params: state.nextResourceCursor ? { cursor: state.nextResourceCursor } : {}
34107
+ },
34108
+ ListResourcesResultSchema,
34109
+ dependencies2,
34110
+ "resources"
34111
+ );
34112
+ dependencies2.setResources(state.resources.concat(response.resources ?? []));
34113
+ dependencies2.setNextResourceCursor(response.nextCursor);
34114
+ };
34115
+ const listResourceTemplates = async (state, dependencies2) => {
34116
+ const response = await sendMCPRequest(
34117
+ {
34118
+ method: "resources/templates/list",
34119
+ params: state.nextResourceTemplateCursor ? { cursor: state.nextResourceTemplateCursor } : {}
34120
+ },
34121
+ ListResourceTemplatesResultSchema,
34122
+ dependencies2,
34123
+ "resources"
34124
+ );
34125
+ dependencies2.setResourceTemplates(
34126
+ state.resourceTemplates.concat(response.resourceTemplates ?? [])
34127
+ );
34128
+ dependencies2.setNextResourceTemplateCursor(response.nextCursor);
34129
+ };
34130
+ const readResource = async (uri, dependencies2) => {
34131
+ const response = await sendMCPRequest(
34132
+ {
34133
+ method: "resources/read",
34134
+ params: { uri }
34135
+ },
34136
+ ReadResourceResultSchema,
34137
+ dependencies2,
34138
+ "resources"
34139
+ );
34140
+ dependencies2.setResourceContent(JSON.stringify(response, null, 2));
34141
+ };
34142
+ const subscribeToResource = async (uri, state, dependencies2) => {
34143
+ if (!state.resourceSubscriptions.has(uri)) {
34144
+ await sendMCPRequest(
34145
+ {
34146
+ method: "resources/subscribe",
34147
+ params: { uri }
34148
+ },
34149
+ objectType({}),
34150
+ dependencies2,
34151
+ "resources"
34152
+ );
34153
+ const clone = new Set(state.resourceSubscriptions);
34154
+ clone.add(uri);
34155
+ dependencies2.setResourceSubscriptions(clone);
34156
+ }
34157
+ };
34158
+ const unsubscribeFromResource = async (uri, state, dependencies2) => {
34159
+ if (state.resourceSubscriptions.has(uri)) {
34160
+ await sendMCPRequest(
34161
+ {
34162
+ method: "resources/unsubscribe",
34163
+ params: { uri }
34164
+ },
34165
+ objectType({}),
34166
+ dependencies2,
34167
+ "resources"
34168
+ );
34169
+ const clone = new Set(state.resourceSubscriptions);
34170
+ clone.delete(uri);
34171
+ dependencies2.setResourceSubscriptions(clone);
34172
+ }
34173
+ };
34174
+ const listPrompts = async (state, dependencies2) => {
34175
+ const response = await sendMCPRequest(
34176
+ {
34177
+ method: "prompts/list",
34178
+ params: state.nextPromptCursor ? { cursor: state.nextPromptCursor } : {}
34179
+ },
34180
+ ListPromptsResultSchema,
34181
+ dependencies2,
34182
+ "prompts"
34183
+ );
34184
+ dependencies2.setPrompts(response.prompts);
34185
+ dependencies2.setNextPromptCursor(response.nextCursor);
34186
+ };
34187
+ const getPrompt = async (name, args = {}, dependencies2) => {
34188
+ const response = await sendMCPRequest(
34189
+ {
34190
+ method: "prompts/get",
34191
+ params: { name, arguments: args }
34192
+ },
34193
+ GetPromptResultSchema,
34194
+ dependencies2,
34195
+ "prompts"
34196
+ );
34197
+ dependencies2.setPromptContent(JSON.stringify(response, null, 2));
34198
+ };
34199
+ const listTools = async (state, dependencies2) => {
34200
+ const response = await sendMCPRequest(
34201
+ {
34202
+ method: "tools/list",
34203
+ params: state.nextToolCursor ? { cursor: state.nextToolCursor } : {}
34204
+ },
34205
+ ListToolsResultSchema,
34206
+ dependencies2,
34207
+ "tools"
34208
+ );
34209
+ dependencies2.setTools(response.tools);
34210
+ dependencies2.setNextToolCursor(response.nextCursor);
34211
+ };
34212
+ const callTool = async (name, params, dependencies2) => {
34213
+ try {
34214
+ const response = await sendMCPRequest(
34215
+ {
34216
+ method: "tools/call",
34217
+ params: {
34218
+ name,
34219
+ arguments: params,
34220
+ _meta: {
34221
+ progressToken: dependencies2.progressTokenRef.current++
34222
+ }
34223
+ }
34224
+ },
34225
+ CompatibilityCallToolResultSchema,
34226
+ dependencies2,
34227
+ "tools"
34228
+ );
34229
+ dependencies2.setToolResult(response);
34230
+ } catch (e) {
34231
+ const toolResult = {
34232
+ content: [
34233
+ {
34234
+ type: "text",
34235
+ text: e.message ?? String(e)
34236
+ }
34237
+ ],
34238
+ isError: true
34239
+ };
34240
+ dependencies2.setToolResult(toolResult);
34241
+ }
34242
+ };
34243
+ const handleRootsChange = async (dependencies2) => {
34244
+ await dependencies2.sendNotification({
34245
+ method: "notifications/roots/list_changed"
34246
+ });
34247
+ };
34248
+ const sendLogLevelRequest = async (level, dependencies2) => {
34249
+ await sendMCPRequest(
34250
+ {
34251
+ method: "logging/setLevel",
34252
+ params: { level }
34253
+ },
34254
+ objectType({}),
34255
+ dependencies2
34256
+ );
34257
+ dependencies2.setLogLevel(level);
34258
+ };
34259
+ const clearStdErrNotifications = (setStdErrNotifications) => {
34260
+ setStdErrNotifications([]);
34261
+ };
34262
+ function clamp(value, [min2, max2]) {
34263
+ return Math.min(max2, Math.max(min2, value));
34264
+ }
33496
34265
  var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
33497
34266
  var SELECTION_KEYS = [" ", "Enter"];
33498
34267
  var SELECT_NAME = "Select";
@@ -33603,12 +34372,12 @@ var Select$1 = (props) => {
33603
34372
  ) });
33604
34373
  };
33605
34374
  Select$1.displayName = SELECT_NAME;
33606
- var TRIGGER_NAME$2 = "SelectTrigger";
34375
+ var TRIGGER_NAME$1 = "SelectTrigger";
33607
34376
  var SelectTrigger$1 = reactExports.forwardRef(
33608
34377
  (props, forwardedRef) => {
33609
34378
  const { __scopeSelect, disabled = false, ...triggerProps } = props;
33610
34379
  const popperScope = usePopperScope$1(__scopeSelect);
33611
- const context = useSelectContext(TRIGGER_NAME$2, __scopeSelect);
34380
+ const context = useSelectContext(TRIGGER_NAME$1, __scopeSelect);
33612
34381
  const isDisabled = context.disabled || disabled;
33613
34382
  const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
33614
34383
  const getItems = useCollection(__scopeSelect);
@@ -33680,7 +34449,7 @@ var SelectTrigger$1 = reactExports.forwardRef(
33680
34449
  ) });
33681
34450
  }
33682
34451
  );
33683
- SelectTrigger$1.displayName = TRIGGER_NAME$2;
34452
+ SelectTrigger$1.displayName = TRIGGER_NAME$1;
33684
34453
  var VALUE_NAME = "SelectValue";
33685
34454
  var SelectValue$1 = reactExports.forwardRef(
33686
34455
  (props, forwardedRef) => {
@@ -34544,7 +35313,7 @@ var SelectArrow = reactExports.forwardRef(
34544
35313
  }
34545
35314
  );
34546
35315
  SelectArrow.displayName = ARROW_NAME$1;
34547
- var BUBBLE_INPUT_NAME$1 = "SelectBubbleInput";
35316
+ var BUBBLE_INPUT_NAME = "SelectBubbleInput";
34548
35317
  var SelectBubbleInput = reactExports.forwardRef(
34549
35318
  ({ __scopeSelect, value, ...props }, forwardedRef) => {
34550
35319
  const ref2 = reactExports.useRef(null);
@@ -34576,7 +35345,7 @@ var SelectBubbleInput = reactExports.forwardRef(
34576
35345
  );
34577
35346
  }
34578
35347
  );
34579
- SelectBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
35348
+ SelectBubbleInput.displayName = BUBBLE_INPUT_NAME;
34580
35349
  function shouldShowPlaceholder(value) {
34581
35350
  return value === "" || value === void 0;
34582
35351
  }
@@ -34740,46 +35509,6 @@ const SelectSeparator = reactExports.forwardRef(({ className, ...props }, ref2)
34740
35509
  }
34741
35510
  ));
34742
35511
  SelectSeparator.displayName = Separator.displayName;
34743
- const useTheme = () => {
34744
- const [theme, setTheme] = reactExports.useState(() => {
34745
- const savedTheme = localStorage.getItem("theme");
34746
- return savedTheme || "system";
34747
- });
34748
- reactExports.useEffect(() => {
34749
- const darkModeMediaQuery = window.matchMedia(
34750
- "(prefers-color-scheme: dark)"
34751
- );
34752
- const handleDarkModeChange = (e) => {
34753
- if (theme === "system") {
34754
- updateDocumentTheme(e.matches ? "dark" : "light");
34755
- }
34756
- };
34757
- const updateDocumentTheme = (newTheme) => {
34758
- document.documentElement.classList.toggle("dark", newTheme === "dark");
34759
- };
34760
- if (theme === "system") {
34761
- updateDocumentTheme(darkModeMediaQuery.matches ? "dark" : "light");
34762
- } else {
34763
- updateDocumentTheme(theme);
34764
- }
34765
- darkModeMediaQuery.addEventListener("change", handleDarkModeChange);
34766
- return () => {
34767
- darkModeMediaQuery.removeEventListener("change", handleDarkModeChange);
34768
- };
34769
- }, [theme]);
34770
- const setThemeWithSideEffect = reactExports.useCallback((newTheme) => {
34771
- setTheme(newTheme);
34772
- localStorage.setItem("theme", newTheme);
34773
- if (newTheme !== "system") {
34774
- document.documentElement.classList.toggle("dark", newTheme === "dark");
34775
- }
34776
- }, []);
34777
- return reactExports.useMemo(
34778
- () => [theme, setThemeWithSideEffect],
34779
- [theme, setThemeWithSideEffect]
34780
- );
34781
- };
34782
- const version = "0.1.0";
34783
35512
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
34784
35513
  createPopperScope
34785
35514
  ]);
@@ -34923,12 +35652,12 @@ var Tooltip$1 = (props) => {
34923
35652
  ) });
34924
35653
  };
34925
35654
  Tooltip$1.displayName = TOOLTIP_NAME;
34926
- var TRIGGER_NAME$1 = "TooltipTrigger";
35655
+ var TRIGGER_NAME = "TooltipTrigger";
34927
35656
  var TooltipTrigger$1 = reactExports.forwardRef(
34928
35657
  (props, forwardedRef) => {
34929
35658
  const { __scopeTooltip, ...triggerProps } = props;
34930
- const context = useTooltipContext(TRIGGER_NAME$1, __scopeTooltip);
34931
- const providerContext = useTooltipProviderContext(TRIGGER_NAME$1, __scopeTooltip);
35659
+ const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);
35660
+ const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);
34932
35661
  const popperScope = usePopperScope(__scopeTooltip);
34933
35662
  const ref2 = reactExports.useRef(null);
34934
35663
  const composedRefs = useComposedRefs(forwardedRef, ref2, context.onTriggerChange);
@@ -34972,7 +35701,7 @@ var TooltipTrigger$1 = reactExports.forwardRef(
34972
35701
  ) });
34973
35702
  }
34974
35703
  );
34975
- TooltipTrigger$1.displayName = TRIGGER_NAME$1;
35704
+ TooltipTrigger$1.displayName = TRIGGER_NAME;
34976
35705
  var PORTAL_NAME = "TooltipPortal";
34977
35706
  var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
34978
35707
  forceMount: void 0
@@ -35262,7 +35991,7 @@ const TooltipContent = reactExports.forwardRef(({ className, sideOffset = 4, ...
35262
35991
  }
35263
35992
  ));
35264
35993
  TooltipContent.displayName = Content2.displayName;
35265
- const Sidebar = ({
35994
+ const ConnectionSection = ({
35266
35995
  connectionStatus,
35267
35996
  transportType,
35268
35997
  setTransportType,
@@ -35281,17 +36010,14 @@ const Sidebar = ({
35281
36010
  onConnect,
35282
36011
  onDisconnect,
35283
36012
  stdErrNotifications,
35284
- clearStdErrNotifications,
36013
+ clearStdErrNotifications: clearStdErrNotifications2,
35285
36014
  logLevel,
35286
- sendLogLevelRequest,
36015
+ sendLogLevelRequest: sendLogLevelRequest2,
35287
36016
  loggingSupported,
35288
36017
  config,
35289
36018
  setConfig
35290
36019
  }) => {
35291
- const [theme, setTheme] = useTheme();
35292
- const [showEnvVars, setShowEnvVars] = reactExports.useState(false);
35293
- const [showBearerToken, setShowBearerToken] = reactExports.useState(false);
35294
- const [showConfig, setShowConfig] = reactExports.useState(false);
36020
+ const [activeTab, setActiveTab] = reactExports.useState("connection");
35295
36021
  const [shownEnvVars, setShownEnvVars] = reactExports.useState(/* @__PURE__ */ new Set());
35296
36022
  const [copiedServerEntry, setCopiedServerEntry] = reactExports.useState(false);
35297
36023
  const [copiedServerFile, setCopiedServerFile] = reactExports.useState(false);
@@ -35382,1054 +36108,536 @@ const Sidebar = ({
35382
36108
  reportError2(error);
35383
36109
  }
35384
36110
  }, [generateMCPServerFile, toast2, reportError2]);
35385
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-80 bg-card border-r border-border flex flex-col h-full", children: [
35386
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "ml-2 text-lg font-semibold", children: [
35387
- "MCP Inspector v",
35388
- version
35389
- ] }) }) }),
35390
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35391
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35392
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35393
- "label",
35394
- {
35395
- className: "text-sm font-medium",
35396
- htmlFor: "transport-type-select",
35397
- children: "Transport Type"
35398
- }
35399
- ),
35400
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35401
- Select,
35402
- {
35403
- value: transportType,
35404
- onValueChange: (value) => setTransportType(value),
35405
- children: [
35406
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "transport-type-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select transport type" }) }),
35407
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
35408
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "stdio", children: "STDIO" }),
35409
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "sse", children: "SSE" }),
35410
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "streamable-http", children: "Streamable HTTP" })
35411
- ] })
35412
- ]
35413
- }
35414
- )
35415
- ] }),
35416
- transportType === "stdio" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
35417
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35418
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "command-input", children: "Command" }),
35419
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35420
- Input,
35421
- {
35422
- id: "command-input",
35423
- placeholder: "Command",
35424
- value: command,
35425
- onChange: (e) => setCommand(e.target.value),
35426
- className: "font-mono"
35427
- }
35428
- )
35429
- ] }),
35430
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35431
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35432
- "label",
35433
- {
35434
- className: "text-sm font-medium",
35435
- htmlFor: "arguments-input",
35436
- children: "Arguments"
35437
- }
35438
- ),
35439
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35440
- Input,
35441
- {
35442
- id: "arguments-input",
35443
- placeholder: "Arguments (space-separated)",
35444
- value: args,
35445
- onChange: (e) => setArgs(e.target.value),
35446
- className: "font-mono"
35447
- }
35448
- )
35449
- ] })
35450
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
35451
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35452
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
35453
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35454
- Input,
35455
- {
35456
- id: "sse-url-input",
35457
- placeholder: "URL",
35458
- value: sseUrl,
35459
- onChange: (e) => setSseUrl(e.target.value),
35460
- className: "font-mono"
35461
- }
35462
- )
35463
- ] }),
35464
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35465
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35466
- Button,
35467
- {
35468
- variant: "outline",
35469
- onClick: () => setShowBearerToken(!showBearerToken),
35470
- className: "flex items-center w-full",
35471
- "data-testid": "auth-button",
35472
- "aria-expanded": showBearerToken,
35473
- children: [
35474
- showBearerToken ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
35475
- "Authentication"
35476
- ]
35477
- }
35478
- ),
35479
- showBearerToken && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35480
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Header Name" }),
35481
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35482
- Input,
35483
- {
35484
- placeholder: "Authorization",
35485
- onChange: (e) => setHeaderName && setHeaderName(e.target.value),
35486
- "data-testid": "header-input",
35487
- className: "font-mono",
35488
- value: headerName
35489
- }
35490
- ),
35491
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35492
- "label",
35493
- {
35494
- className: "text-sm font-medium",
35495
- htmlFor: "bearer-token-input",
35496
- children: "Bearer Token"
35497
- }
35498
- ),
35499
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35500
- Input,
35501
- {
35502
- id: "bearer-token-input",
35503
- placeholder: "Bearer Token",
35504
- value: bearerToken,
35505
- onChange: (e) => setBearerToken(e.target.value),
35506
- "data-testid": "bearer-token-input",
35507
- className: "font-mono",
35508
- type: "password"
35509
- }
35510
- )
35511
- ] })
35512
- ] })
35513
- ] }),
35514
- transportType === "stdio" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35515
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35516
- Button,
35517
- {
35518
- variant: "outline",
35519
- onClick: () => setShowEnvVars(!showEnvVars),
35520
- className: "flex items-center w-full",
35521
- "data-testid": "env-vars-button",
35522
- "aria-expanded": showEnvVars,
35523
- children: [
35524
- showEnvVars ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
35525
- "Environment Variables"
35526
- ]
35527
- }
35528
- ),
35529
- showEnvVars && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35530
- Object.entries(env).map(([key, value], idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 pb-4", children: [
35531
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
36111
+ const maybeRenderTabs = () => {
36112
+ if (connectionStatus === "connected") {
36113
+ return null;
36114
+ }
36115
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex border-b border-slate-200/60 dark:border-slate-700/60 px-6 bg-gradient-to-r from-slate-50/50 to-white/50 dark:from-slate-900/50 dark:to-slate-800/50", children: [
36116
+ { key: "auth", label: "Auth" },
36117
+ ...transportType === "stdio" ? [{ key: "env", label: "Environment" }] : [],
36118
+ { key: "config", label: "Configuration" },
36119
+ ...loggingSupported ? [{ key: "logging", label: "Logging" }] : []
36120
+ ].map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
36121
+ "button",
36122
+ {
36123
+ className: `px-6 py-3 text-sm font-medium border-b-2 transition-all duration-200 relative ${activeTab === tab.key ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 hover:border-slate-300 dark:hover:border-slate-600"}`,
36124
+ onClick: () => setActiveTab(tab.key),
36125
+ children: [
36126
+ tab.label,
36127
+ activeTab === tab.key && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-x-0 bottom-0 h-0.5 bg-gradient-to-r from-blue-500 to-blue-600 shadow-lg" })
36128
+ ]
36129
+ },
36130
+ tab.key
36131
+ )) });
36132
+ };
36133
+ const maybeRenderContentBody = () => {
36134
+ if (connectionStatus === "connected") {
36135
+ return null;
36136
+ }
36137
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-auto", children: [
36138
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6", children: [
36139
+ activeTab === "auth" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/60 dark:bg-slate-800/60 backdrop-blur-sm rounded-xl p-6 border border-slate-200/60 dark:border-slate-700/60 shadow-lg", children: [
36140
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-semibold mb-6 text-slate-800 bg-clip-text", children: "Authentication" }),
36141
+ transportType !== "stdio" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-5", children: [
36142
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
36143
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: "Header Name" }),
35532
36144
  /* @__PURE__ */ jsxRuntimeExports.jsx(
35533
36145
  Input,
35534
36146
  {
35535
- "aria-label": `Environment variable key ${idx + 1}`,
35536
- placeholder: "Key",
35537
- value: key,
35538
- onChange: (e) => {
35539
- const newKey = e.target.value;
35540
- const newEnv = Object.entries(env).reduce(
35541
- (acc, [k2, v]) => {
35542
- if (k2 === key) {
35543
- acc[newKey] = value;
35544
- } else {
35545
- acc[k2] = v;
35546
- }
35547
- return acc;
35548
- },
35549
- {}
35550
- );
35551
- setEnv(newEnv);
35552
- setShownEnvVars((prev) => {
35553
- const next = new Set(prev);
35554
- if (next.has(key)) {
35555
- next.delete(key);
35556
- next.add(newKey);
35557
- }
35558
- return next;
35559
- });
35560
- },
35561
- className: "font-mono"
35562
- }
35563
- ),
35564
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35565
- Button,
35566
- {
35567
- variant: "destructive",
35568
- size: "icon",
35569
- className: "h-9 w-9 p-0 shrink-0",
35570
- onClick: () => {
35571
- const { [key]: _removed, ...rest } = env;
35572
- setEnv(rest);
35573
- },
35574
- children: "×"
36147
+ placeholder: "Authorization",
36148
+ onChange: (e) => setHeaderName && setHeaderName(e.target.value),
36149
+ className: "font-mono h-11 bg-white/70 dark:bg-slate-900/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200 shadow-sm hover:shadow-md focus:shadow-lg",
36150
+ value: headerName
35575
36151
  }
35576
36152
  )
35577
36153
  ] }),
35578
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
36154
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
36155
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: "Bearer Token" }),
35579
36156
  /* @__PURE__ */ jsxRuntimeExports.jsx(
35580
36157
  Input,
35581
36158
  {
35582
- "aria-label": `Environment variable value ${idx + 1}`,
35583
- type: shownEnvVars.has(key) ? "text" : "password",
35584
- placeholder: "Value",
35585
- value,
35586
- onChange: (e) => {
35587
- const newEnv = { ...env };
35588
- newEnv[key] = e.target.value;
35589
- setEnv(newEnv);
35590
- },
35591
- className: "font-mono"
35592
- }
35593
- ),
35594
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35595
- Button,
35596
- {
35597
- variant: "outline",
35598
- size: "icon",
35599
- className: "h-9 w-9 p-0 shrink-0",
35600
- onClick: () => {
35601
- setShownEnvVars((prev) => {
35602
- const next = new Set(prev);
35603
- if (next.has(key)) {
35604
- next.delete(key);
35605
- } else {
35606
- next.add(key);
35607
- }
35608
- return next;
35609
- });
35610
- },
35611
- "aria-label": shownEnvVars.has(key) ? "Hide value" : "Show value",
35612
- "aria-pressed": shownEnvVars.has(key),
35613
- title: shownEnvVars.has(key) ? "Hide value" : "Show value",
35614
- children: shownEnvVars.has(key) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": "true" })
36159
+ placeholder: "Bearer Token",
36160
+ value: bearerToken,
36161
+ onChange: (e) => setBearerToken(e.target.value),
36162
+ className: "font-mono h-11 bg-white/70 dark:bg-slate-900/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200 shadow-sm hover:shadow-md focus:shadow-lg",
36163
+ type: "password"
35615
36164
  }
35616
36165
  )
35617
36166
  ] })
35618
- ] }, idx)),
35619
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35620
- Button,
36167
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-slate-600 dark:text-slate-400 italic", children: "Authentication is not available for STDIO connections." })
36168
+ ] }) }),
36169
+ activeTab === "env" && transportType === "stdio" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/60 dark:bg-slate-800/60 backdrop-blur-sm rounded-xl p-6 border border-slate-200/60 dark:border-slate-700/60 shadow-lg", children: [
36170
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
36171
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-semibold text-slate-800bg-clip-text", children: "Environment Variables" }),
36172
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36173
+ Button,
36174
+ {
36175
+ variant: "outline",
36176
+ onClick: () => {
36177
+ const key = "";
36178
+ const newEnv = { ...env };
36179
+ newEnv[key] = "";
36180
+ setEnv(newEnv);
36181
+ },
36182
+ className: "bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-emerald-400/60 dark:hover:border-emerald-500/60 hover:bg-emerald-50/80 dark:hover:bg-emerald-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36183
+ children: "Add Variable"
36184
+ }
36185
+ )
36186
+ ] }),
36187
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: Object.entries(env).map(([key, value], idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
36188
+ "div",
35621
36189
  {
35622
- variant: "outline",
35623
- className: "w-full mt-2",
35624
- onClick: () => {
35625
- const key = "";
35626
- const newEnv = { ...env };
35627
- newEnv[key] = "";
35628
- setEnv(newEnv);
36190
+ className: "bg-white/40 dark:bg-slate-900/40 backdrop-blur-sm rounded-lg p-4 border border-slate-200/40 dark:border-slate-700/40 shadow-md hover:shadow-lg transition-all duration-200",
36191
+ children: [
36192
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 mb-3", children: [
36193
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36194
+ Input,
36195
+ {
36196
+ placeholder: "Key",
36197
+ value: key,
36198
+ onChange: (e) => {
36199
+ const newKey = e.target.value;
36200
+ const newEnv = Object.entries(env).reduce(
36201
+ (acc, [k2, v]) => {
36202
+ if (k2 === key) {
36203
+ acc[newKey] = value;
36204
+ } else {
36205
+ acc[k2] = v;
36206
+ }
36207
+ return acc;
36208
+ },
36209
+ {}
36210
+ );
36211
+ setEnv(newEnv);
36212
+ setShownEnvVars((prev) => {
36213
+ const next = new Set(prev);
36214
+ if (next.has(key)) {
36215
+ next.delete(key);
36216
+ next.add(newKey);
36217
+ }
36218
+ return next;
36219
+ });
36220
+ },
36221
+ className: "font-mono flex-1 h-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200"
36222
+ }
36223
+ ),
36224
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36225
+ Button,
36226
+ {
36227
+ variant: "destructive",
36228
+ size: "icon",
36229
+ onClick: () => {
36230
+ const { [key]: _removed, ...rest } = env;
36231
+ setEnv(rest);
36232
+ },
36233
+ className: "h-10 w-10 bg-red-500/80 hover:bg-red-600/90 shadow-md hover:shadow-lg transition-all duration-200",
36234
+ children: "×"
36235
+ }
36236
+ )
36237
+ ] }),
36238
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
36239
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36240
+ Input,
36241
+ {
36242
+ type: shownEnvVars.has(key) ? "text" : "password",
36243
+ placeholder: "Value",
36244
+ value,
36245
+ onChange: (e) => {
36246
+ const newEnv = { ...env };
36247
+ newEnv[key] = e.target.value;
36248
+ setEnv(newEnv);
36249
+ },
36250
+ className: "font-mono flex-1 h-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200"
36251
+ }
36252
+ ),
36253
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36254
+ Button,
36255
+ {
36256
+ variant: "outline",
36257
+ size: "icon",
36258
+ onClick: () => {
36259
+ setShownEnvVars((prev) => {
36260
+ const next = new Set(prev);
36261
+ if (next.has(key)) {
36262
+ next.delete(key);
36263
+ } else {
36264
+ next.add(key);
36265
+ }
36266
+ return next;
36267
+ });
36268
+ },
36269
+ className: "h-10 w-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 hover:bg-blue-50/80 dark:hover:bg-blue-900/20 transition-all duration-200",
36270
+ children: shownEnvVars.has(key) ? /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "h-4 w-4" })
36271
+ }
36272
+ )
36273
+ ] })
36274
+ ]
36275
+ },
36276
+ idx
36277
+ )) })
36278
+ ] }) }),
36279
+ activeTab === "config" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/60 dark:bg-slate-800/60 backdrop-blur-sm rounded-xl p-6 border border-slate-200/60 dark:border-slate-700/60 shadow-lg", children: [
36280
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-semibold mb-6 text-slate-800 bg-clip-text", children: "Configuration" }),
36281
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-5", children: Object.entries(config).map(([key, configItem]) => {
36282
+ const configKey = key;
36283
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
36284
+ "div",
36285
+ {
36286
+ className: "space-y-3 p-4 bg-white/40 dark:bg-slate-900/40 backdrop-blur-sm rounded-lg border border-slate-200/40 dark:border-slate-700/40 shadow-sm hover:shadow-md transition-all duration-200",
36287
+ children: [
36288
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
36289
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-slate-800", children: configItem.label }),
36290
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
36291
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleHelp, { className: "h-4 w-4 text-slate-500 dark:text-slate-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200" }) }),
36292
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "bg-white/95 dark:bg-slate-800/95 backdrop-blur-xl border-slate-200/60 dark:border-slate-700/60 shadow-xl", children: configItem.description })
36293
+ ] })
36294
+ ] }),
36295
+ typeof configItem.value === "number" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
36296
+ Input,
36297
+ {
36298
+ type: "number",
36299
+ value: configItem.value,
36300
+ onChange: (e) => {
36301
+ const newConfig = { ...config };
36302
+ newConfig[configKey] = {
36303
+ ...configItem,
36304
+ value: Number(e.target.value)
36305
+ };
36306
+ setConfig(newConfig);
36307
+ },
36308
+ className: "font-mono h-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200"
36309
+ }
36310
+ ) : typeof configItem.value === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
36311
+ Select,
36312
+ {
36313
+ value: configItem.value.toString(),
36314
+ onValueChange: (val) => {
36315
+ const newConfig = { ...config };
36316
+ newConfig[configKey] = {
36317
+ ...configItem,
36318
+ value: val === "true"
36319
+ };
36320
+ setConfig(newConfig);
36321
+ },
36322
+ children: [
36323
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "h-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 transition-all duration-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
36324
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { className: "bg-white/95 dark:bg-slate-800/95 backdrop-blur-xl border-slate-200/60 dark:border-slate-700/60 shadow-xl", children: [
36325
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36326
+ SelectItem,
36327
+ {
36328
+ value: "true",
36329
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36330
+ children: "True"
36331
+ }
36332
+ ),
36333
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36334
+ SelectItem,
36335
+ {
36336
+ value: "false",
36337
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36338
+ children: "False"
36339
+ }
36340
+ )
36341
+ ] })
36342
+ ]
36343
+ }
36344
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
36345
+ Input,
36346
+ {
36347
+ value: configItem.value,
36348
+ onChange: (e) => {
36349
+ const newConfig = { ...config };
36350
+ newConfig[configKey] = {
36351
+ ...configItem,
36352
+ value: e.target.value
36353
+ };
36354
+ setConfig(newConfig);
36355
+ },
36356
+ className: "font-mono h-10 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200"
36357
+ }
36358
+ )
36359
+ ]
35629
36360
  },
35630
- children: "Add Environment Variable"
35631
- }
35632
- )
35633
- ] })
36361
+ key
36362
+ );
36363
+ }) })
36364
+ ] }) }),
36365
+ activeTab === "logging" && loggingSupported && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/60 dark:bg-slate-800/60 backdrop-blur-sm rounded-xl p-6 border border-slate-200/60 dark:border-slate-700/60 shadow-lg", children: [
36366
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-semibold mb-6 text-slate-800 dark:text-slate-200 bg-gradient-to-r from-orange-600 to-orange-800 dark:from-orange-400 dark:to-orange-600 bg-clip-text text-transparent", children: "Logging Configuration" }),
36367
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
36368
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: "Logging Level" }),
36369
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36370
+ Select,
36371
+ {
36372
+ value: logLevel,
36373
+ onValueChange: (value) => sendLogLevelRequest2(value),
36374
+ children: [
36375
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-64 h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 transition-all duration-200 shadow-sm hover:shadow-md", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select logging level" }) }),
36376
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { className: "bg-white/95 dark:bg-slate-800/95 backdrop-blur-xl border-slate-200/60 dark:border-slate-700/60 shadow-xl", children: Object.values(LoggingLevelSchema.enum).map((level) => /* @__PURE__ */ jsxRuntimeExports.jsx(
36377
+ SelectItem,
36378
+ {
36379
+ value: level,
36380
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36381
+ children: level
36382
+ },
36383
+ level
36384
+ )) })
36385
+ ]
36386
+ }
36387
+ )
36388
+ ] })
36389
+ ] }) })
35634
36390
  ] }),
35635
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 mt-2", children: [
35636
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
35637
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
36391
+ stdErrNotifications.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-red-200/60 dark:border-red-800/60 bg-gradient-to-r from-red-50/80 to-rose-50/80 dark:from-red-950/60 dark:to-rose-950/60 backdrop-blur-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6", children: [
36392
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
36393
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-sm font-semibold text-red-700 dark:text-red-400 flex items-center gap-2", children: [
36394
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-red-500 rounded-full animate-pulse" }),
36395
+ "Error output from MCP server"
36396
+ ] }),
36397
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
35638
36398
  Button,
35639
36399
  {
35640
36400
  variant: "outline",
35641
36401
  size: "sm",
35642
- onClick: handleCopyServerEntry,
35643
- className: "w-full",
35644
- children: [
35645
- copiedServerEntry ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
35646
- "Server Entry"
35647
- ]
36402
+ onClick: clearStdErrNotifications2,
36403
+ className: "bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-red-300/60 dark:border-red-600/60 hover:border-red-500/60 dark:hover:border-red-400/60 hover:bg-red-50/80 dark:hover:bg-red-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36404
+ children: "Clear"
35648
36405
  }
35649
- ) }),
35650
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "Copy Server Entry" })
36406
+ )
35651
36407
  ] }),
35652
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
35653
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
35654
- Button,
36408
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-48 overflow-y-auto space-y-3", children: stdErrNotifications.map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
36409
+ "div",
36410
+ {
36411
+ className: "text-sm text-red-800 dark:text-red-200 font-mono p-4 bg-white/60 dark:bg-slate-900/60 backdrop-blur-sm rounded-lg border border-red-200/60 dark:border-red-700/60 shadow-md hover:shadow-lg transition-all duration-200",
36412
+ children: notification.params.content
36413
+ },
36414
+ index2
36415
+ )) })
36416
+ ] }) })
36417
+ ] });
36418
+ };
36419
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col bg-gradient-to-br from-slate-50 via-white to-slate-100 dark:from-slate-950 dark:via-slate-900 dark:to-slate-800", children: [
36420
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "backdrop-blur-xl bg-white/80 dark:bg-slate-900/80 border-b border-slate-200/60 dark:border-slate-700/60 shadow-sm", children: [
36421
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6", children: [
36422
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4 mb-6", children: [
36423
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
36424
+ Select,
35655
36425
  {
35656
- variant: "outline",
35657
- size: "sm",
35658
- onClick: handleCopyServerFile,
35659
- className: "w-full",
36426
+ value: transportType,
36427
+ onValueChange: (value) => setTransportType(value),
35660
36428
  children: [
35661
- copiedServerFile ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
35662
- "Servers File"
36429
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-36 h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 transition-all duration-200 shadow-sm hover:shadow-md", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select transport type" }) }),
36430
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { className: "bg-white/95 dark:bg-slate-800/95 backdrop-blur-xl border-slate-200/60 dark:border-slate-700/60 shadow-xl", children: [
36431
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36432
+ SelectItem,
36433
+ {
36434
+ value: "stdio",
36435
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36436
+ children: "STDIO"
36437
+ }
36438
+ ),
36439
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36440
+ SelectItem,
36441
+ {
36442
+ value: "sse",
36443
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36444
+ children: "SSE"
36445
+ }
36446
+ ),
36447
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36448
+ SelectItem,
36449
+ {
36450
+ value: "streamable-http",
36451
+ className: "hover:bg-blue-50/80 dark:hover:bg-blue-900/30",
36452
+ children: "HTTP"
36453
+ }
36454
+ )
36455
+ ] })
35663
36456
  ]
35664
36457
  }
35665
36458
  ) }),
35666
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "Copy Servers File" })
35667
- ] })
35668
- ] }),
35669
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35670
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35671
- Button,
35672
- {
35673
- variant: "outline",
35674
- onClick: () => setShowConfig(!showConfig),
35675
- className: "flex items-center w-full",
35676
- "data-testid": "config-button",
35677
- "aria-expanded": showConfig,
35678
- children: [
35679
- showConfig ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
35680
- /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-4 h-4 mr-2" }),
35681
- "Configuration"
35682
- ]
35683
- }
35684
- ),
35685
- showConfig && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: Object.entries(config).map(([key, configItem]) => {
35686
- const configKey = key;
35687
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35688
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
35689
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35690
- "label",
35691
- {
35692
- className: "text-sm font-medium text-green-600 break-all",
35693
- htmlFor: `${configKey}-input`,
35694
- children: configItem.label
35695
- }
35696
- ),
35697
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
35698
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleHelp, { className: "h-4 w-4 text-muted-foreground" }) }),
35699
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: configItem.description })
35700
- ] })
35701
- ] }),
35702
- typeof configItem.value === "number" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
36459
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: transportType === "stdio" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
36460
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
35703
36461
  Input,
35704
36462
  {
35705
- id: `${configKey}-input`,
35706
- type: "number",
35707
- "data-testid": `${configKey}-input`,
35708
- value: configItem.value,
35709
- onChange: (e) => {
35710
- const newConfig = { ...config };
35711
- newConfig[configKey] = {
35712
- ...configItem,
35713
- value: Number(e.target.value)
35714
- };
35715
- setConfig(newConfig);
35716
- },
35717
- className: "font-mono"
36463
+ placeholder: "npx",
36464
+ value: command,
36465
+ onChange: (e) => setCommand(e.target.value),
36466
+ className: "font-mono flex-1 h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200 shadow-sm hover:shadow-md focus:shadow-lg"
35718
36467
  }
35719
- ) : typeof configItem.value === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
35720
- Select,
36468
+ ),
36469
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36470
+ Input,
36471
+ {
36472
+ placeholder: "@modelcontextprotocol/server-brave-search",
36473
+ value: args,
36474
+ onChange: (e) => setArgs(e.target.value),
36475
+ className: "font-mono flex-1 h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200 shadow-sm hover:shadow-md focus:shadow-lg"
36476
+ }
36477
+ )
36478
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
36479
+ Input,
36480
+ {
36481
+ placeholder: transportType === "sse" ? "https://mcp.asana.com/sse" : "Enter URL",
36482
+ value: sseUrl,
36483
+ onChange: (e) => setSseUrl(e.target.value),
36484
+ className: "font-mono h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 focus:border-blue-500 dark:focus:border-blue-400 transition-all duration-200 shadow-sm hover:shadow-md focus:shadow-lg"
36485
+ }
36486
+ ) }),
36487
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-3", children: connectionStatus === "connected" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36488
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36489
+ Button,
35721
36490
  {
35722
- "data-testid": `${configKey}-select`,
35723
- value: configItem.value.toString(),
35724
- onValueChange: (val) => {
35725
- const newConfig = { ...config };
35726
- newConfig[configKey] = {
35727
- ...configItem,
35728
- value: val === "true"
35729
- };
35730
- setConfig(newConfig);
36491
+ onClick: () => {
36492
+ onDisconnect();
36493
+ onConnect();
35731
36494
  },
36495
+ className: "px-6 h-11 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-105",
35732
36496
  children: [
35733
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: `${configKey}-input`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
35734
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
35735
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "true", children: "True" }),
35736
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "false", children: "False" })
35737
- ] })
36497
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-4 h-4 mr-2" }),
36498
+ transportType === "stdio" ? "Restart" : "Reconnect"
35738
36499
  ]
35739
36500
  }
35740
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
35741
- Input,
36501
+ ),
36502
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36503
+ Button,
35742
36504
  {
35743
- id: `${configKey}-input`,
35744
- "data-testid": `${configKey}-input`,
35745
- value: configItem.value,
35746
- onChange: (e) => {
35747
- const newConfig = { ...config };
35748
- newConfig[configKey] = {
35749
- ...configItem,
35750
- value: e.target.value
35751
- };
35752
- setConfig(newConfig);
35753
- },
35754
- className: "font-mono"
36505
+ onClick: onDisconnect,
36506
+ variant: "outline",
36507
+ className: "h-11 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-red-400/60 dark:hover:border-red-500/60 hover:bg-red-50/80 dark:hover:bg-red-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36508
+ children: [
36509
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCwOff, { className: "w-4 h-4 mr-2" }),
36510
+ "Disconnect"
36511
+ ]
35755
36512
  }
35756
36513
  )
35757
- ] }, key);
35758
- }) })
35759
- ] }),
35760
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35761
- connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
35762
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
36514
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
35763
36515
  Button,
35764
36516
  {
35765
- "data-testid": "connect-button",
35766
- onClick: () => {
35767
- onDisconnect();
35768
- onConnect();
35769
- },
36517
+ onClick: onConnect,
36518
+ className: "px-8 h-11 bg-gradient-to-r from-emerald-600 to-emerald-700 hover:from-emerald-700 hover:to-emerald-800 text-white shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-105",
35770
36519
  children: [
35771
- /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-4 h-4 mr-2" }),
35772
- transportType === "stdio" ? "Restart" : "Reconnect"
36520
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { className: "w-4 h-4 mr-2" }),
36521
+ "Connect"
35773
36522
  ]
35774
36523
  }
35775
- ),
35776
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { onClick: onDisconnect, children: [
35777
- /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCwOff, { className: "w-4 h-4 mr-2" }),
35778
- "Disconnect"
35779
- ] })
35780
- ] }),
35781
- connectionStatus !== "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: "w-full", onClick: onConnect, children: [
35782
- /* @__PURE__ */ jsxRuntimeExports.jsx(Play, { className: "w-4 h-4 mr-2" }),
35783
- "Connect"
36524
+ ) })
35784
36525
  ] }),
35785
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center space-x-2 mb-4", children: [
35786
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35787
- "div",
35788
- {
35789
- className: `w-2 h-2 rounded-full ${(() => {
35790
- switch (connectionStatus) {
35791
- case "connected":
35792
- return "bg-green-500";
35793
- case "error":
35794
- return "bg-red-500";
35795
- case "error-connecting-to-proxy":
35796
- return "bg-red-500";
35797
- default:
35798
- return "bg-gray-500";
36526
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
36527
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
36528
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
36529
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
36530
+ "div",
36531
+ {
36532
+ className: `w-3 h-3 rounded-full shadow-lg ${(() => {
36533
+ switch (connectionStatus) {
36534
+ case "connected":
36535
+ return "bg-emerald-500 shadow-emerald-500/50";
36536
+ case "error":
36537
+ return "bg-red-500 shadow-red-500/50";
36538
+ case "error-connecting-to-proxy":
36539
+ return "bg-red-500 shadow-red-500/50";
36540
+ default:
36541
+ return "bg-slate-400 shadow-slate-400/50";
36542
+ }
36543
+ })()}`
35799
36544
  }
35800
- })()}`
35801
- }
35802
- ),
35803
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: (() => {
35804
- switch (connectionStatus) {
35805
- case "connected":
35806
- return "Connected";
35807
- case "error":
35808
- return "Connection Error, is your MCP server running?";
35809
- case "error-connecting-to-proxy":
35810
- return "Error Connecting to MCP Inspector Proxy - Check Console logs";
35811
- default:
35812
- return "Disconnected";
35813
- }
35814
- })() })
35815
- ] }),
35816
- loggingSupported && connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35817
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35818
- "label",
35819
- {
35820
- className: "text-sm font-medium",
35821
- htmlFor: "logging-level-select",
35822
- children: "Logging Level"
35823
- }
35824
- ),
35825
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35826
- Select,
35827
- {
35828
- value: logLevel,
35829
- onValueChange: (value) => sendLogLevelRequest(value),
35830
- children: [
35831
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "logging-level-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select logging level" }) }),
35832
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: Object.values(LoggingLevelSchema.enum).map((level) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: level, children: level }, level)) })
35833
- ]
35834
- }
35835
- )
35836
- ] }),
35837
- stdErrNotifications.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 border-t border-gray-200 pt-4", children: [
35838
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
35839
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: "Error output from MCP server" }),
36545
+ ),
36546
+ connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 w-3 h-3 rounded-full bg-emerald-500 animate-ping opacity-75" })
36547
+ ] }),
35840
36548
  /* @__PURE__ */ jsxRuntimeExports.jsx(
35841
- Button,
36549
+ "span",
35842
36550
  {
35843
- variant: "outline",
35844
- size: "sm",
35845
- onClick: clearStdErrNotifications,
35846
- className: "h-8 px-2",
35847
- children: "Clear"
36551
+ className: `text-sm font-medium ${(() => {
36552
+ switch (connectionStatus) {
36553
+ case "connected":
36554
+ return "text-emerald-700 dark:text-emerald-300";
36555
+ case "error":
36556
+ return "text-red-700 dark:text-red-300";
36557
+ case "error-connecting-to-proxy":
36558
+ return "text-red-700 dark:text-red-300";
36559
+ default:
36560
+ return "text-slate-600 dark:text-slate-400";
36561
+ }
36562
+ })()}`,
36563
+ children: (() => {
36564
+ switch (connectionStatus) {
36565
+ case "connected":
36566
+ return "Connected";
36567
+ case "error":
36568
+ return "Connection Error, is your MCP server running?";
36569
+ case "error-connecting-to-proxy":
36570
+ return "Error Connecting to MCP Inspector Proxy - Check Console logs";
36571
+ default:
36572
+ return "Disconnected";
36573
+ }
36574
+ })()
35848
36575
  }
35849
36576
  )
35850
36577
  ] }),
35851
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 max-h-80 overflow-y-auto", children: stdErrNotifications.map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
35852
- "div",
35853
- {
35854
- className: "text-sm text-red-500 font-mono py-2 border-b border-gray-200 last:border-b-0",
35855
- children: notification.params.content
35856
- },
35857
- index2
35858
- )) })
35859
- ] }) })
35860
- ] })
35861
- ] }) }),
35862
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
35863
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35864
- Select,
35865
- {
35866
- value: theme,
35867
- onValueChange: (value) => setTheme(value),
35868
- children: [
35869
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-[100px]", id: "theme-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
35870
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
35871
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "system", children: "System" }),
35872
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "light", children: "Light" }),
35873
- /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "dark", children: "Dark" })
35874
- ] })
35875
- ]
35876
- }
35877
- ),
35878
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
35879
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", title: "Inspector Documentation", asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35880
- "a",
35881
- {
35882
- href: "https://modelcontextprotocol.io/docs/tools/inspector",
35883
- target: "_blank",
35884
- rel: "noopener noreferrer",
35885
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleHelp, { className: "w-4 h-4 text-foreground" })
35886
- }
35887
- ) }),
35888
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", title: "Debugging Guide", asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35889
- "a",
35890
- {
35891
- href: "https://modelcontextprotocol.io/docs/tools/debugging",
35892
- target: "_blank",
35893
- rel: "noopener noreferrer",
35894
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-4 h-4 text-foreground" })
35895
- }
35896
- ) }),
35897
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35898
- Button,
35899
- {
35900
- variant: "ghost",
35901
- title: "Report bugs or contribute on GitHub",
35902
- asChild: true,
35903
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35904
- "a",
35905
- {
35906
- href: "https://github.com/modelcontextprotocol/inspector",
35907
- target: "_blank",
35908
- rel: "noopener noreferrer",
35909
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Github, { className: "w-4 h-4 text-foreground" })
35910
- }
35911
- )
35912
- }
35913
- )
35914
- ] })
35915
- ] }) })
35916
- ] });
35917
- };
35918
- var CHECKBOX_NAME = "Checkbox";
35919
- var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
35920
- var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
35921
- function CheckboxProvider(props) {
35922
- const {
35923
- __scopeCheckbox,
35924
- checked: checkedProp,
35925
- children,
35926
- defaultChecked,
35927
- disabled,
35928
- form,
35929
- name,
35930
- onCheckedChange,
35931
- required: required2,
35932
- value = "on",
35933
- // @ts-expect-error
35934
- internal_do_not_use_render
35935
- } = props;
35936
- const [checked, setChecked] = useControllableState({
35937
- prop: checkedProp,
35938
- defaultProp: defaultChecked ?? false,
35939
- onChange: onCheckedChange,
35940
- caller: CHECKBOX_NAME
35941
- });
35942
- const [control, setControl] = reactExports.useState(null);
35943
- const [bubbleInput, setBubbleInput] = reactExports.useState(null);
35944
- const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
35945
- const isFormControl = control ? !!form || !!control.closest("form") : (
35946
- // We set this to true by default so that events bubble to forms without JS (SSR)
35947
- true
35948
- );
35949
- const context = {
35950
- checked,
35951
- disabled,
35952
- setChecked,
35953
- control,
35954
- setControl,
35955
- name,
35956
- form,
35957
- value,
35958
- hasConsumerStoppedPropagationRef,
35959
- required: required2,
35960
- defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
35961
- isFormControl,
35962
- bubbleInput,
35963
- setBubbleInput
35964
- };
35965
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
35966
- CheckboxProviderImpl,
35967
- {
35968
- scope: __scopeCheckbox,
35969
- ...context,
35970
- children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
35971
- }
35972
- );
35973
- }
35974
- var TRIGGER_NAME = "CheckboxTrigger";
35975
- var CheckboxTrigger = reactExports.forwardRef(
35976
- ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
35977
- const {
35978
- control,
35979
- value,
35980
- disabled,
35981
- checked,
35982
- required: required2,
35983
- setControl,
35984
- setChecked,
35985
- hasConsumerStoppedPropagationRef,
35986
- isFormControl,
35987
- bubbleInput
35988
- } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
35989
- const composedRefs = useComposedRefs(forwardedRef, setControl);
35990
- const initialCheckedStateRef = reactExports.useRef(checked);
35991
- reactExports.useEffect(() => {
35992
- const form = control == null ? void 0 : control.form;
35993
- if (form) {
35994
- const reset = () => setChecked(initialCheckedStateRef.current);
35995
- form.addEventListener("reset", reset);
35996
- return () => form.removeEventListener("reset", reset);
35997
- }
35998
- }, [control, setChecked]);
35999
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
36000
- Primitive.button,
36001
- {
36002
- type: "button",
36003
- role: "checkbox",
36004
- "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
36005
- "aria-required": required2,
36006
- "data-state": getState(checked),
36007
- "data-disabled": disabled ? "" : void 0,
36008
- disabled,
36009
- value,
36010
- ...checkboxProps,
36011
- ref: composedRefs,
36012
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
36013
- if (event.key === "Enter") event.preventDefault();
36014
- }),
36015
- onClick: composeEventHandlers(onClick, (event) => {
36016
- setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
36017
- if (bubbleInput && isFormControl) {
36018
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
36019
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
36020
- }
36021
- })
36022
- }
36023
- );
36024
- }
36025
- );
36026
- CheckboxTrigger.displayName = TRIGGER_NAME;
36027
- var Checkbox$1 = reactExports.forwardRef(
36028
- (props, forwardedRef) => {
36029
- const {
36030
- __scopeCheckbox,
36031
- name,
36032
- checked,
36033
- defaultChecked,
36034
- required: required2,
36035
- disabled,
36036
- value,
36037
- onCheckedChange,
36038
- form,
36039
- ...checkboxProps
36040
- } = props;
36041
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
36042
- CheckboxProvider,
36043
- {
36044
- __scopeCheckbox,
36045
- checked,
36046
- defaultChecked,
36047
- disabled,
36048
- required: required2,
36049
- onCheckedChange,
36050
- name,
36051
- form,
36052
- value,
36053
- internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36054
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36055
- CheckboxTrigger,
36056
- {
36057
- ...checkboxProps,
36058
- ref: forwardedRef,
36059
- __scopeCheckbox
36060
- }
36061
- ),
36062
- isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
36063
- CheckboxBubbleInput,
36064
- {
36065
- __scopeCheckbox
36066
- }
36067
- )
36068
- ] })
36069
- }
36070
- );
36071
- }
36072
- );
36073
- Checkbox$1.displayName = CHECKBOX_NAME;
36074
- var INDICATOR_NAME = "CheckboxIndicator";
36075
- var CheckboxIndicator = reactExports.forwardRef(
36076
- (props, forwardedRef) => {
36077
- const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
36078
- const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
36079
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
36080
- Presence,
36081
- {
36082
- present: forceMount || isIndeterminate(context.checked) || context.checked === true,
36083
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36084
- Primitive.span,
36085
- {
36086
- "data-state": getState(context.checked),
36087
- "data-disabled": context.disabled ? "" : void 0,
36088
- ...indicatorProps,
36089
- ref: forwardedRef,
36090
- style: { pointerEvents: "none", ...props.style }
36091
- }
36092
- )
36093
- }
36094
- );
36095
- }
36096
- );
36097
- CheckboxIndicator.displayName = INDICATOR_NAME;
36098
- var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
36099
- var CheckboxBubbleInput = reactExports.forwardRef(
36100
- ({ __scopeCheckbox, ...props }, forwardedRef) => {
36101
- const {
36102
- control,
36103
- hasConsumerStoppedPropagationRef,
36104
- checked,
36105
- defaultChecked,
36106
- required: required2,
36107
- disabled,
36108
- name,
36109
- value,
36110
- form,
36111
- bubbleInput,
36112
- setBubbleInput
36113
- } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
36114
- const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
36115
- const prevChecked = usePrevious(checked);
36116
- const controlSize = useSize(control);
36117
- reactExports.useEffect(() => {
36118
- const input = bubbleInput;
36119
- if (!input) return;
36120
- const inputProto = window.HTMLInputElement.prototype;
36121
- const descriptor = Object.getOwnPropertyDescriptor(
36122
- inputProto,
36123
- "checked"
36124
- );
36125
- const setChecked = descriptor.set;
36126
- const bubbles = !hasConsumerStoppedPropagationRef.current;
36127
- if (prevChecked !== checked && setChecked) {
36128
- const event = new Event("click", { bubbles });
36129
- input.indeterminate = isIndeterminate(checked);
36130
- setChecked.call(input, isIndeterminate(checked) ? false : checked);
36131
- input.dispatchEvent(event);
36132
- }
36133
- }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
36134
- const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
36135
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
36136
- Primitive.input,
36137
- {
36138
- type: "checkbox",
36139
- "aria-hidden": true,
36140
- defaultChecked: defaultChecked ?? defaultCheckedRef.current,
36141
- required: required2,
36142
- disabled,
36143
- name,
36144
- value,
36145
- form,
36146
- ...props,
36147
- tabIndex: -1,
36148
- ref: composedRefs,
36149
- style: {
36150
- ...props.style,
36151
- ...controlSize,
36152
- position: "absolute",
36153
- pointerEvents: "none",
36154
- opacity: 0,
36155
- margin: 0,
36156
- // We transform because the input is absolutely positioned but we have
36157
- // rendered it **after** the button. This pulls it back to sit on top
36158
- // of the button.
36159
- transform: "translateX(-100%)"
36160
- }
36161
- }
36162
- );
36163
- }
36164
- );
36165
- CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
36166
- function isFunction(value) {
36167
- return typeof value === "function";
36168
- }
36169
- function isIndeterminate(checked) {
36170
- return checked === "indeterminate";
36171
- }
36172
- function getState(checked) {
36173
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
36174
- }
36175
- const Checkbox = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
36176
- Checkbox$1,
36177
- {
36178
- ref: ref2,
36179
- className: cn(
36180
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
36181
- className
36182
- ),
36183
- ...props,
36184
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36185
- CheckboxIndicator,
36186
- {
36187
- className: cn("flex items-center justify-center text-current"),
36188
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "h-4 w-4" })
36189
- }
36190
- )
36191
- }
36192
- ));
36193
- Checkbox.displayName = Checkbox$1.displayName;
36194
- const Textarea = reactExports.forwardRef(
36195
- ({ className, ...props }, ref2) => {
36196
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
36197
- "textarea",
36198
- {
36199
- className: cn(
36200
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
36201
- className
36202
- ),
36203
- ref: ref2,
36204
- ...props
36205
- }
36206
- );
36207
- }
36208
- );
36209
- Textarea.displayName = "Textarea";
36210
- const ToolsTab = ({
36211
- tools,
36212
- listTools,
36213
- clearTools,
36214
- callTool,
36215
- selectedTool,
36216
- setSelectedTool,
36217
- toolResult,
36218
- nextCursor
36219
- }) => {
36220
- const [params, setParams] = reactExports.useState({});
36221
- const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
36222
- reactExports.useEffect(() => {
36223
- const params2 = Object.entries(
36224
- (selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
36225
- ).map(([key, value]) => [
36226
- key,
36227
- generateDefaultValue(value)
36228
- ]);
36229
- setParams(Object.fromEntries(params2));
36230
- }, [selectedTool]);
36231
- const renderToolResult = () => {
36232
- if (!toolResult) return null;
36233
- if ("content" in toolResult) {
36234
- const parsedResult = CallToolResultSchema.safeParse(toolResult);
36235
- if (!parsedResult.success) {
36236
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36237
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Invalid Tool Result:" }),
36238
- /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult }),
36239
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Errors:" }),
36240
- parsedResult.error.errors.map((error, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: error }, idx))
36241
- ] });
36242
- }
36243
- const structuredResult = parsedResult.data;
36244
- const isError = structuredResult.isError ?? false;
36245
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36246
- /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "font-semibold mb-2", children: [
36247
- "Tool Result:",
36248
- " ",
36249
- isError ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 font-semibold", children: "Error" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: "Success" })
36250
- ] }),
36251
- structuredResult.content.map((item, index2) => {
36252
- var _a, _b;
36253
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
36254
- item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
36255
- item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
36256
- "img",
36578
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
36579
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36580
+ Button,
36257
36581
  {
36258
- src: `data:${item.mimeType};base64,${item.data}`,
36259
- alt: "Tool result image",
36260
- className: "max-w-full h-auto"
36582
+ variant: "outline",
36583
+ size: "sm",
36584
+ onClick: handleCopyServerEntry,
36585
+ className: "h-9 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 hover:bg-blue-50/80 dark:hover:bg-blue-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36586
+ children: [
36587
+ copiedServerEntry ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2 text-emerald-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
36588
+ "Copy Entry"
36589
+ ]
36261
36590
  }
36262
36591
  ),
36263
- item.type === "resource" && (((_b = (_a = item.resource) == null ? void 0 : _a.mimeType) == null ? void 0 : _b.startsWith("audio/")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
36264
- "audio",
36592
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36593
+ Button,
36265
36594
  {
36266
- controls: true,
36267
- src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
36268
- className: "w-full",
36269
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
36595
+ variant: "outline",
36596
+ size: "sm",
36597
+ onClick: handleCopyServerFile,
36598
+ className: "h-9 bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-slate-300/60 dark:border-slate-600/60 hover:border-blue-400/60 dark:hover:border-blue-500/60 hover:bg-blue-50/80 dark:hover:bg-blue-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36599
+ children: [
36600
+ copiedServerFile ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2 text-emerald-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
36601
+ "Copy File"
36602
+ ]
36270
36603
  }
36271
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource }))
36272
- ] }, index2);
36273
- })
36274
- ] });
36275
- } else if ("toolResult" in toolResult) {
36276
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36277
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Tool Result (Legacy):" }),
36278
- /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult.toolResult })
36279
- ] });
36280
- }
36281
- };
36282
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
36283
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36284
- ListPane,
36285
- {
36286
- items: tools,
36287
- listItems: listTools,
36288
- clearItems: () => {
36289
- clearTools();
36290
- setSelectedTool(null);
36291
- },
36292
- setSelectedItem: setSelectedTool,
36293
- renderItem: (tool) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-start", children: [
36294
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: tool.name }),
36295
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 text-left", children: tool.description })
36604
+ )
36605
+ ] })
36606
+ ] })
36607
+ ] }),
36608
+ maybeRenderTabs()
36609
+ ] }),
36610
+ maybeRenderContentBody(),
36611
+ stdErrNotifications.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-red-200/60 dark:border-red-800/60 bg-gradient-to-r from-red-50/80 to-rose-50/80 dark:from-red-950/60 dark:to-rose-950/60 backdrop-blur-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6", children: [
36612
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
36613
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-sm font-semibold text-red-700 dark:text-red-400 flex items-center gap-2", children: [
36614
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-red-500 rounded-full animate-pulse" }),
36615
+ "Error output from MCP server"
36296
36616
  ] }),
36297
- title: "Tools",
36298
- buttonText: nextCursor ? "List More Tools" : "List Tools",
36299
- isButtonDisabled: !nextCursor && tools.length > 0
36300
- }
36301
- ),
36302
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
36303
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedTool ? selectedTool.name : "Select a tool" }) }),
36304
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
36305
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: selectedTool.description }),
36306
- Object.entries(selectedTool.inputSchema.properties ?? []).map(
36307
- ([key, value]) => {
36308
- const prop = value;
36309
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36310
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36311
- Label$1,
36312
- {
36313
- htmlFor: key,
36314
- className: "block text-sm font-medium text-gray-700",
36315
- children: key
36316
- }
36317
- ),
36318
- prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
36319
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36320
- Checkbox,
36321
- {
36322
- id: key,
36323
- name: key,
36324
- checked: !!params[key],
36325
- onCheckedChange: (checked) => setParams({
36326
- ...params,
36327
- [key]: checked
36328
- })
36329
- }
36330
- ),
36331
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36332
- "label",
36333
- {
36334
- htmlFor: key,
36335
- className: "text-sm font-medium text-gray-700 dark:text-gray-300",
36336
- children: prop.description || "Toggle this option"
36337
- }
36338
- )
36339
- ] }) : prop.type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
36340
- Textarea,
36341
- {
36342
- id: key,
36343
- name: key,
36344
- placeholder: prop.description,
36345
- value: params[key] ?? "",
36346
- onChange: (e) => setParams({
36347
- ...params,
36348
- [key]: e.target.value
36349
- }),
36350
- className: "mt-1"
36351
- }
36352
- ) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36353
- DynamicJsonForm,
36354
- {
36355
- schema: {
36356
- type: prop.type,
36357
- properties: prop.properties,
36358
- description: prop.description,
36359
- items: prop.items
36360
- },
36361
- value: params[key] ?? generateDefaultValue(prop),
36362
- onChange: (newValue) => {
36363
- setParams({
36364
- ...params,
36365
- [key]: newValue
36366
- });
36367
- }
36368
- }
36369
- ) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
36370
- Input,
36371
- {
36372
- type: "number",
36373
- id: key,
36374
- name: key,
36375
- placeholder: prop.description,
36376
- value: params[key] ?? "",
36377
- onChange: (e) => setParams({
36378
- ...params,
36379
- [key]: Number(e.target.value)
36380
- }),
36381
- className: "mt-1"
36382
- }
36383
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36384
- DynamicJsonForm,
36385
- {
36386
- schema: {
36387
- type: prop.type,
36388
- properties: prop.properties,
36389
- description: prop.description,
36390
- items: prop.items
36391
- },
36392
- value: params[key],
36393
- onChange: (newValue) => {
36394
- setParams({
36395
- ...params,
36396
- [key]: newValue
36397
- });
36398
- }
36399
- }
36400
- ) })
36401
- ] }, key);
36402
- }
36403
- ),
36404
36617
  /* @__PURE__ */ jsxRuntimeExports.jsx(
36405
36618
  Button,
36406
36619
  {
36407
- onClick: async () => {
36408
- try {
36409
- setIsToolRunning(true);
36410
- await callTool(selectedTool.name, params);
36411
- } finally {
36412
- setIsToolRunning(false);
36413
- }
36414
- },
36415
- disabled: isToolRunning,
36416
- children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36417
- /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
36418
- "Running..."
36419
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36420
- /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4 mr-2" }),
36421
- "Run Tool"
36422
- ] })
36620
+ variant: "outline",
36621
+ size: "sm",
36622
+ onClick: clearStdErrNotifications2,
36623
+ className: "bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm border-red-300/60 dark:border-red-600/60 hover:border-red-500/60 dark:hover:border-red-400/60 hover:bg-red-50/80 dark:hover:bg-red-900/20 transition-all duration-200 shadow-sm hover:shadow-md",
36624
+ children: "Clear"
36423
36625
  }
36424
- ),
36425
- toolResult && renderToolResult()
36426
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a tool from the list to view its details and run it" }) }) })
36427
- ] })
36428
- ] }) });
36626
+ )
36627
+ ] }),
36628
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-48 overflow-y-auto space-y-3", children: stdErrNotifications.map((notification, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
36629
+ "div",
36630
+ {
36631
+ className: "text-sm text-red-800 dark:text-red-200 font-mono p-4 bg-white/60 dark:bg-slate-900/60 backdrop-blur-sm rounded-lg border border-red-200/60 dark:border-red-700/60 shadow-md hover:shadow-lg transition-all duration-200",
36632
+ children: notification.params.content
36633
+ },
36634
+ index2
36635
+ )) })
36636
+ ] }) })
36637
+ ] });
36429
36638
  };
36430
36639
  const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
36431
36640
  const App = () => {
36432
- var _a;
36433
36641
  const [resources, setResources] = reactExports.useState([]);
36434
36642
  const [resourceTemplates, setResourceTemplates] = reactExports.useState([]);
36435
36643
  const [resourceContent, setResourceContent] = reactExports.useState("");
@@ -36447,7 +36655,6 @@ const App = () => {
36447
36655
  const [sseUrl, setSseUrl] = reactExports.useState(getInitialSseUrl);
36448
36656
  const [transportType, setTransportType] = reactExports.useState(getInitialTransportType);
36449
36657
  const [logLevel, setLogLevel] = reactExports.useState("debug");
36450
- const [notifications, setNotifications] = reactExports.useState([]);
36451
36658
  const [stdErrNotifications, setStdErrNotifications] = reactExports.useState([]);
36452
36659
  const [roots, setRoots] = reactExports.useState([]);
36453
36660
  const [env, setEnv] = reactExports.useState({});
@@ -36491,7 +36698,6 @@ const App = () => {
36491
36698
  const [nextPromptCursor, setNextPromptCursor] = reactExports.useState();
36492
36699
  const [nextToolCursor, setNextToolCursor] = reactExports.useState();
36493
36700
  const progressTokenRef = reactExports.useRef(0);
36494
- const { height: historyPaneHeight, handleDragStart } = useDraggablePane(300);
36495
36701
  const {
36496
36702
  connectionStatus,
36497
36703
  serverCapabilities,
@@ -36512,8 +36718,7 @@ const App = () => {
36512
36718
  bearerToken,
36513
36719
  headerName,
36514
36720
  config,
36515
- onNotification: (notification) => {
36516
- setNotifications((prev) => [...prev, notification]);
36721
+ onNotification: () => {
36517
36722
  },
36518
36723
  onStdErrNotification: (notification) => {
36519
36724
  setStdErrNotifications((prev) => [
@@ -36623,190 +36828,85 @@ const App = () => {
36623
36828
  window.location.hash = "resources";
36624
36829
  }
36625
36830
  }, []);
36626
- const handleApproveSampling = (id, result) => {
36627
- setPendingSampleRequests((prev) => {
36628
- const request = prev.find((r2) => r2.id === id);
36629
- request == null ? void 0 : request.resolve(result);
36630
- return prev.filter((r2) => r2.id !== id);
36631
- });
36831
+ const helperDependencies = {
36832
+ makeRequest,
36833
+ sendNotification,
36834
+ setErrors,
36835
+ setResources,
36836
+ setResourceTemplates,
36837
+ setResourceContent,
36838
+ setResourceSubscriptions,
36839
+ setPrompts,
36840
+ setPromptContent,
36841
+ setTools,
36842
+ setToolResult,
36843
+ setNextResourceCursor,
36844
+ setNextResourceTemplateCursor,
36845
+ setNextPromptCursor,
36846
+ setNextToolCursor,
36847
+ setLogLevel,
36848
+ setStdErrNotifications,
36849
+ setPendingSampleRequests,
36850
+ progressTokenRef
36632
36851
  };
36633
- const handleRejectSampling = (id) => {
36634
- setPendingSampleRequests((prev) => {
36635
- const request = prev.find((r2) => r2.id === id);
36636
- request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
36637
- return prev.filter((r2) => r2.id !== id);
36638
- });
36852
+ const helperState = {
36853
+ resources,
36854
+ resourceTemplates,
36855
+ resourceSubscriptions,
36856
+ nextResourceCursor,
36857
+ nextResourceTemplateCursor,
36858
+ nextPromptCursor,
36859
+ nextToolCursor
36639
36860
  };
36640
- const clearError = (tabKey) => {
36641
- setErrors((prev) => ({ ...prev, [tabKey]: null }));
36861
+ const handleApproveSamplingWrapper = (id, result) => {
36862
+ handleApproveSampling(id, result, setPendingSampleRequests);
36642
36863
  };
36643
- const sendMCPRequest = async (request, schema, tabKey) => {
36644
- try {
36645
- const response = await makeRequest(request, schema);
36646
- if (tabKey !== void 0) {
36647
- clearError(tabKey);
36648
- }
36649
- return response;
36650
- } catch (e) {
36651
- const errorString = e.message ?? String(e);
36652
- if (tabKey !== void 0) {
36653
- setErrors((prev) => ({
36654
- ...prev,
36655
- [tabKey]: errorString
36656
- }));
36657
- }
36658
- throw e;
36659
- }
36864
+ const handleRejectSamplingWrapper = (id) => {
36865
+ handleRejectSampling(id, setPendingSampleRequests);
36660
36866
  };
36661
- const listResources = async () => {
36662
- const response = await sendMCPRequest(
36663
- {
36664
- method: "resources/list",
36665
- params: nextResourceCursor ? { cursor: nextResourceCursor } : {}
36666
- },
36667
- ListResourcesResultSchema,
36668
- "resources"
36669
- );
36670
- setResources(resources.concat(response.resources ?? []));
36671
- setNextResourceCursor(response.nextCursor);
36867
+ const clearErrorWrapper = (tabKey) => {
36868
+ clearError(tabKey, setErrors);
36672
36869
  };
36673
- const listResourceTemplates = async () => {
36674
- const response = await sendMCPRequest(
36675
- {
36676
- method: "resources/templates/list",
36677
- params: nextResourceTemplateCursor ? { cursor: nextResourceTemplateCursor } : {}
36678
- },
36679
- ListResourceTemplatesResultSchema,
36680
- "resources"
36681
- );
36682
- setResourceTemplates(
36683
- resourceTemplates.concat(response.resourceTemplates ?? [])
36684
- );
36685
- setNextResourceTemplateCursor(response.nextCursor);
36870
+ const sendMCPRequestWrapper = async (request, schema, tabKey) => {
36871
+ return sendMCPRequest(request, schema, helperDependencies, tabKey);
36686
36872
  };
36687
- const readResource = async (uri) => {
36688
- const response = await sendMCPRequest(
36689
- {
36690
- method: "resources/read",
36691
- params: { uri }
36692
- },
36693
- ReadResourceResultSchema,
36694
- "resources"
36695
- );
36696
- setResourceContent(JSON.stringify(response, null, 2));
36873
+ const listResourcesWrapper = async () => {
36874
+ return listResources(helperState, helperDependencies);
36697
36875
  };
36698
- const subscribeToResource = async (uri) => {
36699
- if (!resourceSubscriptions.has(uri)) {
36700
- await sendMCPRequest(
36701
- {
36702
- method: "resources/subscribe",
36703
- params: { uri }
36704
- },
36705
- objectType({}),
36706
- "resources"
36707
- );
36708
- const clone = new Set(resourceSubscriptions);
36709
- clone.add(uri);
36710
- setResourceSubscriptions(clone);
36711
- }
36876
+ const listResourceTemplatesWrapper = async () => {
36877
+ return listResourceTemplates(helperState, helperDependencies);
36712
36878
  };
36713
- const unsubscribeFromResource = async (uri) => {
36714
- if (resourceSubscriptions.has(uri)) {
36715
- await sendMCPRequest(
36716
- {
36717
- method: "resources/unsubscribe",
36718
- params: { uri }
36719
- },
36720
- objectType({}),
36721
- "resources"
36722
- );
36723
- const clone = new Set(resourceSubscriptions);
36724
- clone.delete(uri);
36725
- setResourceSubscriptions(clone);
36726
- }
36879
+ const readResourceWrapper = async (uri) => {
36880
+ return readResource(uri, helperDependencies);
36727
36881
  };
36728
- const listPrompts = async () => {
36729
- const response = await sendMCPRequest(
36730
- {
36731
- method: "prompts/list",
36732
- params: nextPromptCursor ? { cursor: nextPromptCursor } : {}
36733
- },
36734
- ListPromptsResultSchema,
36735
- "prompts"
36736
- );
36737
- setPrompts(response.prompts);
36738
- setNextPromptCursor(response.nextCursor);
36882
+ const subscribeToResourceWrapper = async (uri) => {
36883
+ return subscribeToResource(uri, helperState, helperDependencies);
36739
36884
  };
36740
- const getPrompt = async (name, args2 = {}) => {
36741
- const response = await sendMCPRequest(
36742
- {
36743
- method: "prompts/get",
36744
- params: { name, arguments: args2 }
36745
- },
36746
- GetPromptResultSchema,
36747
- "prompts"
36748
- );
36749
- setPromptContent(JSON.stringify(response, null, 2));
36885
+ const unsubscribeFromResourceWrapper = async (uri) => {
36886
+ return unsubscribeFromResource(uri, helperState, helperDependencies);
36750
36887
  };
36751
- const listTools = async () => {
36752
- const response = await sendMCPRequest(
36753
- {
36754
- method: "tools/list",
36755
- params: nextToolCursor ? { cursor: nextToolCursor } : {}
36756
- },
36757
- ListToolsResultSchema,
36758
- "tools"
36759
- );
36760
- setTools(response.tools);
36761
- setNextToolCursor(response.nextCursor);
36888
+ const listPromptsWrapper = async () => {
36889
+ return listPrompts(helperState, helperDependencies);
36762
36890
  };
36763
- const callTool = async (name, params) => {
36764
- try {
36765
- const response = await sendMCPRequest(
36766
- {
36767
- method: "tools/call",
36768
- params: {
36769
- name,
36770
- arguments: params,
36771
- _meta: {
36772
- progressToken: progressTokenRef.current++
36773
- }
36774
- }
36775
- },
36776
- CompatibilityCallToolResultSchema,
36777
- "tools"
36778
- );
36779
- setToolResult(response);
36780
- } catch (e) {
36781
- const toolResult2 = {
36782
- content: [
36783
- {
36784
- type: "text",
36785
- text: e.message ?? String(e)
36786
- }
36787
- ],
36788
- isError: true
36789
- };
36790
- setToolResult(toolResult2);
36791
- }
36891
+ const getPromptWrapper = async (name, args2 = {}) => {
36892
+ return getPrompt(name, args2, helperDependencies);
36792
36893
  };
36793
- const handleRootsChange = async () => {
36794
- await sendNotification({ method: "notifications/roots/list_changed" });
36894
+ const listToolsWrapper = async () => {
36895
+ return listTools(helperState, helperDependencies);
36795
36896
  };
36796
- const sendLogLevelRequest = async (level) => {
36797
- await sendMCPRequest(
36798
- {
36799
- method: "logging/setLevel",
36800
- params: { level }
36801
- },
36802
- objectType({})
36803
- );
36804
- setLogLevel(level);
36897
+ const callToolWrapper = async (name, params) => {
36898
+ return callTool(name, params, helperDependencies);
36899
+ };
36900
+ const handleRootsChangeWrapper = async () => {
36901
+ return handleRootsChange(helperDependencies);
36805
36902
  };
36806
- const clearStdErrNotifications = () => {
36807
- setStdErrNotifications([]);
36903
+ const sendLogLevelRequestWrapper = async (level) => {
36904
+ return sendLogLevelRequest(level, helperDependencies);
36808
36905
  };
36809
- const AuthDebuggerWrapper = () => /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "auth", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36906
+ const clearStdErrNotificationsWrapper = () => {
36907
+ clearStdErrNotifications(setStdErrNotifications);
36908
+ };
36909
+ const AuthDebuggerWrapper = () => /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "auth", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36810
36910
  AuthDebugger,
36811
36911
  {
36812
36912
  serverUrl: sseUrl,
@@ -36817,19 +36917,306 @@ const App = () => {
36817
36917
  ) });
36818
36918
  if (window.location.pathname === "/oauth/callback") {
36819
36919
  const OAuthCallback = React.lazy(
36820
- () => __vitePreload(() => import("./OAuthCallback-D9GEIvKa.js"), true ? __vite__mapDeps([0,1]) : void 0)
36920
+ () => __vitePreload(() => import("./OAuthCallback-kC0-8Fug.js"), true ? __vite__mapDeps([0,1]) : void 0)
36821
36921
  );
36822
- return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
36922
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36923
+ reactExports.Suspense,
36924
+ {
36925
+ fallback: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
36926
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
36927
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground", children: "Loading..." })
36928
+ ] }),
36929
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect })
36930
+ }
36931
+ ) });
36823
36932
  }
36824
36933
  if (window.location.pathname === "/oauth/callback/debug") {
36825
36934
  const OAuthDebugCallback = React.lazy(
36826
- () => __vitePreload(() => import("./OAuthDebugCallback-zUpX3mpm.js"), true ? __vite__mapDeps([2,1]) : void 0)
36935
+ () => __vitePreload(() => import("./OAuthDebugCallback-BpNrhMCC.js"), true ? __vite__mapDeps([2,1]) : void 0)
36827
36936
  );
36828
- return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
36937
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36938
+ reactExports.Suspense,
36939
+ {
36940
+ fallback: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
36941
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
36942
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground", children: "Loading..." })
36943
+ ] }),
36944
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect })
36945
+ }
36946
+ ) });
36829
36947
  }
36830
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-screen bg-background", children: [
36831
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36832
- Sidebar,
36948
+ const renderTabs = () => {
36949
+ const serverHasNoCapabilities = !(serverCapabilities == null ? void 0 : serverCapabilities.resources) && !(serverCapabilities == null ? void 0 : serverCapabilities.prompts) && !(serverCapabilities == null ? void 0 : serverCapabilities.tools);
36950
+ const renderTabsList = () => {
36951
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "grid w-full grid-cols-7 bg-muted/30 backdrop-blur-sm border border-border/50 rounded-xl p-1 h-auto", children: [
36952
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36953
+ TabsTrigger,
36954
+ {
36955
+ value: "resources",
36956
+ disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources),
36957
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
36958
+ children: [
36959
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Files, { className: "w-4 h-4" }),
36960
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Resources" })
36961
+ ]
36962
+ }
36963
+ ),
36964
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36965
+ TabsTrigger,
36966
+ {
36967
+ value: "prompts",
36968
+ disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts),
36969
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
36970
+ children: [
36971
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-4 h-4" }),
36972
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Prompts" })
36973
+ ]
36974
+ }
36975
+ ),
36976
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36977
+ TabsTrigger,
36978
+ {
36979
+ value: "tools",
36980
+ disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.tools),
36981
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
36982
+ children: [
36983
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Hammer, { className: "w-4 h-4" }),
36984
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Tools" })
36985
+ ]
36986
+ }
36987
+ ),
36988
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
36989
+ TabsTrigger,
36990
+ {
36991
+ value: "ping",
36992
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
36993
+ children: [
36994
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "w-4 h-4" }),
36995
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Ping" })
36996
+ ]
36997
+ }
36998
+ ),
36999
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
37000
+ TabsTrigger,
37001
+ {
37002
+ value: "sampling",
37003
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50 relative",
37004
+ children: [
37005
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Hash, { className: "w-4 h-4" }),
37006
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Sampling" }),
37007
+ pendingSampleRequests.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center animate-pulse", children: pendingSampleRequests.length })
37008
+ ]
37009
+ }
37010
+ ),
37011
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
37012
+ TabsTrigger,
37013
+ {
37014
+ value: "roots",
37015
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
37016
+ children: [
37017
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FolderTree, { className: "w-4 h-4" }),
37018
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Roots" })
37019
+ ]
37020
+ }
37021
+ ),
37022
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
37023
+ TabsTrigger,
37024
+ {
37025
+ value: "auth",
37026
+ className: "flex items-center gap-2 px-4 py-3 rounded-lg transition-all duration-200 data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:border data-[state=active]:border-border/50",
37027
+ children: [
37028
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Key, { className: "w-4 h-4" }),
37029
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "hidden sm:inline", children: "Auth" })
37030
+ ]
37031
+ }
37032
+ )
37033
+ ] });
37034
+ };
37035
+ const computeTabDefaultValue = () => {
37036
+ return Object.keys(serverCapabilities ?? {}).includes(
37037
+ window.location.hash.slice(1)
37038
+ ) ? window.location.hash.slice(1) : (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping";
37039
+ };
37040
+ const renderServerNoCapabilities = () => {
37041
+ if (serverHasNoCapabilities) {
37042
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center p-12 rounded-xl bg-card border border-border/50 shadow-sm", children: [
37043
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-16 h-16 text-muted-foreground mb-4" }),
37044
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-semibold mb-2", children: "No Capabilities Available" }),
37045
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted-foreground text-center mb-6 max-w-md", children: "The connected server does not support any MCP capabilities. You can still use the Ping feature to test connectivity." }),
37046
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37047
+ PingTab,
37048
+ {
37049
+ onPingClick: () => {
37050
+ void sendMCPRequestWrapper(
37051
+ {
37052
+ method: "ping"
37053
+ },
37054
+ EmptyResultSchema
37055
+ );
37056
+ }
37057
+ }
37058
+ ) })
37059
+ ] });
37060
+ }
37061
+ };
37062
+ const renderTabsContent = () => {
37063
+ var _a;
37064
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-0", children: [
37065
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "resources", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37066
+ ResourcesTab,
37067
+ {
37068
+ resources,
37069
+ resourceTemplates,
37070
+ listResources: () => {
37071
+ clearErrorWrapper("resources");
37072
+ listResourcesWrapper();
37073
+ },
37074
+ clearResources: () => {
37075
+ setResources([]);
37076
+ setNextResourceCursor(void 0);
37077
+ },
37078
+ listResourceTemplates: () => {
37079
+ clearErrorWrapper("resources");
37080
+ listResourceTemplatesWrapper();
37081
+ },
37082
+ clearResourceTemplates: () => {
37083
+ setResourceTemplates([]);
37084
+ setNextResourceTemplateCursor(void 0);
37085
+ },
37086
+ readResource: (uri) => {
37087
+ clearErrorWrapper("resources");
37088
+ readResourceWrapper(uri);
37089
+ },
37090
+ selectedResource,
37091
+ setSelectedResource: (resource) => {
37092
+ clearErrorWrapper("resources");
37093
+ setSelectedResource(resource);
37094
+ },
37095
+ resourceSubscriptionsSupported: ((_a = serverCapabilities == null ? void 0 : serverCapabilities.resources) == null ? void 0 : _a.subscribe) || false,
37096
+ resourceSubscriptions,
37097
+ subscribeToResource: (uri) => {
37098
+ clearErrorWrapper("resources");
37099
+ subscribeToResourceWrapper(uri);
37100
+ },
37101
+ unsubscribeFromResource: (uri) => {
37102
+ clearErrorWrapper("resources");
37103
+ unsubscribeFromResourceWrapper(uri);
37104
+ },
37105
+ handleCompletion,
37106
+ completionsSupported,
37107
+ resourceContent,
37108
+ nextCursor: nextResourceCursor,
37109
+ nextTemplateCursor: nextResourceTemplateCursor,
37110
+ error: errors.resources
37111
+ }
37112
+ ) }),
37113
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "prompts", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37114
+ PromptsTab,
37115
+ {
37116
+ prompts,
37117
+ listPrompts: () => {
37118
+ clearErrorWrapper("prompts");
37119
+ listPromptsWrapper();
37120
+ },
37121
+ clearPrompts: () => {
37122
+ setPrompts([]);
37123
+ setNextPromptCursor(void 0);
37124
+ },
37125
+ getPrompt: (name, args2) => {
37126
+ clearErrorWrapper("prompts");
37127
+ getPromptWrapper(name, args2);
37128
+ },
37129
+ selectedPrompt,
37130
+ setSelectedPrompt: (prompt) => {
37131
+ clearErrorWrapper("prompts");
37132
+ setSelectedPrompt(prompt);
37133
+ setPromptContent("");
37134
+ },
37135
+ handleCompletion,
37136
+ completionsSupported,
37137
+ promptContent,
37138
+ nextCursor: nextPromptCursor,
37139
+ error: errors.prompts
37140
+ }
37141
+ ) }),
37142
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37143
+ ToolsTab,
37144
+ {
37145
+ tools,
37146
+ listTools: () => {
37147
+ clearErrorWrapper("tools");
37148
+ listToolsWrapper();
37149
+ },
37150
+ clearTools: () => {
37151
+ setTools([]);
37152
+ setNextToolCursor(void 0);
37153
+ },
37154
+ callTool: async (name, params) => {
37155
+ clearErrorWrapper("tools");
37156
+ setToolResult(null);
37157
+ await callToolWrapper(name, params);
37158
+ },
37159
+ selectedTool,
37160
+ setSelectedTool: (tool) => {
37161
+ clearErrorWrapper("tools");
37162
+ setSelectedTool(tool);
37163
+ setToolResult(null);
37164
+ },
37165
+ toolResult,
37166
+ nextCursor: nextToolCursor,
37167
+ error: errors.tools,
37168
+ connectionStatus
37169
+ }
37170
+ ) }),
37171
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "console", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConsoleTab, {}) }),
37172
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "ping", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37173
+ PingTab,
37174
+ {
37175
+ onPingClick: () => {
37176
+ void sendMCPRequestWrapper(
37177
+ {
37178
+ method: "ping"
37179
+ },
37180
+ EmptyResultSchema
37181
+ );
37182
+ }
37183
+ }
37184
+ ) }),
37185
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "sampling", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37186
+ SamplingTab,
37187
+ {
37188
+ pendingRequests: pendingSampleRequests,
37189
+ onApprove: handleApproveSamplingWrapper,
37190
+ onReject: handleRejectSamplingWrapper
37191
+ }
37192
+ ) }),
37193
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "roots", className: "mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37194
+ RootsTab,
37195
+ {
37196
+ roots,
37197
+ setRoots,
37198
+ onRootsChange: handleRootsChangeWrapper
37199
+ }
37200
+ ) }),
37201
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AuthDebuggerWrapper, {})
37202
+ ] });
37203
+ };
37204
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
37205
+ Tabs,
37206
+ {
37207
+ defaultValue: computeTabDefaultValue(),
37208
+ className: "flex-1 flex flex-col",
37209
+ onValueChange: (value) => window.location.hash = value,
37210
+ children: [
37211
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky top-0 z-10 bg-background/80 backdrop-blur-md border-b border-border/50 px-6 pt-4 pb-2", children: renderTabsList() }),
37212
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 p-6 overflow-auto", children: serverHasNoCapabilities ? renderServerNoCapabilities() : renderTabsContent() })
37213
+ ]
37214
+ }
37215
+ ) });
37216
+ };
37217
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-screen bg-gradient-to-br from-slate-50/50 to-slate-100/50 dark:from-slate-900/50 dark:to-slate-800/50 flex flex-col overflow-hidden app-container", children: [
37218
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-background/80 backdrop-blur-md border-b border-border/50 shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37219
+ ConnectionSection,
36833
37220
  {
36834
37221
  connectionStatus,
36835
37222
  transportType,
@@ -36852,278 +37239,27 @@ const App = () => {
36852
37239
  onDisconnect: disconnectMcpServer,
36853
37240
  stdErrNotifications,
36854
37241
  logLevel,
36855
- sendLogLevelRequest,
37242
+ sendLogLevelRequest: sendLogLevelRequestWrapper,
36856
37243
  loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
36857
- clearStdErrNotifications
37244
+ clearStdErrNotifications: clearStdErrNotificationsWrapper
36858
37245
  }
36859
- ),
36860
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
36861
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-auto", children: mcpClient ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
36862
- Tabs,
36863
- {
36864
- defaultValue: Object.keys(serverCapabilities ?? {}).includes(
36865
- window.location.hash.slice(1)
36866
- ) ? window.location.hash.slice(1) : (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping",
36867
- className: "w-full p-4",
36868
- onValueChange: (value) => window.location.hash = value,
36869
- children: [
36870
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "mb-4 p-0", children: [
36871
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
36872
- TabsTrigger,
36873
- {
36874
- value: "resources",
36875
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources),
36876
- children: [
36877
- /* @__PURE__ */ jsxRuntimeExports.jsx(Files, { className: "w-4 h-4 mr-2" }),
36878
- "Resources"
36879
- ]
36880
- }
36881
- ),
36882
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
36883
- TabsTrigger,
36884
- {
36885
- value: "prompts",
36886
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts),
36887
- children: [
36888
- /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-4 h-4 mr-2" }),
36889
- "Prompts"
36890
- ]
36891
- }
36892
- ),
36893
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
36894
- TabsTrigger,
36895
- {
36896
- value: "tools",
36897
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.tools),
36898
- children: [
36899
- /* @__PURE__ */ jsxRuntimeExports.jsx(Hammer, { className: "w-4 h-4 mr-2" }),
36900
- "Tools"
36901
- ]
36902
- }
36903
- ),
36904
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsTrigger, { value: "ping", children: [
36905
- /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "w-4 h-4 mr-2" }),
36906
- "Ping"
36907
- ] }),
36908
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsTrigger, { value: "sampling", className: "relative", children: [
36909
- /* @__PURE__ */ jsxRuntimeExports.jsx(Hash, { className: "w-4 h-4 mr-2" }),
36910
- "Sampling",
36911
- pendingSampleRequests.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center", children: pendingSampleRequests.length })
36912
- ] }),
36913
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsTrigger, { value: "roots", children: [
36914
- /* @__PURE__ */ jsxRuntimeExports.jsx(FolderTree, { className: "w-4 h-4 mr-2" }),
36915
- "Roots"
36916
- ] }),
36917
- /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsTrigger, { value: "auth", children: [
36918
- /* @__PURE__ */ jsxRuntimeExports.jsx(Key, { className: "w-4 h-4 mr-2" }),
36919
- "Auth"
36920
- ] })
36921
- ] }),
36922
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full", children: !(serverCapabilities == null ? void 0 : serverCapabilities.resources) && !(serverCapabilities == null ? void 0 : serverCapabilities.prompts) && !(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36923
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg text-gray-500", children: "The connected server does not support any MCP capabilities" }) }),
36924
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36925
- PingTab,
36926
- {
36927
- onPingClick: () => {
36928
- void sendMCPRequest(
36929
- {
36930
- method: "ping"
36931
- },
36932
- EmptyResultSchema
36933
- );
36934
- }
36935
- }
36936
- )
36937
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
36938
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36939
- ResourcesTab,
36940
- {
36941
- resources,
36942
- resourceTemplates,
36943
- listResources: () => {
36944
- clearError("resources");
36945
- listResources();
36946
- },
36947
- clearResources: () => {
36948
- setResources([]);
36949
- setNextResourceCursor(void 0);
36950
- },
36951
- listResourceTemplates: () => {
36952
- clearError("resources");
36953
- listResourceTemplates();
36954
- },
36955
- clearResourceTemplates: () => {
36956
- setResourceTemplates([]);
36957
- setNextResourceTemplateCursor(void 0);
36958
- },
36959
- readResource: (uri) => {
36960
- clearError("resources");
36961
- readResource(uri);
36962
- },
36963
- selectedResource,
36964
- setSelectedResource: (resource) => {
36965
- clearError("resources");
36966
- setSelectedResource(resource);
36967
- },
36968
- resourceSubscriptionsSupported: ((_a = serverCapabilities == null ? void 0 : serverCapabilities.resources) == null ? void 0 : _a.subscribe) || false,
36969
- resourceSubscriptions,
36970
- subscribeToResource: (uri) => {
36971
- clearError("resources");
36972
- subscribeToResource(uri);
36973
- },
36974
- unsubscribeFromResource: (uri) => {
36975
- clearError("resources");
36976
- unsubscribeFromResource(uri);
36977
- },
36978
- handleCompletion,
36979
- completionsSupported,
36980
- resourceContent,
36981
- nextCursor: nextResourceCursor,
36982
- nextTemplateCursor: nextResourceTemplateCursor,
36983
- error: errors.resources
36984
- }
36985
- ),
36986
- /* @__PURE__ */ jsxRuntimeExports.jsx(
36987
- PromptsTab,
36988
- {
36989
- prompts,
36990
- listPrompts: () => {
36991
- clearError("prompts");
36992
- listPrompts();
36993
- },
36994
- clearPrompts: () => {
36995
- setPrompts([]);
36996
- setNextPromptCursor(void 0);
36997
- },
36998
- getPrompt: (name, args2) => {
36999
- clearError("prompts");
37000
- getPrompt(name, args2);
37001
- },
37002
- selectedPrompt,
37003
- setSelectedPrompt: (prompt) => {
37004
- clearError("prompts");
37005
- setSelectedPrompt(prompt);
37006
- setPromptContent("");
37007
- },
37008
- handleCompletion,
37009
- completionsSupported,
37010
- promptContent,
37011
- nextCursor: nextPromptCursor,
37012
- error: errors.prompts
37013
- }
37014
- ),
37015
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37016
- ToolsTab,
37017
- {
37018
- tools,
37019
- listTools: () => {
37020
- clearError("tools");
37021
- listTools();
37022
- },
37023
- clearTools: () => {
37024
- setTools([]);
37025
- setNextToolCursor(void 0);
37026
- },
37027
- callTool: async (name, params) => {
37028
- clearError("tools");
37029
- setToolResult(null);
37030
- await callTool(name, params);
37031
- },
37032
- selectedTool,
37033
- setSelectedTool: (tool) => {
37034
- clearError("tools");
37035
- setSelectedTool(tool);
37036
- setToolResult(null);
37037
- },
37038
- toolResult,
37039
- nextCursor: nextToolCursor,
37040
- error: errors.tools
37041
- }
37042
- ),
37043
- /* @__PURE__ */ jsxRuntimeExports.jsx(ConsoleTab, {}),
37044
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37045
- PingTab,
37046
- {
37047
- onPingClick: () => {
37048
- void sendMCPRequest(
37049
- {
37050
- method: "ping"
37051
- },
37052
- EmptyResultSchema
37053
- );
37054
- }
37055
- }
37056
- ),
37057
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37058
- SamplingTab,
37059
- {
37060
- pendingRequests: pendingSampleRequests,
37061
- onApprove: handleApproveSampling,
37062
- onReject: handleRejectSampling
37063
- }
37064
- ),
37065
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37066
- RootsTab,
37067
- {
37068
- roots,
37069
- setRoots,
37070
- onRootsChange: handleRootsChange
37071
- }
37072
- ),
37073
- /* @__PURE__ */ jsxRuntimeExports.jsx(AuthDebuggerWrapper, {})
37074
- ] }) })
37075
- ]
37076
- }
37077
- ) : isAuthDebuggerVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(
37078
- Tabs,
37079
- {
37080
- defaultValue: "auth",
37081
- className: "w-full p-4",
37082
- onValueChange: (value) => window.location.hash = value,
37083
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(AuthDebuggerWrapper, {})
37084
- }
37085
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-4", children: [
37086
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg text-gray-500", children: "Connect to an MCP server to start inspecting" }),
37087
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
37088
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Need to configure authentication?" }),
37089
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37090
- Button,
37091
- {
37092
- variant: "outline",
37093
- size: "sm",
37094
- onClick: () => setIsAuthDebuggerVisible(true),
37095
- children: "Open Auth Settings"
37096
- }
37097
- )
37098
- ] })
37099
- ] }) }),
37100
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
37101
- "div",
37102
- {
37103
- className: "relative border-t border-border",
37104
- style: {
37105
- height: `${historyPaneHeight}px`
37106
- },
37107
- children: [
37108
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37109
- "div",
37110
- {
37111
- className: "absolute w-full h-4 -top-2 cursor-row-resize flex items-center justify-center hover:bg-accent/50",
37112
- onMouseDown: handleDragStart,
37113
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-1 rounded-full bg-border" })
37114
- }
37115
- ),
37116
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37117
- HistoryAndNotifications,
37118
- {
37119
- requestHistory,
37120
- serverNotifications: notifications
37121
- }
37122
- ) })
37123
- ]
37124
- }
37125
- )
37126
- ] })
37246
+ ) }),
37247
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-hidden overflow-y-auto", children: mcpClient ? renderTabs() : isAuthDebuggerVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37248
+ Tabs,
37249
+ {
37250
+ defaultValue: "auth",
37251
+ className: "h-full",
37252
+ onValueChange: (value) => window.location.hash = value,
37253
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(AuthDebuggerWrapper, {})
37254
+ }
37255
+ ) }) : null }),
37256
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37257
+ HistoryAndNotifications,
37258
+ {
37259
+ requestHistory,
37260
+ toolResult
37261
+ }
37262
+ )
37127
37263
  ] });
37128
37264
  };
37129
37265
  clientExports.createRoot(document.getElementById("root")).render(