@modelcontextprotocol/inspector 0.17.0 → 0.17.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,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
1
  function _mergeNamespaces(n, m2) {
5
2
  for (var i = 0; i < m2.length; i++) {
6
3
  const e = m2[i];
@@ -22,36 +19,28 @@ function _mergeNamespaces(n, m2) {
22
19
  }
23
20
  (function polyfill() {
24
21
  const relList = document.createElement("link").relList;
25
- if (relList && relList.supports && relList.supports("modulepreload")) {
26
- return;
27
- }
28
- for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
29
- processPreload(link);
30
- }
22
+ if (relList && relList.supports && relList.supports("modulepreload")) return;
23
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link);
31
24
  new MutationObserver((mutations) => {
32
25
  for (const mutation of mutations) {
33
- if (mutation.type !== "childList") {
34
- continue;
35
- }
36
- for (const node of mutation.addedNodes) {
37
- if (node.tagName === "LINK" && node.rel === "modulepreload")
38
- processPreload(node);
39
- }
26
+ if (mutation.type !== "childList") continue;
27
+ for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
40
28
  }
41
- }).observe(document, { childList: true, subtree: true });
29
+ }).observe(document, {
30
+ childList: true,
31
+ subtree: true
32
+ });
42
33
  function getFetchOpts(link) {
43
34
  const fetchOpts = {};
44
35
  if (link.integrity) fetchOpts.integrity = link.integrity;
45
36
  if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
46
- if (link.crossOrigin === "use-credentials")
47
- fetchOpts.credentials = "include";
37
+ if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
48
38
  else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
49
39
  else fetchOpts.credentials = "same-origin";
50
40
  return fetchOpts;
51
41
  }
52
42
  function processPreload(link) {
53
- if (link.ep)
54
- return;
43
+ if (link.ep) return;
55
44
  link.ep = true;
56
45
  const fetchOpts = getFetchOpts(link);
57
46
  fetch(link.href, fetchOpts);
@@ -7203,9 +7192,9 @@ var reactDomExports = requireReactDom();
7203
7192
  const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
7204
7193
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
7205
7194
  return function handleEvent(event) {
7206
- originalEventHandler == null ? void 0 : originalEventHandler(event);
7195
+ originalEventHandler?.(event);
7207
7196
  if (checkForDefaultPrevented === false || !event.defaultPrevented) {
7208
- return ourEventHandler == null ? void 0 : ourEventHandler(event);
7197
+ return ourEventHandler?.(event);
7209
7198
  }
7210
7199
  };
7211
7200
  }
@@ -7266,16 +7255,14 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
7266
7255
  const index2 = defaultContexts.length;
7267
7256
  defaultContexts = [...defaultContexts, defaultContext];
7268
7257
  const Provider2 = (props) => {
7269
- var _a;
7270
7258
  const { scope, children, ...context } = props;
7271
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
7259
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
7272
7260
  const value = reactExports.useMemo(() => context, Object.values(context));
7273
7261
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
7274
7262
  };
7275
7263
  Provider2.displayName = rootComponentName + "Provider";
7276
7264
  function useContext2(consumerName, scope) {
7277
- var _a;
7278
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
7265
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
7279
7266
  const context = reactExports.useContext(Context);
7280
7267
  if (context) return context;
7281
7268
  if (defaultContext !== void 0) return defaultContext;
@@ -7288,7 +7275,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
7288
7275
  return reactExports.createContext(defaultContext);
7289
7276
  });
7290
7277
  return function useScope(scope) {
7291
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
7278
+ const contexts = scope?.[scopeName] || scopeContexts;
7292
7279
  return reactExports.useMemo(
7293
7280
  () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
7294
7281
  [scope, contexts]
@@ -7398,13 +7385,12 @@ function mergeProps(slotProps, childProps) {
7398
7385
  return { ...slotProps, ...overrideProps };
7399
7386
  }
7400
7387
  function getElementRef$1(element) {
7401
- var _a, _b;
7402
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
7388
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7403
7389
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7404
7390
  if (mayWarn) {
7405
7391
  return element.ref;
7406
7392
  }
7407
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
7393
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
7408
7394
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7409
7395
  if (mayWarn) {
7410
7396
  return element.props.ref;
@@ -7513,12 +7499,9 @@ function useCallbackRef$1(callback) {
7513
7499
  reactExports.useEffect(() => {
7514
7500
  callbackRef.current = callback;
7515
7501
  });
7516
- return reactExports.useMemo(() => (...args) => {
7517
- var _a;
7518
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
7519
- }, []);
7502
+ return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []);
7520
7503
  }
7521
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7504
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
7522
7505
  const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
7523
7506
  reactExports.useEffect(() => {
7524
7507
  const handleKeyDown = (event) => {
@@ -7553,7 +7536,7 @@ var DismissableLayer = reactExports.forwardRef(
7553
7536
  } = props;
7554
7537
  const context = reactExports.useContext(DismissableLayerContext);
7555
7538
  const [node, setNode] = reactExports.useState(null);
7556
- const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
7539
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
7557
7540
  const [, force] = reactExports.useState({});
7558
7541
  const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
7559
7542
  const layers = Array.from(context.layers);
@@ -7566,22 +7549,22 @@ var DismissableLayer = reactExports.forwardRef(
7566
7549
  const target = event.target;
7567
7550
  const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
7568
7551
  if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
7569
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
7570
- onInteractOutside == null ? void 0 : onInteractOutside(event);
7571
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
7552
+ onPointerDownOutside?.(event);
7553
+ onInteractOutside?.(event);
7554
+ if (!event.defaultPrevented) onDismiss?.();
7572
7555
  }, ownerDocument);
7573
7556
  const focusOutside = useFocusOutside((event) => {
7574
7557
  const target = event.target;
7575
7558
  const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
7576
7559
  if (isFocusInBranch) return;
7577
- onFocusOutside == null ? void 0 : onFocusOutside(event);
7578
- onInteractOutside == null ? void 0 : onInteractOutside(event);
7579
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
7560
+ onFocusOutside?.(event);
7561
+ onInteractOutside?.(event);
7562
+ if (!event.defaultPrevented) onDismiss?.();
7580
7563
  }, ownerDocument);
7581
7564
  useEscapeKeydown((event) => {
7582
7565
  const isHighestLayer = index2 === context.layers.size - 1;
7583
7566
  if (!isHighestLayer) return;
7584
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
7567
+ onEscapeKeyDown?.(event);
7585
7568
  if (!event.defaultPrevented && onDismiss) {
7586
7569
  event.preventDefault();
7587
7570
  onDismiss();
@@ -7654,7 +7637,7 @@ var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
7654
7637
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
7655
7638
  });
7656
7639
  DismissableLayerBranch.displayName = BRANCH_NAME;
7657
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7640
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
7658
7641
  const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
7659
7642
  const isPointerInsideReactTreeRef = reactExports.useRef(false);
7660
7643
  const handleClickRef = reactExports.useRef(() => {
@@ -7697,7 +7680,7 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
7697
7680
  onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
7698
7681
  };
7699
7682
  }
7700
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7683
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
7701
7684
  const handleFocusOutside = useCallbackRef$1(onFocusOutside);
7702
7685
  const isFocusInsideReactTreeRef = reactExports.useRef(false);
7703
7686
  reactExports.useEffect(() => {
@@ -7733,15 +7716,14 @@ function handleAndDispatchCustomEvent$1(name2, handler, detail, { discrete }) {
7733
7716
  }
7734
7717
  var Root$6 = DismissableLayer;
7735
7718
  var Branch = DismissableLayerBranch;
7736
- var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
7719
+ var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => {
7737
7720
  };
7738
7721
  var PORTAL_NAME$4 = "Portal";
7739
7722
  var Portal$3 = reactExports.forwardRef((props, forwardedRef) => {
7740
- var _a;
7741
7723
  const { container: containerProp, ...portalProps } = props;
7742
7724
  const [mounted, setMounted] = reactExports.useState(false);
7743
7725
  useLayoutEffect2(() => setMounted(true), []);
7744
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
7726
+ const container = containerProp || mounted && globalThis?.document?.body;
7745
7727
  return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
7746
7728
  });
7747
7729
  Portal$3.displayName = PORTAL_NAME$4;
@@ -7792,7 +7774,7 @@ function usePresence(present) {
7792
7774
  const currentAnimationName = getAnimationName(styles);
7793
7775
  if (present) {
7794
7776
  send("MOUNT");
7795
- } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
7777
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
7796
7778
  send("UNMOUNT");
7797
7779
  } else {
7798
7780
  const isAnimating = prevAnimationName !== currentAnimationName;
@@ -7852,16 +7834,15 @@ function usePresence(present) {
7852
7834
  };
7853
7835
  }
7854
7836
  function getAnimationName(styles) {
7855
- return (styles == null ? void 0 : styles.animationName) || "none";
7837
+ return styles?.animationName || "none";
7856
7838
  }
7857
7839
  function getElementRef(element) {
7858
- var _a, _b;
7859
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
7840
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7860
7841
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7861
7842
  if (mayWarn) {
7862
7843
  return element.ref;
7863
7844
  }
7864
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
7845
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
7865
7846
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7866
7847
  if (mayWarn) {
7867
7848
  return element.props.ref;
@@ -7898,11 +7879,10 @@ function useControllableState({
7898
7879
  }
7899
7880
  const setValue = reactExports.useCallback(
7900
7881
  (nextValue) => {
7901
- var _a;
7902
7882
  if (isControlled) {
7903
7883
  const value2 = isFunction$1(nextValue) ? nextValue(prop) : nextValue;
7904
7884
  if (value2 !== prop) {
7905
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
7885
+ onChangeRef.current?.(value2);
7906
7886
  }
7907
7887
  } else {
7908
7888
  setUncontrolledProp(nextValue);
@@ -7923,9 +7903,8 @@ function useUncontrolledState({
7923
7903
  onChangeRef.current = onChange;
7924
7904
  }, [onChange]);
7925
7905
  reactExports.useEffect(() => {
7926
- var _a;
7927
7906
  if (prevValueRef.current !== value) {
7928
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
7907
+ onChangeRef.current?.(value);
7929
7908
  prevValueRef.current = value;
7930
7909
  }
7931
7910
  }, [value, prevValueRef]);
@@ -8027,9 +8006,8 @@ var ToastViewport$1 = reactExports.forwardRef(
8027
8006
  const hasToasts = context.toastCount > 0;
8028
8007
  reactExports.useEffect(() => {
8029
8008
  const handleKeyDown = (event) => {
8030
- var _a;
8031
8009
  const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);
8032
- if (isHotkeyPressed) (_a = ref2.current) == null ? void 0 : _a.focus();
8010
+ if (isHotkeyPressed) ref2.current?.focus();
8033
8011
  };
8034
8012
  document.addEventListener("keydown", handleKeyDown);
8035
8013
  return () => document.removeEventListener("keydown", handleKeyDown);
@@ -8092,7 +8070,6 @@ var ToastViewport$1 = reactExports.forwardRef(
8092
8070
  const viewport = ref2.current;
8093
8071
  if (viewport) {
8094
8072
  const handleKeyDown = (event) => {
8095
- var _a, _b, _c;
8096
8073
  const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
8097
8074
  const isTabKey = event.key === "Tab" && !isMetaKey;
8098
8075
  if (isTabKey) {
@@ -8100,7 +8077,7 @@ var ToastViewport$1 = reactExports.forwardRef(
8100
8077
  const isTabbingBackwards = event.shiftKey;
8101
8078
  const targetIsViewport = event.target === viewport;
8102
8079
  if (targetIsViewport && isTabbingBackwards) {
8103
- (_a = headFocusProxyRef.current) == null ? void 0 : _a.focus();
8080
+ headFocusProxyRef.current?.focus();
8104
8081
  return;
8105
8082
  }
8106
8083
  const tabbingDirection = isTabbingBackwards ? "backwards" : "forwards";
@@ -8109,7 +8086,7 @@ var ToastViewport$1 = reactExports.forwardRef(
8109
8086
  if (focusFirst$2(sortedCandidates.slice(index2 + 1))) {
8110
8087
  event.preventDefault();
8111
8088
  } else {
8112
- isTabbingBackwards ? (_b = headFocusProxyRef.current) == null ? void 0 : _b.focus() : (_c = tailFocusProxyRef.current) == null ? void 0 : _c.focus();
8089
+ isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();
8113
8090
  }
8114
8091
  }
8115
8092
  };
@@ -8170,9 +8147,8 @@ var FocusProxy = reactExports.forwardRef(
8170
8147
  ref: forwardedRef,
8171
8148
  style: { position: "fixed" },
8172
8149
  onFocus: (event) => {
8173
- var _a;
8174
8150
  const prevFocusedElement = event.relatedTarget;
8175
- const isFocusFromOutsideViewport = !((_a = context.viewport) == null ? void 0 : _a.contains(prevFocusedElement));
8151
+ const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);
8176
8152
  if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();
8177
8153
  }
8178
8154
  }
@@ -8265,9 +8241,8 @@ var ToastImpl = reactExports.forwardRef(
8265
8241
  const closeTimerRef = reactExports.useRef(0);
8266
8242
  const { onToastAdd, onToastRemove } = context;
8267
8243
  const handleClose = useCallbackRef$1(() => {
8268
- var _a;
8269
- const isFocusInToast = node == null ? void 0 : node.contains(document.activeElement);
8270
- if (isFocusInToast) (_a = context.viewport) == null ? void 0 : _a.focus();
8244
+ const isFocusInToast = node?.contains(document.activeElement);
8245
+ if (isFocusInToast) context.viewport?.focus();
8271
8246
  onClose();
8272
8247
  });
8273
8248
  const startTimer = reactExports.useCallback(
@@ -8284,13 +8259,13 @@ var ToastImpl = reactExports.forwardRef(
8284
8259
  if (viewport) {
8285
8260
  const handleResume = () => {
8286
8261
  startTimer(closeTimerRemainingTimeRef.current);
8287
- onResume == null ? void 0 : onResume();
8262
+ onResume?.();
8288
8263
  };
8289
8264
  const handlePause = () => {
8290
8265
  const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
8291
8266
  closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;
8292
8267
  window.clearTimeout(closeTimerRef.current);
8293
- onPause == null ? void 0 : onPause();
8268
+ onPause?.();
8294
8269
  };
8295
8270
  viewport.addEventListener(VIEWPORT_PAUSE, handlePause);
8296
8271
  viewport.addEventListener(VIEWPORT_RESUME, handleResume);
@@ -8341,7 +8316,7 @@ var ToastImpl = reactExports.forwardRef(
8341
8316
  style: { userSelect: "none", touchAction: "none", ...props.style },
8342
8317
  onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
8343
8318
  if (event.key !== "Escape") return;
8344
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event.nativeEvent);
8319
+ onEscapeKeyDown?.(event.nativeEvent);
8345
8320
  if (!event.nativeEvent.defaultPrevented) {
8346
8321
  context.isFocusedToastEscapeKeyDownRef.current = true;
8347
8322
  handleClose();
@@ -8655,7 +8630,6 @@ const createClassGroupUtils = (config) => {
8655
8630
  };
8656
8631
  };
8657
8632
  const getGroupRecursive = (classParts, classPartObject) => {
8658
- var _a;
8659
8633
  if (classParts.length === 0) {
8660
8634
  return classPartObject.classGroupId;
8661
8635
  }
@@ -8669,15 +8643,15 @@ const getGroupRecursive = (classParts, classPartObject) => {
8669
8643
  return void 0;
8670
8644
  }
8671
8645
  const classRest = classParts.join(CLASS_PART_SEPARATOR);
8672
- return (_a = classPartObject.validators.find(({
8646
+ return classPartObject.validators.find(({
8673
8647
  validator
8674
- }) => validator(classRest))) == null ? void 0 : _a.classGroupId;
8648
+ }) => validator(classRest))?.classGroupId;
8675
8649
  };
8676
8650
  const arbitraryPropertyRegex = /^\[(.+)\]$/;
8677
8651
  const getGroupIdForArbitraryProperty = (className) => {
8678
8652
  if (arbitraryPropertyRegex.test(className)) {
8679
8653
  const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
8680
- const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
8654
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
8681
8655
  if (property) {
8682
8656
  return "arbitrary.." + property;
8683
8657
  }
@@ -11316,63 +11290,43 @@ const seen = {};
11316
11290
  const __vitePreload = function preload(baseModule, deps, importerUrl) {
11317
11291
  let promise = Promise.resolve();
11318
11292
  if (deps && deps.length > 0) {
11319
- let allSettled2 = function(promises) {
11320
- return Promise.all(
11321
- promises.map(
11322
- (p2) => Promise.resolve(p2).then(
11323
- (value) => ({ status: "fulfilled", value }),
11324
- (reason) => ({ status: "rejected", reason })
11325
- )
11326
- )
11327
- );
11293
+ let allSettled = function(promises$2) {
11294
+ return Promise.all(promises$2.map((p2) => Promise.resolve(p2).then((value$1) => ({
11295
+ status: "fulfilled",
11296
+ value: value$1
11297
+ }), (reason) => ({
11298
+ status: "rejected",
11299
+ reason
11300
+ }))));
11328
11301
  };
11329
11302
  document.getElementsByTagName("link");
11330
- const cspNonceMeta = document.querySelector(
11331
- "meta[property=csp-nonce]"
11332
- );
11333
- const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
11334
- promise = allSettled2(
11335
- deps.map((dep) => {
11336
- dep = assetsURL(dep);
11337
- if (dep in seen) return;
11338
- seen[dep] = true;
11339
- const isCss = dep.endsWith(".css");
11340
- const cssSelector = isCss ? '[rel="stylesheet"]' : "";
11341
- if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
11342
- return;
11343
- }
11344
- const link = document.createElement("link");
11345
- link.rel = isCss ? "stylesheet" : scriptRel;
11346
- if (!isCss) {
11347
- link.as = "script";
11348
- }
11349
- link.crossOrigin = "";
11350
- link.href = dep;
11351
- if (cspNonce) {
11352
- link.setAttribute("nonce", cspNonce);
11353
- }
11354
- document.head.appendChild(link);
11355
- if (isCss) {
11356
- return new Promise((res, rej) => {
11357
- link.addEventListener("load", res);
11358
- link.addEventListener(
11359
- "error",
11360
- () => rej(new Error(`Unable to preload CSS for ${dep}`))
11361
- );
11362
- });
11363
- }
11364
- })
11365
- );
11303
+ const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
11304
+ const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
11305
+ promise = allSettled(deps.map((dep) => {
11306
+ dep = assetsURL(dep);
11307
+ if (dep in seen) return;
11308
+ seen[dep] = true;
11309
+ const isCss = dep.endsWith(".css");
11310
+ const cssSelector = isCss ? '[rel="stylesheet"]' : "";
11311
+ if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
11312
+ const link = document.createElement("link");
11313
+ link.rel = isCss ? "stylesheet" : scriptRel;
11314
+ if (!isCss) link.as = "script";
11315
+ link.crossOrigin = "";
11316
+ link.href = dep;
11317
+ if (cspNonce) link.setAttribute("nonce", cspNonce);
11318
+ document.head.appendChild(link);
11319
+ if (isCss) return new Promise((res, rej) => {
11320
+ link.addEventListener("load", res);
11321
+ link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
11322
+ });
11323
+ }));
11366
11324
  }
11367
- function handlePreloadError(err) {
11368
- const e = new Event("vite:preloadError", {
11369
- cancelable: true
11370
- });
11371
- e.payload = err;
11372
- window.dispatchEvent(e);
11373
- if (!e.defaultPrevented) {
11374
- throw err;
11375
- }
11325
+ function handlePreloadError(err$2) {
11326
+ const e$1 = new Event("vite:preloadError", { cancelable: true });
11327
+ e$1.payload = err$2;
11328
+ window.dispatchEvent(e$1);
11329
+ if (!e$1.defaultPrevented) throw err$2;
11376
11330
  }
11377
11331
  return promise.then((res) => {
11378
11332
  for (const item of res || []) {
@@ -11840,7 +11794,7 @@ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
11840
11794
  var errorUtil;
11841
11795
  (function(errorUtil2) {
11842
11796
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
11843
- errorUtil2.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
11797
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
11844
11798
  })(errorUtil || (errorUtil = {}));
11845
11799
  class ParseInputLazyPath {
11846
11800
  constructor(parent, value, path, key) {
@@ -11954,10 +11908,10 @@ class ZodType {
11954
11908
  const ctx = {
11955
11909
  common: {
11956
11910
  issues: [],
11957
- async: (params == null ? void 0 : params.async) ?? false,
11958
- contextualErrorMap: params == null ? void 0 : params.errorMap
11911
+ async: params?.async ?? false,
11912
+ contextualErrorMap: params?.errorMap
11959
11913
  },
11960
- path: (params == null ? void 0 : params.path) || [],
11914
+ path: params?.path || [],
11961
11915
  schemaErrorMap: this._def.errorMap,
11962
11916
  parent: null,
11963
11917
  data: data2,
@@ -11967,7 +11921,6 @@ class ZodType {
11967
11921
  return handleResult(ctx, result);
11968
11922
  }
11969
11923
  "~validate"(data2) {
11970
- var _a, _b;
11971
11924
  const ctx = {
11972
11925
  common: {
11973
11926
  issues: [],
@@ -11988,7 +11941,7 @@ class ZodType {
11988
11941
  issues: ctx.common.issues
11989
11942
  };
11990
11943
  } catch (err) {
11991
- if ((_b = (_a = err == null ? void 0 : err.message) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("encountered")) {
11944
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
11992
11945
  this["~standard"].async = true;
11993
11946
  }
11994
11947
  ctx.common = {
@@ -12013,10 +11966,10 @@ class ZodType {
12013
11966
  const ctx = {
12014
11967
  common: {
12015
11968
  issues: [],
12016
- contextualErrorMap: params == null ? void 0 : params.errorMap,
11969
+ contextualErrorMap: params?.errorMap,
12017
11970
  async: true
12018
11971
  },
12019
- path: (params == null ? void 0 : params.path) || [],
11972
+ path: params?.path || [],
12020
11973
  schemaErrorMap: this._def.errorMap,
12021
11974
  parent: null,
12022
11975
  data: data2,
@@ -12247,7 +12200,7 @@ function isValidJWT(jwt, alg) {
12247
12200
  const decoded = JSON.parse(atob(base64));
12248
12201
  if (typeof decoded !== "object" || decoded === null)
12249
12202
  return false;
12250
- if ("typ" in decoded && (decoded == null ? void 0 : decoded.typ) !== "JWT")
12203
+ if ("typ" in decoded && decoded?.typ !== "JWT")
12251
12204
  return false;
12252
12205
  if (!decoded.alg)
12253
12206
  return false;
@@ -12636,10 +12589,10 @@ class ZodString extends ZodType {
12636
12589
  }
12637
12590
  return this._addCheck({
12638
12591
  kind: "datetime",
12639
- precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
12640
- offset: (options == null ? void 0 : options.offset) ?? false,
12641
- local: (options == null ? void 0 : options.local) ?? false,
12642
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12592
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
12593
+ offset: options?.offset ?? false,
12594
+ local: options?.local ?? false,
12595
+ ...errorUtil.errToObj(options?.message)
12643
12596
  });
12644
12597
  }
12645
12598
  date(message) {
@@ -12655,8 +12608,8 @@ class ZodString extends ZodType {
12655
12608
  }
12656
12609
  return this._addCheck({
12657
12610
  kind: "time",
12658
- precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
12659
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12611
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
12612
+ ...errorUtil.errToObj(options?.message)
12660
12613
  });
12661
12614
  }
12662
12615
  duration(message) {
@@ -12673,8 +12626,8 @@ class ZodString extends ZodType {
12673
12626
  return this._addCheck({
12674
12627
  kind: "includes",
12675
12628
  value,
12676
- position: options == null ? void 0 : options.position,
12677
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12629
+ position: options?.position,
12630
+ ...errorUtil.errToObj(options?.message)
12678
12631
  });
12679
12632
  }
12680
12633
  startsWith(value, message) {
@@ -12809,7 +12762,7 @@ ZodString.create = (params) => {
12809
12762
  return new ZodString({
12810
12763
  checks: [],
12811
12764
  typeName: ZodFirstPartyTypeKind.ZodString,
12812
- coerce: (params == null ? void 0 : params.coerce) ?? false,
12765
+ coerce: params?.coerce ?? false,
12813
12766
  ...processCreateParams(params)
12814
12767
  });
12815
12768
  };
@@ -13049,7 +13002,7 @@ ZodNumber.create = (params) => {
13049
13002
  return new ZodNumber({
13050
13003
  checks: [],
13051
13004
  typeName: ZodFirstPartyTypeKind.ZodNumber,
13052
- coerce: (params == null ? void 0 : params.coerce) || false,
13005
+ coerce: params?.coerce || false,
13053
13006
  ...processCreateParams(params)
13054
13007
  });
13055
13008
  };
@@ -13221,7 +13174,7 @@ ZodBigInt.create = (params) => {
13221
13174
  return new ZodBigInt({
13222
13175
  checks: [],
13223
13176
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
13224
- coerce: (params == null ? void 0 : params.coerce) ?? false,
13177
+ coerce: params?.coerce ?? false,
13225
13178
  ...processCreateParams(params)
13226
13179
  });
13227
13180
  };
@@ -13246,7 +13199,7 @@ class ZodBoolean extends ZodType {
13246
13199
  ZodBoolean.create = (params) => {
13247
13200
  return new ZodBoolean({
13248
13201
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
13249
- coerce: (params == null ? void 0 : params.coerce) || false,
13202
+ coerce: params?.coerce || false,
13250
13203
  ...processCreateParams(params)
13251
13204
  });
13252
13205
  };
@@ -13354,7 +13307,7 @@ class ZodDate extends ZodType {
13354
13307
  ZodDate.create = (params) => {
13355
13308
  return new ZodDate({
13356
13309
  checks: [],
13357
- coerce: (params == null ? void 0 : params.coerce) || false,
13310
+ coerce: params?.coerce || false,
13358
13311
  typeName: ZodFirstPartyTypeKind.ZodDate,
13359
13312
  ...processCreateParams(params)
13360
13313
  });
@@ -13728,8 +13681,7 @@ class ZodObject extends ZodType {
13728
13681
  unknownKeys: "strict",
13729
13682
  ...message !== void 0 ? {
13730
13683
  errorMap: (issue, ctx) => {
13731
- var _a, _b;
13732
- const defaultError = ((_b = (_a = this._def).errorMap) == null ? void 0 : _b.call(_a, issue, ctx).message) ?? ctx.defaultError;
13684
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
13733
13685
  if (issue.code === "unrecognized_keys")
13734
13686
  return {
13735
13687
  message: errorUtil.errToObj(message).message ?? defaultError
@@ -15123,12 +15075,7 @@ const optionalType = ZodOptional.create;
15123
15075
  ZodNullable.create;
15124
15076
  const NEVER = INVALID;
15125
15077
  const LATEST_PROTOCOL_VERSION = "2025-06-18";
15126
- const SUPPORTED_PROTOCOL_VERSIONS = [
15127
- LATEST_PROTOCOL_VERSION,
15128
- "2025-03-26",
15129
- "2024-11-05",
15130
- "2024-10-07"
15131
- ];
15078
+ const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
15132
15079
  const JSONRPC_VERSION = "2.0";
15133
15080
  const ProgressTokenSchema = unionType([stringType(), numberType().int()]);
15134
15081
  const CursorSchema = stringType();
@@ -15208,12 +15155,7 @@ const JSONRPCErrorSchema = objectType({
15208
15155
  })
15209
15156
  }).strict();
15210
15157
  const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
15211
- const JSONRPCMessageSchema = unionType([
15212
- JSONRPCRequestSchema,
15213
- JSONRPCNotificationSchema,
15214
- JSONRPCResponseSchema,
15215
- JSONRPCErrorSchema
15216
- ]);
15158
+ const JSONRPCMessageSchema = unionType([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
15217
15159
  const EmptyResultSchema = ResultSchema.strict();
15218
15160
  const CancelledNotificationSchema = NotificationSchema.extend({
15219
15161
  method: literalType("notifications/cancelled"),
@@ -15240,21 +15182,38 @@ const IconSchema = objectType({
15240
15182
  */
15241
15183
  mimeType: optionalType(stringType()),
15242
15184
  /**
15243
- * Optional string specifying icon dimensions (e.g., "48x48 96x96").
15185
+ * Optional array of strings that specify sizes at which the icon can be used.
15186
+ * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
15187
+ *
15188
+ * If not provided, the client should assume that the icon can be used at any size.
15189
+ */
15190
+ sizes: optionalType(arrayType(stringType()))
15191
+ }).passthrough();
15192
+ const IconsSchema = objectType({
15193
+ /**
15194
+ * Optional set of sized icons that the client can display in a user interface.
15195
+ *
15196
+ * Clients that support rendering icons MUST support at least the following MIME types:
15197
+ * - `image/png` - PNG images (safe, universal compatibility)
15198
+ * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
15199
+ *
15200
+ * Clients that support rendering icons SHOULD also support:
15201
+ * - `image/svg+xml` - SVG images (scalable but requires security precautions)
15202
+ * - `image/webp` - WebP images (modern, efficient format)
15244
15203
  */
15245
- sizes: optionalType(stringType())
15204
+ icons: arrayType(IconSchema).optional()
15246
15205
  }).passthrough();
15247
15206
  const BaseMetadataSchema = objectType({
15248
15207
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
15249
15208
  name: stringType(),
15250
15209
  /**
15251
- * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
15252
- * even by those unfamiliar with domain-specific terminology.
15253
- *
15254
- * If not provided, the name should be used for display (except for Tool,
15255
- * where `annotations.title` should be given precedence over using `name`,
15256
- * if present).
15257
- */
15210
+ * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
15211
+ * even by those unfamiliar with domain-specific terminology.
15212
+ *
15213
+ * If not provided, the name should be used for display (except for Tool,
15214
+ * where `annotations.title` should be given precedence over using `name`,
15215
+ * if present).
15216
+ */
15258
15217
  title: optionalType(stringType())
15259
15218
  }).passthrough();
15260
15219
  const ImplementationSchema = BaseMetadataSchema.extend({
@@ -15262,17 +15221,8 @@ const ImplementationSchema = BaseMetadataSchema.extend({
15262
15221
  /**
15263
15222
  * An optional URL of the website for this implementation.
15264
15223
  */
15265
- websiteUrl: optionalType(stringType()),
15266
- /**
15267
- * An optional list of icons for this implementation.
15268
- * This can be used by clients to display the implementation in a user interface.
15269
- * Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
15270
- * The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
15271
- * The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
15272
- * The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
15273
- */
15274
- icons: optionalType(arrayType(IconSchema))
15275
- });
15224
+ websiteUrl: optionalType(stringType())
15225
+ }).merge(IconsSchema);
15276
15226
  const ClientCapabilitiesSchema = objectType({
15277
15227
  /**
15278
15228
  * Experimental, non-standard capabilities that the client supports.
@@ -15462,16 +15412,12 @@ const ResourceSchema = BaseMetadataSchema.extend({
15462
15412
  * The MIME type of this resource, if known.
15463
15413
  */
15464
15414
  mimeType: optionalType(stringType()),
15465
- /**
15466
- * An optional list of icons for this resource.
15467
- */
15468
- icons: optionalType(arrayType(IconSchema)),
15469
15415
  /**
15470
15416
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15471
15417
  * for notes on _meta usage.
15472
15418
  */
15473
15419
  _meta: optionalType(objectType({}).passthrough())
15474
- });
15420
+ }).merge(IconsSchema);
15475
15421
  const ResourceTemplateSchema = BaseMetadataSchema.extend({
15476
15422
  /**
15477
15423
  * A URI template (according to RFC 6570) that can be used to construct resource URIs.
@@ -15492,7 +15438,7 @@ const ResourceTemplateSchema = BaseMetadataSchema.extend({
15492
15438
  * for notes on _meta usage.
15493
15439
  */
15494
15440
  _meta: optionalType(objectType({}).passthrough())
15495
- });
15441
+ }).merge(IconsSchema);
15496
15442
  const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
15497
15443
  method: literalType("resources/list")
15498
15444
  });
@@ -15570,16 +15516,12 @@ const PromptSchema = BaseMetadataSchema.extend({
15570
15516
  * A list of arguments to use for templating the prompt.
15571
15517
  */
15572
15518
  arguments: optionalType(arrayType(PromptArgumentSchema)),
15573
- /**
15574
- * An optional list of icons for this prompt.
15575
- */
15576
- icons: optionalType(arrayType(IconSchema)),
15577
15519
  /**
15578
15520
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15579
15521
  * for notes on _meta usage.
15580
15522
  */
15581
15523
  _meta: optionalType(objectType({}).passthrough())
15582
- });
15524
+ }).merge(IconsSchema);
15583
15525
  const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
15584
15526
  method: literalType("prompts/list")
15585
15527
  });
@@ -15741,16 +15683,12 @@ const ToolSchema = BaseMetadataSchema.extend({
15741
15683
  * Optional additional tool information.
15742
15684
  */
15743
15685
  annotations: optionalType(ToolAnnotationsSchema),
15744
- /**
15745
- * An optional list of icons for this tool.
15746
- */
15747
- icons: optionalType(arrayType(IconSchema)),
15748
15686
  /**
15749
15687
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15750
15688
  * for notes on _meta usage.
15751
15689
  */
15752
15690
  _meta: optionalType(objectType({}).passthrough())
15753
- });
15691
+ }).merge(IconsSchema);
15754
15692
  const ListToolsRequestSchema = PaginatedRequestSchema.extend({
15755
15693
  method: literalType("tools/list")
15756
15694
  });
@@ -15800,16 +15738,7 @@ const CallToolRequestSchema = RequestSchema.extend({
15800
15738
  const ToolListChangedNotificationSchema = NotificationSchema.extend({
15801
15739
  method: literalType("notifications/tools/list_changed")
15802
15740
  });
15803
- const LoggingLevelSchema = enumType([
15804
- "debug",
15805
- "info",
15806
- "notice",
15807
- "warning",
15808
- "error",
15809
- "critical",
15810
- "alert",
15811
- "emergency"
15812
- ]);
15741
+ const LoggingLevelSchema = enumType(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
15813
15742
  const SetLevelRequestSchema = RequestSchema.extend({
15814
15743
  method: literalType("logging/setLevel"),
15815
15744
  params: BaseRequestParamsSchema.extend({
@@ -15902,11 +15831,7 @@ const CreateMessageResultSchema = ResultSchema.extend({
15902
15831
  */
15903
15832
  stopReason: optionalType(enumType(["endTurn", "stopSequence", "maxTokens"]).or(stringType())),
15904
15833
  role: enumType(["user", "assistant"]),
15905
- content: discriminatedUnionType("type", [
15906
- TextContentSchema,
15907
- ImageContentSchema,
15908
- AudioContentSchema
15909
- ])
15834
+ content: discriminatedUnionType("type", [TextContentSchema, ImageContentSchema, AudioContentSchema])
15910
15835
  });
15911
15836
  const BooleanSchemaSchema = objectType({
15912
15837
  type: literalType("boolean"),
@@ -15936,12 +15861,7 @@ const EnumSchemaSchema = objectType({
15936
15861
  enum: arrayType(stringType()),
15937
15862
  enumNames: optionalType(arrayType(stringType()))
15938
15863
  }).passthrough();
15939
- const PrimitiveSchemaDefinitionSchema = unionType([
15940
- BooleanSchemaSchema,
15941
- StringSchemaSchema,
15942
- NumberSchemaSchema,
15943
- EnumSchemaSchema
15944
- ]);
15864
+ const PrimitiveSchemaDefinitionSchema = unionType([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
15945
15865
  const ElicitRequestSchema = RequestSchema.extend({
15946
15866
  method: literalType("elicitation/create"),
15947
15867
  params: BaseRequestParamsSchema.extend({
@@ -16069,18 +15989,8 @@ unionType([
16069
15989
  InitializedNotificationSchema,
16070
15990
  RootsListChangedNotificationSchema
16071
15991
  ]);
16072
- unionType([
16073
- EmptyResultSchema,
16074
- CreateMessageResultSchema,
16075
- ElicitResultSchema,
16076
- ListRootsResultSchema
16077
- ]);
16078
- unionType([
16079
- PingRequestSchema,
16080
- CreateMessageRequestSchema,
16081
- ElicitRequestSchema,
16082
- ListRootsRequestSchema
16083
- ]);
15992
+ unionType([EmptyResultSchema, CreateMessageResultSchema, ElicitResultSchema, ListRootsResultSchema]);
15993
+ unionType([PingRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema]);
16084
15994
  unionType([
16085
15995
  CancelledNotificationSchema,
16086
15996
  ProgressNotificationSchema,
@@ -16213,6 +16123,7 @@ const OAuthErrorResponseSchema = objectType({
16213
16123
  error_description: stringType().optional(),
16214
16124
  error_uri: stringType().optional()
16215
16125
  });
16126
+ const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literalType("").transform(() => void 0));
16216
16127
  const OAuthClientMetadataSchema = objectType({
16217
16128
  redirect_uris: arrayType(SafeUrlSchema),
16218
16129
  token_endpoint_auth_method: stringType().optional(),
@@ -16220,10 +16131,10 @@ const OAuthClientMetadataSchema = objectType({
16220
16131
  response_types: arrayType(stringType()).optional(),
16221
16132
  client_name: stringType().optional(),
16222
16133
  client_uri: SafeUrlSchema.optional(),
16223
- logo_uri: SafeUrlSchema.optional(),
16134
+ logo_uri: OptionalSafeUrlSchema,
16224
16135
  scope: stringType().optional(),
16225
16136
  contacts: arrayType(stringType()).optional(),
16226
- tos_uri: SafeUrlSchema.optional(),
16137
+ tos_uri: OptionalSafeUrlSchema,
16227
16138
  policy_uri: stringType().optional(),
16228
16139
  jwks_uri: SafeUrlSchema.optional(),
16229
16140
  jwks: anyType().optional(),
@@ -16247,7 +16158,7 @@ objectType({
16247
16158
  token_type_hint: stringType().optional()
16248
16159
  }).strip();
16249
16160
  const name = "@modelcontextprotocol/inspector-client";
16250
- const version$1 = "0.17.0";
16161
+ const version$1 = "0.17.2";
16251
16162
  const packageJson = {
16252
16163
  name,
16253
16164
  version: version$1
@@ -16274,8 +16185,9 @@ const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
16274
16185
  const DEFAULT_INSPECTOR_CONFIG = {
16275
16186
  MCP_SERVER_REQUEST_TIMEOUT: {
16276
16187
  label: "Request Timeout",
16277
- description: "Timeout for requests to the MCP server (ms)",
16278
- value: 1e4,
16188
+ description: "Client-side timeout (ms) - Inspector will cancel requests after this time",
16189
+ value: 3e5,
16190
+ // 5 minutes - increased to support elicitation and other long-running tools
16279
16191
  is_session_item: false
16280
16192
  },
16281
16193
  MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
@@ -16466,6 +16378,8 @@ class UnauthorizedError extends Error {
16466
16378
  super(message !== null && message !== void 0 ? message : "Unauthorized");
16467
16379
  }
16468
16380
  }
16381
+ const AUTHORIZATION_CODE_RESPONSE_TYPE = "code";
16382
+ const AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
16469
16383
  function selectClientAuthMethod(clientInformation, supportedMethods) {
16470
16384
  const hasClientSecret = clientInformation.client_secret !== void 0;
16471
16385
  if (supportedMethods.length === 0) {
@@ -16755,8 +16669,10 @@ function buildDiscoveryUrls(authorizationServerUrl) {
16755
16669
  return urlsToTry;
16756
16670
  }
16757
16671
  async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
16758
- var _a;
16759
- const headers = { "MCP-Protocol-Version": protocolVersion };
16672
+ const headers = {
16673
+ "MCP-Protocol-Version": protocolVersion,
16674
+ Accept: "application/json"
16675
+ };
16760
16676
  const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
16761
16677
  for (const { url: endpointUrl, type: type2 } of urlsToTry) {
16762
16678
  const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
@@ -16772,26 +16688,20 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
16772
16688
  if (type2 === "oauth") {
16773
16689
  return OAuthMetadataSchema.parse(await response.json());
16774
16690
  } else {
16775
- const metadata = OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
16776
- if (!((_a = metadata.code_challenge_methods_supported) === null || _a === void 0 ? void 0 : _a.includes("S256"))) {
16777
- throw new Error(`Incompatible OIDC provider at ${endpointUrl}: does not support S256 code challenge method required by MCP specification`);
16778
- }
16779
- return metadata;
16691
+ return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
16780
16692
  }
16781
16693
  }
16782
16694
  return void 0;
16783
16695
  }
16784
16696
  async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
16785
- const responseType = "code";
16786
- const codeChallengeMethod = "S256";
16787
16697
  let authorizationUrl;
16788
16698
  if (metadata) {
16789
16699
  authorizationUrl = new URL(metadata.authorization_endpoint);
16790
- if (!metadata.response_types_supported.includes(responseType)) {
16791
- throw new Error(`Incompatible auth server: does not support response type ${responseType}`);
16700
+ if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) {
16701
+ throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
16792
16702
  }
16793
- if (!metadata.code_challenge_methods_supported || !metadata.code_challenge_methods_supported.includes(codeChallengeMethod)) {
16794
- throw new Error(`Incompatible auth server: does not support code challenge method ${codeChallengeMethod}`);
16703
+ if (metadata.code_challenge_methods_supported && !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) {
16704
+ throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
16795
16705
  }
16796
16706
  } else {
16797
16707
  authorizationUrl = new URL("/authorize", authorizationServerUrl);
@@ -16799,10 +16709,10 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
16799
16709
  const challenge = await pkceChallenge();
16800
16710
  const codeVerifier = challenge.code_verifier;
16801
16711
  const codeChallenge = challenge.code_challenge;
16802
- authorizationUrl.searchParams.set("response_type", responseType);
16712
+ authorizationUrl.searchParams.set("response_type", AUTHORIZATION_CODE_RESPONSE_TYPE);
16803
16713
  authorizationUrl.searchParams.set("client_id", clientInformation.client_id);
16804
16714
  authorizationUrl.searchParams.set("code_challenge", codeChallenge);
16805
- authorizationUrl.searchParams.set("code_challenge_method", codeChallengeMethod);
16715
+ authorizationUrl.searchParams.set("code_challenge_method", AUTHORIZATION_CODE_CHALLENGE_METHOD);
16806
16716
  authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
16807
16717
  if (state) {
16808
16718
  authorizationUrl.searchParams.set("state", state);
@@ -16827,7 +16737,7 @@ async function exchangeAuthorization(authorizationServerUrl, { metadata, clientI
16827
16737
  }
16828
16738
  const headers = new Headers({
16829
16739
  "Content-Type": "application/x-www-form-urlencoded",
16830
- "Accept": "application/json"
16740
+ Accept: "application/json"
16831
16741
  });
16832
16742
  const params = new URLSearchParams({
16833
16743
  grant_type: grantType,
@@ -16970,8 +16880,8 @@ const discoverScopes = async (serverUrl, resourceMetadata) => {
16970
16880
  const metadata = await discoverAuthorizationServerMetadata(
16971
16881
  new URL("/", serverUrl)
16972
16882
  );
16973
- const resourceScopes = resourceMetadata == null ? void 0 : resourceMetadata.scopes_supported;
16974
- const oauthScopes = metadata == null ? void 0 : metadata.scopes_supported;
16883
+ const resourceScopes = resourceMetadata?.scopes_supported;
16884
+ const oauthScopes = metadata?.scopes_supported;
16975
16885
  const scopesSupported = resourceScopes && resourceScopes.length > 0 ? resourceScopes : oauthScopes;
16976
16886
  return scopesSupported && scopesSupported.length > 0 ? scopesSupported.join(" ") : void 0;
16977
16887
  } catch (error) {
@@ -17016,20 +16926,23 @@ const clearClientInformationFromSessionStorage = ({
17016
16926
  };
17017
16927
  class InspectorOAuthClientProvider {
17018
16928
  constructor(serverUrl, scope) {
17019
- __publicField(this, "scope");
17020
16929
  this.serverUrl = serverUrl;
17021
16930
  this.scope = scope;
17022
16931
  sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
17023
16932
  }
16933
+ scope;
17024
16934
  get redirectUrl() {
17025
16935
  return window.location.origin + "/oauth/callback";
17026
16936
  }
17027
16937
  get debugRedirectUrl() {
17028
16938
  return window.location.origin + "/oauth/callback/debug";
17029
16939
  }
16940
+ get redirect_uris() {
16941
+ return [.../* @__PURE__ */ new Set([this.redirectUrl, this.debugRedirectUrl])];
16942
+ }
17030
16943
  get clientMetadata() {
17031
16944
  return {
17032
- redirect_uris: [this.redirectUrl, this.debugRedirectUrl],
16945
+ redirect_uris: this.redirect_uris,
17033
16946
  token_endpoint_auth_method: "none",
17034
16947
  grant_types: ["authorization_code", "refresh_token"],
17035
16948
  response_types: ["code"],
@@ -17138,7 +17051,6 @@ const oauthTransitions = {
17138
17051
  metadata_discovery: {
17139
17052
  canTransition: async () => true,
17140
17053
  execute: async (context) => {
17141
- var _a;
17142
17054
  let authServerUrl = new URL("/", context.serverUrl);
17143
17055
  let resourceMetadata = null;
17144
17056
  let resourceMetadataError = null;
@@ -17146,7 +17058,7 @@ const oauthTransitions = {
17146
17058
  resourceMetadata = await discoverOAuthProtectedResourceMetadata(
17147
17059
  context.serverUrl
17148
17060
  );
17149
- if ((_a = resourceMetadata == null ? void 0 : resourceMetadata.authorization_servers) == null ? void 0 : _a.length) {
17061
+ if (resourceMetadata?.authorization_servers?.length) {
17150
17062
  authServerUrl = new URL(resourceMetadata.authorization_servers[0]);
17151
17063
  }
17152
17064
  } catch (e) {
@@ -17181,10 +17093,9 @@ const oauthTransitions = {
17181
17093
  client_registration: {
17182
17094
  canTransition: async (context) => !!context.state.oauthMetadata,
17183
17095
  execute: async (context) => {
17184
- var _a;
17185
17096
  const metadata = context.state.oauthMetadata;
17186
17097
  const clientMetadata = context.provider.clientMetadata;
17187
- const scopesSupported = ((_a = context.state.resourceMetadata) == null ? void 0 : _a.scopes_supported) || metadata.scopes_supported;
17098
+ const scopesSupported = context.state.resourceMetadata?.scopes_supported || metadata.scopes_supported;
17188
17099
  if (scopesSupported) {
17189
17100
  clientMetadata.scope = scopesSupported.join(" ");
17190
17101
  }
@@ -23404,43 +23315,48 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
23404
23315
  }
23405
23316
  }
23406
23317
  function isPropertyRequired(propertyName, schema) {
23407
- var _a;
23408
- return ((_a = schema.required) == null ? void 0 : _a.includes(propertyName)) ?? false;
23318
+ return schema.required?.includes(propertyName) ?? false;
23409
23319
  }
23410
23320
  function normalizeUnionType(schema) {
23411
23321
  if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "string") && schema.anyOf.some((t) => t.type === "null")) {
23412
- return { ...schema, type: "string", anyOf: void 0 };
23322
+ return { ...schema, type: "string", anyOf: void 0, nullable: true };
23413
23323
  }
23414
23324
  if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "boolean") && schema.anyOf.some((t) => t.type === "null")) {
23415
- return { ...schema, type: "boolean", anyOf: void 0 };
23325
+ return { ...schema, type: "boolean", anyOf: void 0, nullable: true };
23416
23326
  }
23417
23327
  if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "number") && schema.anyOf.some((t) => t.type === "null")) {
23418
- return { ...schema, type: "number", anyOf: void 0 };
23328
+ return { ...schema, type: "number", anyOf: void 0, nullable: true };
23419
23329
  }
23420
23330
  if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "integer") && schema.anyOf.some((t) => t.type === "null")) {
23421
- return { ...schema, type: "integer", anyOf: void 0 };
23331
+ return { ...schema, type: "integer", anyOf: void 0, nullable: true };
23422
23332
  }
23423
23333
  if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("string") && schema.type.includes("null")) {
23424
- return { ...schema, type: "string" };
23334
+ return { ...schema, type: "string", nullable: true };
23425
23335
  }
23426
23336
  if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("boolean") && schema.type.includes("null")) {
23427
- return { ...schema, type: "boolean" };
23337
+ return { ...schema, type: "boolean", nullable: true };
23428
23338
  }
23429
23339
  if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("number") && schema.type.includes("null")) {
23430
- return { ...schema, type: "number" };
23340
+ return { ...schema, type: "number", nullable: true };
23431
23341
  }
23432
23342
  if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("integer") && schema.type.includes("null")) {
23433
- return { ...schema, type: "integer" };
23343
+ return { ...schema, type: "integer", nullable: true };
23434
23344
  }
23435
23345
  return schema;
23436
23346
  }
23437
23347
  function cleanParams(params, schema) {
23438
23348
  const cleaned = {};
23439
23349
  const required2 = schema.required || [];
23350
+ const properties2 = schema.properties || {};
23440
23351
  for (const [key, value] of Object.entries(params)) {
23441
23352
  const isFieldRequired = required2.includes(key);
23353
+ const fieldSchema = properties2[key];
23354
+ const hasDefault = fieldSchema && "default" in fieldSchema;
23355
+ const defaultValue = hasDefault ? fieldSchema.default : void 0;
23442
23356
  if (isFieldRequired) {
23443
23357
  cleaned[key] = value;
23358
+ } else if (hasDefault && value === defaultValue) {
23359
+ cleaned[key] = value;
23444
23360
  } else {
23445
23361
  if (value !== void 0 && value !== "" && value !== null) {
23446
23362
  cleaned[key] = value;
@@ -23491,7 +23407,10 @@ class Protocol {
23491
23407
  const totalElapsed = Date.now() - info.startTime;
23492
23408
  if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
23493
23409
  this._timeoutInfo.delete(messageId);
23494
- throw new McpError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", { maxTotalTimeout: info.maxTotalTimeout, totalElapsed });
23410
+ throw new McpError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
23411
+ maxTotalTimeout: info.maxTotalTimeout,
23412
+ totalElapsed
23413
+ });
23495
23414
  }
23496
23415
  clearTimeout(info.timeoutId);
23497
23416
  info.timeoutId = setTimeout(info.onTimeout, info.timeout);
@@ -24442,7 +24361,11 @@ class SSEClientTransport {
24442
24361
  }
24443
24362
  let result;
24444
24363
  try {
24445
- result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24364
+ result = await auth(this._authProvider, {
24365
+ serverUrl: this._url,
24366
+ resourceMetadataUrl: this._resourceMetadataUrl,
24367
+ fetchFn: this._fetch
24368
+ });
24446
24369
  } catch (error) {
24447
24370
  (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
24448
24371
  throw error;
@@ -24541,7 +24464,12 @@ class SSEClientTransport {
24541
24464
  if (!this._authProvider) {
24542
24465
  throw new UnauthorizedError("No auth provider");
24543
24466
  }
24544
- const result = await auth(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24467
+ const result = await auth(this._authProvider, {
24468
+ serverUrl: this._url,
24469
+ authorizationCode,
24470
+ resourceMetadataUrl: this._resourceMetadataUrl,
24471
+ fetchFn: this._fetch
24472
+ });
24545
24473
  if (result !== "AUTHORIZED") {
24546
24474
  throw new UnauthorizedError("Failed to authorize");
24547
24475
  }
@@ -24571,7 +24499,11 @@ class SSEClientTransport {
24571
24499
  if (!response.ok) {
24572
24500
  if (response.status === 401 && this._authProvider) {
24573
24501
  this._resourceMetadataUrl = extractResourceMetadataUrl(response);
24574
- const result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24502
+ const result = await auth(this._authProvider, {
24503
+ serverUrl: this._url,
24504
+ resourceMetadataUrl: this._resourceMetadataUrl,
24505
+ fetchFn: this._fetch
24506
+ });
24575
24507
  if (result !== "AUTHORIZED") {
24576
24508
  throw new UnauthorizedError();
24577
24509
  }
@@ -24626,6 +24558,7 @@ class StreamableHTTPError extends Error {
24626
24558
  class StreamableHTTPClientTransport {
24627
24559
  constructor(url, opts) {
24628
24560
  var _a;
24561
+ this._hasCompletedAuthFlow = false;
24629
24562
  this._url = url;
24630
24563
  this._resourceMetadataUrl = void 0;
24631
24564
  this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit;
@@ -24641,7 +24574,11 @@ class StreamableHTTPClientTransport {
24641
24574
  }
24642
24575
  let result;
24643
24576
  try {
24644
- result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24577
+ result = await auth(this._authProvider, {
24578
+ serverUrl: this._url,
24579
+ resourceMetadataUrl: this._resourceMetadataUrl,
24580
+ fetchFn: this._fetch
24581
+ });
24645
24582
  } catch (error) {
24646
24583
  (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
24647
24584
  throw error;
@@ -24807,7 +24744,12 @@ class StreamableHTTPClientTransport {
24807
24744
  if (!this._authProvider) {
24808
24745
  throw new UnauthorizedError("No auth provider");
24809
24746
  }
24810
- const result = await auth(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24747
+ const result = await auth(this._authProvider, {
24748
+ serverUrl: this._url,
24749
+ authorizationCode,
24750
+ resourceMetadataUrl: this._resourceMetadataUrl,
24751
+ fetchFn: this._fetch
24752
+ });
24811
24753
  if (result !== "AUTHORIZED") {
24812
24754
  throw new UnauthorizedError("Failed to authorize");
24813
24755
  }
@@ -24845,16 +24787,25 @@ class StreamableHTTPClientTransport {
24845
24787
  }
24846
24788
  if (!response.ok) {
24847
24789
  if (response.status === 401 && this._authProvider) {
24790
+ if (this._hasCompletedAuthFlow) {
24791
+ throw new StreamableHTTPError(401, "Server returned 401 after successful authentication");
24792
+ }
24848
24793
  this._resourceMetadataUrl = extractResourceMetadataUrl(response);
24849
- const result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl, fetchFn: this._fetch });
24794
+ const result = await auth(this._authProvider, {
24795
+ serverUrl: this._url,
24796
+ resourceMetadataUrl: this._resourceMetadataUrl,
24797
+ fetchFn: this._fetch
24798
+ });
24850
24799
  if (result !== "AUTHORIZED") {
24851
24800
  throw new UnauthorizedError();
24852
24801
  }
24802
+ this._hasCompletedAuthFlow = true;
24853
24803
  return this.send(message);
24854
24804
  }
24855
24805
  const text = await response.text().catch(() => null);
24856
24806
  throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
24857
24807
  }
24808
+ this._hasCompletedAuthFlow = false;
24858
24809
  if (response.status === 202) {
24859
24810
  if (isInitializedNotification(message)) {
24860
24811
  this._startOrAuthSse({ resumptionToken: void 0 }).catch((err) => {
@@ -25053,6 +25004,7 @@ function useConnection({
25053
25004
  env,
25054
25005
  customHeaders,
25055
25006
  oauthClientId,
25007
+ oauthClientSecret,
25056
25008
  oauthScope,
25057
25009
  config,
25058
25010
  connectionType = "proxy",
@@ -25083,12 +25035,18 @@ function useConnection({
25083
25035
  });
25084
25036
  return;
25085
25037
  }
25038
+ const clientInformation = {
25039
+ client_id: oauthClientId
25040
+ };
25041
+ if (oauthClientSecret) {
25042
+ clientInformation.client_secret = oauthClientSecret;
25043
+ }
25086
25044
  saveClientInformationToSessionStorage({
25087
25045
  serverUrl: sseUrl,
25088
- clientInformation: { client_id: oauthClientId },
25046
+ clientInformation,
25089
25047
  isPreregistered: true
25090
25048
  });
25091
- }, [oauthClientId, sseUrl]);
25049
+ }, [oauthClientId, oauthClientSecret, sseUrl]);
25092
25050
  const pushHistory = (request, response) => {
25093
25051
  setRequestHistory((prev) => [
25094
25052
  ...prev,
@@ -25105,10 +25063,10 @@ function useConnection({
25105
25063
  try {
25106
25064
  const abortController = new AbortController();
25107
25065
  const mcpRequestOptions = {
25108
- signal: (options == null ? void 0 : options.signal) ?? abortController.signal,
25109
- resetTimeoutOnProgress: (options == null ? void 0 : options.resetTimeoutOnProgress) ?? resetRequestTimeoutOnProgress(config),
25110
- timeout: (options == null ? void 0 : options.timeout) ?? getMCPServerRequestTimeout(config),
25111
- maxTotalTimeout: (options == null ? void 0 : options.maxTotalTimeout) ?? getMCPServerRequestMaxTotalTimeout(config)
25066
+ signal: options?.signal ?? abortController.signal,
25067
+ resetTimeoutOnProgress: options?.resetTimeoutOnProgress ?? resetRequestTimeoutOnProgress(config),
25068
+ timeout: options?.timeout ?? getMCPServerRequestTimeout(config),
25069
+ maxTotalTimeout: options?.maxTotalTimeout ?? getMCPServerRequestMaxTotalTimeout(config)
25112
25070
  };
25113
25071
  if (mcpRequestOptions.resetTimeoutOnProgress) {
25114
25072
  mcpRequestOptions.onprogress = (params) => {
@@ -25131,7 +25089,7 @@ function useConnection({
25131
25089
  }
25132
25090
  return response;
25133
25091
  } catch (e) {
25134
- if (!(options == null ? void 0 : options.suppressToast)) {
25092
+ if (!options?.suppressToast) {
25135
25093
  const errorString = e.message ?? String(e);
25136
25094
  toast2({
25137
25095
  title: "Error",
@@ -25166,7 +25124,7 @@ function useConnection({
25166
25124
  signal,
25167
25125
  suppressToast: true
25168
25126
  });
25169
- return (response == null ? void 0 : response.completion.values) || [];
25127
+ return response?.completion.values || [];
25170
25128
  } catch (e) {
25171
25129
  if (e instanceof McpError && e.code === ErrorCode.MethodNotFound) {
25172
25130
  setCompletionsSupported(false);
@@ -25215,7 +25173,7 @@ function useConnection({
25215
25173
  }
25216
25174
  const proxyHealthResponse = await fetch(proxyHealthUrl, { headers });
25217
25175
  const proxyHealth = await proxyHealthResponse.json();
25218
- if ((proxyHealth == null ? void 0 : proxyHealth.status) !== "ok") {
25176
+ if (proxyHealth?.status !== "ok") {
25219
25177
  throw new Error("MCP Proxy Server is not healthy");
25220
25178
  }
25221
25179
  } catch (e) {
@@ -25231,7 +25189,7 @@ function useConnection({
25231
25189
  };
25232
25190
  const handleAuthError = async (error) => {
25233
25191
  if (is401Error(error)) {
25234
- let scope = oauthScope == null ? void 0 : oauthScope.trim();
25192
+ let scope = oauthScope?.trim();
25235
25193
  if (!scope) {
25236
25194
  let resourceMetadata;
25237
25195
  try {
@@ -25265,7 +25223,6 @@ function useConnection({
25265
25223
  }
25266
25224
  };
25267
25225
  const connect = async (_e2, retryCount = 0) => {
25268
- var _a;
25269
25226
  const clientCapabilities = {
25270
25227
  capabilities: {
25271
25228
  sampling: {},
@@ -25307,7 +25264,7 @@ function useConnection({
25307
25264
  (header) => header.enabled && header.name.trim().toLowerCase() === "authorization"
25308
25265
  );
25309
25266
  if (needsOAuthToken) {
25310
- const oauthToken = (_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token;
25267
+ const oauthToken = (await serverAuthProvider.tokens())?.access_token;
25311
25268
  if (oauthToken) {
25312
25269
  finalHeaders = [
25313
25270
  // Remove any existing Authorization headers with empty tokens
@@ -25525,7 +25482,7 @@ function useConnection({
25525
25482
  throw error;
25526
25483
  }
25527
25484
  setServerCapabilities(capabilities ?? null);
25528
- setCompletionsSupported((capabilities == null ? void 0 : capabilities.completions) !== void 0);
25485
+ setCompletionsSupported(capabilities?.completions !== void 0);
25529
25486
  if (onPendingRequest) {
25530
25487
  client2.setRequestHandler(CreateMessageRequestSchema, (request) => {
25531
25488
  return new Promise((resolve, reject) => {
@@ -25538,7 +25495,7 @@ function useConnection({
25538
25495
  return { roots: getRoots() };
25539
25496
  });
25540
25497
  }
25541
- if ((capabilities == null ? void 0 : capabilities.logging) && defaultLoggingLevel) {
25498
+ if (capabilities?.logging && defaultLoggingLevel) {
25542
25499
  lastRequest = "logging/setLevel";
25543
25500
  await client2.setLoggingLevel(defaultLoggingLevel);
25544
25501
  pushHistory(
@@ -25576,7 +25533,7 @@ function useConnection({
25576
25533
  const disconnect = async () => {
25577
25534
  if (transportType === "streamable-http")
25578
25535
  await clientTransport.terminateSession();
25579
- await (mcpClient == null ? void 0 : mcpClient.close());
25536
+ await mcpClient?.close();
25580
25537
  const authProvider = new InspectorOAuthClientProvider(sseUrl);
25581
25538
  authProvider.clear();
25582
25539
  setMcpClient(null);
@@ -26874,7 +26831,7 @@ const OAuthFlowProgress = ({
26874
26831
  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-600 mt-1", children: [
26875
26832
  "Resource metadata was added in the",
26876
26833
  " ",
26877
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://modelcontextprotocol.io/specification/draft/basic/authorization#2-3-1-authorization-server-location", children: "2025-DRAFT-v2 specification update" }),
26834
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#authorization-server-location", children: "2025-06-18 specification update" }),
26878
26835
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
26879
26836
  authState.resourceMetadataError.message,
26880
26837
  authState.resourceMetadataError instanceof TypeError && " (This could indicate the endpoint doesn't exist or does not have CORS configured)"
@@ -27369,7 +27326,7 @@ function useCopy({ timeout = 500 } = {}) {
27369
27326
  clearTimeout(timeoutId);
27370
27327
  }
27371
27328
  };
27372
- }, [copied]);
27329
+ }, [copied, timeout]);
27373
27330
  return { copied, setCopied };
27374
27331
  }
27375
27332
  const JsonView = reactExports.memo(
@@ -27399,7 +27356,7 @@ const JsonView = reactExports.memo(
27399
27356
  variant: "destructive"
27400
27357
  });
27401
27358
  }
27402
- }, [toast2, normalizedData]);
27359
+ }, [toast2, normalizedData, setCopied]);
27403
27360
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("p-4 border rounded relative", className), children: [
27404
27361
  withCopyButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
27405
27362
  Button,
@@ -27433,6 +27390,7 @@ const JsonNode = reactExports.memo(
27433
27390
  initialExpandDepth,
27434
27391
  isError = false
27435
27392
  }) => {
27393
+ const { toast: toast2 } = useToast();
27436
27394
  const [isExpanded, setIsExpanded] = reactExports.useState(depth < initialExpandDepth);
27437
27395
  const [typeStyleMap] = reactExports.useState({
27438
27396
  number: "text-blue-600",
@@ -27444,6 +27402,50 @@ const JsonNode = reactExports.memo(
27444
27402
  default: "text-gray-700"
27445
27403
  });
27446
27404
  const dataType = getDataType(data2);
27405
+ const [copied, setCopied] = reactExports.useState(false);
27406
+ reactExports.useEffect(() => {
27407
+ let timeoutId;
27408
+ if (copied) {
27409
+ timeoutId = setTimeout(() => setCopied(false), 500);
27410
+ }
27411
+ return () => {
27412
+ if (timeoutId) clearTimeout(timeoutId);
27413
+ };
27414
+ }, [copied]);
27415
+ const handleCopyValue = reactExports.useCallback(
27416
+ (value) => {
27417
+ try {
27418
+ let text;
27419
+ const valueType = getDataType(value);
27420
+ switch (valueType) {
27421
+ case "string":
27422
+ text = value;
27423
+ break;
27424
+ case "number":
27425
+ case "boolean":
27426
+ text = String(value);
27427
+ break;
27428
+ case "null":
27429
+ text = "null";
27430
+ break;
27431
+ case "undefined":
27432
+ text = "undefined";
27433
+ break;
27434
+ default:
27435
+ text = JSON.stringify(value);
27436
+ }
27437
+ navigator.clipboard.writeText(text);
27438
+ setCopied(true);
27439
+ } catch (error) {
27440
+ toast2({
27441
+ title: "Error",
27442
+ description: `There was an error coping result into the clipboard: ${error instanceof Error ? error.message : String(error)}`,
27443
+ variant: "destructive"
27444
+ });
27445
+ }
27446
+ },
27447
+ [toast2]
27448
+ );
27447
27449
  const renderCollapsible = (isArray) => {
27448
27450
  const items2 = isArray ? data2 : Object.entries(data2);
27449
27451
  const itemCount = items2.length;
@@ -27511,7 +27513,7 @@ const JsonNode = reactExports.memo(
27511
27513
  const maxLength = 100;
27512
27514
  const isTooLong = value.length > maxLength;
27513
27515
  if (!isTooLong) {
27514
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20", children: [
27516
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20 group items-start", children: [
27515
27517
  name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27516
27518
  name2,
27517
27519
  ":"
@@ -27529,10 +27531,24 @@ const JsonNode = reactExports.memo(
27529
27531
  '"'
27530
27532
  ]
27531
27533
  }
27534
+ ),
27535
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27536
+ Button,
27537
+ {
27538
+ variant: "ghost",
27539
+ className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
27540
+ onClick: (e) => {
27541
+ e.stopPropagation();
27542
+ handleCopyValue(value);
27543
+ },
27544
+ "aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
27545
+ title: name2 ? `Copy value of ${name2}` : "Copy value",
27546
+ children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
27547
+ }
27532
27548
  )
27533
27549
  ] });
27534
27550
  }
27535
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
27551
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20 items-start", children: [
27536
27552
  name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
27537
27553
  name2,
27538
27554
  ":"
@@ -27548,6 +27564,20 @@ const JsonNode = reactExports.memo(
27548
27564
  title: isExpanded ? "Click to collapse" : "Click to expand",
27549
27565
  children: isExpanded ? `"${value}"` : `"${value.slice(0, maxLength)}..."`
27550
27566
  }
27567
+ ),
27568
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27569
+ Button,
27570
+ {
27571
+ variant: "ghost",
27572
+ className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
27573
+ onClick: (e) => {
27574
+ e.stopPropagation();
27575
+ handleCopyValue(value);
27576
+ },
27577
+ "aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
27578
+ title: name2 ? `Copy value of ${name2}` : "Copy value",
27579
+ children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
27580
+ }
27551
27581
  )
27552
27582
  ] });
27553
27583
  };
@@ -27558,12 +27588,26 @@ const JsonNode = reactExports.memo(
27558
27588
  case "string":
27559
27589
  return renderString(data2);
27560
27590
  default:
27561
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20", children: [
27591
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20 group", children: [
27562
27592
  name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27563
27593
  name2,
27564
27594
  ":"
27565
27595
  ] }),
27566
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) })
27596
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) }),
27597
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
27598
+ Button,
27599
+ {
27600
+ variant: "ghost",
27601
+ className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
27602
+ onClick: (e) => {
27603
+ e.stopPropagation();
27604
+ handleCopyValue(data2);
27605
+ },
27606
+ "aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
27607
+ title: name2 ? `Copy value of ${name2}` : "Copy value",
27608
+ children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
27609
+ }
27610
+ )
27567
27611
  ] });
27568
27612
  }
27569
27613
  }
@@ -27944,15 +27988,14 @@ function createFocusScopesStack() {
27944
27988
  add(focusScope) {
27945
27989
  const activeFocusScope = stack[0];
27946
27990
  if (focusScope !== activeFocusScope) {
27947
- activeFocusScope == null ? void 0 : activeFocusScope.pause();
27991
+ activeFocusScope?.pause();
27948
27992
  }
27949
27993
  stack = arrayRemove(stack, focusScope);
27950
27994
  stack.unshift(focusScope);
27951
27995
  },
27952
27996
  remove(focusScope) {
27953
- var _a;
27954
27997
  stack = arrayRemove(stack, focusScope);
27955
- (_a = stack[0]) == null ? void 0 : _a.resume();
27998
+ stack[0]?.resume();
27956
27999
  }
27957
28000
  };
27958
28001
  }
@@ -28892,9 +28935,8 @@ var DialogContentModal = reactExports.forwardRef(
28892
28935
  trapFocus: context.open,
28893
28936
  disableOutsidePointerEvents: true,
28894
28937
  onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
28895
- var _a;
28896
28938
  event.preventDefault();
28897
- (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
28939
+ context.triggerRef.current?.focus();
28898
28940
  }),
28899
28941
  onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
28900
28942
  const originalEvent = event.detail.originalEvent;
@@ -28923,18 +28965,16 @@ var DialogContentNonModal = reactExports.forwardRef(
28923
28965
  trapFocus: false,
28924
28966
  disableOutsidePointerEvents: false,
28925
28967
  onCloseAutoFocus: (event) => {
28926
- var _a, _b;
28927
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
28968
+ props.onCloseAutoFocus?.(event);
28928
28969
  if (!event.defaultPrevented) {
28929
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
28970
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
28930
28971
  event.preventDefault();
28931
28972
  }
28932
28973
  hasInteractedOutsideRef.current = false;
28933
28974
  hasPointerDownOutsideRef.current = false;
28934
28975
  },
28935
28976
  onInteractOutside: (event) => {
28936
- var _a, _b;
28937
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
28977
+ props.onInteractOutside?.(event);
28938
28978
  if (!event.defaultPrevented) {
28939
28979
  hasInteractedOutsideRef.current = true;
28940
28980
  if (event.detail.originalEvent.type === "pointerdown") {
@@ -28942,7 +28982,7 @@ var DialogContentNonModal = reactExports.forwardRef(
28942
28982
  }
28943
28983
  }
28944
28984
  const target = event.target;
28945
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
28985
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
28946
28986
  if (targetIsTrigger) event.preventDefault();
28947
28987
  if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
28948
28988
  event.preventDefault();
@@ -29054,8 +29094,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
29054
29094
  const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
29055
29095
  const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
29056
29096
  reactExports.useEffect(() => {
29057
- var _a;
29058
- const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
29097
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
29059
29098
  if (descriptionId && describedById) {
29060
29099
  const hasDescription = document.getElementById(descriptionId);
29061
29100
  if (!hasDescription) console.warn(MESSAGE);
@@ -31444,7 +31483,7 @@ var PopperAnchor = reactExports.forwardRef(
31444
31483
  const anchorRef = reactExports.useRef(null);
31445
31484
  reactExports.useEffect(() => {
31446
31485
  const previousAnchor = anchorRef.current;
31447
- anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref2.current;
31486
+ anchorRef.current = virtualRef?.current || ref2.current;
31448
31487
  if (previousAnchor !== anchorRef.current) {
31449
31488
  context.onAnchorChange(anchorRef.current);
31450
31489
  }
@@ -31457,7 +31496,6 @@ var CONTENT_NAME$3 = "PopperContent";
31457
31496
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$3);
31458
31497
  var PopperContent = reactExports.forwardRef(
31459
31498
  (props, forwardedRef) => {
31460
- var _a, _b, _c, _d, _e2, _f;
31461
31499
  const {
31462
31500
  __scopePopper,
31463
31501
  side = "bottom",
@@ -31479,8 +31517,8 @@ var PopperContent = reactExports.forwardRef(
31479
31517
  const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
31480
31518
  const [arrow$12, setArrow] = reactExports.useState(null);
31481
31519
  const arrowSize = useSize(arrow$12);
31482
- const arrowWidth = (arrowSize == null ? void 0 : arrowSize.width) ?? 0;
31483
- const arrowHeight = (arrowSize == null ? void 0 : arrowSize.height) ?? 0;
31520
+ const arrowWidth = arrowSize?.width ?? 0;
31521
+ const arrowHeight = arrowSize?.height ?? 0;
31484
31522
  const desiredPlacement = side + (align !== "center" ? "-" + align : "");
31485
31523
  const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
31486
31524
  const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
@@ -31533,12 +31571,12 @@ var PopperContent = reactExports.forwardRef(
31533
31571
  const handlePlaced = useCallbackRef$1(onPlaced);
31534
31572
  useLayoutEffect2(() => {
31535
31573
  if (isPositioned) {
31536
- handlePlaced == null ? void 0 : handlePlaced();
31574
+ handlePlaced?.();
31537
31575
  }
31538
31576
  }, [isPositioned, handlePlaced]);
31539
- const arrowX = (_a = middlewareData.arrow) == null ? void 0 : _a.x;
31540
- const arrowY = (_b = middlewareData.arrow) == null ? void 0 : _b.y;
31541
- const cannotCenterArrow = ((_c = middlewareData.arrow) == null ? void 0 : _c.centerOffset) !== 0;
31577
+ const arrowX = middlewareData.arrow?.x;
31578
+ const arrowY = middlewareData.arrow?.y;
31579
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
31542
31580
  const [contentZIndex, setContentZIndex] = reactExports.useState();
31543
31581
  useLayoutEffect2(() => {
31544
31582
  if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
@@ -31555,13 +31593,13 @@ var PopperContent = reactExports.forwardRef(
31555
31593
  minWidth: "max-content",
31556
31594
  zIndex: contentZIndex,
31557
31595
  ["--radix-popper-transform-origin"]: [
31558
- (_d = middlewareData.transformOrigin) == null ? void 0 : _d.x,
31559
- (_e2 = middlewareData.transformOrigin) == null ? void 0 : _e2.y
31596
+ middlewareData.transformOrigin?.x,
31597
+ middlewareData.transformOrigin?.y
31560
31598
  ].join(" "),
31561
31599
  // hide the content if using the hide middleware and should be hidden
31562
31600
  // set visibility to hidden and disable pointer events so the UI behaves
31563
31601
  // as if the PopperContent isn't there at all
31564
- ...((_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden) && {
31602
+ ...middlewareData.hide?.referenceHidden && {
31565
31603
  visibility: "hidden",
31566
31604
  pointerEvents: "none"
31567
31605
  }
@@ -31660,16 +31698,15 @@ var transformOrigin = (options) => ({
31660
31698
  name: "transformOrigin",
31661
31699
  options,
31662
31700
  fn(data2) {
31663
- var _a, _b, _c;
31664
31701
  const { placement, rects, middlewareData } = data2;
31665
- const cannotCenterArrow = ((_a = middlewareData.arrow) == null ? void 0 : _a.centerOffset) !== 0;
31702
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
31666
31703
  const isArrowHidden = cannotCenterArrow;
31667
31704
  const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
31668
31705
  const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
31669
31706
  const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
31670
31707
  const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
31671
- const arrowXCenter = (((_b = middlewareData.arrow) == null ? void 0 : _b.x) ?? 0) + arrowWidth / 2;
31672
- const arrowYCenter = (((_c = middlewareData.arrow) == null ? void 0 : _c.y) ?? 0) + arrowHeight / 2;
31708
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
31709
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
31673
31710
  let x = "";
31674
31711
  let y = "";
31675
31712
  if (placedSide === "bottom") {
@@ -31816,9 +31853,8 @@ var PopoverContentModal = reactExports.forwardRef(
31816
31853
  trapFocus: context.open,
31817
31854
  disableOutsidePointerEvents: true,
31818
31855
  onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
31819
- var _a;
31820
31856
  event.preventDefault();
31821
- if (!isRightClickOutsideRef.current) (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
31857
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
31822
31858
  }),
31823
31859
  onPointerDownOutside: composeEventHandlers(
31824
31860
  props.onPointerDownOutside,
@@ -31852,18 +31888,16 @@ var PopoverContentNonModal = reactExports.forwardRef(
31852
31888
  trapFocus: false,
31853
31889
  disableOutsidePointerEvents: false,
31854
31890
  onCloseAutoFocus: (event) => {
31855
- var _a, _b;
31856
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
31891
+ props.onCloseAutoFocus?.(event);
31857
31892
  if (!event.defaultPrevented) {
31858
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
31893
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
31859
31894
  event.preventDefault();
31860
31895
  }
31861
31896
  hasInteractedOutsideRef.current = false;
31862
31897
  hasPointerDownOutsideRef.current = false;
31863
31898
  },
31864
31899
  onInteractOutside: (event) => {
31865
- var _a, _b;
31866
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
31900
+ props.onInteractOutside?.(event);
31867
31901
  if (!event.defaultPrevented) {
31868
31902
  hasInteractedOutsideRef.current = true;
31869
31903
  if (event.detail.originalEvent.type === "pointerdown") {
@@ -31871,7 +31905,7 @@ var PopoverContentNonModal = reactExports.forwardRef(
31871
31905
  }
31872
31906
  }
31873
31907
  const target = event.target;
31874
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
31908
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
31875
31909
  if (targetIsTrigger) event.preventDefault();
31876
31910
  if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
31877
31911
  event.preventDefault();
@@ -31997,12 +32031,22 @@ function Combobox({
31997
32031
  value,
31998
32032
  onChange,
31999
32033
  onInputChange,
32034
+ onFocus,
32000
32035
  options = [],
32001
32036
  placeholder = "Select...",
32002
32037
  emptyMessage = "No results found.",
32003
32038
  id
32004
32039
  }) {
32005
32040
  const [open, setOpen] = React.useState(false);
32041
+ const handleOpenChange = React.useCallback(
32042
+ (newOpen) => {
32043
+ setOpen(newOpen);
32044
+ if (newOpen && onFocus) {
32045
+ onFocus();
32046
+ }
32047
+ },
32048
+ [onFocus]
32049
+ );
32006
32050
  const handleSelect = React.useCallback(
32007
32051
  (option) => {
32008
32052
  onChange(option);
@@ -32016,7 +32060,7 @@ function Combobox({
32016
32060
  },
32017
32061
  [onInputChange]
32018
32062
  );
32019
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { open, onOpenChange: setOpen, children: [
32063
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
32020
32064
  /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
32021
32065
  Button,
32022
32066
  {
@@ -32072,10 +32116,9 @@ var Label$2 = reactExports.forwardRef((props, forwardedRef) => {
32072
32116
  ...props,
32073
32117
  ref: forwardedRef,
32074
32118
  onMouseDown: (event) => {
32075
- var _a;
32076
32119
  const target = event.target;
32077
32120
  if (target.closest("button, input, select, textarea")) return;
32078
- (_a = props.onMouseDown) == null ? void 0 : _a.call(props, event);
32121
+ props.onMouseDown?.(event);
32079
32122
  if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
32080
32123
  }
32081
32124
  }
@@ -32138,8 +32181,7 @@ const ListPane = ({
32138
32181
  const handleSearchClick = () => {
32139
32182
  setIsSearchExpanded(true);
32140
32183
  setTimeout(() => {
32141
- var _a;
32142
- (_a = searchInputRef.current) == null ? void 0 : _a.focus();
32184
+ searchInputRef.current?.focus();
32143
32185
  }, 100);
32144
32186
  };
32145
32187
  const handleSearchBlur = () => {
@@ -32320,14 +32362,12 @@ const PromptsTab = ({
32320
32362
  nextCursor,
32321
32363
  error
32322
32364
  }) => {
32323
- var _a;
32324
32365
  const [promptArgs, setPromptArgs] = reactExports.useState({});
32325
32366
  const { completions, clearCompletions, requestCompletions } = useCompletionState(handleCompletion, completionsSupported);
32326
32367
  reactExports.useEffect(() => {
32327
32368
  clearCompletions();
32328
32369
  }, [clearCompletions, selectedPrompt]);
32329
- const handleInputChange = async (argName, value) => {
32330
- setPromptArgs((prev) => ({ ...prev, [argName]: value }));
32370
+ const triggerCompletions = (argName, value) => {
32331
32371
  if (selectedPrompt) {
32332
32372
  requestCompletions(
32333
32373
  {
@@ -32340,6 +32380,14 @@ const PromptsTab = ({
32340
32380
  );
32341
32381
  }
32342
32382
  };
32383
+ const handleInputChange = async (argName, value) => {
32384
+ setPromptArgs((prev) => ({ ...prev, [argName]: value }));
32385
+ triggerCompletions(argName, value);
32386
+ };
32387
+ const handleFocus = async (argName) => {
32388
+ const currentValue = promptArgs[argName] || "";
32389
+ triggerCompletions(argName, currentValue);
32390
+ };
32343
32391
  const handleGetPrompt = () => {
32344
32392
  if (selectedPrompt) {
32345
32393
  getPrompt(selectedPrompt.name, promptArgs);
@@ -32373,10 +32421,10 @@ const PromptsTab = ({
32373
32421
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
32374
32422
  /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
32375
32423
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
32376
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
32424
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
32377
32425
  ] }) : selectedPrompt ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
32378
32426
  selectedPrompt.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedPrompt.description }),
32379
- (_a = selectedPrompt.arguments) == null ? void 0 : _a.map((arg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32427
+ selectedPrompt.arguments?.map((arg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32380
32428
  /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: arg.name, children: arg.name }),
32381
32429
  /* @__PURE__ */ jsxRuntimeExports.jsx(
32382
32430
  Combobox,
@@ -32386,6 +32434,7 @@ const PromptsTab = ({
32386
32434
  value: promptArgs[arg.name] || "",
32387
32435
  onChange: (value) => handleInputChange(arg.name, value),
32388
32436
  onInputChange: (value) => handleInputChange(arg.name, value),
32437
+ onFocus: () => handleFocus(arg.name),
32389
32438
  options: completions[arg.name] || []
32390
32439
  }
32391
32440
  ),
@@ -32641,7 +32690,6 @@ const ResourcesTab = ({
32641
32690
  nextTemplateCursor,
32642
32691
  error
32643
32692
  }) => {
32644
- var _a;
32645
32693
  const [selectedTemplate, setSelectedTemplate] = reactExports.useState(null);
32646
32694
  const [templateValues, setTemplateValues] = reactExports.useState(
32647
32695
  {}
@@ -32655,7 +32703,7 @@ const ResourcesTab = ({
32655
32703
  };
32656
32704
  const handleTemplateValueChange = async (key, value) => {
32657
32705
  setTemplateValues((prev) => ({ ...prev, [key]: value }));
32658
- if (selectedTemplate == null ? void 0 : selectedTemplate.uriTemplate) {
32706
+ if (selectedTemplate?.uriTemplate) {
32659
32707
  requestCompletions(
32660
32708
  {
32661
32709
  type: "ref/resource",
@@ -32734,7 +32782,7 @@ const ResourcesTab = ({
32734
32782
  "h3",
32735
32783
  {
32736
32784
  className: "font-semibold truncate",
32737
- title: (selectedResource == null ? void 0 : selectedResource.name) || (selectedTemplate == null ? void 0 : selectedTemplate.name),
32785
+ title: selectedResource?.name || selectedTemplate?.name,
32738
32786
  children: selectedResource ? selectedResource.name : selectedTemplate ? selectedTemplate.name : "Select a resource or template"
32739
32787
  }
32740
32788
  ),
@@ -32774,7 +32822,7 @@ const ResourcesTab = ({
32774
32822
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
32775
32823
  /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
32776
32824
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
32777
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
32825
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
32778
32826
  ] }) : selectedResource ? /* @__PURE__ */ jsxRuntimeExports.jsx(
32779
32827
  JsonView,
32780
32828
  {
@@ -32783,9 +32831,9 @@ const ResourcesTab = ({
32783
32831
  }
32784
32832
  ) : selectedTemplate ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
32785
32833
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTemplate.description }),
32786
- (_a = new UriTemplate(
32834
+ new UriTemplate(
32787
32835
  selectedTemplate.uriTemplate
32788
- ).variableNames) == null ? void 0 : _a.map((key) => {
32836
+ ).variableNames?.map((key) => {
32789
32837
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32790
32838
  /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: key, children: key }),
32791
32839
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -34955,7 +35003,6 @@ const DynamicJsonForm = reactExports.forwardRef(
34955
35003
  validateJson
34956
35004
  }));
34957
35005
  const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
34958
- var _a, _b, _c;
34959
35006
  if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
34960
35007
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
34961
35008
  JsonEditor,
@@ -34980,7 +35027,7 @@ const DynamicJsonForm = reactExports.forwardRef(
34980
35027
  }
34981
35028
  );
34982
35029
  }
34983
- const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
35030
+ const isRequired = parentSchema?.required?.includes(propertyName || "") ?? false;
34984
35031
  let fieldType = propSchema.type;
34985
35032
  if (Array.isArray(fieldType)) {
34986
35033
  fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
@@ -35080,7 +35127,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35080
35127
  Input,
35081
35128
  {
35082
35129
  type: "number",
35083
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
35130
+ value: currentValue?.toString() ?? "",
35084
35131
  onChange: (e) => {
35085
35132
  const val = e.target.value;
35086
35133
  if (!val && !isRequired) {
@@ -35104,7 +35151,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35104
35151
  {
35105
35152
  type: "number",
35106
35153
  step: "1",
35107
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
35154
+ value: currentValue?.toString() ?? "",
35108
35155
  onChange: (e) => {
35109
35156
  const val = e.target.value;
35110
35157
  if (!val && !isRequired) {
@@ -35156,30 +35203,27 @@ const DynamicJsonForm = reactExports.forwardRef(
35156
35203
  }
35157
35204
  );
35158
35205
  }
35159
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
35160
- var _a2;
35161
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35162
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
35163
- key,
35164
- ((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
35165
- ] }),
35166
- renderFormFields(
35167
- subSchema,
35168
- currentValue == null ? void 0 : currentValue[key],
35169
- [...path, key],
35170
- depth + 1,
35171
- propSchema,
35172
- key
35173
- )
35174
- ] }, key);
35175
- }) });
35206
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35207
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
35208
+ key,
35209
+ propSchema.required?.includes(key) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
35210
+ ] }),
35211
+ renderFormFields(
35212
+ subSchema,
35213
+ currentValue?.[key],
35214
+ [...path, key],
35215
+ depth + 1,
35216
+ propSchema,
35217
+ key
35218
+ )
35219
+ ] }, key)) });
35176
35220
  case "array": {
35177
35221
  const arrayValue = Array.isArray(currentValue) ? currentValue : [];
35178
35222
  if (!propSchema.items) return null;
35179
35223
  if (isSimpleObject(propSchema.items)) {
35180
35224
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35181
35225
  propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
35182
- ((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
35226
+ propSchema.items?.description && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
35183
35227
  "Items: ",
35184
35228
  propSchema.items.description
35185
35229
  ] }),
@@ -35216,7 +35260,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35216
35260
  );
35217
35261
  handleFieldChange(path, [...arrayValue, defaultValue]);
35218
35262
  },
35219
- title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
35263
+ title: propSchema.items?.description ? `Add new ${propSchema.items.description}` : "Add new item",
35220
35264
  children: "Add Item"
35221
35265
  }
35222
35266
  )
@@ -35329,7 +35373,6 @@ const SamplingRequest = ({
35329
35373
  request,
35330
35374
  onReject
35331
35375
  }) => {
35332
- var _a;
35333
35376
  const { toast: toast2 } = useToast();
35334
35377
  const [messageResult, setMessageResult] = reactExports.useState({
35335
35378
  model: "stub-model",
@@ -35340,7 +35383,7 @@ const SamplingRequest = ({
35340
35383
  text: ""
35341
35384
  }
35342
35385
  });
35343
- const contentType = (_a = messageResult == null ? void 0 : messageResult.content) == null ? void 0 : _a.type;
35386
+ const contentType = messageResult?.content?.type;
35344
35387
  const schema = reactExports.useMemo(() => {
35345
35388
  const s = {
35346
35389
  type: "object",
@@ -35358,7 +35401,7 @@ const SamplingRequest = ({
35358
35401
  },
35359
35402
  role: {
35360
35403
  type: "string",
35361
- default: "endTurn",
35404
+ default: "assistant",
35362
35405
  description: "Role of the model"
35363
35406
  },
35364
35407
  content: {
@@ -35784,10 +35827,10 @@ var SelectContentImpl = reactExports.forwardRef(
35784
35827
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
35785
35828
  for (const candidate of candidates) {
35786
35829
  if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
35787
- candidate == null ? void 0 : candidate.scrollIntoView({ block: "nearest" });
35830
+ candidate?.scrollIntoView({ block: "nearest" });
35788
35831
  if (candidate === firstItem && viewport) viewport.scrollTop = 0;
35789
35832
  if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
35790
- candidate == null ? void 0 : candidate.focus();
35833
+ candidate?.focus();
35791
35834
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
35792
35835
  }
35793
35836
  },
@@ -35807,10 +35850,9 @@ var SelectContentImpl = reactExports.forwardRef(
35807
35850
  if (content) {
35808
35851
  let pointerMoveDelta = { x: 0, y: 0 };
35809
35852
  const handlePointerMove = (event) => {
35810
- var _a, _b;
35811
35853
  pointerMoveDelta = {
35812
- x: Math.abs(Math.round(event.pageX) - (((_a = triggerPointerDownPosRef.current) == null ? void 0 : _a.x) ?? 0)),
35813
- y: Math.abs(Math.round(event.pageY) - (((_b = triggerPointerDownPosRef.current) == null ? void 0 : _b.y) ?? 0))
35854
+ x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),
35855
+ y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))
35814
35856
  };
35815
35857
  };
35816
35858
  const handlePointerUp = (event) => {
@@ -35862,7 +35904,7 @@ var SelectContentImpl = reactExports.forwardRef(
35862
35904
  },
35863
35905
  [context.value]
35864
35906
  );
35865
- const handleItemLeave = reactExports.useCallback(() => content == null ? void 0 : content.focus(), [content]);
35907
+ const handleItemLeave = reactExports.useCallback(() => content?.focus(), [content]);
35866
35908
  const itemTextRefCallback = reactExports.useCallback(
35867
35909
  (node, value, disabled) => {
35868
35910
  const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
@@ -35911,8 +35953,7 @@ var SelectContentImpl = reactExports.forwardRef(
35911
35953
  event.preventDefault();
35912
35954
  },
35913
35955
  onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
35914
- var _a;
35915
- (_a = context.trigger) == null ? void 0 : _a.focus({ preventScroll: true });
35956
+ context.trigger?.focus({ preventScroll: true });
35916
35957
  event.preventDefault();
35917
35958
  }),
35918
35959
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -36070,7 +36111,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
36070
36111
  contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
36071
36112
  contentWrapper.style.minHeight = minContentHeight + "px";
36072
36113
  contentWrapper.style.maxHeight = availableHeight + "px";
36073
- onPlaced == null ? void 0 : onPlaced();
36114
+ onPlaced?.();
36074
36115
  requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
36075
36116
  }
36076
36117
  }, [
@@ -36094,7 +36135,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
36094
36135
  (node) => {
36095
36136
  if (node && shouldRepositionRef.current === true) {
36096
36137
  position();
36097
- focusSelectedItem == null ? void 0 : focusSelectedItem();
36138
+ focusSelectedItem?.();
36098
36139
  shouldRepositionRef.current = false;
36099
36140
  }
36100
36141
  },
@@ -36214,7 +36255,7 @@ var SelectViewport = reactExports.forwardRef(
36214
36255
  onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
36215
36256
  const viewport = event.currentTarget;
36216
36257
  const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
36217
- if ((shouldExpandOnScrollRef == null ? void 0 : shouldExpandOnScrollRef.current) && contentWrapper) {
36258
+ if (shouldExpandOnScrollRef?.current && contentWrapper) {
36218
36259
  const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
36219
36260
  if (scrolledBy > 0) {
36220
36261
  const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
@@ -36278,10 +36319,7 @@ var SelectItem$1 = reactExports.forwardRef(
36278
36319
  const [isFocused, setIsFocused] = reactExports.useState(false);
36279
36320
  const composedRefs = useComposedRefs(
36280
36321
  forwardedRef,
36281
- (node) => {
36282
- var _a;
36283
- return (_a = contentContext.itemRefCallback) == null ? void 0 : _a.call(contentContext, node, value, disabled);
36284
- }
36322
+ (node) => contentContext.itemRefCallback?.(node, value, disabled)
36285
36323
  );
36286
36324
  const textId = useId();
36287
36325
  const pointerTypeRef = reactExports.useRef("touch");
@@ -36305,7 +36343,7 @@ var SelectItem$1 = reactExports.forwardRef(
36305
36343
  textId,
36306
36344
  isSelected,
36307
36345
  onItemTextChange: reactExports.useCallback((node) => {
36308
- setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
36346
+ setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
36309
36347
  }, []),
36310
36348
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36311
36349
  Collection.ItemSlot,
@@ -36339,23 +36377,20 @@ var SelectItem$1 = reactExports.forwardRef(
36339
36377
  pointerTypeRef.current = event.pointerType;
36340
36378
  }),
36341
36379
  onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
36342
- var _a;
36343
36380
  pointerTypeRef.current = event.pointerType;
36344
36381
  if (disabled) {
36345
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36382
+ contentContext.onItemLeave?.();
36346
36383
  } else if (pointerTypeRef.current === "mouse") {
36347
36384
  event.currentTarget.focus({ preventScroll: true });
36348
36385
  }
36349
36386
  }),
36350
36387
  onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
36351
- var _a;
36352
36388
  if (event.currentTarget === document.activeElement) {
36353
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36389
+ contentContext.onItemLeave?.();
36354
36390
  }
36355
36391
  }),
36356
36392
  onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
36357
- var _a;
36358
- const isTypingAhead = ((_a = contentContext.searchRef) == null ? void 0 : _a.current) !== "";
36393
+ const isTypingAhead = contentContext.searchRef?.current !== "";
36359
36394
  if (isTypingAhead && event.key === " ") return;
36360
36395
  if (SELECTION_KEYS.includes(event.key)) handleSelect();
36361
36396
  if (event.key === " ") event.preventDefault();
@@ -36382,12 +36417,9 @@ var SelectItemText = reactExports.forwardRef(
36382
36417
  forwardedRef,
36383
36418
  (node) => setItemTextNode(node),
36384
36419
  itemContext.onItemTextChange,
36385
- (node) => {
36386
- var _a;
36387
- return (_a = contentContext.itemTextRefCallback) == null ? void 0 : _a.call(contentContext, node, itemContext.value, itemContext.disabled);
36388
- }
36420
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
36389
36421
  );
36390
- const textContent = itemTextNode == null ? void 0 : itemTextNode.textContent;
36422
+ const textContent = itemTextNode?.textContent;
36391
36423
  const nativeOption = reactExports.useMemo(
36392
36424
  () => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
36393
36425
  [itemContext.disabled, itemContext.value, textContent]
@@ -36495,9 +36527,8 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
36495
36527
  return () => clearAutoScrollTimer();
36496
36528
  }, [clearAutoScrollTimer]);
36497
36529
  useLayoutEffect2(() => {
36498
- var _a;
36499
36530
  const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
36500
- (_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
36531
+ activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
36501
36532
  }, [getItems]);
36502
36533
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
36503
36534
  Primitive.div,
@@ -36512,8 +36543,7 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
36512
36543
  }
36513
36544
  }),
36514
36545
  onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
36515
- var _a;
36516
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36546
+ contentContext.onItemLeave?.();
36517
36547
  if (autoScrollTimerRef.current === null) {
36518
36548
  autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
36519
36549
  }
@@ -36778,7 +36808,7 @@ const useTheme = () => {
36778
36808
  [theme, setThemeWithSideEffect]
36779
36809
  );
36780
36810
  };
36781
- const version = "0.17.0";
36811
+ const version = "0.17.2";
36782
36812
  var [createTooltipContext] = createContextScope("Tooltip", [
36783
36813
  createPopperScope
36784
36814
  ]);
@@ -36859,7 +36889,7 @@ var Tooltip$1 = (props) => {
36859
36889
  } else {
36860
36890
  providerContext.onClose();
36861
36891
  }
36862
- onOpenChange == null ? void 0 : onOpenChange(open2);
36892
+ onOpenChange?.(open2);
36863
36893
  },
36864
36894
  caller: TOOLTIP_NAME
36865
36895
  });
@@ -37031,7 +37061,7 @@ var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => {
37031
37061
  const handleTrackPointerGrace = (event) => {
37032
37062
  const target = event.target;
37033
37063
  const pointerPosition = { x: event.clientX, y: event.clientY };
37034
- const hasEnteredTarget = (trigger == null ? void 0 : trigger.contains(target)) || (content == null ? void 0 : content.contains(target));
37064
+ const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
37035
37065
  const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
37036
37066
  if (hasEnteredTarget) {
37037
37067
  handleRemoveGraceArea();
@@ -37069,7 +37099,7 @@ var TooltipContentImpl = reactExports.forwardRef(
37069
37099
  if (context.trigger) {
37070
37100
  const handleScroll2 = (event) => {
37071
37101
  const target = event.target;
37072
- if (target == null ? void 0 : target.contains(context.trigger)) onClose();
37102
+ if (target?.contains(context.trigger)) onClose();
37073
37103
  };
37074
37104
  window.addEventListener("scroll", handleScroll2, { capture: true });
37075
37105
  return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
@@ -37444,7 +37474,7 @@ const createEmptyHeader = () => ({
37444
37474
  });
37445
37475
  const createHeaderFromBearerToken = (bearerToken, headerName) => ({
37446
37476
  name: headerName || "Authorization",
37447
- value: (headerName == null ? void 0 : headerName.toLowerCase()) === "authorization" || !headerName ? `Bearer ${bearerToken}` : bearerToken,
37477
+ value: headerName?.toLowerCase() === "authorization" || !headerName ? `Bearer ${bearerToken}` : bearerToken,
37448
37478
  enabled: true
37449
37479
  });
37450
37480
  const migrateFromLegacyAuth = (bearerToken, headerName) => {
@@ -37665,6 +37695,8 @@ const Sidebar = ({
37665
37695
  setCustomHeaders,
37666
37696
  oauthClientId,
37667
37697
  setOauthClientId,
37698
+ oauthClientSecret,
37699
+ setOauthClientSecret,
37668
37700
  oauthScope,
37669
37701
  setOauthScope,
37670
37702
  onConnect,
@@ -37682,6 +37714,7 @@ const Sidebar = ({
37682
37714
  const [showAuthConfig, setShowAuthConfig] = reactExports.useState(false);
37683
37715
  const [showConfig, setShowConfig] = reactExports.useState(false);
37684
37716
  const [shownEnvVars, setShownEnvVars] = reactExports.useState(/* @__PURE__ */ new Set());
37717
+ const [showClientSecret, setShowClientSecret] = reactExports.useState(false);
37685
37718
  const [copiedServerEntry, setCopiedServerEntry] = reactExports.useState(false);
37686
37719
  const [copiedServerFile, setCopiedServerFile] = reactExports.useState(false);
37687
37720
  const { toast: toast2 } = useToast();
@@ -38085,6 +38118,33 @@ const Sidebar = ({
38085
38118
  className: "font-mono"
38086
38119
  }
38087
38120
  ),
38121
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Client Secret" }),
38122
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
38123
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38124
+ Input,
38125
+ {
38126
+ type: showClientSecret ? "text" : "password",
38127
+ placeholder: "Client Secret (optional)",
38128
+ onChange: (e) => setOauthClientSecret(e.target.value),
38129
+ value: oauthClientSecret,
38130
+ "data-testid": "oauth-client-secret-input",
38131
+ className: "font-mono"
38132
+ }
38133
+ ),
38134
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38135
+ Button,
38136
+ {
38137
+ variant: "outline",
38138
+ size: "icon",
38139
+ className: "h-9 w-9 p-0 shrink-0",
38140
+ onClick: () => setShowClientSecret(!showClientSecret),
38141
+ "aria-label": showClientSecret ? "Hide secret" : "Show secret",
38142
+ "aria-pressed": showClientSecret,
38143
+ title: showClientSecret ? "Hide secret" : "Show secret",
38144
+ children: showClientSecret ? /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": "true" })
38145
+ }
38146
+ )
38147
+ ] }),
38088
38148
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Redirect URL" }),
38089
38149
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38090
38150
  Input,
@@ -38245,12 +38305,11 @@ const Sidebar = ({
38245
38305
  }
38246
38306
  ),
38247
38307
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: (() => {
38248
- var _a;
38249
38308
  switch (connectionStatus) {
38250
38309
  case "connected":
38251
38310
  return "Connected";
38252
38311
  case "error": {
38253
- const hasProxyToken = (_a = config.MCP_PROXY_AUTH_TOKEN) == null ? void 0 : _a.value;
38312
+ const hasProxyToken = config.MCP_PROXY_AUTH_TOKEN?.value;
38254
38313
  if (!hasProxyToken) {
38255
38314
  return "Connection Error - Did you add the proxy session token in Configuration?";
38256
38315
  }
@@ -38416,7 +38475,7 @@ var CheckboxTrigger = reactExports.forwardRef(
38416
38475
  const composedRefs = useComposedRefs(forwardedRef, setControl);
38417
38476
  const initialCheckedStateRef = reactExports.useRef(checked);
38418
38477
  reactExports.useEffect(() => {
38419
- const form = control == null ? void 0 : control.form;
38478
+ const form = control?.form;
38420
38479
  if (form) {
38421
38480
  const reset = () => setChecked(initialCheckedStateRef.current);
38422
38481
  form.addEventListener("reset", reset);
@@ -38804,40 +38863,37 @@ const ToolResults = ({
38804
38863
  }
38805
38864
  )
38806
38865
  ] }),
38807
- structuredResult.content.map((item, index2) => {
38808
- var _a, _b;
38809
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
38810
- item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
38811
- item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38812
- "img",
38813
- {
38814
- src: `data:${item.mimeType};base64,${item.data}`,
38815
- alt: "Tool result image",
38816
- className: "max-w-full h-auto"
38817
- }
38818
- ),
38819
- item.type === "resource" && (((_b = (_a = item.resource) == null ? void 0 : _a.mimeType) == null ? void 0 : _b.startsWith("audio/")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38820
- "audio",
38821
- {
38822
- controls: true,
38823
- src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
38824
- className: "w-full",
38825
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
38826
- }
38827
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource })),
38828
- item.type === "resource_link" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38829
- ResourceLinkView,
38830
- {
38831
- uri: item.uri,
38832
- name: item.name,
38833
- description: item.description,
38834
- mimeType: item.mimeType,
38835
- resourceContent: resourceContent[item.uri] || "",
38836
- onReadResource
38837
- }
38838
- )
38839
- ] }, index2);
38840
- })
38866
+ structuredResult.content.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
38867
+ item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
38868
+ item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38869
+ "img",
38870
+ {
38871
+ src: `data:${item.mimeType};base64,${item.data}`,
38872
+ alt: "Tool result image",
38873
+ className: "max-w-full h-auto"
38874
+ }
38875
+ ),
38876
+ item.type === "resource" && (item.resource?.mimeType?.startsWith("audio/") ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38877
+ "audio",
38878
+ {
38879
+ controls: true,
38880
+ src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
38881
+ className: "w-full",
38882
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
38883
+ }
38884
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource })),
38885
+ item.type === "resource_link" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38886
+ ResourceLinkView,
38887
+ {
38888
+ uri: item.uri,
38889
+ name: item.name,
38890
+ description: item.description,
38891
+ mimeType: item.mimeType,
38892
+ resourceContent: resourceContent[item.uri] || "",
38893
+ onReadResource
38894
+ }
38895
+ )
38896
+ ] }, index2))
38841
38897
  ] })
38842
38898
  ] });
38843
38899
  } else if ("toolResult" in toolResult) {
@@ -38879,13 +38935,13 @@ const ToolsTab = ({
38879
38935
  };
38880
38936
  reactExports.useEffect(() => {
38881
38937
  const params2 = Object.entries(
38882
- (selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
38938
+ selectedTool?.inputSchema.properties ?? []
38883
38939
  ).map(([key, value]) => [
38884
38940
  key,
38885
38941
  generateDefaultValue(
38886
38942
  value,
38887
38943
  key,
38888
- selectedTool == null ? void 0 : selectedTool.inputSchema
38944
+ selectedTool?.inputSchema
38889
38945
  )
38890
38946
  ]);
38891
38947
  setParams(Object.fromEntries(params2));
@@ -38905,7 +38961,7 @@ const ToolsTab = ({
38905
38961
  setSelectedItem: setSelectedTool,
38906
38962
  renderItem: (tool) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-start", children: [
38907
38963
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: tool.name }),
38908
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 text-left", children: tool.description })
38964
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 text-left line-clamp-3", children: tool.description })
38909
38965
  ] }),
38910
38966
  title: "Tools",
38911
38967
  buttonText: nextCursor ? "List More Tools" : "List Tools",
@@ -38918,141 +38974,199 @@ const ToolsTab = ({
38918
38974
  error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
38919
38975
  /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
38920
38976
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
38921
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
38977
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
38922
38978
  ] }),
38923
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTool.description }),
38979
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400 whitespace-pre-wrap max-h-48 overflow-y-auto", children: selectedTool.description }),
38924
38980
  Object.entries(selectedTool.inputSchema.properties ?? []).map(
38925
38981
  ([key, value]) => {
38926
38982
  const prop = normalizeUnionType(value);
38927
38983
  const inputSchema = selectedTool.inputSchema;
38928
38984
  const required2 = isPropertyRequired(key, inputSchema);
38929
38985
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
38930
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
38931
- Label$1,
38932
- {
38933
- htmlFor: key,
38934
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300",
38935
- children: [
38936
- key,
38937
- required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
38938
- ]
38939
- }
38940
- ),
38941
- prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
38942
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38943
- Checkbox,
38944
- {
38945
- id: key,
38946
- name: key,
38947
- checked: !!params[key],
38948
- onCheckedChange: (checked) => setParams({
38949
- ...params,
38950
- [key]: checked
38951
- })
38952
- }
38953
- ),
38954
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38955
- "label",
38986
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
38987
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
38988
+ Label$1,
38956
38989
  {
38957
38990
  htmlFor: key,
38958
- className: "text-sm font-medium text-gray-700 dark:text-gray-300",
38959
- children: prop.description || "Toggle this option"
38991
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300",
38992
+ children: [
38993
+ key,
38994
+ required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
38995
+ ]
38960
38996
  }
38961
- )
38962
- ] }) : prop.type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38963
- Textarea,
38964
- {
38965
- id: key,
38966
- name: key,
38967
- placeholder: prop.description,
38968
- value: params[key] === void 0 ? "" : String(params[key]),
38969
- onChange: (e) => {
38970
- const value2 = e.target.value;
38971
- if (value2 === "") {
38972
- setParams({
38973
- ...params,
38974
- [key]: void 0
38975
- });
38976
- } else {
38977
- setParams({
38997
+ ),
38998
+ prop.nullable ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
38999
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39000
+ Checkbox,
39001
+ {
39002
+ id: key,
39003
+ name: key,
39004
+ checked: params[key] === null,
39005
+ onCheckedChange: (checked) => setParams({
38978
39006
  ...params,
38979
- [key]: value2
38980
- });
39007
+ [key]: checked ? null : prop.default !== null ? prop.default : prop.type === "boolean" ? false : prop.type === "string" ? "" : prop.type === "number" || prop.type === "integer" ? void 0 : void 0
39008
+ })
38981
39009
  }
38982
- },
38983
- className: "mt-1"
38984
- }
38985
- ) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38986
- DynamicJsonForm,
38987
- {
38988
- ref: (ref2) => formRefs.current[key] = ref2,
38989
- schema: {
38990
- type: prop.type,
38991
- properties: prop.properties,
38992
- description: prop.description,
38993
- items: prop.items
38994
- },
38995
- value: params[key] ?? generateDefaultValue(prop),
38996
- onChange: (newValue) => {
38997
- setParams({
38998
- ...params,
38999
- [key]: newValue
39000
- });
39001
- setTimeout(checkValidationErrors, 100);
39002
- }
39003
- }
39004
- ) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
39005
- Input,
39010
+ ),
39011
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39012
+ "label",
39013
+ {
39014
+ htmlFor: key,
39015
+ className: "text-sm font-medium text-gray-700 dark:text-gray-300",
39016
+ children: "null"
39017
+ }
39018
+ )
39019
+ ] }) : null
39020
+ ] }),
39021
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39022
+ "div",
39006
39023
  {
39007
- type: "number",
39008
- id: key,
39009
- name: key,
39010
- placeholder: prop.description,
39011
- value: params[key] === void 0 ? "" : String(params[key]),
39012
- onChange: (e) => {
39013
- const value2 = e.target.value;
39014
- if (value2 === "") {
39015
- setParams({
39016
- ...params,
39017
- [key]: void 0
39018
- });
39019
- } else {
39020
- const num = Number(value2);
39021
- if (!isNaN(num)) {
39024
+ role: "toolinputwrapper",
39025
+ className: `${prop.nullable && params[key] === null ? "pointer-events-none opacity-50" : ""}`,
39026
+ children: prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
39027
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39028
+ Checkbox,
39029
+ {
39030
+ id: key,
39031
+ name: key,
39032
+ checked: !!params[key],
39033
+ onCheckedChange: (checked) => setParams({
39034
+ ...params,
39035
+ [key]: checked
39036
+ })
39037
+ }
39038
+ ),
39039
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39040
+ "label",
39041
+ {
39042
+ htmlFor: key,
39043
+ className: "text-sm font-medium text-gray-700 dark:text-gray-300",
39044
+ children: prop.description || "Toggle this option"
39045
+ }
39046
+ )
39047
+ ] }) : prop.type === "string" && prop.enum ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
39048
+ Select,
39049
+ {
39050
+ value: params[key] === void 0 ? "" : String(params[key]),
39051
+ onValueChange: (value2) => {
39052
+ if (value2 === "") {
39053
+ setParams({
39054
+ ...params,
39055
+ [key]: void 0
39056
+ });
39057
+ } else {
39058
+ setParams({
39059
+ ...params,
39060
+ [key]: value2
39061
+ });
39062
+ }
39063
+ },
39064
+ children: [
39065
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: key, className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
39066
+ SelectValue,
39067
+ {
39068
+ placeholder: prop.description || "Select an option"
39069
+ }
39070
+ ) }),
39071
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: prop.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: option, children: option }, option)) })
39072
+ ]
39073
+ }
39074
+ ) : prop.type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
39075
+ Textarea,
39076
+ {
39077
+ id: key,
39078
+ name: key,
39079
+ placeholder: prop.description,
39080
+ value: params[key] === void 0 ? "" : String(params[key]),
39081
+ onChange: (e) => {
39082
+ const value2 = e.target.value;
39083
+ if (value2 === "") {
39084
+ setParams({
39085
+ ...params,
39086
+ [key]: void 0
39087
+ });
39088
+ } else {
39089
+ setParams({
39090
+ ...params,
39091
+ [key]: value2
39092
+ });
39093
+ }
39094
+ },
39095
+ className: "mt-1"
39096
+ }
39097
+ ) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
39098
+ DynamicJsonForm,
39099
+ {
39100
+ ref: (ref2) => formRefs.current[key] = ref2,
39101
+ schema: {
39102
+ type: prop.type,
39103
+ properties: prop.properties,
39104
+ description: prop.description,
39105
+ items: prop.items
39106
+ },
39107
+ value: params[key] ?? generateDefaultValue(prop),
39108
+ onChange: (newValue) => {
39022
39109
  setParams({
39023
39110
  ...params,
39024
- [key]: num
39111
+ [key]: newValue
39025
39112
  });
39026
- } else {
39113
+ setTimeout(checkValidationErrors, 100);
39114
+ }
39115
+ }
39116
+ ) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
39117
+ Input,
39118
+ {
39119
+ type: "number",
39120
+ id: key,
39121
+ name: key,
39122
+ placeholder: prop.description,
39123
+ value: params[key] === void 0 ? "" : String(params[key]),
39124
+ onChange: (e) => {
39125
+ const value2 = e.target.value;
39126
+ if (value2 === "") {
39127
+ setParams({
39128
+ ...params,
39129
+ [key]: void 0
39130
+ });
39131
+ } else {
39132
+ const num = Number(value2);
39133
+ if (!isNaN(num)) {
39134
+ setParams({
39135
+ ...params,
39136
+ [key]: num
39137
+ });
39138
+ } else {
39139
+ setParams({
39140
+ ...params,
39141
+ [key]: value2
39142
+ });
39143
+ }
39144
+ }
39145
+ },
39146
+ className: "mt-1"
39147
+ }
39148
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
39149
+ DynamicJsonForm,
39150
+ {
39151
+ ref: (ref2) => formRefs.current[key] = ref2,
39152
+ schema: {
39153
+ type: prop.type,
39154
+ properties: prop.properties,
39155
+ description: prop.description,
39156
+ items: prop.items
39157
+ },
39158
+ value: params[key],
39159
+ onChange: (newValue) => {
39027
39160
  setParams({
39028
39161
  ...params,
39029
- [key]: value2
39162
+ [key]: newValue
39030
39163
  });
39164
+ setTimeout(checkValidationErrors, 100);
39031
39165
  }
39032
39166
  }
39033
- },
39034
- className: "mt-1"
39035
- }
39036
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
39037
- DynamicJsonForm,
39038
- {
39039
- ref: (ref2) => formRefs.current[key] = ref2,
39040
- schema: {
39041
- type: prop.type,
39042
- properties: prop.properties,
39043
- description: prop.description,
39044
- items: prop.items
39045
- },
39046
- value: params[key],
39047
- onChange: (newValue) => {
39048
- setParams({
39049
- ...params,
39050
- [key]: newValue
39051
- });
39052
- setTimeout(checkValidationErrors, 100);
39053
- }
39167
+ ) })
39054
39168
  }
39055
- ) })
39169
+ )
39056
39170
  ] }, key);
39057
39171
  }
39058
39172
  ),
@@ -39311,7 +39425,6 @@ const ElicitationTab = ({ pendingRequests, onResolve }) => {
39311
39425
  };
39312
39426
  const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
39313
39427
  const App = () => {
39314
- var _a;
39315
39428
  const [resources, setResources] = reactExports.useState([]);
39316
39429
  const [resourceTemplates, setResourceTemplates] = reactExports.useState([]);
39317
39430
  const [resourceContent, setResourceContent] = reactExports.useState("");
@@ -39353,6 +39466,9 @@ const App = () => {
39353
39466
  const [oauthScope, setOauthScope] = reactExports.useState(() => {
39354
39467
  return localStorage.getItem("lastOauthScope") || "";
39355
39468
  });
39469
+ const [oauthClientSecret, setOauthClientSecret] = reactExports.useState(() => {
39470
+ return localStorage.getItem("lastOauthClientSecret") || "";
39471
+ });
39356
39472
  const [customHeaders, setCustomHeaders] = reactExports.useState(() => {
39357
39473
  const savedHeaders = localStorage.getItem("lastCustomHeaders");
39358
39474
  if (savedHeaders) {
@@ -39434,6 +39550,7 @@ const App = () => {
39434
39550
  env,
39435
39551
  customHeaders,
39436
39552
  oauthClientId,
39553
+ oauthClientSecret,
39437
39554
  oauthScope,
39438
39555
  config,
39439
39556
  connectionType,
@@ -39474,9 +39591,9 @@ const App = () => {
39474
39591
  if (serverCapabilities) {
39475
39592
  const hash = window.location.hash.slice(1);
39476
39593
  const validTabs = [
39477
- ...(serverCapabilities == null ? void 0 : serverCapabilities.resources) ? ["resources"] : [],
39478
- ...(serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? ["prompts"] : [],
39479
- ...(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? ["tools"] : [],
39594
+ ...serverCapabilities?.resources ? ["resources"] : [],
39595
+ ...serverCapabilities?.prompts ? ["prompts"] : [],
39596
+ ...serverCapabilities?.tools ? ["tools"] : [],
39480
39597
  "ping",
39481
39598
  "sampling",
39482
39599
  "elicitations",
@@ -39485,7 +39602,7 @@ const App = () => {
39485
39602
  ];
39486
39603
  const isValidTab = validTabs.includes(hash);
39487
39604
  if (!isValidTab) {
39488
- const defaultTab = (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping";
39605
+ const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
39489
39606
  setActiveTab(defaultTab);
39490
39607
  window.location.hash = defaultTab;
39491
39608
  }
@@ -39539,6 +39656,9 @@ const App = () => {
39539
39656
  reactExports.useEffect(() => {
39540
39657
  localStorage.setItem("lastOauthScope", oauthScope);
39541
39658
  }, [oauthScope]);
39659
+ reactExports.useEffect(() => {
39660
+ localStorage.setItem("lastOauthClientSecret", oauthClientSecret);
39661
+ }, [oauthClientSecret]);
39542
39662
  reactExports.useEffect(() => {
39543
39663
  saveInspectorConfig(CONFIG_LOCAL_STORAGE_KEY, config);
39544
39664
  }, [config]);
@@ -39662,7 +39782,7 @@ const App = () => {
39662
39782
  }, [roots]);
39663
39783
  reactExports.useEffect(() => {
39664
39784
  if (mcpClient && !window.location.hash) {
39665
- const defaultTab = (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping";
39785
+ const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
39666
39786
  window.location.hash = defaultTab;
39667
39787
  } else if (!mcpClient && window.location.hash) {
39668
39788
  window.history.replaceState(
@@ -39685,14 +39805,14 @@ const App = () => {
39685
39805
  const handleApproveSampling = (id, result) => {
39686
39806
  setPendingSampleRequests((prev) => {
39687
39807
  const request = prev.find((r2) => r2.id === id);
39688
- request == null ? void 0 : request.resolve(result);
39808
+ request?.resolve(result);
39689
39809
  return prev.filter((r2) => r2.id !== id);
39690
39810
  });
39691
39811
  };
39692
39812
  const handleRejectSampling = (id) => {
39693
39813
  setPendingSampleRequests((prev) => {
39694
39814
  const request = prev.find((r2) => r2.id === id);
39695
- request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
39815
+ request?.reject(new Error("Sampling request rejected"));
39696
39816
  return prev.filter((r2) => r2.id !== id);
39697
39817
  });
39698
39818
  };
@@ -39704,9 +39824,9 @@ const App = () => {
39704
39824
  if (request.originatingTab) {
39705
39825
  const originatingTab = request.originatingTab;
39706
39826
  const validTabs = [
39707
- ...(serverCapabilities == null ? void 0 : serverCapabilities.resources) ? ["resources"] : [],
39708
- ...(serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? ["prompts"] : [],
39709
- ...(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? ["tools"] : [],
39827
+ ...serverCapabilities?.resources ? ["resources"] : [],
39828
+ ...serverCapabilities?.prompts ? ["prompts"] : [],
39829
+ ...serverCapabilities?.tools ? ["tools"] : [],
39710
39830
  "ping",
39711
39831
  "sampling",
39712
39832
  "elicitations",
@@ -39861,7 +39981,7 @@ const App = () => {
39861
39981
  lastToolCallOriginTabRef.current = currentTabRef.current;
39862
39982
  try {
39863
39983
  const tool = tools.find((t) => t.name === name2);
39864
- const cleanedParams = (tool == null ? void 0 : tool.inputSchema) ? cleanParams(params, tool.inputSchema) : params;
39984
+ const cleanedParams = tool?.inputSchema ? cleanParams(params, tool.inputSchema) : params;
39865
39985
  const response = await sendMCPRequest(
39866
39986
  {
39867
39987
  method: "tools/call",
@@ -39919,13 +40039,13 @@ const App = () => {
39919
40039
  ) });
39920
40040
  if (window.location.pathname === "/oauth/callback") {
39921
40041
  const OAuthCallback = React.lazy(
39922
- () => __vitePreload(() => import("./OAuthCallback-C0JXhwud.js"), true ? [] : void 0)
40042
+ () => __vitePreload(() => import("./OAuthCallback-DOgG8dke.js"), true ? [] : void 0)
39923
40043
  );
39924
40044
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
39925
40045
  }
39926
40046
  if (window.location.pathname === "/oauth/callback/debug") {
39927
40047
  const OAuthDebugCallback = React.lazy(
39928
- () => __vitePreload(() => import("./OAuthDebugCallback-TZR9iqA_.js"), true ? [] : void 0)
40048
+ () => __vitePreload(() => import("./OAuthDebugCallback-m70IPFbL.js"), true ? [] : void 0)
39929
40049
  );
39930
40050
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
39931
40051
  }
@@ -39961,13 +40081,15 @@ const App = () => {
39961
40081
  setCustomHeaders,
39962
40082
  oauthClientId,
39963
40083
  setOauthClientId,
40084
+ oauthClientSecret,
40085
+ setOauthClientSecret,
39964
40086
  oauthScope,
39965
40087
  setOauthScope,
39966
40088
  onConnect: connectMcpServer,
39967
40089
  onDisconnect: disconnectMcpServer,
39968
40090
  logLevel,
39969
40091
  sendLogLevelRequest,
39970
- loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
40092
+ loggingSupported: !!serverCapabilities?.logging || false,
39971
40093
  connectionType,
39972
40094
  setConnectionType
39973
40095
  }
@@ -40009,7 +40131,7 @@ const App = () => {
40009
40131
  TabsTrigger,
40010
40132
  {
40011
40133
  value: "resources",
40012
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources),
40134
+ disabled: !serverCapabilities?.resources,
40013
40135
  children: [
40014
40136
  /* @__PURE__ */ jsxRuntimeExports.jsx(Files, { className: "w-4 h-4 mr-2" }),
40015
40137
  "Resources"
@@ -40020,7 +40142,7 @@ const App = () => {
40020
40142
  TabsTrigger,
40021
40143
  {
40022
40144
  value: "prompts",
40023
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts),
40145
+ disabled: !serverCapabilities?.prompts,
40024
40146
  children: [
40025
40147
  /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-4 h-4 mr-2" }),
40026
40148
  "Prompts"
@@ -40031,7 +40153,7 @@ const App = () => {
40031
40153
  TabsTrigger,
40032
40154
  {
40033
40155
  value: "tools",
40034
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.tools),
40156
+ disabled: !serverCapabilities?.tools,
40035
40157
  children: [
40036
40158
  /* @__PURE__ */ jsxRuntimeExports.jsx(Hammer, { className: "w-4 h-4 mr-2" }),
40037
40159
  "Tools"
@@ -40061,7 +40183,7 @@ const App = () => {
40061
40183
  "Auth"
40062
40184
  ] })
40063
40185
  ] }),
40064
- /* @__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: [
40186
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full", children: !serverCapabilities?.resources && !serverCapabilities?.prompts && !serverCapabilities?.tools ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
40065
40187
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg text-gray-500 dark:text-gray-400", children: "The connected server does not support any MCP capabilities" }) }),
40066
40188
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40067
40189
  PingTab,
@@ -40107,7 +40229,7 @@ const App = () => {
40107
40229
  clearError("resources");
40108
40230
  setSelectedResource(resource);
40109
40231
  },
40110
- resourceSubscriptionsSupported: ((_a = serverCapabilities == null ? void 0 : serverCapabilities.resources) == null ? void 0 : _a.subscribe) || false,
40232
+ resourceSubscriptionsSupported: serverCapabilities?.resources?.subscribe || false,
40111
40233
  resourceSubscriptions,
40112
40234
  subscribeToResource: (uri) => {
40113
40235
  clearError("resources");