@bryan-thompson/inspector-assessment-client 1.7.1 → 1.7.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.
@@ -361,7 +361,7 @@ var hasRequiredScheduler_production_min;
361
361
  function requireScheduler_production_min() {
362
362
  if (hasRequiredScheduler_production_min) return scheduler_production_min;
363
363
  hasRequiredScheduler_production_min = 1;
364
- (function(exports) {
364
+ (function(exports$1) {
365
365
  function f(a, b) {
366
366
  var c = a.length;
367
367
  a.push(b);
@@ -394,12 +394,12 @@ function requireScheduler_production_min() {
394
394
  }
395
395
  if ("object" === typeof performance && "function" === typeof performance.now) {
396
396
  var l = performance;
397
- exports.unstable_now = function() {
397
+ exports$1.unstable_now = function() {
398
398
  return l.now();
399
399
  };
400
400
  } else {
401
401
  var p2 = Date, q = p2.now();
402
- exports.unstable_now = function() {
402
+ exports$1.unstable_now = function() {
403
403
  return p2.now() - q;
404
404
  };
405
405
  }
@@ -435,7 +435,7 @@ function requireScheduler_production_min() {
435
435
  v.callback = null;
436
436
  y = v.priorityLevel;
437
437
  var e = d(v.expirationTime <= b);
438
- b = exports.unstable_now();
438
+ b = exports$1.unstable_now();
439
439
  "function" === typeof e ? v.callback = e : v === h(r2) && k2(r2);
440
440
  G2(b);
441
441
  } else k2(r2);
@@ -454,11 +454,11 @@ function requireScheduler_production_min() {
454
454
  }
455
455
  var N2 = false, O = null, L2 = -1, P2 = 5, Q = -1;
456
456
  function M() {
457
- return exports.unstable_now() - Q < P2 ? false : true;
457
+ return exports$1.unstable_now() - Q < P2 ? false : true;
458
458
  }
459
459
  function R() {
460
460
  if (null !== O) {
461
- var a = exports.unstable_now();
461
+ var a = exports$1.unstable_now();
462
462
  Q = a;
463
463
  var b = true;
464
464
  try {
@@ -487,31 +487,31 @@ function requireScheduler_production_min() {
487
487
  }
488
488
  function K2(a, b) {
489
489
  L2 = D2(function() {
490
- a(exports.unstable_now());
490
+ a(exports$1.unstable_now());
491
491
  }, b);
492
492
  }
493
- exports.unstable_IdlePriority = 5;
494
- exports.unstable_ImmediatePriority = 1;
495
- exports.unstable_LowPriority = 4;
496
- exports.unstable_NormalPriority = 3;
497
- exports.unstable_Profiling = null;
498
- exports.unstable_UserBlockingPriority = 2;
499
- exports.unstable_cancelCallback = function(a) {
493
+ exports$1.unstable_IdlePriority = 5;
494
+ exports$1.unstable_ImmediatePriority = 1;
495
+ exports$1.unstable_LowPriority = 4;
496
+ exports$1.unstable_NormalPriority = 3;
497
+ exports$1.unstable_Profiling = null;
498
+ exports$1.unstable_UserBlockingPriority = 2;
499
+ exports$1.unstable_cancelCallback = function(a) {
500
500
  a.callback = null;
501
501
  };
502
- exports.unstable_continueExecution = function() {
502
+ exports$1.unstable_continueExecution = function() {
503
503
  A || z || (A = true, I(J2));
504
504
  };
505
- exports.unstable_forceFrameRate = function(a) {
505
+ exports$1.unstable_forceFrameRate = function(a) {
506
506
  0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5;
507
507
  };
508
- exports.unstable_getCurrentPriorityLevel = function() {
508
+ exports$1.unstable_getCurrentPriorityLevel = function() {
509
509
  return y;
510
510
  };
511
- exports.unstable_getFirstCallbackNode = function() {
511
+ exports$1.unstable_getFirstCallbackNode = function() {
512
512
  return h(r2);
513
513
  };
514
- exports.unstable_next = function(a) {
514
+ exports$1.unstable_next = function(a) {
515
515
  switch (y) {
516
516
  case 1:
517
517
  case 2:
@@ -529,11 +529,11 @@ function requireScheduler_production_min() {
529
529
  y = c;
530
530
  }
531
531
  };
532
- exports.unstable_pauseExecution = function() {
532
+ exports$1.unstable_pauseExecution = function() {
533
533
  };
534
- exports.unstable_requestPaint = function() {
534
+ exports$1.unstable_requestPaint = function() {
535
535
  };
536
- exports.unstable_runWithPriority = function(a, b) {
536
+ exports$1.unstable_runWithPriority = function(a, b) {
537
537
  switch (a) {
538
538
  case 1:
539
539
  case 2:
@@ -552,8 +552,8 @@ function requireScheduler_production_min() {
552
552
  y = c;
553
553
  }
554
554
  };
555
- exports.unstable_scheduleCallback = function(a, b, c) {
556
- var d = exports.unstable_now();
555
+ exports$1.unstable_scheduleCallback = function(a, b, c) {
556
+ var d = exports$1.unstable_now();
557
557
  "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
558
558
  switch (a) {
559
559
  case 1:
@@ -576,8 +576,8 @@ function requireScheduler_production_min() {
576
576
  c > d ? (a.sortIndex = c, f(t, a), null === h(r2) && a === h(t) && (B2 ? (E(L2), L2 = -1) : B2 = true, K2(H2, c - d))) : (a.sortIndex = e, f(r2, a), A || z || (A = true, I(J2)));
577
577
  return a;
578
578
  };
579
- exports.unstable_shouldYield = M;
580
- exports.unstable_wrapCallback = function(a) {
579
+ exports$1.unstable_shouldYield = M;
580
+ exports$1.unstable_wrapCallback = function(a) {
581
581
  var b = y;
582
582
  return function() {
583
583
  var c = y;
@@ -7270,12 +7270,12 @@ function composeContextScopes(...scopes) {
7270
7270
  return createScope;
7271
7271
  }
7272
7272
  // @__NO_SIDE_EFFECTS__
7273
- function createSlot(ownerName) {
7274
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
7273
+ function createSlot$5(ownerName) {
7274
+ const SlotClone = /* @__PURE__ */ createSlotClone$5(ownerName);
7275
7275
  const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
7276
7276
  const { children, ...slotProps } = props;
7277
7277
  const childrenArray = reactExports.Children.toArray(children);
7278
- const slottable = childrenArray.find(isSlottable);
7278
+ const slottable = childrenArray.find(isSlottable$5);
7279
7279
  if (slottable) {
7280
7280
  const newElement = slottable.props.children;
7281
7281
  const newChildren = childrenArray.map((child) => {
@@ -7293,14 +7293,13 @@ function createSlot(ownerName) {
7293
7293
  Slot2.displayName = `${ownerName}.Slot`;
7294
7294
  return Slot2;
7295
7295
  }
7296
- var Slot$3 = /* @__PURE__ */ createSlot("Slot");
7297
7296
  // @__NO_SIDE_EFFECTS__
7298
- function createSlotClone(ownerName) {
7297
+ function createSlotClone$5(ownerName) {
7299
7298
  const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
7300
7299
  const { children, ...slotProps } = props;
7301
7300
  if (reactExports.isValidElement(children)) {
7302
- const childrenRef = getElementRef$1(children);
7303
- const props2 = mergeProps(slotProps, children.props);
7301
+ const childrenRef = getElementRef$6(children);
7302
+ const props2 = mergeProps$5(slotProps, children.props);
7304
7303
  if (children.type !== reactExports.Fragment) {
7305
7304
  props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
7306
7305
  }
@@ -7311,20 +7310,11 @@ function createSlotClone(ownerName) {
7311
7310
  SlotClone.displayName = `${ownerName}.SlotClone`;
7312
7311
  return SlotClone;
7313
7312
  }
7314
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
7315
- // @__NO_SIDE_EFFECTS__
7316
- function createSlottable(ownerName) {
7317
- const Slottable2 = ({ children }) => {
7318
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
7319
- };
7320
- Slottable2.displayName = `${ownerName}.Slottable`;
7321
- Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
7322
- return Slottable2;
7313
+ var SLOTTABLE_IDENTIFIER$6 = Symbol("radix.slottable");
7314
+ function isSlottable$5(child) {
7315
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$6;
7323
7316
  }
7324
- function isSlottable(child) {
7325
- return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
7326
- }
7327
- function mergeProps(slotProps, childProps) {
7317
+ function mergeProps$5(slotProps, childProps) {
7328
7318
  const overrideProps = { ...childProps };
7329
7319
  for (const propName in childProps) {
7330
7320
  const slotPropValue = slotProps[propName];
@@ -7348,7 +7338,7 @@ function mergeProps(slotProps, childProps) {
7348
7338
  }
7349
7339
  return { ...slotProps, ...overrideProps };
7350
7340
  }
7351
- function getElementRef$1(element) {
7341
+ function getElementRef$6(element) {
7352
7342
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7353
7343
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7354
7344
  if (mayWarn) {
@@ -7376,7 +7366,7 @@ function createCollection(name2) {
7376
7366
  };
7377
7367
  CollectionProvider.displayName = PROVIDER_NAME2;
7378
7368
  const COLLECTION_SLOT_NAME = name2 + "CollectionSlot";
7379
- const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
7369
+ const CollectionSlotImpl = /* @__PURE__ */ createSlot$5(COLLECTION_SLOT_NAME);
7380
7370
  const CollectionSlot = React.forwardRef(
7381
7371
  (props, forwardedRef) => {
7382
7372
  const { scope: scope2, children } = props;
@@ -7388,7 +7378,7 @@ function createCollection(name2) {
7388
7378
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
7389
7379
  const ITEM_SLOT_NAME = name2 + "CollectionItemSlot";
7390
7380
  const ITEM_DATA_ATTR = "data-radix-collection-item";
7391
- const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
7381
+ const CollectionItemSlotImpl = /* @__PURE__ */ createSlot$5(ITEM_SLOT_NAME);
7392
7382
  const CollectionItemSlot = React.forwardRef(
7393
7383
  (props, forwardedRef) => {
7394
7384
  const { scope: scope2, children, ...itemData } = props;
@@ -7423,7 +7413,89 @@ function createCollection(name2) {
7423
7413
  createCollectionScope2
7424
7414
  ];
7425
7415
  }
7426
- var NODES = [
7416
+ // @__NO_SIDE_EFFECTS__
7417
+ function createSlot$4(ownerName) {
7418
+ const SlotClone = /* @__PURE__ */ createSlotClone$4(ownerName);
7419
+ const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
7420
+ const { children, ...slotProps } = props;
7421
+ const childrenArray = reactExports.Children.toArray(children);
7422
+ const slottable = childrenArray.find(isSlottable$4);
7423
+ if (slottable) {
7424
+ const newElement = slottable.props.children;
7425
+ const newChildren = childrenArray.map((child) => {
7426
+ if (child === slottable) {
7427
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
7428
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
7429
+ } else {
7430
+ return child;
7431
+ }
7432
+ });
7433
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
7434
+ }
7435
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
7436
+ });
7437
+ Slot2.displayName = `${ownerName}.Slot`;
7438
+ return Slot2;
7439
+ }
7440
+ // @__NO_SIDE_EFFECTS__
7441
+ function createSlotClone$4(ownerName) {
7442
+ const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
7443
+ const { children, ...slotProps } = props;
7444
+ if (reactExports.isValidElement(children)) {
7445
+ const childrenRef = getElementRef$5(children);
7446
+ const props2 = mergeProps$4(slotProps, children.props);
7447
+ if (children.type !== reactExports.Fragment) {
7448
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
7449
+ }
7450
+ return reactExports.cloneElement(children, props2);
7451
+ }
7452
+ return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
7453
+ });
7454
+ SlotClone.displayName = `${ownerName}.SlotClone`;
7455
+ return SlotClone;
7456
+ }
7457
+ var SLOTTABLE_IDENTIFIER$5 = Symbol("radix.slottable");
7458
+ function isSlottable$4(child) {
7459
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$5;
7460
+ }
7461
+ function mergeProps$4(slotProps, childProps) {
7462
+ const overrideProps = { ...childProps };
7463
+ for (const propName in childProps) {
7464
+ const slotPropValue = slotProps[propName];
7465
+ const childPropValue = childProps[propName];
7466
+ const isHandler = /^on[A-Z]/.test(propName);
7467
+ if (isHandler) {
7468
+ if (slotPropValue && childPropValue) {
7469
+ overrideProps[propName] = (...args) => {
7470
+ const result = childPropValue(...args);
7471
+ slotPropValue(...args);
7472
+ return result;
7473
+ };
7474
+ } else if (slotPropValue) {
7475
+ overrideProps[propName] = slotPropValue;
7476
+ }
7477
+ } else if (propName === "style") {
7478
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
7479
+ } else if (propName === "className") {
7480
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
7481
+ }
7482
+ }
7483
+ return { ...slotProps, ...overrideProps };
7484
+ }
7485
+ function getElementRef$5(element) {
7486
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7487
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7488
+ if (mayWarn) {
7489
+ return element.ref;
7490
+ }
7491
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
7492
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7493
+ if (mayWarn) {
7494
+ return element.props.ref;
7495
+ }
7496
+ return element.props.ref || element.ref;
7497
+ }
7498
+ var NODES$1 = [
7427
7499
  "a",
7428
7500
  "button",
7429
7501
  "div",
@@ -7442,8 +7514,8 @@ var NODES = [
7442
7514
  "svg",
7443
7515
  "ul"
7444
7516
  ];
7445
- var Primitive = NODES.reduce((primitive, node) => {
7446
- const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
7517
+ var Primitive$1 = NODES$1.reduce((primitive, node) => {
7518
+ const Slot2 = /* @__PURE__ */ createSlot$4(`Primitive.${node}`);
7447
7519
  const Node2 = reactExports.forwardRef((props, forwardedRef) => {
7448
7520
  const { asChild, ...primitiveProps } = props;
7449
7521
  const Comp = asChild ? Slot2 : node;
@@ -7565,7 +7637,7 @@ var DismissableLayer = reactExports.forwardRef(
7565
7637
  return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
7566
7638
  }, []);
7567
7639
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
7568
- Primitive.div,
7640
+ Primitive$1.div,
7569
7641
  {
7570
7642
  ...layerProps,
7571
7643
  ref: composedRefs,
@@ -7598,7 +7670,7 @@ var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
7598
7670
  };
7599
7671
  }
7600
7672
  }, [context.branches]);
7601
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
7673
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { ...props, ref: composedRefs });
7602
7674
  });
7603
7675
  DismissableLayerBranch.displayName = BRANCH_NAME;
7604
7676
  function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
@@ -7688,7 +7760,7 @@ var Portal$3 = reactExports.forwardRef((props, forwardedRef) => {
7688
7760
  const [mounted, setMounted] = reactExports.useState(false);
7689
7761
  useLayoutEffect2(() => setMounted(true), []);
7690
7762
  const container = containerProp || mounted && globalThis?.document?.body;
7691
- return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
7763
+ return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { ...portalProps, ref: forwardedRef }), container) : null;
7692
7764
  });
7693
7765
  Portal$3.displayName = PORTAL_NAME$4;
7694
7766
  function useStateMachine(initialState, machine) {
@@ -7701,7 +7773,7 @@ var Presence = (props) => {
7701
7773
  const { present, children } = props;
7702
7774
  const presence = usePresence(present);
7703
7775
  const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children);
7704
- const ref2 = useComposedRefs(presence.ref, getElementRef(child));
7776
+ const ref2 = useComposedRefs(presence.ref, getElementRef$4(child));
7705
7777
  const forceMount = typeof children === "function";
7706
7778
  return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref: ref2 }) : null;
7707
7779
  };
@@ -7800,7 +7872,7 @@ function usePresence(present) {
7800
7872
  function getAnimationName(styles) {
7801
7873
  return styles?.animationName || "none";
7802
7874
  }
7803
- function getElementRef(element) {
7875
+ function getElementRef$4(element) {
7804
7876
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7805
7877
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7806
7878
  if (mayWarn) {
@@ -7894,7 +7966,7 @@ var NAME$2 = "VisuallyHidden";
7894
7966
  var VisuallyHidden = reactExports.forwardRef(
7895
7967
  (props, forwardedRef) => {
7896
7968
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
7897
- Primitive.span,
7969
+ Primitive$1.span,
7898
7970
  {
7899
7971
  ...props,
7900
7972
  ref: forwardedRef,
@@ -8079,7 +8151,7 @@ var ToastViewport$1 = reactExports.forwardRef(
8079
8151
  }
8080
8152
  }
8081
8153
  ),
8082
- /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),
8154
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),
8083
8155
  hasToasts && /* @__PURE__ */ jsxRuntimeExports.jsx(
8084
8156
  FocusProxy,
8085
8157
  {
@@ -8270,7 +8342,7 @@ var ToastImpl = reactExports.forwardRef(
8270
8342
  context.isFocusedToastEscapeKeyDownRef.current = false;
8271
8343
  }),
8272
8344
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8273
- Primitive.li,
8345
+ Primitive$1.li,
8274
8346
  {
8275
8347
  tabIndex: 0,
8276
8348
  "data-state": open ? "open" : "closed",
@@ -8376,7 +8448,7 @@ var TITLE_NAME$1 = "ToastTitle";
8376
8448
  var ToastTitle$1 = reactExports.forwardRef(
8377
8449
  (props, forwardedRef) => {
8378
8450
  const { __scopeToast, ...titleProps } = props;
8379
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...titleProps, ref: forwardedRef });
8451
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { ...titleProps, ref: forwardedRef });
8380
8452
  }
8381
8453
  );
8382
8454
  ToastTitle$1.displayName = TITLE_NAME$1;
@@ -8384,7 +8456,7 @@ var DESCRIPTION_NAME$1 = "ToastDescription";
8384
8456
  var ToastDescription$1 = reactExports.forwardRef(
8385
8457
  (props, forwardedRef) => {
8386
8458
  const { __scopeToast, ...descriptionProps } = props;
8387
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...descriptionProps, ref: forwardedRef });
8459
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { ...descriptionProps, ref: forwardedRef });
8388
8460
  }
8389
8461
  );
8390
8462
  ToastDescription$1.displayName = DESCRIPTION_NAME$1;
@@ -8408,7 +8480,7 @@ var ToastClose$1 = reactExports.forwardRef(
8408
8480
  const { __scopeToast, ...closeProps } = props;
8409
8481
  const interactiveContext = useToastInteractiveContext(CLOSE_NAME$2, __scopeToast);
8410
8482
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8411
- Primitive.button,
8483
+ Primitive$1.button,
8412
8484
  {
8413
8485
  type: "button",
8414
8486
  ...closeProps,
@@ -8422,7 +8494,7 @@ ToastClose$1.displayName = CLOSE_NAME$2;
8422
8494
  var ToastAnnounceExclude = reactExports.forwardRef((props, forwardedRef) => {
8423
8495
  const { __scopeToast, altText, ...announceExcludeProps } = props;
8424
8496
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8425
- Primitive.div,
8497
+ Primitive$1.div,
8426
8498
  {
8427
8499
  "data-radix-toast-announce-exclude": "",
8428
8500
  "data-radix-toast-announce-alt": altText || void 0,
@@ -14691,7 +14763,7 @@ const JSONRPC_VERSION = "2.0";
14691
14763
  const AssertObjectSchema = custom$1((v) => v !== null && (typeof v === "object" || typeof v === "function"));
14692
14764
  const ProgressTokenSchema = union([string(), number$1().int()]);
14693
14765
  const CursorSchema = string();
14694
- const TaskCreationParamsSchema = looseObject({
14766
+ looseObject({
14695
14767
  /**
14696
14768
  * Time in milliseconds to keep task results available after completion.
14697
14769
  * If null, the task has unlimited lifetime until manually cleaned up.
@@ -14702,7 +14774,10 @@ const TaskCreationParamsSchema = looseObject({
14702
14774
  */
14703
14775
  pollInterval: number$1().optional()
14704
14776
  });
14705
- const RelatedTaskMetadataSchema = looseObject({
14777
+ const TaskMetadataSchema = object({
14778
+ ttl: number$1().optional()
14779
+ });
14780
+ const RelatedTaskMetadataSchema = object({
14706
14781
  taskId: string()
14707
14782
  });
14708
14783
  const RequestMetaSchema = looseObject({
@@ -14715,48 +14790,45 @@ const RequestMetaSchema = looseObject({
14715
14790
  */
14716
14791
  [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
14717
14792
  });
14718
- const BaseRequestParamsSchema = looseObject({
14719
- /**
14720
- * If specified, the caller is requesting that the receiver create a task to represent the request.
14721
- * Task creation parameters are now at the top level instead of in _meta.
14722
- */
14723
- task: TaskCreationParamsSchema.optional(),
14793
+ const BaseRequestParamsSchema = object({
14724
14794
  /**
14725
14795
  * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
14726
14796
  */
14727
14797
  _meta: RequestMetaSchema.optional()
14728
14798
  });
14799
+ const TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
14800
+ /**
14801
+ * If specified, the caller is requesting task-augmented execution for this request.
14802
+ * The request will return a CreateTaskResult immediately, and the actual result can be
14803
+ * retrieved later via tasks/result.
14804
+ *
14805
+ * Task augmentation is subject to capability negotiation - receivers MUST declare support
14806
+ * for task augmentation of specific request types in their capabilities.
14807
+ */
14808
+ task: TaskMetadataSchema.optional()
14809
+ });
14810
+ const isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
14729
14811
  const RequestSchema = object({
14730
14812
  method: string(),
14731
- params: BaseRequestParamsSchema.optional()
14813
+ params: BaseRequestParamsSchema.loose().optional()
14732
14814
  });
14733
- const NotificationsParamsSchema = looseObject({
14815
+ const NotificationsParamsSchema = object({
14734
14816
  /**
14735
14817
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
14736
14818
  * for notes on _meta usage.
14737
14819
  */
14738
- _meta: object({
14739
- /**
14740
- * If specified, this notification is related to the provided task.
14741
- */
14742
- [RELATED_TASK_META_KEY]: optional(RelatedTaskMetadataSchema)
14743
- }).passthrough().optional()
14820
+ _meta: RequestMetaSchema.optional()
14744
14821
  });
14745
14822
  const NotificationSchema = object({
14746
14823
  method: string(),
14747
- params: NotificationsParamsSchema.optional()
14824
+ params: NotificationsParamsSchema.loose().optional()
14748
14825
  });
14749
14826
  const ResultSchema = looseObject({
14750
14827
  /**
14751
14828
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
14752
14829
  * for notes on _meta usage.
14753
14830
  */
14754
- _meta: looseObject({
14755
- /**
14756
- * If specified, this result is related to the provided task.
14757
- */
14758
- [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
14759
- }).optional()
14831
+ _meta: RequestMetaSchema.optional()
14760
14832
  });
14761
14833
  const RequestIdSchema = union([string(), number$1().int()]);
14762
14834
  const JSONRPCRequestSchema = object({
@@ -14770,12 +14842,12 @@ const JSONRPCNotificationSchema = object({
14770
14842
  ...NotificationSchema.shape
14771
14843
  }).strict();
14772
14844
  const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
14773
- const JSONRPCResponseSchema = object({
14845
+ const JSONRPCResultResponseSchema = object({
14774
14846
  jsonrpc: literal(JSONRPC_VERSION),
14775
14847
  id: RequestIdSchema,
14776
14848
  result: ResultSchema
14777
14849
  }).strict();
14778
- const isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
14850
+ const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
14779
14851
  var ErrorCode;
14780
14852
  (function(ErrorCode2) {
14781
14853
  ErrorCode2[ErrorCode2["ConnectionClosed"] = -32e3] = "ConnectionClosed";
@@ -14787,9 +14859,9 @@ var ErrorCode;
14787
14859
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
14788
14860
  ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
14789
14861
  })(ErrorCode || (ErrorCode = {}));
14790
- const JSONRPCErrorSchema = object({
14862
+ const JSONRPCErrorResponseSchema = object({
14791
14863
  jsonrpc: literal(JSONRPC_VERSION),
14792
- id: RequestIdSchema,
14864
+ id: RequestIdSchema.optional(),
14793
14865
  error: object({
14794
14866
  /**
14795
14867
  * The error type that occurred.
@@ -14802,11 +14874,17 @@ const JSONRPCErrorSchema = object({
14802
14874
  /**
14803
14875
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
14804
14876
  */
14805
- data: optional(unknown())
14877
+ data: unknown().optional()
14806
14878
  })
14807
14879
  }).strict();
14808
- const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
14809
- const JSONRPCMessageSchema = union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
14880
+ const isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
14881
+ const JSONRPCMessageSchema = union([
14882
+ JSONRPCRequestSchema,
14883
+ JSONRPCNotificationSchema,
14884
+ JSONRPCResultResponseSchema,
14885
+ JSONRPCErrorResponseSchema
14886
+ ]);
14887
+ union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
14810
14888
  const EmptyResultSchema = ResultSchema.strict();
14811
14889
  const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
14812
14890
  /**
@@ -14814,7 +14892,7 @@ const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
14814
14892
  *
14815
14893
  * This MUST correspond to the ID of a request previously issued in the same direction.
14816
14894
  */
14817
- requestId: RequestIdSchema,
14895
+ requestId: RequestIdSchema.optional(),
14818
14896
  /**
14819
14897
  * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
14820
14898
  */
@@ -14839,7 +14917,15 @@ const IconSchema = object({
14839
14917
  *
14840
14918
  * If not provided, the client should assume that the icon can be used at any size.
14841
14919
  */
14842
- sizes: array(string()).optional()
14920
+ sizes: array(string()).optional(),
14921
+ /**
14922
+ * Optional specifier for the theme this icon is designed for. `light` indicates
14923
+ * the icon is designed to be used with a light background, and `dark` indicates
14924
+ * the icon is designed to be used with a dark background.
14925
+ *
14926
+ * If not provided, the client should assume the icon can be used with any theme.
14927
+ */
14928
+ theme: _enum$2(["light", "dark"]).optional()
14843
14929
  });
14844
14930
  const IconsSchema = object({
14845
14931
  /**
@@ -14875,7 +14961,15 @@ const ImplementationSchema = BaseMetadataSchema.extend({
14875
14961
  /**
14876
14962
  * An optional URL of the website for this implementation.
14877
14963
  */
14878
- websiteUrl: string().optional()
14964
+ websiteUrl: string().optional(),
14965
+ /**
14966
+ * An optional human-readable description of what this implementation does.
14967
+ *
14968
+ * This can be used by clients or servers to provide context about their purpose
14969
+ * and capabilities. For example, a server might describe the types of resources
14970
+ * or tools it provides, while a client might describe its intended use case.
14971
+ */
14972
+ description: string().optional()
14879
14973
  });
14880
14974
  const FormElicitationCapabilitySchema = intersection(object({
14881
14975
  applyDefaults: boolean().optional()
@@ -14891,54 +14985,54 @@ const ElicitationCapabilitySchema = preprocess((value) => {
14891
14985
  form: FormElicitationCapabilitySchema.optional(),
14892
14986
  url: AssertObjectSchema.optional()
14893
14987
  }), record(string(), unknown()).optional()));
14894
- const ClientTasksCapabilitySchema = object({
14988
+ const ClientTasksCapabilitySchema = looseObject({
14895
14989
  /**
14896
14990
  * Present if the client supports listing tasks.
14897
14991
  */
14898
- list: optional(object({}).passthrough()),
14992
+ list: AssertObjectSchema.optional(),
14899
14993
  /**
14900
14994
  * Present if the client supports cancelling tasks.
14901
14995
  */
14902
- cancel: optional(object({}).passthrough()),
14996
+ cancel: AssertObjectSchema.optional(),
14903
14997
  /**
14904
14998
  * Capabilities for task creation on specific request types.
14905
14999
  */
14906
- requests: optional(object({
15000
+ requests: looseObject({
14907
15001
  /**
14908
15002
  * Task support for sampling requests.
14909
15003
  */
14910
- sampling: optional(object({
14911
- createMessage: optional(object({}).passthrough())
14912
- }).passthrough()),
15004
+ sampling: looseObject({
15005
+ createMessage: AssertObjectSchema.optional()
15006
+ }).optional(),
14913
15007
  /**
14914
15008
  * Task support for elicitation requests.
14915
15009
  */
14916
- elicitation: optional(object({
14917
- create: optional(object({}).passthrough())
14918
- }).passthrough())
14919
- }).passthrough())
14920
- }).passthrough();
14921
- const ServerTasksCapabilitySchema = object({
15010
+ elicitation: looseObject({
15011
+ create: AssertObjectSchema.optional()
15012
+ }).optional()
15013
+ }).optional()
15014
+ });
15015
+ const ServerTasksCapabilitySchema = looseObject({
14922
15016
  /**
14923
15017
  * Present if the server supports listing tasks.
14924
15018
  */
14925
- list: optional(object({}).passthrough()),
15019
+ list: AssertObjectSchema.optional(),
14926
15020
  /**
14927
15021
  * Present if the server supports cancelling tasks.
14928
15022
  */
14929
- cancel: optional(object({}).passthrough()),
15023
+ cancel: AssertObjectSchema.optional(),
14930
15024
  /**
14931
15025
  * Capabilities for task creation on specific request types.
14932
15026
  */
14933
- requests: optional(object({
15027
+ requests: looseObject({
14934
15028
  /**
14935
15029
  * Task support for tool requests.
14936
15030
  */
14937
- tools: optional(object({
14938
- call: optional(object({}).passthrough())
14939
- }).passthrough())
14940
- }).passthrough())
14941
- }).passthrough();
15031
+ tools: looseObject({
15032
+ call: AssertObjectSchema.optional()
15033
+ }).optional()
15034
+ }).optional()
15035
+ });
14942
15036
  const ClientCapabilitiesSchema = object({
14943
15037
  /**
14944
15038
  * Experimental, non-standard capabilities that the client supports.
@@ -14974,7 +15068,7 @@ const ClientCapabilitiesSchema = object({
14974
15068
  /**
14975
15069
  * Present if the client supports task creation.
14976
15070
  */
14977
- tasks: optional(ClientTasksCapabilitySchema)
15071
+ tasks: ClientTasksCapabilitySchema.optional()
14978
15072
  });
14979
15073
  const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
14980
15074
  /**
@@ -15004,12 +15098,12 @@ const ServerCapabilitiesSchema = object({
15004
15098
  /**
15005
15099
  * Present if the server offers any prompt templates.
15006
15100
  */
15007
- prompts: optional(object({
15101
+ prompts: object({
15008
15102
  /**
15009
15103
  * Whether this server supports issuing notifications for changes to the prompt list.
15010
15104
  */
15011
- listChanged: optional(boolean())
15012
- })),
15105
+ listChanged: boolean().optional()
15106
+ }).optional(),
15013
15107
  /**
15014
15108
  * Present if the server offers any resources to read.
15015
15109
  */
@@ -15035,8 +15129,8 @@ const ServerCapabilitiesSchema = object({
15035
15129
  /**
15036
15130
  * Present if the server supports task creation.
15037
15131
  */
15038
- tasks: optional(ServerTasksCapabilitySchema)
15039
- }).passthrough();
15132
+ tasks: ServerTasksCapabilitySchema.optional()
15133
+ });
15040
15134
  const InitializeResultSchema = ResultSchema.extend({
15041
15135
  /**
15042
15136
  * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
@@ -15052,11 +15146,13 @@ const InitializeResultSchema = ResultSchema.extend({
15052
15146
  instructions: string().optional()
15053
15147
  });
15054
15148
  const InitializedNotificationSchema = NotificationSchema.extend({
15055
- method: literal("notifications/initialized")
15149
+ method: literal("notifications/initialized"),
15150
+ params: NotificationsParamsSchema.optional()
15056
15151
  });
15057
15152
  const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
15058
15153
  const PingRequestSchema = RequestSchema.extend({
15059
- method: literal("ping")
15154
+ method: literal("ping"),
15155
+ params: BaseRequestParamsSchema.optional()
15060
15156
  });
15061
15157
  const ProgressSchema = object({
15062
15158
  /**
@@ -15099,11 +15195,12 @@ const PaginatedResultSchema = ResultSchema.extend({
15099
15195
  * An opaque token representing the pagination position after the last returned result.
15100
15196
  * If present, there may be more results available.
15101
15197
  */
15102
- nextCursor: optional(CursorSchema)
15198
+ nextCursor: CursorSchema.optional()
15103
15199
  });
15200
+ const TaskStatusSchema = _enum$2(["working", "input_required", "completed", "failed", "cancelled"]);
15104
15201
  const TaskSchema = object({
15105
15202
  taskId: string(),
15106
- status: _enum$2(["working", "input_required", "completed", "failed", "cancelled"]),
15203
+ status: TaskStatusSchema,
15107
15204
  /**
15108
15205
  * Time in milliseconds to keep task results available after completion.
15109
15206
  * If null, the task has unlimited lifetime until manually cleaned up.
@@ -15144,6 +15241,7 @@ const GetTaskPayloadRequestSchema = RequestSchema.extend({
15144
15241
  taskId: string()
15145
15242
  })
15146
15243
  });
15244
+ ResultSchema.loose();
15147
15245
  const ListTasksRequestSchema = PaginatedRequestSchema.extend({
15148
15246
  method: literal("tasks/list")
15149
15247
  });
@@ -15182,7 +15280,7 @@ const Base64Schema = string().refine((val) => {
15182
15280
  try {
15183
15281
  atob(val);
15184
15282
  return true;
15185
- } catch (_a) {
15283
+ } catch {
15186
15284
  return false;
15187
15285
  }
15188
15286
  }, { message: "Invalid Base64 string" });
@@ -15192,11 +15290,12 @@ const BlobResourceContentsSchema = ResourceContentsSchema.extend({
15192
15290
  */
15193
15291
  blob: Base64Schema
15194
15292
  });
15293
+ const RoleSchema = _enum$2(["user", "assistant"]);
15195
15294
  const AnnotationsSchema = object({
15196
15295
  /**
15197
15296
  * Intended audience(s) for the resource.
15198
15297
  */
15199
- audience: array(_enum$2(["user", "assistant"])).optional(),
15298
+ audience: array(RoleSchema).optional(),
15200
15299
  /**
15201
15300
  * Importance hint for the resource, from 0 (least) to 1 (most).
15202
15301
  */
@@ -15289,7 +15388,8 @@ const ReadResourceResultSchema = ResultSchema.extend({
15289
15388
  contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
15290
15389
  });
15291
15390
  const ResourceListChangedNotificationSchema = NotificationSchema.extend({
15292
- method: literal("notifications/resources/list_changed")
15391
+ method: literal("notifications/resources/list_changed"),
15392
+ params: NotificationsParamsSchema.optional()
15293
15393
  });
15294
15394
  const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
15295
15395
  const SubscribeRequestSchema = RequestSchema.extend({
@@ -15434,13 +15534,13 @@ const ToolUseContentSchema = object({
15434
15534
  * Arguments to pass to the tool.
15435
15535
  * Must conform to the tool's inputSchema.
15436
15536
  */
15437
- input: object({}).passthrough(),
15537
+ input: record(string(), unknown()),
15438
15538
  /**
15439
15539
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15440
15540
  * for notes on _meta usage.
15441
15541
  */
15442
- _meta: optional(object({}).passthrough())
15443
- }).passthrough();
15542
+ _meta: record(string(), unknown()).optional()
15543
+ });
15444
15544
  const EmbeddedResourceSchema = object({
15445
15545
  type: literal("resource"),
15446
15546
  resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
@@ -15465,18 +15565,19 @@ const ContentBlockSchema = union([
15465
15565
  EmbeddedResourceSchema
15466
15566
  ]);
15467
15567
  const PromptMessageSchema = object({
15468
- role: _enum$2(["user", "assistant"]),
15568
+ role: RoleSchema,
15469
15569
  content: ContentBlockSchema
15470
15570
  });
15471
15571
  const GetPromptResultSchema = ResultSchema.extend({
15472
15572
  /**
15473
15573
  * An optional description for the prompt.
15474
15574
  */
15475
- description: optional(string()),
15575
+ description: string().optional(),
15476
15576
  messages: array(PromptMessageSchema)
15477
15577
  });
15478
15578
  const PromptListChangedNotificationSchema = NotificationSchema.extend({
15479
- method: literal("notifications/prompts/list_changed")
15579
+ method: literal("notifications/prompts/list_changed"),
15580
+ params: NotificationsParamsSchema.optional()
15480
15581
  });
15481
15582
  const ToolAnnotationsSchema = object({
15482
15583
  /**
@@ -15557,11 +15658,11 @@ const ToolSchema = object({
15557
15658
  /**
15558
15659
  * Optional additional tool information.
15559
15660
  */
15560
- annotations: optional(ToolAnnotationsSchema),
15661
+ annotations: ToolAnnotationsSchema.optional(),
15561
15662
  /**
15562
15663
  * Execution-related properties for this tool.
15563
15664
  */
15564
- execution: optional(ToolExecutionSchema),
15665
+ execution: ToolExecutionSchema.optional(),
15565
15666
  /**
15566
15667
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15567
15668
  * for notes on _meta usage.
@@ -15602,12 +15703,12 @@ const CallToolResultSchema = ResultSchema.extend({
15602
15703
  * server does not support tool calls, or any other exceptional conditions,
15603
15704
  * should be reported as an MCP error response.
15604
15705
  */
15605
- isError: optional(boolean())
15706
+ isError: boolean().optional()
15606
15707
  });
15607
15708
  const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
15608
15709
  toolResult: unknown()
15609
15710
  }));
15610
- const CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
15711
+ const CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
15611
15712
  /**
15612
15713
  * The name of the tool to call.
15613
15714
  */
@@ -15615,14 +15716,35 @@ const CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
15615
15716
  /**
15616
15717
  * Arguments to pass to the tool.
15617
15718
  */
15618
- arguments: optional(record(string(), unknown()))
15719
+ arguments: record(string(), unknown()).optional()
15619
15720
  });
15620
15721
  const CallToolRequestSchema = RequestSchema.extend({
15621
15722
  method: literal("tools/call"),
15622
15723
  params: CallToolRequestParamsSchema
15623
15724
  });
15624
15725
  const ToolListChangedNotificationSchema = NotificationSchema.extend({
15625
- method: literal("notifications/tools/list_changed")
15726
+ method: literal("notifications/tools/list_changed"),
15727
+ params: NotificationsParamsSchema.optional()
15728
+ });
15729
+ const ListChangedOptionsBaseSchema = object({
15730
+ /**
15731
+ * If true, the list will be refreshed automatically when a list changed notification is received.
15732
+ * The callback will be called with the updated list.
15733
+ *
15734
+ * If false, the callback will be called with null items, allowing manual refresh.
15735
+ *
15736
+ * @default true
15737
+ */
15738
+ autoRefresh: boolean().default(true),
15739
+ /**
15740
+ * Debounce time in milliseconds for list changed notification processing.
15741
+ *
15742
+ * Multiple notifications received within this timeframe will only trigger one refresh.
15743
+ * Set to 0 to disable debouncing.
15744
+ *
15745
+ * @default 300
15746
+ */
15747
+ debounceMs: number$1().int().nonnegative().default(300)
15626
15748
  });
15627
15749
  const LoggingLevelSchema = _enum$2(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
15628
15750
  const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -15663,19 +15785,19 @@ const ModelPreferencesSchema = object({
15663
15785
  /**
15664
15786
  * Optional hints to use for model selection.
15665
15787
  */
15666
- hints: optional(array(ModelHintSchema)),
15788
+ hints: array(ModelHintSchema).optional(),
15667
15789
  /**
15668
15790
  * How much to prioritize cost when selecting a model.
15669
15791
  */
15670
- costPriority: optional(number$1().min(0).max(1)),
15792
+ costPriority: number$1().min(0).max(1).optional(),
15671
15793
  /**
15672
15794
  * How much to prioritize sampling speed (latency) when selecting a model.
15673
15795
  */
15674
- speedPriority: optional(number$1().min(0).max(1)),
15796
+ speedPriority: number$1().min(0).max(1).optional(),
15675
15797
  /**
15676
15798
  * How much to prioritize intelligence and capabilities when selecting a model.
15677
15799
  */
15678
- intelligencePriority: optional(number$1().min(0).max(1))
15800
+ intelligencePriority: number$1().min(0).max(1).optional()
15679
15801
  });
15680
15802
  const ToolChoiceSchema = object({
15681
15803
  /**
@@ -15684,20 +15806,20 @@ const ToolChoiceSchema = object({
15684
15806
  * - "required": Model MUST use at least one tool before completing
15685
15807
  * - "none": Model MUST NOT use any tools
15686
15808
  */
15687
- mode: optional(_enum$2(["auto", "required", "none"]))
15809
+ mode: _enum$2(["auto", "required", "none"]).optional()
15688
15810
  });
15689
15811
  const ToolResultContentSchema = object({
15690
15812
  type: literal("tool_result"),
15691
15813
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
15692
15814
  content: array(ContentBlockSchema).default([]),
15693
- structuredContent: object({}).passthrough().optional(),
15694
- isError: optional(boolean()),
15815
+ structuredContent: object({}).loose().optional(),
15816
+ isError: boolean().optional(),
15695
15817
  /**
15696
15818
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15697
15819
  * for notes on _meta usage.
15698
15820
  */
15699
- _meta: optional(object({}).passthrough())
15700
- }).passthrough();
15821
+ _meta: record(string(), unknown()).optional()
15822
+ });
15701
15823
  const SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
15702
15824
  const SamplingMessageContentBlockSchema = discriminatedUnion("type", [
15703
15825
  TextContentSchema,
@@ -15707,15 +15829,15 @@ const SamplingMessageContentBlockSchema = discriminatedUnion("type", [
15707
15829
  ToolResultContentSchema
15708
15830
  ]);
15709
15831
  const SamplingMessageSchema = object({
15710
- role: _enum$2(["user", "assistant"]),
15832
+ role: RoleSchema,
15711
15833
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
15712
15834
  /**
15713
15835
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
15714
15836
  * for notes on _meta usage.
15715
15837
  */
15716
- _meta: optional(object({}).passthrough())
15717
- }).passthrough();
15718
- const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
15838
+ _meta: record(string(), unknown()).optional()
15839
+ });
15840
+ const CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
15719
15841
  messages: array(SamplingMessageSchema),
15720
15842
  /**
15721
15843
  * The server's preferences for which model to select. The client MAY modify or omit this request.
@@ -15749,13 +15871,13 @@ const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
15749
15871
  * Tools that the model may use during generation.
15750
15872
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
15751
15873
  */
15752
- tools: optional(array(ToolSchema)),
15874
+ tools: array(ToolSchema).optional(),
15753
15875
  /**
15754
15876
  * Controls how the model uses tools.
15755
15877
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
15756
15878
  * Default is `{ mode: "auto" }`.
15757
15879
  */
15758
- toolChoice: optional(ToolChoiceSchema)
15880
+ toolChoice: ToolChoiceSchema.optional()
15759
15881
  });
15760
15882
  const CreateMessageRequestSchema = RequestSchema.extend({
15761
15883
  method: literal("sampling/createMessage"),
@@ -15777,7 +15899,7 @@ const CreateMessageResultSchema = ResultSchema.extend({
15777
15899
  * This field is an open string to allow for provider-specific stop reasons.
15778
15900
  */
15779
15901
  stopReason: optional(_enum$2(["endTurn", "stopSequence", "maxTokens"]).or(string())),
15780
- role: _enum$2(["user", "assistant"]),
15902
+ role: RoleSchema,
15781
15903
  /**
15782
15904
  * Response content. Single content block (text, image, or audio).
15783
15905
  */
@@ -15800,7 +15922,7 @@ const CreateMessageResultWithToolsSchema = ResultSchema.extend({
15800
15922
  * This field is an open string to allow for provider-specific stop reasons.
15801
15923
  */
15802
15924
  stopReason: optional(_enum$2(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string())),
15803
- role: _enum$2(["user", "assistant"]),
15925
+ role: RoleSchema,
15804
15926
  /**
15805
15927
  * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
15806
15928
  */
@@ -15884,7 +16006,7 @@ const TitledMultiSelectEnumSchemaSchema = object({
15884
16006
  const MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
15885
16007
  const EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
15886
16008
  const PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
15887
- const ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
16009
+ const ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
15888
16010
  /**
15889
16011
  * The elicitation mode.
15890
16012
  *
@@ -15905,7 +16027,7 @@ const ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
15905
16027
  required: array(string()).optional()
15906
16028
  })
15907
16029
  });
15908
- const ElicitRequestURLParamsSchema = BaseRequestParamsSchema.extend({
16030
+ const ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
15909
16031
  /**
15910
16032
  * The elicitation mode.
15911
16033
  */
@@ -16027,13 +16149,15 @@ const RootSchema = object({
16027
16149
  _meta: record(string(), unknown()).optional()
16028
16150
  });
16029
16151
  const ListRootsRequestSchema = RequestSchema.extend({
16030
- method: literal("roots/list")
16152
+ method: literal("roots/list"),
16153
+ params: BaseRequestParamsSchema.optional()
16031
16154
  });
16032
16155
  const ListRootsResultSchema = ResultSchema.extend({
16033
16156
  roots: array(RootSchema)
16034
16157
  });
16035
16158
  const RootsListChangedNotificationSchema = NotificationSchema.extend({
16036
- method: literal("notifications/roots/list_changed")
16159
+ method: literal("notifications/roots/list_changed"),
16160
+ params: NotificationsParamsSchema.optional()
16037
16161
  });
16038
16162
  union([
16039
16163
  PingRequestSchema,
@@ -16051,7 +16175,8 @@ union([
16051
16175
  ListToolsRequestSchema,
16052
16176
  GetTaskRequestSchema,
16053
16177
  GetTaskPayloadRequestSchema,
16054
- ListTasksRequestSchema
16178
+ ListTasksRequestSchema,
16179
+ CancelTaskRequestSchema
16055
16180
  ]);
16056
16181
  union([
16057
16182
  CancelledNotificationSchema,
@@ -16077,7 +16202,8 @@ union([
16077
16202
  ListRootsRequestSchema,
16078
16203
  GetTaskRequestSchema,
16079
16204
  GetTaskPayloadRequestSchema,
16080
- ListTasksRequestSchema
16205
+ ListTasksRequestSchema,
16206
+ CancelTaskRequestSchema
16081
16207
  ]);
16082
16208
  union([
16083
16209
  CancelledNotificationSchema,
@@ -16132,8 +16258,7 @@ class UrlElicitationRequiredError extends McpError {
16132
16258
  });
16133
16259
  }
16134
16260
  get elicitations() {
16135
- var _a, _b;
16136
- return (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.elicitations) !== null && _b !== void 0 ? _b : [];
16261
+ return this.data?.elicitations ?? [];
16137
16262
  }
16138
16263
  }
16139
16264
  const SafeUrlSchema = url().superRefine((val, ctx) => {
@@ -16279,7 +16404,7 @@ object({
16279
16404
  token_type_hint: string().optional()
16280
16405
  }).strip();
16281
16406
  const name = "@bryan-thompson/inspector-assessment-client";
16282
- const version$1 = "1.7.1";
16407
+ const version$1 = "1.7.2";
16283
16408
  const packageJson = {
16284
16409
  name,
16285
16410
  version: version$1
@@ -16441,11 +16566,15 @@ async function getRandomValues(size2) {
16441
16566
  }
16442
16567
  async function random(size2) {
16443
16568
  const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
16569
+ const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length;
16444
16570
  let result = "";
16445
- const randomUints = await getRandomValues(size2);
16446
- for (let i = 0; i < size2; i++) {
16447
- const randomIndex = randomUints[i] % mask.length;
16448
- result += mask[randomIndex];
16571
+ while (result.length < size2) {
16572
+ const randomBytes = await getRandomValues(size2 - result.length);
16573
+ for (const randomByte of randomBytes) {
16574
+ if (randomByte < evenDistCutoff) {
16575
+ result += mask[randomByte % mask.length];
16576
+ }
16577
+ }
16449
16578
  }
16450
16579
  return result;
16451
16580
  }
@@ -16582,7 +16711,7 @@ const OAUTH_ERRORS = {
16582
16711
  };
16583
16712
  class UnauthorizedError extends Error {
16584
16713
  constructor(message) {
16585
- super(message !== null && message !== void 0 ? message : "Unauthorized");
16714
+ super(message ?? "Unauthorized");
16586
16715
  }
16587
16716
  }
16588
16717
  function isClientAuthMethod(method) {
@@ -16655,22 +16784,20 @@ async function parseErrorResponse(input) {
16655
16784
  }
16656
16785
  }
16657
16786
  async function auth(provider, options) {
16658
- var _a, _b;
16659
16787
  try {
16660
16788
  return await authInternal(provider, options);
16661
16789
  } catch (error) {
16662
16790
  if (error instanceof InvalidClientError || error instanceof UnauthorizedClientError) {
16663
- await ((_a = provider.invalidateCredentials) === null || _a === void 0 ? void 0 : _a.call(provider, "all"));
16791
+ await provider.invalidateCredentials?.("all");
16664
16792
  return await authInternal(provider, options);
16665
16793
  } else if (error instanceof InvalidGrantError) {
16666
- await ((_b = provider.invalidateCredentials) === null || _b === void 0 ? void 0 : _b.call(provider, "tokens"));
16794
+ await provider.invalidateCredentials?.("tokens");
16667
16795
  return await authInternal(provider, options);
16668
16796
  }
16669
16797
  throw error;
16670
16798
  }
16671
16799
  }
16672
16800
  async function authInternal(provider, { serverUrl, authorizationCode, scope: scope2, resourceMetadataUrl, fetchFn }) {
16673
- var _a, _b;
16674
16801
  let resourceMetadata;
16675
16802
  let authorizationServerUrl;
16676
16803
  try {
@@ -16678,7 +16805,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope: sco
16678
16805
  if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) {
16679
16806
  authorizationServerUrl = resourceMetadata.authorization_servers[0];
16680
16807
  }
16681
- } catch (_c) {
16808
+ } catch {
16682
16809
  }
16683
16810
  if (!authorizationServerUrl) {
16684
16811
  authorizationServerUrl = new URL("/", serverUrl);
@@ -16692,7 +16819,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope: sco
16692
16819
  if (authorizationCode !== void 0) {
16693
16820
  throw new Error("Existing OAuth client information is required when exchanging an authorization code");
16694
16821
  }
16695
- const supportsUrlBasedClientId = (metadata2 === null || metadata2 === void 0 ? void 0 : metadata2.client_id_metadata_document_supported) === true;
16822
+ const supportsUrlBasedClientId = metadata2?.client_id_metadata_document_supported === true;
16696
16823
  const clientMetadataUrl = provider.clientMetadataUrl;
16697
16824
  if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) {
16698
16825
  throw new InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`);
@@ -16702,7 +16829,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope: sco
16702
16829
  clientInformation = {
16703
16830
  client_id: clientMetadataUrl
16704
16831
  };
16705
- await ((_a = provider.saveClientInformation) === null || _a === void 0 ? void 0 : _a.call(provider, clientInformation));
16832
+ await provider.saveClientInformation?.(clientInformation);
16706
16833
  } else {
16707
16834
  if (!provider.saveClientInformation) {
16708
16835
  throw new Error("OAuth client information must be saveable for dynamic registration");
@@ -16728,7 +16855,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope: sco
16728
16855
  return "AUTHORIZED";
16729
16856
  }
16730
16857
  const tokens = await provider.tokens();
16731
- if (tokens === null || tokens === void 0 ? void 0 : tokens.refresh_token) {
16858
+ if (tokens?.refresh_token) {
16732
16859
  try {
16733
16860
  const newTokens = await refreshAuthorization(authorizationServerUrl, {
16734
16861
  metadata: metadata2,
@@ -16753,7 +16880,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope: sco
16753
16880
  clientInformation,
16754
16881
  state,
16755
16882
  redirectUrl: provider.redirectUrl,
16756
- scope: scope2 || ((_b = resourceMetadata === null || resourceMetadata === void 0 ? void 0 : resourceMetadata.scopes_supported) === null || _b === void 0 ? void 0 : _b.join(" ")) || provider.clientMetadata.scope,
16883
+ scope: scope2 || resourceMetadata?.scopes_supported?.join(" ") || provider.clientMetadata.scope,
16757
16884
  resource
16758
16885
  });
16759
16886
  await provider.saveCodeVerifier(codeVerifier);
@@ -16766,14 +16893,14 @@ function isHttpsUrl(value) {
16766
16893
  try {
16767
16894
  const url2 = new URL(value);
16768
16895
  return url2.protocol === "https:" && url2.pathname !== "/";
16769
- } catch (_a) {
16896
+ } catch {
16770
16897
  return false;
16771
16898
  }
16772
16899
  }
16773
16900
  async function selectResourceURL(serverUrl, provider, resourceMetadata) {
16774
16901
  const defaultResource = resourceUrlFromServerUrl(serverUrl);
16775
16902
  if (provider.validateResourceURL) {
16776
- return await provider.validateResourceURL(defaultResource, resourceMetadata === null || resourceMetadata === void 0 ? void 0 : resourceMetadata.resource);
16903
+ return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource);
16777
16904
  }
16778
16905
  if (!resourceMetadata) {
16779
16906
  return void 0;
@@ -16797,7 +16924,7 @@ function extractWWWAuthenticateParams(res) {
16797
16924
  if (resourceMetadataMatch) {
16798
16925
  try {
16799
16926
  resourceMetadataUrl = new URL(resourceMetadataMatch);
16800
- } catch (_a) {
16927
+ } catch {
16801
16928
  }
16802
16929
  }
16803
16930
  const scope2 = extractFieldFromWwwAuth(res, "scope") || void 0;
@@ -16821,17 +16948,16 @@ function extractFieldFromWwwAuth(response, fieldName) {
16821
16948
  return null;
16822
16949
  }
16823
16950
  async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {
16824
- var _a, _b;
16825
16951
  const response = await discoverMetadataWithFallback(serverUrl, "oauth-protected-resource", fetchFn, {
16826
- protocolVersion: opts === null || opts === void 0 ? void 0 : opts.protocolVersion,
16827
- metadataUrl: opts === null || opts === void 0 ? void 0 : opts.resourceMetadataUrl
16952
+ protocolVersion: opts?.protocolVersion,
16953
+ metadataUrl: opts?.resourceMetadataUrl
16828
16954
  });
16829
16955
  if (!response || response.status === 404) {
16830
- await ((_a = response === null || response === void 0 ? void 0 : response.body) === null || _a === void 0 ? void 0 : _a.cancel());
16956
+ await response?.body?.cancel();
16831
16957
  throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);
16832
16958
  }
16833
16959
  if (!response.ok) {
16834
- await ((_b = response.body) === null || _b === void 0 ? void 0 : _b.cancel());
16960
+ await response.body?.cancel();
16835
16961
  throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`);
16836
16962
  }
16837
16963
  return OAuthProtectedResourceMetadataSchema.parse(await response.json());
@@ -16866,19 +16992,18 @@ function shouldAttemptFallback(response, pathname) {
16866
16992
  return !response || response.status >= 400 && response.status < 500 && pathname !== "/";
16867
16993
  }
16868
16994
  async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
16869
- var _a, _b;
16870
16995
  const issuer = new URL(serverUrl);
16871
- const protocolVersion = (_a = opts === null || opts === void 0 ? void 0 : opts.protocolVersion) !== null && _a !== void 0 ? _a : LATEST_PROTOCOL_VERSION;
16996
+ const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION;
16872
16997
  let url2;
16873
- if (opts === null || opts === void 0 ? void 0 : opts.metadataUrl) {
16998
+ if (opts?.metadataUrl) {
16874
16999
  url2 = new URL(opts.metadataUrl);
16875
17000
  } else {
16876
17001
  const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
16877
- url2 = new URL(wellKnownPath, (_b = opts === null || opts === void 0 ? void 0 : opts.metadataServerUrl) !== null && _b !== void 0 ? _b : issuer);
17002
+ url2 = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
16878
17003
  url2.search = issuer.search;
16879
17004
  }
16880
17005
  let response = await tryMetadataDiscovery(url2, protocolVersion, fetchFn);
16881
- if (!(opts === null || opts === void 0 ? void 0 : opts.metadataUrl) && shouldAttemptFallback(response, issuer.pathname)) {
17006
+ if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) {
16882
17007
  const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer);
16883
17008
  response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn);
16884
17009
  }
@@ -16918,7 +17043,6 @@ function buildDiscoveryUrls(authorizationServerUrl) {
16918
17043
  return urlsToTry;
16919
17044
  }
16920
17045
  async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
16921
- var _a;
16922
17046
  const headers = {
16923
17047
  "MCP-Protocol-Version": protocolVersion,
16924
17048
  Accept: "application/json"
@@ -16930,7 +17054,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
16930
17054
  continue;
16931
17055
  }
16932
17056
  if (!response.ok) {
16933
- await ((_a = response.body) === null || _a === void 0 ? void 0 : _a.cancel());
17057
+ await response.body?.cancel();
16934
17058
  if (response.status >= 400 && response.status < 500) {
16935
17059
  continue;
16936
17060
  }
@@ -16971,7 +17095,7 @@ async function startAuthorization(authorizationServerUrl, { metadata: metadata2,
16971
17095
  if (scope2) {
16972
17096
  authorizationUrl.searchParams.set("scope", scope2);
16973
17097
  }
16974
- if (scope2 === null || scope2 === void 0 ? void 0 : scope2.includes("offline_access")) {
17098
+ if (scope2?.includes("offline_access")) {
16975
17099
  authorizationUrl.searchParams.append("prompt", "consent");
16976
17100
  }
16977
17101
  if (resource) {
@@ -16988,8 +17112,7 @@ function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redire
16988
17112
  });
16989
17113
  }
16990
17114
  async function executeTokenRequest(authorizationServerUrl, { metadata: metadata2, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) {
16991
- var _a;
16992
- const tokenUrl = (metadata2 === null || metadata2 === void 0 ? void 0 : metadata2.token_endpoint) ? new URL(metadata2.token_endpoint) : new URL("/token", authorizationServerUrl);
17115
+ const tokenUrl = metadata2?.token_endpoint ? new URL(metadata2.token_endpoint) : new URL("/token", authorizationServerUrl);
16993
17116
  const headers = new Headers({
16994
17117
  "Content-Type": "application/x-www-form-urlencoded",
16995
17118
  Accept: "application/json"
@@ -17000,11 +17123,11 @@ async function executeTokenRequest(authorizationServerUrl, { metadata: metadata2
17000
17123
  if (addClientAuthentication) {
17001
17124
  await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata2);
17002
17125
  } else if (clientInformation) {
17003
- const supportedMethods = (_a = metadata2 === null || metadata2 === void 0 ? void 0 : metadata2.token_endpoint_auth_methods_supported) !== null && _a !== void 0 ? _a : [];
17126
+ const supportedMethods = metadata2?.token_endpoint_auth_methods_supported ?? [];
17004
17127
  const authMethod = selectClientAuthMethod(clientInformation, supportedMethods);
17005
17128
  applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams);
17006
17129
  }
17007
- const response = await (fetchFn !== null && fetchFn !== void 0 ? fetchFn : fetch)(tokenUrl, {
17130
+ const response = await (fetchFn ?? fetch)(tokenUrl, {
17008
17131
  method: "POST",
17009
17132
  headers,
17010
17133
  body: tokenRequestParams
@@ -17060,7 +17183,7 @@ async function fetchToken(provider, authorizationServerUrl, { metadata: metadata
17060
17183
  return executeTokenRequest(authorizationServerUrl, {
17061
17184
  metadata: metadata2,
17062
17185
  tokenRequestParams,
17063
- clientInformation: clientInformation !== null && clientInformation !== void 0 ? clientInformation : void 0,
17186
+ clientInformation: clientInformation ?? void 0,
17064
17187
  addClientAuthentication: provider.addClientAuthentication,
17065
17188
  resource,
17066
17189
  fetchFn
@@ -17076,7 +17199,7 @@ async function registerClient(authorizationServerUrl, { metadata: metadata2, cli
17076
17199
  } else {
17077
17200
  registrationUrl = new URL("/register", authorizationServerUrl);
17078
17201
  }
17079
- const response = await (fetchFn !== null && fetchFn !== void 0 ? fetchFn : fetch)(registrationUrl, {
17202
+ const response = await (fetchFn ?? fetch)(registrationUrl, {
17080
17203
  method: "POST",
17081
17204
  headers: {
17082
17205
  "Content-Type": "application/json"
@@ -17495,10 +17618,10 @@ var hasRequiredUri_all;
17495
17618
  function requireUri_all() {
17496
17619
  if (hasRequiredUri_all) return uri_all$1.exports;
17497
17620
  hasRequiredUri_all = 1;
17498
- (function(module, exports) {
17621
+ (function(module, exports$1) {
17499
17622
  (function(global2, factory) {
17500
- factory(exports);
17501
- })(uri_all, (function(exports2) {
17623
+ factory(exports$1);
17624
+ })(uri_all, (function(exports$12) {
17502
17625
  function merge2() {
17503
17626
  for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
17504
17627
  sets[_key] = arguments[_key];
@@ -18499,19 +18622,19 @@ function requireUri_all() {
18499
18622
  SCHEMES[handler$4.scheme] = handler$4;
18500
18623
  SCHEMES[handler$5.scheme] = handler$5;
18501
18624
  SCHEMES[handler$6.scheme] = handler$6;
18502
- exports2.SCHEMES = SCHEMES;
18503
- exports2.pctEncChar = pctEncChar;
18504
- exports2.pctDecChars = pctDecChars;
18505
- exports2.parse = parse2;
18506
- exports2.removeDotSegments = removeDotSegments;
18507
- exports2.serialize = serialize;
18508
- exports2.resolveComponents = resolveComponents;
18509
- exports2.resolve = resolve2;
18510
- exports2.normalize = normalize;
18511
- exports2.equal = equal2;
18512
- exports2.escapeComponent = escapeComponent;
18513
- exports2.unescapeComponent = unescapeComponent;
18514
- Object.defineProperty(exports2, "__esModule", { value: true });
18625
+ exports$12.SCHEMES = SCHEMES;
18626
+ exports$12.pctEncChar = pctEncChar;
18627
+ exports$12.pctDecChars = pctDecChars;
18628
+ exports$12.parse = parse2;
18629
+ exports$12.removeDotSegments = removeDotSegments;
18630
+ exports$12.serialize = serialize;
18631
+ exports$12.resolveComponents = resolveComponents;
18632
+ exports$12.resolve = resolve2;
18633
+ exports$12.normalize = normalize;
18634
+ exports$12.equal = equal2;
18635
+ exports$12.escapeComponent = escapeComponent;
18636
+ exports$12.unescapeComponent = unescapeComponent;
18637
+ Object.defineProperty(exports$12, "__esModule", { value: true });
18515
18638
  }));
18516
18639
  })(uri_all$1, uri_all$1.exports);
18517
18640
  return uri_all$1.exports;
@@ -23525,8 +23648,8 @@ function requireAjv$1() {
23525
23648
  return ajv$2;
23526
23649
  }
23527
23650
  var ajvExports$1 = requireAjv$1();
23528
- const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports$1);
23529
- const ajv$1 = new Ajv();
23651
+ const Ajv$1 = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports$1);
23652
+ const ajv$1 = new Ajv$1();
23530
23653
  const toolOutputValidators = /* @__PURE__ */ new Map();
23531
23654
  function cacheToolOutputSchemas(tools) {
23532
23655
  toolOutputValidators.clear();
@@ -27284,13 +27407,12 @@ function safeParse(schema, data2) {
27284
27407
  return result;
27285
27408
  }
27286
27409
  function getObjectShape(schema) {
27287
- var _a, _b;
27288
27410
  if (!schema)
27289
27411
  return void 0;
27290
27412
  let rawShape;
27291
27413
  if (isZ4Schema(schema)) {
27292
27414
  const v4Schema = schema;
27293
- rawShape = (_b = (_a = v4Schema._zod) === null || _a === void 0 ? void 0 : _a.def) === null || _b === void 0 ? void 0 : _b.shape;
27415
+ rawShape = v4Schema._zod?.def?.shape;
27294
27416
  } else {
27295
27417
  const v3Schema = schema;
27296
27418
  rawShape = v3Schema.shape;
@@ -27300,17 +27422,16 @@ function getObjectShape(schema) {
27300
27422
  if (typeof rawShape === "function") {
27301
27423
  try {
27302
27424
  return rawShape();
27303
- } catch (_c) {
27425
+ } catch {
27304
27426
  return void 0;
27305
27427
  }
27306
27428
  }
27307
27429
  return rawShape;
27308
27430
  }
27309
27431
  function getLiteralValue(schema) {
27310
- var _a;
27311
27432
  if (isZ4Schema(schema)) {
27312
27433
  const v4Schema = schema;
27313
- const def2 = (_a = v4Schema._zod) === null || _a === void 0 ? void 0 : _a.def;
27434
+ const def2 = v4Schema._zod?.def;
27314
27435
  if (def2) {
27315
27436
  if (def2.value !== void 0)
27316
27437
  return def2.value;
@@ -27339,7 +27460,7 @@ function isTerminal(status) {
27339
27460
  new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
27340
27461
  function getMethodLiteral(schema) {
27341
27462
  const shape = getObjectShape(schema);
27342
- const methodSchema = shape === null || shape === void 0 ? void 0 : shape.method;
27463
+ const methodSchema = shape?.method;
27343
27464
  if (!methodSchema) {
27344
27465
  throw new Error("Schema is missing a method literal");
27345
27466
  }
@@ -27381,8 +27502,8 @@ class Protocol {
27381
27502
  // Automatic pong by default.
27382
27503
  (_request) => ({})
27383
27504
  );
27384
- this._taskStore = _options === null || _options === void 0 ? void 0 : _options.taskStore;
27385
- this._taskMessageQueue = _options === null || _options === void 0 ? void 0 : _options.taskMessageQueue;
27505
+ this._taskStore = _options?.taskStore;
27506
+ this._taskMessageQueue = _options?.taskMessageQueue;
27386
27507
  if (this._taskStore) {
27387
27508
  this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
27388
27509
  const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
@@ -27395,7 +27516,6 @@ class Protocol {
27395
27516
  });
27396
27517
  this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
27397
27518
  const handleTaskResult = async () => {
27398
- var _a;
27399
27519
  const taskId = request.params.taskId;
27400
27520
  if (this._taskMessageQueue) {
27401
27521
  let queuedMessage;
@@ -27419,7 +27539,7 @@ class Protocol {
27419
27539
  }
27420
27540
  continue;
27421
27541
  }
27422
- await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.send(queuedMessage.message, { relatedRequestId: extra.requestId }));
27542
+ await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
27423
27543
  }
27424
27544
  }
27425
27545
  const task = await this._taskStore.getTask(taskId, extra.sessionId);
@@ -27448,9 +27568,8 @@ class Protocol {
27448
27568
  return await handleTaskResult();
27449
27569
  });
27450
27570
  this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
27451
- var _a;
27452
27571
  try {
27453
- const { tasks, nextCursor } = await this._taskStore.listTasks((_a = request.params) === null || _a === void 0 ? void 0 : _a.cursor, extra.sessionId);
27572
+ const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
27454
27573
  return {
27455
27574
  tasks,
27456
27575
  nextCursor,
@@ -27489,8 +27608,11 @@ class Protocol {
27489
27608
  }
27490
27609
  }
27491
27610
  async _oncancel(notification) {
27611
+ if (!notification.params.requestId) {
27612
+ return;
27613
+ }
27492
27614
  const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
27493
- controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason);
27615
+ controller?.abort(notification.params.reason);
27494
27616
  }
27495
27617
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
27496
27618
  this._timeoutInfo.set(messageId, {
@@ -27531,22 +27653,21 @@ class Protocol {
27531
27653
  * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
27532
27654
  */
27533
27655
  async connect(transport) {
27534
- var _a, _b, _c;
27535
27656
  this._transport = transport;
27536
- const _onclose = (_a = this.transport) === null || _a === void 0 ? void 0 : _a.onclose;
27657
+ const _onclose = this.transport?.onclose;
27537
27658
  this._transport.onclose = () => {
27538
- _onclose === null || _onclose === void 0 ? void 0 : _onclose();
27659
+ _onclose?.();
27539
27660
  this._onclose();
27540
27661
  };
27541
- const _onerror = (_b = this.transport) === null || _b === void 0 ? void 0 : _b.onerror;
27662
+ const _onerror = this.transport?.onerror;
27542
27663
  this._transport.onerror = (error) => {
27543
- _onerror === null || _onerror === void 0 ? void 0 : _onerror(error);
27664
+ _onerror?.(error);
27544
27665
  this._onerror(error);
27545
27666
  };
27546
- const _onmessage = (_c = this._transport) === null || _c === void 0 ? void 0 : _c.onmessage;
27667
+ const _onmessage = this._transport?.onmessage;
27547
27668
  this._transport.onmessage = (message, extra) => {
27548
- _onmessage === null || _onmessage === void 0 ? void 0 : _onmessage(message, extra);
27549
- if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
27669
+ _onmessage?.(message, extra);
27670
+ if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
27550
27671
  this._onresponse(message);
27551
27672
  } else if (isJSONRPCRequest(message)) {
27552
27673
  this._onrequest(message, extra);
@@ -27559,7 +27680,6 @@ class Protocol {
27559
27680
  await this._transport.start();
27560
27681
  }
27561
27682
  _onclose() {
27562
- var _a;
27563
27683
  const responseHandlers = this._responseHandlers;
27564
27684
  this._responseHandlers = /* @__PURE__ */ new Map();
27565
27685
  this._progressHandlers.clear();
@@ -27567,28 +27687,25 @@ class Protocol {
27567
27687
  this._pendingDebouncedNotifications.clear();
27568
27688
  const error = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
27569
27689
  this._transport = void 0;
27570
- (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
27690
+ this.onclose?.();
27571
27691
  for (const handler of responseHandlers.values()) {
27572
27692
  handler(error);
27573
27693
  }
27574
27694
  }
27575
27695
  _onerror(error) {
27576
- var _a;
27577
- (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
27696
+ this.onerror?.(error);
27578
27697
  }
27579
27698
  _onnotification(notification) {
27580
- var _a;
27581
- const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler;
27699
+ const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
27582
27700
  if (handler === void 0) {
27583
27701
  return;
27584
27702
  }
27585
27703
  Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
27586
27704
  }
27587
27705
  _onrequest(request, extra) {
27588
- var _a, _b, _c, _d, _e2, _f;
27589
- const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler;
27706
+ const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
27590
27707
  const capturedTransport = this._transport;
27591
- const relatedTaskId = (_d = (_c = (_b = request.params) === null || _b === void 0 ? void 0 : _b._meta) === null || _c === void 0 ? void 0 : _c[RELATED_TASK_META_KEY]) === null || _d === void 0 ? void 0 : _d.taskId;
27708
+ const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
27592
27709
  if (handler === void 0) {
27593
27710
  const errorResponse = {
27594
27711
  jsonrpc: "2.0",
@@ -27603,20 +27720,20 @@ class Protocol {
27603
27720
  type: "error",
27604
27721
  message: errorResponse,
27605
27722
  timestamp: Date.now()
27606
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId).catch((error) => this._onerror(new Error(`Failed to enqueue error response: ${error}`)));
27723
+ }, capturedTransport?.sessionId).catch((error) => this._onerror(new Error(`Failed to enqueue error response: ${error}`)));
27607
27724
  } else {
27608
- capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(errorResponse).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`)));
27725
+ capturedTransport?.send(errorResponse).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`)));
27609
27726
  }
27610
27727
  return;
27611
27728
  }
27612
27729
  const abortController = new AbortController();
27613
27730
  this._requestHandlerAbortControllers.set(request.id, abortController);
27614
- const taskCreationParams = (_e2 = request.params) === null || _e2 === void 0 ? void 0 : _e2.task;
27615
- const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId) : void 0;
27731
+ const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : void 0;
27732
+ const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : void 0;
27616
27733
  const fullExtra = {
27617
27734
  signal: abortController.signal,
27618
- sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,
27619
- _meta: (_f = request.params) === null || _f === void 0 ? void 0 : _f._meta,
27735
+ sessionId: capturedTransport?.sessionId,
27736
+ _meta: request.params?._meta,
27620
27737
  sendNotification: async (notification) => {
27621
27738
  const notificationOptions = { relatedRequestId: request.id };
27622
27739
  if (relatedTaskId) {
@@ -27625,25 +27742,24 @@ class Protocol {
27625
27742
  await this.notification(notification, notificationOptions);
27626
27743
  },
27627
27744
  sendRequest: async (r2, resultSchema, options) => {
27628
- var _a2, _b2;
27629
27745
  const requestOptions = { ...options, relatedRequestId: request.id };
27630
27746
  if (relatedTaskId && !requestOptions.relatedTask) {
27631
27747
  requestOptions.relatedTask = { taskId: relatedTaskId };
27632
27748
  }
27633
- const effectiveTaskId = (_b2 = (_a2 = requestOptions.relatedTask) === null || _a2 === void 0 ? void 0 : _a2.taskId) !== null && _b2 !== void 0 ? _b2 : relatedTaskId;
27749
+ const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
27634
27750
  if (effectiveTaskId && taskStore) {
27635
27751
  await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
27636
27752
  }
27637
27753
  return await this.request(r2, resultSchema, requestOptions);
27638
27754
  },
27639
- authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo,
27755
+ authInfo: extra?.authInfo,
27640
27756
  requestId: request.id,
27641
- requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo,
27757
+ requestInfo: extra?.requestInfo,
27642
27758
  taskId: relatedTaskId,
27643
27759
  taskStore,
27644
- taskRequestedTtl: taskCreationParams === null || taskCreationParams === void 0 ? void 0 : taskCreationParams.ttl,
27645
- closeSSEStream: extra === null || extra === void 0 ? void 0 : extra.closeSSEStream,
27646
- closeStandaloneSSEStream: extra === null || extra === void 0 ? void 0 : extra.closeStandaloneSSEStream
27760
+ taskRequestedTtl: taskCreationParams?.ttl,
27761
+ closeSSEStream: extra?.closeSSEStream,
27762
+ closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
27647
27763
  };
27648
27764
  Promise.resolve().then(() => {
27649
27765
  if (taskCreationParams) {
@@ -27663,12 +27779,11 @@ class Protocol {
27663
27779
  type: "response",
27664
27780
  message: response,
27665
27781
  timestamp: Date.now()
27666
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId);
27782
+ }, capturedTransport?.sessionId);
27667
27783
  } else {
27668
- await (capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(response));
27784
+ await capturedTransport?.send(response);
27669
27785
  }
27670
27786
  }, async (error) => {
27671
- var _a2;
27672
27787
  if (abortController.signal.aborted) {
27673
27788
  return;
27674
27789
  }
@@ -27677,7 +27792,7 @@ class Protocol {
27677
27792
  id: request.id,
27678
27793
  error: {
27679
27794
  code: Number.isSafeInteger(error["code"]) ? error["code"] : ErrorCode.InternalError,
27680
- message: (_a2 = error.message) !== null && _a2 !== void 0 ? _a2 : "Internal error",
27795
+ message: error.message ?? "Internal error",
27681
27796
  ...error["data"] !== void 0 && { data: error["data"] }
27682
27797
  }
27683
27798
  };
@@ -27686,9 +27801,9 @@ class Protocol {
27686
27801
  type: "error",
27687
27802
  message: errorResponse,
27688
27803
  timestamp: Date.now()
27689
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId);
27804
+ }, capturedTransport?.sessionId);
27690
27805
  } else {
27691
- await (capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(errorResponse));
27806
+ await capturedTransport?.send(errorResponse);
27692
27807
  }
27693
27808
  }).catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))).finally(() => {
27694
27809
  this._requestHandlerAbortControllers.delete(request.id);
@@ -27722,7 +27837,7 @@ class Protocol {
27722
27837
  const resolver = this._requestResolvers.get(messageId);
27723
27838
  if (resolver) {
27724
27839
  this._requestResolvers.delete(messageId);
27725
- if (isJSONRPCResponse(response)) {
27840
+ if (isJSONRPCResultResponse(response)) {
27726
27841
  resolver(response);
27727
27842
  } else {
27728
27843
  const error = new McpError(response.error.code, response.error.message, response.error.data);
@@ -27738,7 +27853,7 @@ class Protocol {
27738
27853
  this._responseHandlers.delete(messageId);
27739
27854
  this._cleanupTimeout(messageId);
27740
27855
  let isTaskResponse = false;
27741
- if (isJSONRPCResponse(response) && response.result && typeof response.result === "object") {
27856
+ if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
27742
27857
  const result = response.result;
27743
27858
  if (result.task && typeof result.task === "object") {
27744
27859
  const task = result.task;
@@ -27751,7 +27866,7 @@ class Protocol {
27751
27866
  if (!isTaskResponse) {
27752
27867
  this._progressHandlers.delete(messageId);
27753
27868
  }
27754
- if (isJSONRPCResponse(response)) {
27869
+ if (isJSONRPCResultResponse(response)) {
27755
27870
  handler(response);
27756
27871
  } else {
27757
27872
  const error = McpError.fromError(response.error.code, response.error.message, response.error.data);
@@ -27765,8 +27880,7 @@ class Protocol {
27765
27880
  * Closes the connection.
27766
27881
  */
27767
27882
  async close() {
27768
- var _a;
27769
- await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close());
27883
+ await this._transport?.close();
27770
27884
  }
27771
27885
  /**
27772
27886
  * Sends a request and returns an AsyncGenerator that yields response messages.
@@ -27796,8 +27910,7 @@ class Protocol {
27796
27910
  * @experimental Use `client.experimental.tasks.requestStream()` to access this method.
27797
27911
  */
27798
27912
  async *requestStream(request, resultSchema, options) {
27799
- var _a, _b, _c, _d;
27800
- const { task } = options !== null && options !== void 0 ? options : {};
27913
+ const { task } = options ?? {};
27801
27914
  if (!task) {
27802
27915
  try {
27803
27916
  const result = await this.request(request, resultSchema, options);
@@ -27844,9 +27957,9 @@ class Protocol {
27844
27957
  yield { type: "result", result };
27845
27958
  return;
27846
27959
  }
27847
- const pollInterval = (_c = (_a = task2.pollInterval) !== null && _a !== void 0 ? _a : (_b = this._options) === null || _b === void 0 ? void 0 : _b.defaultTaskPollInterval) !== null && _c !== void 0 ? _c : 1e3;
27960
+ const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
27848
27961
  await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
27849
- (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.throwIfAborted();
27962
+ options?.signal?.throwIfAborted();
27850
27963
  }
27851
27964
  } catch (error) {
27852
27965
  yield {
@@ -27861,9 +27974,8 @@ class Protocol {
27861
27974
  * Do not use this method to emit notifications! Use notification() instead.
27862
27975
  */
27863
27976
  request(request, resultSchema, options) {
27864
- const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options !== null && options !== void 0 ? options : {};
27977
+ const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
27865
27978
  return new Promise((resolve2, reject) => {
27866
- var _a, _b, _c, _d, _e2, _f, _g;
27867
27979
  const earlyReject = (error) => {
27868
27980
  reject(error);
27869
27981
  };
@@ -27871,7 +27983,7 @@ class Protocol {
27871
27983
  earlyReject(new Error("Not connected"));
27872
27984
  return;
27873
27985
  }
27874
- if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) {
27986
+ if (this._options?.enforceStrictCapabilities === true) {
27875
27987
  try {
27876
27988
  this.assertCapabilityForMethod(request.method);
27877
27989
  if (task) {
@@ -27882,19 +27994,19 @@ class Protocol {
27882
27994
  return;
27883
27995
  }
27884
27996
  }
27885
- (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted();
27997
+ options?.signal?.throwIfAborted();
27886
27998
  const messageId = this._requestMessageId++;
27887
27999
  const jsonrpcRequest = {
27888
28000
  ...request,
27889
28001
  jsonrpc: "2.0",
27890
28002
  id: messageId
27891
28003
  };
27892
- if (options === null || options === void 0 ? void 0 : options.onprogress) {
28004
+ if (options?.onprogress) {
27893
28005
  this._progressHandlers.set(messageId, options.onprogress);
27894
28006
  jsonrpcRequest.params = {
27895
28007
  ...request.params,
27896
28008
  _meta: {
27897
- ...((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {},
28009
+ ...request.params?._meta || {},
27898
28010
  progressToken: messageId
27899
28011
  }
27900
28012
  };
@@ -27909,17 +28021,16 @@ class Protocol {
27909
28021
  jsonrpcRequest.params = {
27910
28022
  ...jsonrpcRequest.params,
27911
28023
  _meta: {
27912
- ...((_d = jsonrpcRequest.params) === null || _d === void 0 ? void 0 : _d._meta) || {},
28024
+ ...jsonrpcRequest.params?._meta || {},
27913
28025
  [RELATED_TASK_META_KEY]: relatedTask
27914
28026
  }
27915
28027
  };
27916
28028
  }
27917
28029
  const cancel = (reason) => {
27918
- var _a2;
27919
28030
  this._responseHandlers.delete(messageId);
27920
28031
  this._progressHandlers.delete(messageId);
27921
28032
  this._cleanupTimeout(messageId);
27922
- (_a2 = this._transport) === null || _a2 === void 0 ? void 0 : _a2.send({
28033
+ this._transport?.send({
27923
28034
  jsonrpc: "2.0",
27924
28035
  method: "notifications/cancelled",
27925
28036
  params: {
@@ -27931,8 +28042,7 @@ class Protocol {
27931
28042
  reject(error);
27932
28043
  };
27933
28044
  this._responseHandlers.set(messageId, (response) => {
27934
- var _a2;
27935
- if ((_a2 = options === null || options === void 0 ? void 0 : options.signal) === null || _a2 === void 0 ? void 0 : _a2.aborted) {
28045
+ if (options?.signal?.aborted) {
27936
28046
  return;
27937
28047
  }
27938
28048
  if (response instanceof Error) {
@@ -27949,14 +28059,13 @@ class Protocol {
27949
28059
  reject(error);
27950
28060
  }
27951
28061
  });
27952
- (_e2 = options === null || options === void 0 ? void 0 : options.signal) === null || _e2 === void 0 ? void 0 : _e2.addEventListener("abort", () => {
27953
- var _a2;
27954
- cancel((_a2 = options === null || options === void 0 ? void 0 : options.signal) === null || _a2 === void 0 ? void 0 : _a2.reason);
28062
+ options?.signal?.addEventListener("abort", () => {
28063
+ cancel(options?.signal?.reason);
27955
28064
  });
27956
- const timeout = (_f = options === null || options === void 0 ? void 0 : options.timeout) !== null && _f !== void 0 ? _f : DEFAULT_REQUEST_TIMEOUT_MSEC;
28065
+ const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
27957
28066
  const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
27958
- this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_g = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _g !== void 0 ? _g : false);
27959
- const relatedTaskId = relatedTask === null || relatedTask === void 0 ? void 0 : relatedTask.taskId;
28067
+ this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
28068
+ const relatedTaskId = relatedTask?.taskId;
27960
28069
  if (relatedTaskId) {
27961
28070
  const responseResolver = (response) => {
27962
28071
  const handler = this._responseHandlers.get(messageId);
@@ -28019,12 +28128,11 @@ class Protocol {
28019
28128
  * Emits a notification, which is a one-way message that does not expect a response.
28020
28129
  */
28021
28130
  async notification(notification, options) {
28022
- var _a, _b, _c, _d, _e2;
28023
28131
  if (!this._transport) {
28024
28132
  throw new Error("Not connected");
28025
28133
  }
28026
28134
  this.assertNotificationCapability(notification.method);
28027
- const relatedTaskId = (_a = options === null || options === void 0 ? void 0 : options.relatedTask) === null || _a === void 0 ? void 0 : _a.taskId;
28135
+ const relatedTaskId = options?.relatedTask?.taskId;
28028
28136
  if (relatedTaskId) {
28029
28137
  const jsonrpcNotification2 = {
28030
28138
  ...notification,
@@ -28032,7 +28140,7 @@ class Protocol {
28032
28140
  params: {
28033
28141
  ...notification.params,
28034
28142
  _meta: {
28035
- ...((_b = notification.params) === null || _b === void 0 ? void 0 : _b._meta) || {},
28143
+ ...notification.params?._meta || {},
28036
28144
  [RELATED_TASK_META_KEY]: options.relatedTask
28037
28145
  }
28038
28146
  }
@@ -28044,15 +28152,14 @@ class Protocol {
28044
28152
  });
28045
28153
  return;
28046
28154
  }
28047
- const debouncedMethods = (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.debouncedNotificationMethods) !== null && _d !== void 0 ? _d : [];
28048
- const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !(options === null || options === void 0 ? void 0 : options.relatedRequestId) && !(options === null || options === void 0 ? void 0 : options.relatedTask);
28155
+ const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
28156
+ const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask;
28049
28157
  if (canDebounce) {
28050
28158
  if (this._pendingDebouncedNotifications.has(notification.method)) {
28051
28159
  return;
28052
28160
  }
28053
28161
  this._pendingDebouncedNotifications.add(notification.method);
28054
28162
  Promise.resolve().then(() => {
28055
- var _a2, _b2;
28056
28163
  this._pendingDebouncedNotifications.delete(notification.method);
28057
28164
  if (!this._transport) {
28058
28165
  return;
@@ -28061,19 +28168,19 @@ class Protocol {
28061
28168
  ...notification,
28062
28169
  jsonrpc: "2.0"
28063
28170
  };
28064
- if (options === null || options === void 0 ? void 0 : options.relatedTask) {
28171
+ if (options?.relatedTask) {
28065
28172
  jsonrpcNotification2 = {
28066
28173
  ...jsonrpcNotification2,
28067
28174
  params: {
28068
28175
  ...jsonrpcNotification2.params,
28069
28176
  _meta: {
28070
- ...((_a2 = jsonrpcNotification2.params) === null || _a2 === void 0 ? void 0 : _a2._meta) || {},
28177
+ ...jsonrpcNotification2.params?._meta || {},
28071
28178
  [RELATED_TASK_META_KEY]: options.relatedTask
28072
28179
  }
28073
28180
  }
28074
28181
  };
28075
28182
  }
28076
- (_b2 = this._transport) === null || _b2 === void 0 ? void 0 : _b2.send(jsonrpcNotification2, options).catch((error) => this._onerror(error));
28183
+ this._transport?.send(jsonrpcNotification2, options).catch((error) => this._onerror(error));
28077
28184
  });
28078
28185
  return;
28079
28186
  }
@@ -28081,13 +28188,13 @@ class Protocol {
28081
28188
  ...notification,
28082
28189
  jsonrpc: "2.0"
28083
28190
  };
28084
- if (options === null || options === void 0 ? void 0 : options.relatedTask) {
28191
+ if (options?.relatedTask) {
28085
28192
  jsonrpcNotification = {
28086
28193
  ...jsonrpcNotification,
28087
28194
  params: {
28088
28195
  ...jsonrpcNotification.params,
28089
28196
  _meta: {
28090
- ...((_e2 = jsonrpcNotification.params) === null || _e2 === void 0 ? void 0 : _e2._meta) || {},
28197
+ ...jsonrpcNotification.params?._meta || {},
28091
28198
  [RELATED_TASK_META_KEY]: options.relatedTask
28092
28199
  }
28093
28200
  }
@@ -28163,11 +28270,10 @@ class Protocol {
28163
28270
  * simply propagates the error.
28164
28271
  */
28165
28272
  async _enqueueTaskMessage(taskId, message, sessionId) {
28166
- var _a;
28167
28273
  if (!this._taskStore || !this._taskMessageQueue) {
28168
28274
  throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
28169
28275
  }
28170
- const maxQueueSize = (_a = this._options) === null || _a === void 0 ? void 0 : _a.maxTaskQueueSize;
28276
+ const maxQueueSize = this._options?.maxTaskQueueSize;
28171
28277
  await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
28172
28278
  }
28173
28279
  /**
@@ -28200,14 +28306,13 @@ class Protocol {
28200
28306
  * @returns Promise that resolves when an update occurs or rejects if aborted
28201
28307
  */
28202
28308
  async _waitForTaskUpdate(taskId, signal) {
28203
- var _a, _b, _c;
28204
- let interval = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.defaultTaskPollInterval) !== null && _b !== void 0 ? _b : 1e3;
28309
+ let interval = this._options?.defaultTaskPollInterval ?? 1e3;
28205
28310
  try {
28206
- const task = await ((_c = this._taskStore) === null || _c === void 0 ? void 0 : _c.getTask(taskId));
28207
- if (task === null || task === void 0 ? void 0 : task.pollInterval) {
28311
+ const task = await this._taskStore?.getTask(taskId);
28312
+ if (task?.pollInterval) {
28208
28313
  interval = task.pollInterval;
28209
28314
  }
28210
- } catch (_d) {
28315
+ } catch {
28211
28316
  }
28212
28317
  return new Promise((resolve2, reject) => {
28213
28318
  if (signal.aborted) {
@@ -28317,17 +28422,17 @@ var hasRequiredCode$1;
28317
28422
  function requireCode$1() {
28318
28423
  if (hasRequiredCode$1) return code$1;
28319
28424
  hasRequiredCode$1 = 1;
28320
- (function(exports) {
28321
- Object.defineProperty(exports, "__esModule", { value: true });
28322
- exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
28425
+ (function(exports$1) {
28426
+ Object.defineProperty(exports$1, "__esModule", { value: true });
28427
+ exports$1.regexpCode = exports$1.getEsmExportName = exports$1.getProperty = exports$1.safeStringify = exports$1.stringify = exports$1.strConcat = exports$1.addCodeArg = exports$1.str = exports$1._ = exports$1.nil = exports$1._Code = exports$1.Name = exports$1.IDENTIFIER = exports$1._CodeOrName = void 0;
28323
28428
  class _CodeOrName {
28324
28429
  }
28325
- exports._CodeOrName = _CodeOrName;
28326
- exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
28430
+ exports$1._CodeOrName = _CodeOrName;
28431
+ exports$1.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
28327
28432
  class Name extends _CodeOrName {
28328
28433
  constructor(s) {
28329
28434
  super();
28330
- if (!exports.IDENTIFIER.test(s))
28435
+ if (!exports$1.IDENTIFIER.test(s))
28331
28436
  throw new Error("CodeGen: name must be a valid identifier");
28332
28437
  this.str = s;
28333
28438
  }
@@ -28341,7 +28446,7 @@ function requireCode$1() {
28341
28446
  return { [this.str]: 1 };
28342
28447
  }
28343
28448
  }
28344
- exports.Name = Name;
28449
+ exports$1.Name = Name;
28345
28450
  class _Code extends _CodeOrName {
28346
28451
  constructor(code2) {
28347
28452
  super();
@@ -28369,8 +28474,8 @@ function requireCode$1() {
28369
28474
  }, {});
28370
28475
  }
28371
28476
  }
28372
- exports._Code = _Code;
28373
- exports.nil = new _Code("");
28477
+ exports$1._Code = _Code;
28478
+ exports$1.nil = new _Code("");
28374
28479
  function _(strs, ...args) {
28375
28480
  const code2 = [strs[0]];
28376
28481
  let i = 0;
@@ -28380,7 +28485,7 @@ function requireCode$1() {
28380
28485
  }
28381
28486
  return new _Code(code2);
28382
28487
  }
28383
- exports._ = _;
28488
+ exports$1._ = _;
28384
28489
  const plus = new _Code("+");
28385
28490
  function str(strs, ...args) {
28386
28491
  const expr = [safeStringify(strs[0])];
@@ -28393,7 +28498,7 @@ function requireCode$1() {
28393
28498
  optimize(expr);
28394
28499
  return new _Code(expr);
28395
28500
  }
28396
- exports.str = str;
28501
+ exports$1.str = str;
28397
28502
  function addCodeArg(code2, arg) {
28398
28503
  if (arg instanceof _Code)
28399
28504
  code2.push(...arg._items);
@@ -28402,7 +28507,7 @@ function requireCode$1() {
28402
28507
  else
28403
28508
  code2.push(interpolate(arg));
28404
28509
  }
28405
- exports.addCodeArg = addCodeArg;
28510
+ exports$1.addCodeArg = addCodeArg;
28406
28511
  function optimize(expr) {
28407
28512
  let i = 1;
28408
28513
  while (i < expr.length - 1) {
@@ -28438,33 +28543,33 @@ function requireCode$1() {
28438
28543
  function strConcat(c1, c2) {
28439
28544
  return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
28440
28545
  }
28441
- exports.strConcat = strConcat;
28546
+ exports$1.strConcat = strConcat;
28442
28547
  function interpolate(x) {
28443
28548
  return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
28444
28549
  }
28445
28550
  function stringify(x) {
28446
28551
  return new _Code(safeStringify(x));
28447
28552
  }
28448
- exports.stringify = stringify;
28553
+ exports$1.stringify = stringify;
28449
28554
  function safeStringify(x) {
28450
28555
  return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
28451
28556
  }
28452
- exports.safeStringify = safeStringify;
28557
+ exports$1.safeStringify = safeStringify;
28453
28558
  function getProperty(key) {
28454
- return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
28559
+ return typeof key == "string" && exports$1.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
28455
28560
  }
28456
- exports.getProperty = getProperty;
28561
+ exports$1.getProperty = getProperty;
28457
28562
  function getEsmExportName(key) {
28458
- if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
28563
+ if (typeof key == "string" && exports$1.IDENTIFIER.test(key)) {
28459
28564
  return new _Code(`${key}`);
28460
28565
  }
28461
28566
  throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
28462
28567
  }
28463
- exports.getEsmExportName = getEsmExportName;
28568
+ exports$1.getEsmExportName = getEsmExportName;
28464
28569
  function regexpCode(rx) {
28465
28570
  return new _Code(rx.toString());
28466
28571
  }
28467
- exports.regexpCode = regexpCode;
28572
+ exports$1.regexpCode = regexpCode;
28468
28573
  })(code$1);
28469
28574
  return code$1;
28470
28575
  }
@@ -28473,9 +28578,9 @@ var hasRequiredScope;
28473
28578
  function requireScope() {
28474
28579
  if (hasRequiredScope) return scope;
28475
28580
  hasRequiredScope = 1;
28476
- (function(exports) {
28477
- Object.defineProperty(exports, "__esModule", { value: true });
28478
- exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
28581
+ (function(exports$1) {
28582
+ Object.defineProperty(exports$1, "__esModule", { value: true });
28583
+ exports$1.ValueScope = exports$1.ValueScopeName = exports$1.Scope = exports$1.varKinds = exports$1.UsedValueState = void 0;
28479
28584
  const code_1 = requireCode$1();
28480
28585
  class ValueError extends Error {
28481
28586
  constructor(name2) {
@@ -28487,8 +28592,8 @@ function requireScope() {
28487
28592
  (function(UsedValueState2) {
28488
28593
  UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
28489
28594
  UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed";
28490
- })(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
28491
- exports.varKinds = {
28595
+ })(UsedValueState || (exports$1.UsedValueState = UsedValueState = {}));
28596
+ exports$1.varKinds = {
28492
28597
  const: new code_1.Name("const"),
28493
28598
  let: new code_1.Name("let"),
28494
28599
  var: new code_1.Name("var")
@@ -28517,7 +28622,7 @@ function requireScope() {
28517
28622
  return this._names[prefix] = { prefix, index: 0 };
28518
28623
  }
28519
28624
  }
28520
- exports.Scope = Scope;
28625
+ exports$1.Scope = Scope;
28521
28626
  class ValueScopeName extends code_1.Name {
28522
28627
  constructor(prefix, nameStr) {
28523
28628
  super(nameStr);
@@ -28528,7 +28633,7 @@ function requireScope() {
28528
28633
  this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
28529
28634
  }
28530
28635
  }
28531
- exports.ValueScopeName = ValueScopeName;
28636
+ exports$1.ValueScopeName = ValueScopeName;
28532
28637
  const line = (0, code_1._)`\n`;
28533
28638
  class ValueScope extends Scope {
28534
28639
  constructor(opts) {
@@ -28598,7 +28703,7 @@ function requireScope() {
28598
28703
  nameSet.set(name2, UsedValueState.Started);
28599
28704
  let c = valueCode(name2);
28600
28705
  if (c) {
28601
- const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
28706
+ const def = this.opts.es5 ? exports$1.varKinds.var : exports$1.varKinds.const;
28602
28707
  code2 = (0, code_1._)`${code2}${def} ${name2} = ${c};${this.opts._n}`;
28603
28708
  } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name2)) {
28604
28709
  code2 = (0, code_1._)`${code2}${c}${this.opts._n}`;
@@ -28611,7 +28716,7 @@ function requireScope() {
28611
28716
  return code2;
28612
28717
  }
28613
28718
  }
28614
- exports.ValueScope = ValueScope;
28719
+ exports$1.ValueScope = ValueScope;
28615
28720
  })(scope);
28616
28721
  return scope;
28617
28722
  }
@@ -28619,50 +28724,50 @@ var hasRequiredCodegen;
28619
28724
  function requireCodegen() {
28620
28725
  if (hasRequiredCodegen) return codegen;
28621
28726
  hasRequiredCodegen = 1;
28622
- (function(exports) {
28623
- Object.defineProperty(exports, "__esModule", { value: true });
28624
- exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
28727
+ (function(exports$1) {
28728
+ Object.defineProperty(exports$1, "__esModule", { value: true });
28729
+ exports$1.or = exports$1.and = exports$1.not = exports$1.CodeGen = exports$1.operators = exports$1.varKinds = exports$1.ValueScopeName = exports$1.ValueScope = exports$1.Scope = exports$1.Name = exports$1.regexpCode = exports$1.stringify = exports$1.getProperty = exports$1.nil = exports$1.strConcat = exports$1.str = exports$1._ = void 0;
28625
28730
  const code_1 = requireCode$1();
28626
28731
  const scope_1 = requireScope();
28627
28732
  var code_2 = requireCode$1();
28628
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
28733
+ Object.defineProperty(exports$1, "_", { enumerable: true, get: function() {
28629
28734
  return code_2._;
28630
28735
  } });
28631
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
28736
+ Object.defineProperty(exports$1, "str", { enumerable: true, get: function() {
28632
28737
  return code_2.str;
28633
28738
  } });
28634
- Object.defineProperty(exports, "strConcat", { enumerable: true, get: function() {
28739
+ Object.defineProperty(exports$1, "strConcat", { enumerable: true, get: function() {
28635
28740
  return code_2.strConcat;
28636
28741
  } });
28637
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
28742
+ Object.defineProperty(exports$1, "nil", { enumerable: true, get: function() {
28638
28743
  return code_2.nil;
28639
28744
  } });
28640
- Object.defineProperty(exports, "getProperty", { enumerable: true, get: function() {
28745
+ Object.defineProperty(exports$1, "getProperty", { enumerable: true, get: function() {
28641
28746
  return code_2.getProperty;
28642
28747
  } });
28643
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
28748
+ Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function() {
28644
28749
  return code_2.stringify;
28645
28750
  } });
28646
- Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function() {
28751
+ Object.defineProperty(exports$1, "regexpCode", { enumerable: true, get: function() {
28647
28752
  return code_2.regexpCode;
28648
28753
  } });
28649
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
28754
+ Object.defineProperty(exports$1, "Name", { enumerable: true, get: function() {
28650
28755
  return code_2.Name;
28651
28756
  } });
28652
28757
  var scope_2 = requireScope();
28653
- Object.defineProperty(exports, "Scope", { enumerable: true, get: function() {
28758
+ Object.defineProperty(exports$1, "Scope", { enumerable: true, get: function() {
28654
28759
  return scope_2.Scope;
28655
28760
  } });
28656
- Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function() {
28761
+ Object.defineProperty(exports$1, "ValueScope", { enumerable: true, get: function() {
28657
28762
  return scope_2.ValueScope;
28658
28763
  } });
28659
- Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function() {
28764
+ Object.defineProperty(exports$1, "ValueScopeName", { enumerable: true, get: function() {
28660
28765
  return scope_2.ValueScopeName;
28661
28766
  } });
28662
- Object.defineProperty(exports, "varKinds", { enumerable: true, get: function() {
28767
+ Object.defineProperty(exports$1, "varKinds", { enumerable: true, get: function() {
28663
28768
  return scope_2.varKinds;
28664
28769
  } });
28665
- exports.operators = {
28770
+ exports$1.operators = {
28666
28771
  GT: new code_1._Code(">"),
28667
28772
  GTE: new code_1._Code(">="),
28668
28773
  LT: new code_1._Code("<"),
@@ -29075,7 +29180,7 @@ function requireCodegen() {
29075
29180
  }
29076
29181
  // `+=` code
29077
29182
  add(lhs, rhs) {
29078
- return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));
29183
+ return this._leafNode(new AssignOp(lhs, exports$1.operators.ADD, rhs));
29079
29184
  }
29080
29185
  // appends passed SafeExpr to code or executes Block
29081
29186
  code(c) {
@@ -29275,7 +29380,7 @@ function requireCodegen() {
29275
29380
  ns[ns.length - 1] = node;
29276
29381
  }
29277
29382
  }
29278
- exports.CodeGen = CodeGen;
29383
+ exports$1.CodeGen = CodeGen;
29279
29384
  function addNames(names2, from) {
29280
29385
  for (const n in from)
29281
29386
  names2[n] = (names2[n] || 0) + (from[n] || 0);
@@ -29316,17 +29421,17 @@ function requireCodegen() {
29316
29421
  function not2(x) {
29317
29422
  return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
29318
29423
  }
29319
- exports.not = not2;
29320
- const andCode = mappend(exports.operators.AND);
29424
+ exports$1.not = not2;
29425
+ const andCode = mappend(exports$1.operators.AND);
29321
29426
  function and(...args) {
29322
29427
  return args.reduce(andCode);
29323
29428
  }
29324
- exports.and = and;
29325
- const orCode = mappend(exports.operators.OR);
29429
+ exports$1.and = and;
29430
+ const orCode = mappend(exports$1.operators.OR);
29326
29431
  function or(...args) {
29327
29432
  return args.reduce(orCode);
29328
29433
  }
29329
- exports.or = or;
29434
+ exports$1.or = or;
29330
29435
  function mappend(op) {
29331
29436
  return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
29332
29437
  }
@@ -29546,19 +29651,19 @@ var hasRequiredErrors;
29546
29651
  function requireErrors() {
29547
29652
  if (hasRequiredErrors) return errors;
29548
29653
  hasRequiredErrors = 1;
29549
- (function(exports) {
29550
- Object.defineProperty(exports, "__esModule", { value: true });
29551
- exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
29654
+ (function(exports$1) {
29655
+ Object.defineProperty(exports$1, "__esModule", { value: true });
29656
+ exports$1.extendErrors = exports$1.resetErrorsCount = exports$1.reportExtraError = exports$1.reportError = exports$1.keyword$DataError = exports$1.keywordError = void 0;
29552
29657
  const codegen_1 = requireCodegen();
29553
29658
  const util_1 = requireUtil();
29554
29659
  const names_1 = requireNames();
29555
- exports.keywordError = {
29660
+ exports$1.keywordError = {
29556
29661
  message: ({ keyword: keyword2 }) => (0, codegen_1.str)`must pass "${keyword2}" keyword validation`
29557
29662
  };
29558
- exports.keyword$DataError = {
29663
+ exports$1.keyword$DataError = {
29559
29664
  message: ({ keyword: keyword2, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword2}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword2}" keyword is invalid ($data)`
29560
29665
  };
29561
- function reportError2(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
29666
+ function reportError2(cxt, error = exports$1.keywordError, errorPaths, overrideAllErrors) {
29562
29667
  const { it } = cxt;
29563
29668
  const { gen, compositeRule, allErrors } = it;
29564
29669
  const errObj = errorObjectCode(cxt, error, errorPaths);
@@ -29568,8 +29673,8 @@ function requireErrors() {
29568
29673
  returnErrors(it, (0, codegen_1._)`[${errObj}]`);
29569
29674
  }
29570
29675
  }
29571
- exports.reportError = reportError2;
29572
- function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
29676
+ exports$1.reportError = reportError2;
29677
+ function reportExtraError(cxt, error = exports$1.keywordError, errorPaths) {
29573
29678
  const { it } = cxt;
29574
29679
  const { gen, compositeRule, allErrors } = it;
29575
29680
  const errObj = errorObjectCode(cxt, error, errorPaths);
@@ -29578,12 +29683,12 @@ function requireErrors() {
29578
29683
  returnErrors(it, names_1.default.vErrors);
29579
29684
  }
29580
29685
  }
29581
- exports.reportExtraError = reportExtraError;
29686
+ exports$1.reportExtraError = reportExtraError;
29582
29687
  function resetErrorsCount(gen, errsCount) {
29583
29688
  gen.assign(names_1.default.errors, errsCount);
29584
29689
  gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
29585
29690
  }
29586
- exports.resetErrorsCount = resetErrorsCount;
29691
+ exports$1.resetErrorsCount = resetErrorsCount;
29587
29692
  function extendErrors({ gen, keyword: keyword2, schemaValue, data: data2, errsCount, it }) {
29588
29693
  if (errsCount === void 0)
29589
29694
  throw new Error("ajv implementation error");
@@ -29598,7 +29703,7 @@ function requireErrors() {
29598
29703
  }
29599
29704
  });
29600
29705
  }
29601
- exports.extendErrors = extendErrors;
29706
+ exports$1.extendErrors = extendErrors;
29602
29707
  function addError(gen, errObj) {
29603
29708
  const err = gen.const("err", errObj);
29604
29709
  gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
@@ -32082,30 +32187,30 @@ var hasRequiredCore$1;
32082
32187
  function requireCore$1() {
32083
32188
  if (hasRequiredCore$1) return core$1;
32084
32189
  hasRequiredCore$1 = 1;
32085
- (function(exports) {
32086
- Object.defineProperty(exports, "__esModule", { value: true });
32087
- exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
32190
+ (function(exports$1) {
32191
+ Object.defineProperty(exports$1, "__esModule", { value: true });
32192
+ exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = void 0;
32088
32193
  var validate_1 = requireValidate();
32089
- Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
32194
+ Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
32090
32195
  return validate_1.KeywordCxt;
32091
32196
  } });
32092
32197
  var codegen_1 = requireCodegen();
32093
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
32198
+ Object.defineProperty(exports$1, "_", { enumerable: true, get: function() {
32094
32199
  return codegen_1._;
32095
32200
  } });
32096
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
32201
+ Object.defineProperty(exports$1, "str", { enumerable: true, get: function() {
32097
32202
  return codegen_1.str;
32098
32203
  } });
32099
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
32204
+ Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function() {
32100
32205
  return codegen_1.stringify;
32101
32206
  } });
32102
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
32207
+ Object.defineProperty(exports$1, "nil", { enumerable: true, get: function() {
32103
32208
  return codegen_1.nil;
32104
32209
  } });
32105
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
32210
+ Object.defineProperty(exports$1, "Name", { enumerable: true, get: function() {
32106
32211
  return codegen_1.Name;
32107
32212
  } });
32108
- Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
32213
+ Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
32109
32214
  return codegen_1.CodeGen;
32110
32215
  } });
32111
32216
  const validation_error_1 = requireValidation_error();
@@ -32559,7 +32664,7 @@ function requireCore$1() {
32559
32664
  }
32560
32665
  Ajv2.ValidationError = validation_error_1.default;
32561
32666
  Ajv2.MissingRefError = ref_error_1.default;
32562
- exports.default = Ajv2;
32667
+ exports$1.default = Ajv2;
32563
32668
  function checkOptions(checkOpts, options, msg, log = "error") {
32564
32669
  for (const key in checkOpts) {
32565
32670
  const opt = key;
@@ -33591,13 +33696,13 @@ var hasRequiredDependencies;
33591
33696
  function requireDependencies() {
33592
33697
  if (hasRequiredDependencies) return dependencies;
33593
33698
  hasRequiredDependencies = 1;
33594
- (function(exports) {
33595
- Object.defineProperty(exports, "__esModule", { value: true });
33596
- exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
33699
+ (function(exports$1) {
33700
+ Object.defineProperty(exports$1, "__esModule", { value: true });
33701
+ exports$1.validateSchemaDeps = exports$1.validatePropertyDeps = exports$1.error = void 0;
33597
33702
  const codegen_1 = requireCodegen();
33598
33703
  const util_1 = requireUtil();
33599
33704
  const code_1 = requireCode();
33600
- exports.error = {
33705
+ exports$1.error = {
33601
33706
  message: ({ params: { property, depsCount, deps } }) => {
33602
33707
  const property_ies = depsCount === 1 ? "property" : "properties";
33603
33708
  return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
@@ -33612,7 +33717,7 @@ function requireDependencies() {
33612
33717
  keyword: "dependencies",
33613
33718
  type: "object",
33614
33719
  schemaType: "object",
33615
- error: exports.error,
33720
+ error: exports$1.error,
33616
33721
  code(cxt) {
33617
33722
  const [propDeps, schDeps] = splitDependencies(cxt);
33618
33723
  validatePropertyDeps(cxt, propDeps);
@@ -33658,7 +33763,7 @@ function requireDependencies() {
33658
33763
  }
33659
33764
  }
33660
33765
  }
33661
- exports.validatePropertyDeps = validatePropertyDeps;
33766
+ exports$1.validatePropertyDeps = validatePropertyDeps;
33662
33767
  function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
33663
33768
  const { gen, data: data2, keyword: keyword2, it } = cxt;
33664
33769
  const valid = gen.name("valid");
@@ -33677,8 +33782,8 @@ function requireDependencies() {
33677
33782
  cxt.ok(valid);
33678
33783
  }
33679
33784
  }
33680
- exports.validateSchemaDeps = validateSchemaDeps;
33681
- exports.default = def;
33785
+ exports$1.validateSchemaDeps = validateSchemaDeps;
33786
+ exports$1.default = def;
33682
33787
  })(dependencies);
33683
33788
  return dependencies;
33684
33789
  }
@@ -34513,9 +34618,9 @@ var hasRequiredAjv;
34513
34618
  function requireAjv() {
34514
34619
  if (hasRequiredAjv) return ajv.exports;
34515
34620
  hasRequiredAjv = 1;
34516
- (function(module, exports) {
34517
- Object.defineProperty(exports, "__esModule", { value: true });
34518
- exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
34621
+ (function(module, exports$1) {
34622
+ Object.defineProperty(exports$1, "__esModule", { value: true });
34623
+ exports$1.MissingRefError = exports$1.ValidationError = exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = exports$1.Ajv = void 0;
34519
34624
  const core_1 = requireCore$1();
34520
34625
  const draft7_1 = requireDraft7();
34521
34626
  const discriminator_1 = requireDiscriminator();
@@ -34541,59 +34646,60 @@ function requireAjv() {
34541
34646
  return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
34542
34647
  }
34543
34648
  }
34544
- exports.Ajv = Ajv2;
34545
- module.exports = exports = Ajv2;
34649
+ exports$1.Ajv = Ajv2;
34650
+ module.exports = exports$1 = Ajv2;
34546
34651
  module.exports.Ajv = Ajv2;
34547
- Object.defineProperty(exports, "__esModule", { value: true });
34548
- exports.default = Ajv2;
34652
+ Object.defineProperty(exports$1, "__esModule", { value: true });
34653
+ exports$1.default = Ajv2;
34549
34654
  var validate_1 = requireValidate();
34550
- Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
34655
+ Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
34551
34656
  return validate_1.KeywordCxt;
34552
34657
  } });
34553
34658
  var codegen_1 = requireCodegen();
34554
- Object.defineProperty(exports, "_", { enumerable: true, get: function() {
34659
+ Object.defineProperty(exports$1, "_", { enumerable: true, get: function() {
34555
34660
  return codegen_1._;
34556
34661
  } });
34557
- Object.defineProperty(exports, "str", { enumerable: true, get: function() {
34662
+ Object.defineProperty(exports$1, "str", { enumerable: true, get: function() {
34558
34663
  return codegen_1.str;
34559
34664
  } });
34560
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function() {
34665
+ Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function() {
34561
34666
  return codegen_1.stringify;
34562
34667
  } });
34563
- Object.defineProperty(exports, "nil", { enumerable: true, get: function() {
34668
+ Object.defineProperty(exports$1, "nil", { enumerable: true, get: function() {
34564
34669
  return codegen_1.nil;
34565
34670
  } });
34566
- Object.defineProperty(exports, "Name", { enumerable: true, get: function() {
34671
+ Object.defineProperty(exports$1, "Name", { enumerable: true, get: function() {
34567
34672
  return codegen_1.Name;
34568
34673
  } });
34569
- Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
34674
+ Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
34570
34675
  return codegen_1.CodeGen;
34571
34676
  } });
34572
34677
  var validation_error_1 = requireValidation_error();
34573
- Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
34678
+ Object.defineProperty(exports$1, "ValidationError", { enumerable: true, get: function() {
34574
34679
  return validation_error_1.default;
34575
34680
  } });
34576
34681
  var ref_error_1 = requireRef_error();
34577
- Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
34682
+ Object.defineProperty(exports$1, "MissingRefError", { enumerable: true, get: function() {
34578
34683
  return ref_error_1.default;
34579
34684
  } });
34580
34685
  })(ajv, ajv.exports);
34581
34686
  return ajv.exports;
34582
34687
  }
34583
34688
  var ajvExports = requireAjv();
34689
+ const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports);
34584
34690
  var dist = { exports: {} };
34585
34691
  var formats = {};
34586
34692
  var hasRequiredFormats;
34587
34693
  function requireFormats() {
34588
34694
  if (hasRequiredFormats) return formats;
34589
34695
  hasRequiredFormats = 1;
34590
- (function(exports) {
34591
- Object.defineProperty(exports, "__esModule", { value: true });
34592
- exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
34696
+ (function(exports$1) {
34697
+ Object.defineProperty(exports$1, "__esModule", { value: true });
34698
+ exports$1.formatNames = exports$1.fastFormats = exports$1.fullFormats = void 0;
34593
34699
  function fmtDef(validate2, compare) {
34594
34700
  return { validate: validate2, compare };
34595
34701
  }
34596
- exports.fullFormats = {
34702
+ exports$1.fullFormats = {
34597
34703
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
34598
34704
  date: fmtDef(date2, compareDate),
34599
34705
  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
@@ -34640,8 +34746,8 @@ function requireFormats() {
34640
34746
  // unchecked string payload
34641
34747
  binary: true
34642
34748
  };
34643
- exports.fastFormats = {
34644
- ...exports.fullFormats,
34749
+ exports$1.fastFormats = {
34750
+ ...exports$1.fullFormats,
34645
34751
  date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
34646
34752
  time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
34647
34753
  "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
@@ -34655,7 +34761,7 @@ function requireFormats() {
34655
34761
  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
34656
34762
  email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
34657
34763
  };
34658
- exports.formatNames = Object.keys(exports.fullFormats);
34764
+ exports$1.formatNames = Object.keys(exports$1.fullFormats);
34659
34765
  function isLeapYear(year) {
34660
34766
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
34661
34767
  }
@@ -34792,9 +34898,9 @@ var hasRequiredLimit;
34792
34898
  function requireLimit() {
34793
34899
  if (hasRequiredLimit) return limit;
34794
34900
  hasRequiredLimit = 1;
34795
- (function(exports) {
34796
- Object.defineProperty(exports, "__esModule", { value: true });
34797
- exports.formatLimitDefinition = void 0;
34901
+ (function(exports$1) {
34902
+ Object.defineProperty(exports$1, "__esModule", { value: true });
34903
+ exports$1.formatLimitDefinition = void 0;
34798
34904
  const ajv_1 = requireAjv();
34799
34905
  const codegen_1 = requireCodegen();
34800
34906
  const ops = codegen_1.operators;
@@ -34808,7 +34914,7 @@ function requireLimit() {
34808
34914
  message: ({ keyword: keyword2, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword2].okStr} ${schemaCode}`,
34809
34915
  params: ({ keyword: keyword2, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword2].okStr}, limit: ${schemaCode}}`
34810
34916
  };
34811
- exports.formatLimitDefinition = {
34917
+ exports$1.formatLimitDefinition = {
34812
34918
  keyword: Object.keys(KWDs),
34813
34919
  type: "string",
34814
34920
  schemaType: "string",
@@ -34854,10 +34960,10 @@ function requireLimit() {
34854
34960
  dependencies: ["format"]
34855
34961
  };
34856
34962
  const formatLimitPlugin = (ajv2) => {
34857
- ajv2.addKeyword(exports.formatLimitDefinition);
34963
+ ajv2.addKeyword(exports$1.formatLimitDefinition);
34858
34964
  return ajv2;
34859
34965
  };
34860
- exports.default = formatLimitPlugin;
34966
+ exports$1.default = formatLimitPlugin;
34861
34967
  })(limit);
34862
34968
  return limit;
34863
34969
  }
@@ -34865,8 +34971,8 @@ var hasRequiredDist;
34865
34971
  function requireDist() {
34866
34972
  if (hasRequiredDist) return dist.exports;
34867
34973
  hasRequiredDist = 1;
34868
- (function(module, exports) {
34869
- Object.defineProperty(exports, "__esModule", { value: true });
34974
+ (function(module, exports$1) {
34975
+ Object.defineProperty(exports$1, "__esModule", { value: true });
34870
34976
  const formats_12 = requireFormats();
34871
34977
  const limit_1 = requireLimit();
34872
34978
  const codegen_1 = requireCodegen();
@@ -34898,16 +35004,16 @@ function requireDist() {
34898
35004
  for (const f of list)
34899
35005
  ajv2.addFormat(f, fs[f]);
34900
35006
  }
34901
- module.exports = exports = formatsPlugin;
34902
- Object.defineProperty(exports, "__esModule", { value: true });
34903
- exports.default = formatsPlugin;
35007
+ module.exports = exports$1 = formatsPlugin;
35008
+ Object.defineProperty(exports$1, "__esModule", { value: true });
35009
+ exports$1.default = formatsPlugin;
34904
35010
  })(dist, dist.exports);
34905
35011
  return dist.exports;
34906
35012
  }
34907
35013
  var distExports = requireDist();
34908
35014
  const _addFormats = /* @__PURE__ */ getDefaultExportFromCjs(distExports);
34909
35015
  function createDefaultAjvInstance() {
34910
- const ajv2 = new ajvExports.Ajv({
35016
+ const ajv2 = new Ajv({
34911
35017
  strict: false,
34912
35018
  validateFormats: true,
34913
35019
  validateSchema: false,
@@ -34939,7 +35045,7 @@ class AjvJsonSchemaValidator {
34939
35045
  * ```
34940
35046
  */
34941
35047
  constructor(ajv2) {
34942
- this._ajv = ajv2 !== null && ajv2 !== void 0 ? ajv2 : createDefaultAjvInstance();
35048
+ this._ajv = ajv2 ?? createDefaultAjvInstance();
34943
35049
  }
34944
35050
  /**
34945
35051
  * Create a validator for the given JSON Schema
@@ -34951,8 +35057,7 @@ class AjvJsonSchemaValidator {
34951
35057
  * @returns A validator function that validates input data
34952
35058
  */
34953
35059
  getValidator(schema) {
34954
- var _a;
34955
- const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? (_a = this._ajv.getSchema(schema.$id)) !== null && _a !== void 0 ? _a : this._ajv.compile(schema) : this._ajv.compile(schema);
35060
+ const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema);
34956
35061
  return (input) => {
34957
35062
  const valid = ajvValidator(input);
34958
35063
  if (valid) {
@@ -35012,13 +35117,12 @@ class ExperimentalClientTasks {
35012
35117
  * @experimental
35013
35118
  */
35014
35119
  async *callToolStream(params, resultSchema = CallToolResultSchema, options) {
35015
- var _a;
35016
35120
  const clientInternal = this._client;
35017
35121
  const optionsWithTask = {
35018
35122
  ...options,
35019
35123
  // We check if the tool is known to be a task during auto-configuration, but assume
35020
35124
  // the caller knows what they're doing if they pass this explicitly
35021
- task: (_a = options === null || options === void 0 ? void 0 : options.task) !== null && _a !== void 0 ? _a : clientInternal.isToolTask(params.name) ? {} : void 0
35125
+ task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : void 0)
35022
35126
  };
35023
35127
  const stream = clientInternal.requestStream({ method: "tools/call", params }, resultSchema, optionsWithTask);
35024
35128
  const validator = clientInternal.getToolOutputValidator(params.name);
@@ -35125,31 +35229,29 @@ class ExperimentalClientTasks {
35125
35229
  }
35126
35230
  }
35127
35231
  function assertToolsCallTaskCapability(requests, method, entityName) {
35128
- var _a;
35129
35232
  if (!requests) {
35130
35233
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
35131
35234
  }
35132
35235
  switch (method) {
35133
35236
  case "tools/call":
35134
- if (!((_a = requests.tools) === null || _a === void 0 ? void 0 : _a.call)) {
35237
+ if (!requests.tools?.call) {
35135
35238
  throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
35136
35239
  }
35137
35240
  break;
35138
35241
  }
35139
35242
  }
35140
35243
  function assertClientRequestTaskCapability(requests, method, entityName) {
35141
- var _a, _b;
35142
35244
  if (!requests) {
35143
35245
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
35144
35246
  }
35145
35247
  switch (method) {
35146
35248
  case "sampling/createMessage":
35147
- if (!((_a = requests.sampling) === null || _a === void 0 ? void 0 : _a.createMessage)) {
35249
+ if (!requests.sampling?.createMessage) {
35148
35250
  throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
35149
35251
  }
35150
35252
  break;
35151
35253
  case "elicitation/create":
35152
- if (!((_b = requests.elicitation) === null || _b === void 0 ? void 0 : _b.create)) {
35254
+ if (!requests.elicitation?.create) {
35153
35255
  throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
35154
35256
  }
35155
35257
  break;
@@ -35173,12 +35275,16 @@ function applyElicitationDefaults(schema, data2) {
35173
35275
  }
35174
35276
  if (Array.isArray(schema.anyOf)) {
35175
35277
  for (const sub of schema.anyOf) {
35176
- applyElicitationDefaults(sub, data2);
35278
+ if (typeof sub !== "boolean") {
35279
+ applyElicitationDefaults(sub, data2);
35280
+ }
35177
35281
  }
35178
35282
  }
35179
35283
  if (Array.isArray(schema.oneOf)) {
35180
35284
  for (const sub of schema.oneOf) {
35181
- applyElicitationDefaults(sub, data2);
35285
+ if (typeof sub !== "boolean") {
35286
+ applyElicitationDefaults(sub, data2);
35287
+ }
35182
35288
  }
35183
35289
  }
35184
35290
  }
@@ -35197,14 +35303,43 @@ class Client extends Protocol {
35197
35303
  * Initializes this client with the given name and version information.
35198
35304
  */
35199
35305
  constructor(_clientInfo, options) {
35200
- var _a, _b;
35201
35306
  super(options);
35202
35307
  this._clientInfo = _clientInfo;
35203
35308
  this._cachedToolOutputValidators = /* @__PURE__ */ new Map();
35204
35309
  this._cachedKnownTaskTools = /* @__PURE__ */ new Set();
35205
35310
  this._cachedRequiredTaskTools = /* @__PURE__ */ new Set();
35206
- this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {};
35207
- this._jsonSchemaValidator = (_b = options === null || options === void 0 ? void 0 : options.jsonSchemaValidator) !== null && _b !== void 0 ? _b : new AjvJsonSchemaValidator();
35311
+ this._listChangedDebounceTimers = /* @__PURE__ */ new Map();
35312
+ this._capabilities = options?.capabilities ?? {};
35313
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
35314
+ if (options?.listChanged) {
35315
+ this._pendingListChangedConfig = options.listChanged;
35316
+ }
35317
+ }
35318
+ /**
35319
+ * Set up handlers for list changed notifications based on config and server capabilities.
35320
+ * This should only be called after initialization when server capabilities are known.
35321
+ * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
35322
+ * @internal
35323
+ */
35324
+ _setupListChangedHandlers(config2) {
35325
+ if (config2.tools && this._serverCapabilities?.tools?.listChanged) {
35326
+ this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config2.tools, async () => {
35327
+ const result = await this.listTools();
35328
+ return result.tools;
35329
+ });
35330
+ }
35331
+ if (config2.prompts && this._serverCapabilities?.prompts?.listChanged) {
35332
+ this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config2.prompts, async () => {
35333
+ const result = await this.listPrompts();
35334
+ return result.prompts;
35335
+ });
35336
+ }
35337
+ if (config2.resources && this._serverCapabilities?.resources?.listChanged) {
35338
+ this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config2.resources, async () => {
35339
+ const result = await this.listResources();
35340
+ return result.resources;
35341
+ });
35342
+ }
35208
35343
  }
35209
35344
  /**
35210
35345
  * Access experimental features.
@@ -35236,21 +35371,20 @@ class Client extends Protocol {
35236
35371
  * Override request handler registration to enforce client-side validation for elicitation.
35237
35372
  */
35238
35373
  setRequestHandler(requestSchema, handler) {
35239
- var _a, _b, _c;
35240
35374
  const shape = getObjectShape(requestSchema);
35241
- const methodSchema = shape === null || shape === void 0 ? void 0 : shape.method;
35375
+ const methodSchema = shape?.method;
35242
35376
  if (!methodSchema) {
35243
35377
  throw new Error("Schema is missing a method literal");
35244
35378
  }
35245
35379
  let methodValue;
35246
35380
  if (isZ4Schema(methodSchema)) {
35247
35381
  const v4Schema = methodSchema;
35248
- const v4Def = (_a = v4Schema._zod) === null || _a === void 0 ? void 0 : _a.def;
35249
- methodValue = (_b = v4Def === null || v4Def === void 0 ? void 0 : v4Def.value) !== null && _b !== void 0 ? _b : v4Schema.value;
35382
+ const v4Def = v4Schema._zod?.def;
35383
+ methodValue = v4Def?.value ?? v4Schema.value;
35250
35384
  } else {
35251
35385
  const v3Schema = methodSchema;
35252
35386
  const legacyDef = v3Schema._def;
35253
- methodValue = (_c = legacyDef === null || legacyDef === void 0 ? void 0 : legacyDef.value) !== null && _c !== void 0 ? _c : v3Schema.value;
35387
+ methodValue = legacyDef?.value ?? v3Schema.value;
35254
35388
  }
35255
35389
  if (typeof methodValue !== "string") {
35256
35390
  throw new Error("Schema method literal must be a string");
@@ -35258,19 +35392,18 @@ class Client extends Protocol {
35258
35392
  const method = methodValue;
35259
35393
  if (method === "elicitation/create") {
35260
35394
  const wrappedHandler = async (request, extra) => {
35261
- var _a2, _b2, _c2;
35262
35395
  const validatedRequest = safeParse(ElicitRequestSchema, request);
35263
35396
  if (!validatedRequest.success) {
35264
35397
  const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
35265
35398
  throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`);
35266
35399
  }
35267
35400
  const { params } = validatedRequest.data;
35268
- const mode = (_a2 = params.mode) !== null && _a2 !== void 0 ? _a2 : "form";
35401
+ params.mode = params.mode ?? "form";
35269
35402
  const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
35270
- if (mode === "form" && !supportsFormMode) {
35403
+ if (params.mode === "form" && !supportsFormMode) {
35271
35404
  throw new McpError(ErrorCode.InvalidParams, "Client does not support form-mode elicitation requests");
35272
35405
  }
35273
- if (mode === "url" && !supportsUrlMode) {
35406
+ if (params.mode === "url" && !supportsUrlMode) {
35274
35407
  throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
35275
35408
  }
35276
35409
  const result = await Promise.resolve(handler(request, extra));
@@ -35288,12 +35421,12 @@ class Client extends Protocol {
35288
35421
  throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
35289
35422
  }
35290
35423
  const validatedResult = validationResult.data;
35291
- const requestedSchema = mode === "form" ? params.requestedSchema : void 0;
35292
- if (mode === "form" && validatedResult.action === "accept" && validatedResult.content && requestedSchema) {
35293
- if ((_c2 = (_b2 = this._capabilities.elicitation) === null || _b2 === void 0 ? void 0 : _b2.form) === null || _c2 === void 0 ? void 0 : _c2.applyDefaults) {
35424
+ const requestedSchema = params.mode === "form" ? params.requestedSchema : void 0;
35425
+ if (params.mode === "form" && validatedResult.action === "accept" && validatedResult.content && requestedSchema) {
35426
+ if (this._capabilities.elicitation?.form?.applyDefaults) {
35294
35427
  try {
35295
35428
  applyElicitationDefaults(requestedSchema, validatedResult.content);
35296
- } catch (_d) {
35429
+ } catch {
35297
35430
  }
35298
35431
  }
35299
35432
  }
@@ -35330,8 +35463,7 @@ class Client extends Protocol {
35330
35463
  return super.setRequestHandler(requestSchema, handler);
35331
35464
  }
35332
35465
  assertCapability(capability, method) {
35333
- var _a;
35334
- if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) {
35466
+ if (!this._serverCapabilities?.[capability]) {
35335
35467
  throw new Error(`Server does not support ${capability} (required for ${method})`);
35336
35468
  }
35337
35469
  }
@@ -35364,6 +35496,10 @@ class Client extends Protocol {
35364
35496
  await this.notification({
35365
35497
  method: "notifications/initialized"
35366
35498
  });
35499
+ if (this._pendingListChangedConfig) {
35500
+ this._setupListChangedHandlers(this._pendingListChangedConfig);
35501
+ this._pendingListChangedConfig = void 0;
35502
+ }
35367
35503
  } catch (error) {
35368
35504
  void this.close();
35369
35505
  throw error;
@@ -35388,16 +35524,15 @@ class Client extends Protocol {
35388
35524
  return this._instructions;
35389
35525
  }
35390
35526
  assertCapabilityForMethod(method) {
35391
- var _a, _b, _c, _d, _e2;
35392
35527
  switch (method) {
35393
35528
  case "logging/setLevel":
35394
- if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) {
35529
+ if (!this._serverCapabilities?.logging) {
35395
35530
  throw new Error(`Server does not support logging (required for ${method})`);
35396
35531
  }
35397
35532
  break;
35398
35533
  case "prompts/get":
35399
35534
  case "prompts/list":
35400
- if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) {
35535
+ if (!this._serverCapabilities?.prompts) {
35401
35536
  throw new Error(`Server does not support prompts (required for ${method})`);
35402
35537
  }
35403
35538
  break;
@@ -35406,7 +35541,7 @@ class Client extends Protocol {
35406
35541
  case "resources/read":
35407
35542
  case "resources/subscribe":
35408
35543
  case "resources/unsubscribe":
35409
- if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) {
35544
+ if (!this._serverCapabilities?.resources) {
35410
35545
  throw new Error(`Server does not support resources (required for ${method})`);
35411
35546
  }
35412
35547
  if (method === "resources/subscribe" && !this._serverCapabilities.resources.subscribe) {
@@ -35415,22 +35550,21 @@ class Client extends Protocol {
35415
35550
  break;
35416
35551
  case "tools/call":
35417
35552
  case "tools/list":
35418
- if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) {
35553
+ if (!this._serverCapabilities?.tools) {
35419
35554
  throw new Error(`Server does not support tools (required for ${method})`);
35420
35555
  }
35421
35556
  break;
35422
35557
  case "completion/complete":
35423
- if (!((_e2 = this._serverCapabilities) === null || _e2 === void 0 ? void 0 : _e2.completions)) {
35558
+ if (!this._serverCapabilities?.completions) {
35424
35559
  throw new Error(`Server does not support completions (required for ${method})`);
35425
35560
  }
35426
35561
  break;
35427
35562
  }
35428
35563
  }
35429
35564
  assertNotificationCapability(method) {
35430
- var _a;
35431
35565
  switch (method) {
35432
35566
  case "notifications/roots/list_changed":
35433
- if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) {
35567
+ if (!this._capabilities.roots?.listChanged) {
35434
35568
  throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
35435
35569
  }
35436
35570
  break;
@@ -35467,15 +35601,13 @@ class Client extends Protocol {
35467
35601
  }
35468
35602
  }
35469
35603
  assertTaskCapability(method) {
35470
- var _a, _b;
35471
- assertToolsCallTaskCapability((_b = (_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.tasks) === null || _b === void 0 ? void 0 : _b.requests, method, "Server");
35604
+ assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, "Server");
35472
35605
  }
35473
35606
  assertTaskHandlerCapability(method) {
35474
- var _a;
35475
35607
  if (!this._capabilities) {
35476
35608
  return;
35477
35609
  }
35478
- assertClientRequestTaskCapability((_a = this._capabilities.tasks) === null || _a === void 0 ? void 0 : _a.requests, method, "Client");
35610
+ assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, "Client");
35479
35611
  }
35480
35612
  async ping(options) {
35481
35613
  return this.request({ method: "ping" }, EmptyResultSchema, options);
@@ -35539,8 +35671,7 @@ class Client extends Protocol {
35539
35671
  return result;
35540
35672
  }
35541
35673
  isToolTask(toolName) {
35542
- var _a, _b, _c, _d;
35543
- if (!((_d = (_c = (_b = (_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.tasks) === null || _b === void 0 ? void 0 : _b.requests) === null || _c === void 0 ? void 0 : _c.tools) === null || _d === void 0 ? void 0 : _d.call)) {
35674
+ if (!this._serverCapabilities?.tasks?.requests?.tools?.call) {
35544
35675
  return false;
35545
35676
  }
35546
35677
  return this._cachedKnownTaskTools.has(toolName);
@@ -35557,7 +35688,6 @@ class Client extends Protocol {
35557
35688
  * Called after listTools() to pre-compile validators for better performance.
35558
35689
  */
35559
35690
  cacheToolMetadata(tools) {
35560
- var _a;
35561
35691
  this._cachedToolOutputValidators.clear();
35562
35692
  this._cachedKnownTaskTools.clear();
35563
35693
  this._cachedRequiredTaskTools.clear();
@@ -35566,7 +35696,7 @@ class Client extends Protocol {
35566
35696
  const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema);
35567
35697
  this._cachedToolOutputValidators.set(tool.name, toolValidator);
35568
35698
  }
35569
- const taskSupport = (_a = tool.execution) === null || _a === void 0 ? void 0 : _a.taskSupport;
35699
+ const taskSupport = tool.execution?.taskSupport;
35570
35700
  if (taskSupport === "required" || taskSupport === "optional") {
35571
35701
  this._cachedKnownTaskTools.add(tool.name);
35572
35702
  }
@@ -35586,6 +35716,47 @@ class Client extends Protocol {
35586
35716
  this.cacheToolMetadata(result.tools);
35587
35717
  return result;
35588
35718
  }
35719
+ /**
35720
+ * Set up a single list changed handler.
35721
+ * @internal
35722
+ */
35723
+ _setupListChangedHandler(listType, notificationSchema, options, fetcher) {
35724
+ const parseResult = ListChangedOptionsBaseSchema.safeParse(options);
35725
+ if (!parseResult.success) {
35726
+ throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
35727
+ }
35728
+ if (typeof options.onChanged !== "function") {
35729
+ throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`);
35730
+ }
35731
+ const { autoRefresh, debounceMs } = parseResult.data;
35732
+ const { onChanged } = options;
35733
+ const refresh = async () => {
35734
+ if (!autoRefresh) {
35735
+ onChanged(null, null);
35736
+ return;
35737
+ }
35738
+ try {
35739
+ const items2 = await fetcher();
35740
+ onChanged(null, items2);
35741
+ } catch (e) {
35742
+ const error = e instanceof Error ? e : new Error(String(e));
35743
+ onChanged(error, null);
35744
+ }
35745
+ };
35746
+ const handler = () => {
35747
+ if (debounceMs) {
35748
+ const existingTimer = this._listChangedDebounceTimers.get(listType);
35749
+ if (existingTimer) {
35750
+ clearTimeout(existingTimer);
35751
+ }
35752
+ const timer = setTimeout(refresh, debounceMs);
35753
+ this._listChangedDebounceTimers.set(listType, timer);
35754
+ } else {
35755
+ refresh();
35756
+ }
35757
+ };
35758
+ this.setNotificationHandler(notificationSchema, handler);
35759
+ }
35589
35760
  async sendRootsListChanged() {
35590
35761
  return this.notification({ method: "notifications/roots/list_changed" });
35591
35762
  }
@@ -35978,7 +36149,7 @@ function createFetchWithInit(baseFetch = fetch, baseInit) {
35978
36149
  ...baseInit,
35979
36150
  ...init,
35980
36151
  // Headers need special handling - merge instead of replace
35981
- headers: (init === null || init === void 0 ? void 0 : init.headers) ? { ...normalizeHeaders(baseInit.headers), ...normalizeHeaders(init.headers) } : baseInit.headers
36152
+ headers: init?.headers ? { ...normalizeHeaders(baseInit.headers), ...normalizeHeaders(init.headers) } : baseInit.headers
35982
36153
  };
35983
36154
  return baseFetch(url2, mergedInit);
35984
36155
  };
@@ -35995,14 +36166,13 @@ class SSEClientTransport {
35995
36166
  this._url = url2;
35996
36167
  this._resourceMetadataUrl = void 0;
35997
36168
  this._scope = void 0;
35998
- this._eventSourceInit = opts === null || opts === void 0 ? void 0 : opts.eventSourceInit;
35999
- this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit;
36000
- this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider;
36001
- this._fetch = opts === null || opts === void 0 ? void 0 : opts.fetch;
36002
- this._fetchWithInit = createFetchWithInit(opts === null || opts === void 0 ? void 0 : opts.fetch, opts === null || opts === void 0 ? void 0 : opts.requestInit);
36169
+ this._eventSourceInit = opts?.eventSourceInit;
36170
+ this._requestInit = opts?.requestInit;
36171
+ this._authProvider = opts?.authProvider;
36172
+ this._fetch = opts?.fetch;
36173
+ this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
36003
36174
  }
36004
36175
  async _authThenStart() {
36005
- var _a;
36006
36176
  if (!this._authProvider) {
36007
36177
  throw new UnauthorizedError("No auth provider");
36008
36178
  }
@@ -36015,7 +36185,7 @@ class SSEClientTransport {
36015
36185
  fetchFn: this._fetchWithInit
36016
36186
  });
36017
36187
  } catch (error) {
36018
- (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
36188
+ this.onerror?.(error);
36019
36189
  throw error;
36020
36190
  }
36021
36191
  if (result !== "AUTHORIZED") {
@@ -36024,7 +36194,6 @@ class SSEClientTransport {
36024
36194
  return await this._startOrAuth();
36025
36195
  }
36026
36196
  async _commonHeaders() {
36027
- var _a;
36028
36197
  const headers = {};
36029
36198
  if (this._authProvider) {
36030
36199
  const tokens = await this._authProvider.tokens();
@@ -36035,15 +36204,14 @@ class SSEClientTransport {
36035
36204
  if (this._protocolVersion) {
36036
36205
  headers["mcp-protocol-version"] = this._protocolVersion;
36037
36206
  }
36038
- const extraHeaders = normalizeHeaders((_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers);
36207
+ const extraHeaders = normalizeHeaders(this._requestInit?.headers);
36039
36208
  return new Headers({
36040
36209
  ...headers,
36041
36210
  ...extraHeaders
36042
36211
  });
36043
36212
  }
36044
36213
  _startOrAuth() {
36045
- var _a, _b, _c;
36046
- const fetchImpl = (_c = (_b = (_a = this === null || this === void 0 ? void 0 : this._eventSourceInit) === null || _a === void 0 ? void 0 : _a.fetch) !== null && _b !== void 0 ? _b : this._fetch) !== null && _c !== void 0 ? _c : fetch;
36214
+ const fetchImpl = this?._eventSourceInit?.fetch ?? this._fetch ?? fetch;
36047
36215
  return new Promise((resolve2, reject) => {
36048
36216
  this._eventSource = new EventSource(this._url.href, {
36049
36217
  ...this._eventSourceInit,
@@ -36064,19 +36232,17 @@ class SSEClientTransport {
36064
36232
  });
36065
36233
  this._abortController = new AbortController();
36066
36234
  this._eventSource.onerror = (event) => {
36067
- var _a2;
36068
36235
  if (event.code === 401 && this._authProvider) {
36069
36236
  this._authThenStart().then(resolve2, reject);
36070
36237
  return;
36071
36238
  }
36072
36239
  const error = new SseError(event.code, event.message, event);
36073
36240
  reject(error);
36074
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, error);
36241
+ this.onerror?.(error);
36075
36242
  };
36076
36243
  this._eventSource.onopen = () => {
36077
36244
  };
36078
36245
  this._eventSource.addEventListener("endpoint", (event) => {
36079
- var _a2;
36080
36246
  const messageEvent = event;
36081
36247
  try {
36082
36248
  this._endpoint = new URL(messageEvent.data, this._url);
@@ -36085,23 +36251,22 @@ class SSEClientTransport {
36085
36251
  }
36086
36252
  } catch (error) {
36087
36253
  reject(error);
36088
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, error);
36254
+ this.onerror?.(error);
36089
36255
  void this.close();
36090
36256
  return;
36091
36257
  }
36092
36258
  resolve2();
36093
36259
  });
36094
36260
  this._eventSource.onmessage = (event) => {
36095
- var _a2, _b2;
36096
36261
  const messageEvent = event;
36097
36262
  let message;
36098
36263
  try {
36099
36264
  message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data));
36100
36265
  } catch (error) {
36101
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, error);
36266
+ this.onerror?.(error);
36102
36267
  return;
36103
36268
  }
36104
- (_b2 = this.onmessage) === null || _b2 === void 0 ? void 0 : _b2.call(this, message);
36269
+ this.onmessage?.(message);
36105
36270
  };
36106
36271
  });
36107
36272
  }
@@ -36130,13 +36295,11 @@ class SSEClientTransport {
36130
36295
  }
36131
36296
  }
36132
36297
  async close() {
36133
- var _a, _b, _c;
36134
- (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort();
36135
- (_b = this._eventSource) === null || _b === void 0 ? void 0 : _b.close();
36136
- (_c = this.onclose) === null || _c === void 0 ? void 0 : _c.call(this);
36298
+ this._abortController?.abort();
36299
+ this._eventSource?.close();
36300
+ this.onclose?.();
36137
36301
  }
36138
36302
  async send(message) {
36139
- var _a, _b, _c, _d;
36140
36303
  if (!this._endpoint) {
36141
36304
  throw new Error("Not connected");
36142
36305
  }
@@ -36148,9 +36311,9 @@ class SSEClientTransport {
36148
36311
  method: "POST",
36149
36312
  headers,
36150
36313
  body: JSON.stringify(message),
36151
- signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal
36314
+ signal: this._abortController?.signal
36152
36315
  };
36153
- const response = await ((_b = this._fetch) !== null && _b !== void 0 ? _b : fetch)(this._endpoint, init);
36316
+ const response = await (this._fetch ?? fetch)(this._endpoint, init);
36154
36317
  if (!response.ok) {
36155
36318
  const text = await response.text().catch(() => null);
36156
36319
  if (response.status === 401 && this._authProvider) {
@@ -36170,9 +36333,9 @@ class SSEClientTransport {
36170
36333
  }
36171
36334
  throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
36172
36335
  }
36173
- await ((_c = response.body) === null || _c === void 0 ? void 0 : _c.cancel());
36336
+ await response.body?.cancel();
36174
36337
  } catch (error) {
36175
- (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, error);
36338
+ this.onerror?.(error);
36176
36339
  throw error;
36177
36340
  }
36178
36341
  }
@@ -36216,20 +36379,18 @@ class StreamableHTTPError extends Error {
36216
36379
  }
36217
36380
  class StreamableHTTPClientTransport {
36218
36381
  constructor(url2, opts) {
36219
- var _a;
36220
36382
  this._hasCompletedAuthFlow = false;
36221
36383
  this._url = url2;
36222
36384
  this._resourceMetadataUrl = void 0;
36223
36385
  this._scope = void 0;
36224
- this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit;
36225
- this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider;
36226
- this._fetch = opts === null || opts === void 0 ? void 0 : opts.fetch;
36227
- this._fetchWithInit = createFetchWithInit(opts === null || opts === void 0 ? void 0 : opts.fetch, opts === null || opts === void 0 ? void 0 : opts.requestInit);
36228
- this._sessionId = opts === null || opts === void 0 ? void 0 : opts.sessionId;
36229
- this._reconnectionOptions = (_a = opts === null || opts === void 0 ? void 0 : opts.reconnectionOptions) !== null && _a !== void 0 ? _a : DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
36386
+ this._requestInit = opts?.requestInit;
36387
+ this._authProvider = opts?.authProvider;
36388
+ this._fetch = opts?.fetch;
36389
+ this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
36390
+ this._sessionId = opts?.sessionId;
36391
+ this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
36230
36392
  }
36231
36393
  async _authThenStart() {
36232
- var _a;
36233
36394
  if (!this._authProvider) {
36234
36395
  throw new UnauthorizedError("No auth provider");
36235
36396
  }
@@ -36242,7 +36403,7 @@ class StreamableHTTPClientTransport {
36242
36403
  fetchFn: this._fetchWithInit
36243
36404
  });
36244
36405
  } catch (error) {
36245
- (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
36406
+ this.onerror?.(error);
36246
36407
  throw error;
36247
36408
  }
36248
36409
  if (result !== "AUTHORIZED") {
@@ -36251,7 +36412,6 @@ class StreamableHTTPClientTransport {
36251
36412
  return await this._startOrAuthSse({ resumptionToken: void 0 });
36252
36413
  }
36253
36414
  async _commonHeaders() {
36254
- var _a;
36255
36415
  const headers = {};
36256
36416
  if (this._authProvider) {
36257
36417
  const tokens = await this._authProvider.tokens();
@@ -36265,14 +36425,13 @@ class StreamableHTTPClientTransport {
36265
36425
  if (this._protocolVersion) {
36266
36426
  headers["mcp-protocol-version"] = this._protocolVersion;
36267
36427
  }
36268
- const extraHeaders = normalizeHeaders((_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers);
36428
+ const extraHeaders = normalizeHeaders(this._requestInit?.headers);
36269
36429
  return new Headers({
36270
36430
  ...headers,
36271
36431
  ...extraHeaders
36272
36432
  });
36273
36433
  }
36274
36434
  async _startOrAuthSse(options) {
36275
- var _a, _b, _c, _d;
36276
36435
  const { resumptionToken } = options;
36277
36436
  try {
36278
36437
  const headers = await this._commonHeaders();
@@ -36280,13 +36439,13 @@ class StreamableHTTPClientTransport {
36280
36439
  if (resumptionToken) {
36281
36440
  headers.set("last-event-id", resumptionToken);
36282
36441
  }
36283
- const response = await ((_a = this._fetch) !== null && _a !== void 0 ? _a : fetch)(this._url, {
36442
+ const response = await (this._fetch ?? fetch)(this._url, {
36284
36443
  method: "GET",
36285
36444
  headers,
36286
- signal: (_b = this._abortController) === null || _b === void 0 ? void 0 : _b.signal
36445
+ signal: this._abortController?.signal
36287
36446
  });
36288
36447
  if (!response.ok) {
36289
- await ((_c = response.body) === null || _c === void 0 ? void 0 : _c.cancel());
36448
+ await response.body?.cancel();
36290
36449
  if (response.status === 401 && this._authProvider) {
36291
36450
  return await this._authThenStart();
36292
36451
  }
@@ -36297,7 +36456,7 @@ class StreamableHTTPClientTransport {
36297
36456
  }
36298
36457
  this._handleSseStream(response.body, options, true);
36299
36458
  } catch (error) {
36300
- (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, error);
36459
+ this.onerror?.(error);
36301
36460
  throw error;
36302
36461
  }
36303
36462
  }
@@ -36323,17 +36482,15 @@ class StreamableHTTPClientTransport {
36323
36482
  * @param attemptCount Current reconnection attempt count for this specific stream
36324
36483
  */
36325
36484
  _scheduleReconnection(options, attemptCount = 0) {
36326
- var _a;
36327
36485
  const maxRetries = this._reconnectionOptions.maxRetries;
36328
36486
  if (attemptCount >= maxRetries) {
36329
- (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`));
36487
+ this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`));
36330
36488
  return;
36331
36489
  }
36332
36490
  const delay = this._getNextReconnectionDelay(attemptCount);
36333
36491
  this._reconnectionTimeout = setTimeout(() => {
36334
36492
  this._startOrAuthSse(options).catch((error) => {
36335
- var _a2;
36336
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`));
36493
+ this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`));
36337
36494
  this._scheduleReconnection(options, attemptCount + 1);
36338
36495
  });
36339
36496
  }, delay);
@@ -36347,7 +36504,6 @@ class StreamableHTTPClientTransport {
36347
36504
  let hasPrimingEvent = false;
36348
36505
  let receivedResponse = false;
36349
36506
  const processStream = async () => {
36350
- var _a, _b, _c, _d;
36351
36507
  try {
36352
36508
  const reader = stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream({
36353
36509
  onRetry: (retryMs) => {
@@ -36362,7 +36518,7 @@ class StreamableHTTPClientTransport {
36362
36518
  if (event.id) {
36363
36519
  lastEventId = event.id;
36364
36520
  hasPrimingEvent = true;
36365
- onresumptiontoken === null || onresumptiontoken === void 0 ? void 0 : onresumptiontoken(event.id);
36521
+ onresumptiontoken?.(event.id);
36366
36522
  }
36367
36523
  if (!event.data) {
36368
36524
  continue;
@@ -36370,15 +36526,15 @@ class StreamableHTTPClientTransport {
36370
36526
  if (!event.event || event.event === "message") {
36371
36527
  try {
36372
36528
  const message = JSONRPCMessageSchema.parse(JSON.parse(event.data));
36373
- if (isJSONRPCResponse(message)) {
36529
+ if (isJSONRPCResultResponse(message)) {
36374
36530
  receivedResponse = true;
36375
36531
  if (replayMessageId !== void 0) {
36376
36532
  message.id = replayMessageId;
36377
36533
  }
36378
36534
  }
36379
- (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message);
36535
+ this.onmessage?.(message);
36380
36536
  } catch (error) {
36381
- (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error);
36537
+ this.onerror?.(error);
36382
36538
  }
36383
36539
  }
36384
36540
  }
@@ -36392,7 +36548,7 @@ class StreamableHTTPClientTransport {
36392
36548
  }, 0);
36393
36549
  }
36394
36550
  } catch (error) {
36395
- (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, new Error(`SSE stream disconnected: ${error}`));
36551
+ this.onerror?.(new Error(`SSE stream disconnected: ${error}`));
36396
36552
  const canResume = isReconnectable || hasPrimingEvent;
36397
36553
  const needsReconnect = canResume && !receivedResponse;
36398
36554
  if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
@@ -36403,7 +36559,7 @@ class StreamableHTTPClientTransport {
36403
36559
  replayMessageId
36404
36560
  }, 0);
36405
36561
  } catch (error2) {
36406
- (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, new Error(`Failed to reconnect: ${error2 instanceof Error ? error2.message : String(error2)}`));
36562
+ this.onerror?.(new Error(`Failed to reconnect: ${error2 instanceof Error ? error2.message : String(error2)}`));
36407
36563
  }
36408
36564
  }
36409
36565
  }
@@ -36435,23 +36591,18 @@ class StreamableHTTPClientTransport {
36435
36591
  }
36436
36592
  }
36437
36593
  async close() {
36438
- var _a, _b;
36439
36594
  if (this._reconnectionTimeout) {
36440
36595
  clearTimeout(this._reconnectionTimeout);
36441
36596
  this._reconnectionTimeout = void 0;
36442
36597
  }
36443
- (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort();
36444
- (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this);
36598
+ this._abortController?.abort();
36599
+ this.onclose?.();
36445
36600
  }
36446
36601
  async send(message, options) {
36447
- var _a, _b, _c, _d, _e2, _f, _g;
36448
36602
  try {
36449
36603
  const { resumptionToken, onresumptiontoken } = options || {};
36450
36604
  if (resumptionToken) {
36451
- this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : void 0 }).catch((err) => {
36452
- var _a2;
36453
- return (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, err);
36454
- });
36605
+ this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : void 0 }).catch((err) => this.onerror?.(err));
36455
36606
  return;
36456
36607
  }
36457
36608
  const headers = await this._commonHeaders();
@@ -36462,9 +36613,9 @@ class StreamableHTTPClientTransport {
36462
36613
  method: "POST",
36463
36614
  headers,
36464
36615
  body: JSON.stringify(message),
36465
- signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal
36616
+ signal: this._abortController?.signal
36466
36617
  };
36467
- const response = await ((_b = this._fetch) !== null && _b !== void 0 ? _b : fetch)(this._url, init);
36618
+ const response = await (this._fetch ?? fetch)(this._url, init);
36468
36619
  const sessionId = response.headers.get("mcp-session-id");
36469
36620
  if (sessionId) {
36470
36621
  this._sessionId = sessionId;
@@ -36503,7 +36654,7 @@ class StreamableHTTPClientTransport {
36503
36654
  if (resourceMetadataUrl) {
36504
36655
  this._resourceMetadataUrl = resourceMetadataUrl;
36505
36656
  }
36506
- this._lastUpscopingHeader = wwwAuthHeader !== null && wwwAuthHeader !== void 0 ? wwwAuthHeader : void 0;
36657
+ this._lastUpscopingHeader = wwwAuthHeader ?? void 0;
36507
36658
  const result = await auth(this._authProvider, {
36508
36659
  serverUrl: this._url,
36509
36660
  resourceMetadataUrl: this._resourceMetadataUrl,
@@ -36521,12 +36672,9 @@ class StreamableHTTPClientTransport {
36521
36672
  this._hasCompletedAuthFlow = false;
36522
36673
  this._lastUpscopingHeader = void 0;
36523
36674
  if (response.status === 202) {
36524
- await ((_c = response.body) === null || _c === void 0 ? void 0 : _c.cancel());
36675
+ await response.body?.cancel();
36525
36676
  if (isInitializedNotification(message)) {
36526
- this._startOrAuthSse({ resumptionToken: void 0 }).catch((err) => {
36527
- var _a2;
36528
- return (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, err);
36529
- });
36677
+ this._startOrAuthSse({ resumptionToken: void 0 }).catch((err) => this.onerror?.(err));
36530
36678
  }
36531
36679
  return;
36532
36680
  }
@@ -36534,23 +36682,23 @@ class StreamableHTTPClientTransport {
36534
36682
  const hasRequests = messages.filter((msg) => "method" in msg && "id" in msg && msg.id !== void 0).length > 0;
36535
36683
  const contentType = response.headers.get("content-type");
36536
36684
  if (hasRequests) {
36537
- if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("text/event-stream")) {
36685
+ if (contentType?.includes("text/event-stream")) {
36538
36686
  this._handleSseStream(response.body, { onresumptiontoken }, false);
36539
- } else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("application/json")) {
36687
+ } else if (contentType?.includes("application/json")) {
36540
36688
  const data2 = await response.json();
36541
36689
  const responseMessages = Array.isArray(data2) ? data2.map((msg) => JSONRPCMessageSchema.parse(msg)) : [JSONRPCMessageSchema.parse(data2)];
36542
36690
  for (const msg of responseMessages) {
36543
- (_d = this.onmessage) === null || _d === void 0 ? void 0 : _d.call(this, msg);
36691
+ this.onmessage?.(msg);
36544
36692
  }
36545
36693
  } else {
36546
- await ((_e2 = response.body) === null || _e2 === void 0 ? void 0 : _e2.cancel());
36694
+ await response.body?.cancel();
36547
36695
  throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`);
36548
36696
  }
36549
36697
  } else {
36550
- await ((_f = response.body) === null || _f === void 0 ? void 0 : _f.cancel());
36698
+ await response.body?.cancel();
36551
36699
  }
36552
36700
  } catch (error) {
36553
- (_g = this.onerror) === null || _g === void 0 ? void 0 : _g.call(this, error);
36701
+ this.onerror?.(error);
36554
36702
  throw error;
36555
36703
  }
36556
36704
  }
@@ -36569,7 +36717,6 @@ class StreamableHTTPClientTransport {
36569
36717
  * the server does not allow clients to terminate sessions.
36570
36718
  */
36571
36719
  async terminateSession() {
36572
- var _a, _b, _c, _d;
36573
36720
  if (!this._sessionId) {
36574
36721
  return;
36575
36722
  }
@@ -36579,16 +36726,16 @@ class StreamableHTTPClientTransport {
36579
36726
  ...this._requestInit,
36580
36727
  method: "DELETE",
36581
36728
  headers,
36582
- signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal
36729
+ signal: this._abortController?.signal
36583
36730
  };
36584
- const response = await ((_b = this._fetch) !== null && _b !== void 0 ? _b : fetch)(this._url, init);
36585
- await ((_c = response.body) === null || _c === void 0 ? void 0 : _c.cancel());
36731
+ const response = await (this._fetch ?? fetch)(this._url, init);
36732
+ await response.body?.cancel();
36586
36733
  if (!response.ok && response.status !== 405) {
36587
36734
  throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`);
36588
36735
  }
36589
36736
  this._sessionId = void 0;
36590
36737
  } catch (error) {
36591
- (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, error);
36738
+ this.onerror?.(error);
36592
36739
  throw error;
36593
36740
  }
36594
36741
  }
@@ -36608,7 +36755,7 @@ class StreamableHTTPClientTransport {
36608
36755
  async resumeStream(lastEventId, options) {
36609
36756
  await this._startOrAuthSse({
36610
36757
  resumptionToken: lastEventId,
36611
- onresumptiontoken: options === null || options === void 0 ? void 0 : options.onresumptiontoken
36758
+ onresumptiontoken: options?.onresumptiontoken
36612
36759
  });
36613
36760
  }
36614
36761
  }
@@ -37500,7 +37647,7 @@ var RovingFocusGroupImpl = reactExports.forwardRef((props, forwardedRef) => {
37500
37647
  []
37501
37648
  ),
37502
37649
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37503
- Primitive.div,
37650
+ Primitive$1.div,
37504
37651
  {
37505
37652
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
37506
37653
  "data-orientation": orientation,
@@ -37565,7 +37712,7 @@ var RovingFocusGroupItem = reactExports.forwardRef(
37565
37712
  focusable,
37566
37713
  active,
37567
37714
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37568
- Primitive.span,
37715
+ Primitive$1.span,
37569
37716
  {
37570
37717
  tabIndex: isCurrentTabStop ? 0 : -1,
37571
37718
  "data-orientation": context.orientation,
@@ -37674,7 +37821,7 @@ var Tabs$1 = reactExports.forwardRef(
37674
37821
  dir: direction,
37675
37822
  activationMode,
37676
37823
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37677
- Primitive.div,
37824
+ Primitive$1.div,
37678
37825
  {
37679
37826
  dir: direction,
37680
37827
  "data-orientation": orientation,
@@ -37702,7 +37849,7 @@ var TabsList$1 = reactExports.forwardRef(
37702
37849
  dir: context.dir,
37703
37850
  loop,
37704
37851
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37705
- Primitive.div,
37852
+ Primitive$1.div,
37706
37853
  {
37707
37854
  role: "tablist",
37708
37855
  "aria-orientation": context.orientation,
@@ -37732,7 +37879,7 @@ var TabsTrigger$1 = reactExports.forwardRef(
37732
37879
  focusable: !disabled,
37733
37880
  active: isSelected,
37734
37881
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37735
- Primitive.button,
37882
+ Primitive$1.button,
37736
37883
  {
37737
37884
  type: "button",
37738
37885
  role: "tab",
@@ -37781,7 +37928,7 @@ var TabsContent$1 = reactExports.forwardRef(
37781
37928
  return () => cancelAnimationFrame(rAF);
37782
37929
  }, []);
37783
37930
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
37784
- Primitive.div,
37931
+ Primitive$1.div,
37785
37932
  {
37786
37933
  "data-state": isSelected ? "active" : "inactive",
37787
37934
  "data-orientation": context.orientation,
@@ -37849,6 +37996,103 @@ const TabsContent = reactExports.forwardRef(({ className, ...props }, ref2) => /
37849
37996
  }
37850
37997
  ));
37851
37998
  TabsContent.displayName = Content$2.displayName;
37999
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
38000
+ var use = React$1[" use ".trim().toString()];
38001
+ function isPromiseLike(value) {
38002
+ return typeof value === "object" && value !== null && "then" in value;
38003
+ }
38004
+ function isLazyComponent(element) {
38005
+ return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
38006
+ }
38007
+ // @__NO_SIDE_EFFECTS__
38008
+ function createSlot$3(ownerName) {
38009
+ const SlotClone = /* @__PURE__ */ createSlotClone$3(ownerName);
38010
+ const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
38011
+ let { children, ...slotProps } = props;
38012
+ if (isLazyComponent(children) && typeof use === "function") {
38013
+ children = use(children._payload);
38014
+ }
38015
+ const childrenArray = reactExports.Children.toArray(children);
38016
+ const slottable = childrenArray.find(isSlottable$3);
38017
+ if (slottable) {
38018
+ const newElement = slottable.props.children;
38019
+ const newChildren = childrenArray.map((child) => {
38020
+ if (child === slottable) {
38021
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
38022
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
38023
+ } else {
38024
+ return child;
38025
+ }
38026
+ });
38027
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
38028
+ }
38029
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
38030
+ });
38031
+ Slot2.displayName = `${ownerName}.Slot`;
38032
+ return Slot2;
38033
+ }
38034
+ var Slot$3 = /* @__PURE__ */ createSlot$3("Slot");
38035
+ // @__NO_SIDE_EFFECTS__
38036
+ function createSlotClone$3(ownerName) {
38037
+ const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
38038
+ let { children, ...slotProps } = props;
38039
+ if (isLazyComponent(children) && typeof use === "function") {
38040
+ children = use(children._payload);
38041
+ }
38042
+ if (reactExports.isValidElement(children)) {
38043
+ const childrenRef = getElementRef$3(children);
38044
+ const props2 = mergeProps$3(slotProps, children.props);
38045
+ if (children.type !== reactExports.Fragment) {
38046
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
38047
+ }
38048
+ return reactExports.cloneElement(children, props2);
38049
+ }
38050
+ return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
38051
+ });
38052
+ SlotClone.displayName = `${ownerName}.SlotClone`;
38053
+ return SlotClone;
38054
+ }
38055
+ var SLOTTABLE_IDENTIFIER$4 = Symbol("radix.slottable");
38056
+ function isSlottable$3(child) {
38057
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$4;
38058
+ }
38059
+ function mergeProps$3(slotProps, childProps) {
38060
+ const overrideProps = { ...childProps };
38061
+ for (const propName in childProps) {
38062
+ const slotPropValue = slotProps[propName];
38063
+ const childPropValue = childProps[propName];
38064
+ const isHandler = /^on[A-Z]/.test(propName);
38065
+ if (isHandler) {
38066
+ if (slotPropValue && childPropValue) {
38067
+ overrideProps[propName] = (...args) => {
38068
+ const result = childPropValue(...args);
38069
+ slotPropValue(...args);
38070
+ return result;
38071
+ };
38072
+ } else if (slotPropValue) {
38073
+ overrideProps[propName] = slotPropValue;
38074
+ }
38075
+ } else if (propName === "style") {
38076
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
38077
+ } else if (propName === "className") {
38078
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
38079
+ }
38080
+ }
38081
+ return { ...slotProps, ...overrideProps };
38082
+ }
38083
+ function getElementRef$3(element) {
38084
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
38085
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
38086
+ if (mayWarn) {
38087
+ return element.ref;
38088
+ }
38089
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
38090
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
38091
+ if (mayWarn) {
38092
+ return element.props.ref;
38093
+ }
38094
+ return element.props.ref || element.ref;
38095
+ }
37852
38096
  const buttonVariants = cva(
37853
38097
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
37854
38098
  {
@@ -39523,7 +39767,7 @@ var FocusScope = reactExports.forwardRef((props, forwardedRef) => {
39523
39767
  },
39524
39768
  [loop, trapped, focusScope.paused]
39525
39769
  );
39526
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
39770
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
39527
39771
  });
39528
39772
  FocusScope.displayName = FOCUS_SCOPE_NAME;
39529
39773
  function focusFirst(candidates, { select = false } = {}) {
@@ -40173,6 +40417,12 @@ function RemoveScrollSideCar(props) {
40173
40417
  if ("touches" in event && moveDirection === "h" && target.type === "range") {
40174
40418
  return false;
40175
40419
  }
40420
+ var selection = window.getSelection();
40421
+ var anchorNode = selection && selection.anchorNode;
40422
+ var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
40423
+ if (isTouchingSelection) {
40424
+ return false;
40425
+ }
40176
40426
  var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
40177
40427
  if (!canBeScrolledInMainDirection) {
40178
40428
  return true;
@@ -40403,6 +40653,88 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
40403
40653
  targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
40404
40654
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
40405
40655
  };
40656
+ // @__NO_SIDE_EFFECTS__
40657
+ function createSlot$2(ownerName) {
40658
+ const SlotClone = /* @__PURE__ */ createSlotClone$2(ownerName);
40659
+ const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
40660
+ const { children, ...slotProps } = props;
40661
+ const childrenArray = reactExports.Children.toArray(children);
40662
+ const slottable = childrenArray.find(isSlottable$2);
40663
+ if (slottable) {
40664
+ const newElement = slottable.props.children;
40665
+ const newChildren = childrenArray.map((child) => {
40666
+ if (child === slottable) {
40667
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
40668
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
40669
+ } else {
40670
+ return child;
40671
+ }
40672
+ });
40673
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
40674
+ }
40675
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
40676
+ });
40677
+ Slot2.displayName = `${ownerName}.Slot`;
40678
+ return Slot2;
40679
+ }
40680
+ // @__NO_SIDE_EFFECTS__
40681
+ function createSlotClone$2(ownerName) {
40682
+ const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
40683
+ const { children, ...slotProps } = props;
40684
+ if (reactExports.isValidElement(children)) {
40685
+ const childrenRef = getElementRef$2(children);
40686
+ const props2 = mergeProps$2(slotProps, children.props);
40687
+ if (children.type !== reactExports.Fragment) {
40688
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
40689
+ }
40690
+ return reactExports.cloneElement(children, props2);
40691
+ }
40692
+ return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
40693
+ });
40694
+ SlotClone.displayName = `${ownerName}.SlotClone`;
40695
+ return SlotClone;
40696
+ }
40697
+ var SLOTTABLE_IDENTIFIER$3 = Symbol("radix.slottable");
40698
+ function isSlottable$2(child) {
40699
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$3;
40700
+ }
40701
+ function mergeProps$2(slotProps, childProps) {
40702
+ const overrideProps = { ...childProps };
40703
+ for (const propName in childProps) {
40704
+ const slotPropValue = slotProps[propName];
40705
+ const childPropValue = childProps[propName];
40706
+ const isHandler = /^on[A-Z]/.test(propName);
40707
+ if (isHandler) {
40708
+ if (slotPropValue && childPropValue) {
40709
+ overrideProps[propName] = (...args) => {
40710
+ const result = childPropValue(...args);
40711
+ slotPropValue(...args);
40712
+ return result;
40713
+ };
40714
+ } else if (slotPropValue) {
40715
+ overrideProps[propName] = slotPropValue;
40716
+ }
40717
+ } else if (propName === "style") {
40718
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
40719
+ } else if (propName === "className") {
40720
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
40721
+ }
40722
+ }
40723
+ return { ...slotProps, ...overrideProps };
40724
+ }
40725
+ function getElementRef$2(element) {
40726
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
40727
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
40728
+ if (mayWarn) {
40729
+ return element.ref;
40730
+ }
40731
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
40732
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
40733
+ if (mayWarn) {
40734
+ return element.props.ref;
40735
+ }
40736
+ return element.props.ref || element.ref;
40737
+ }
40406
40738
  var DIALOG_NAME = "Dialog";
40407
40739
  var [createDialogContext] = createContextScope(DIALOG_NAME);
40408
40740
  var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
@@ -40448,7 +40780,7 @@ var DialogTrigger = reactExports.forwardRef(
40448
40780
  const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
40449
40781
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
40450
40782
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
40451
- Primitive.button,
40783
+ Primitive$1.button,
40452
40784
  {
40453
40785
  type: "button",
40454
40786
  "aria-haspopup": "dialog",
@@ -40483,7 +40815,7 @@ var DialogOverlay$1 = reactExports.forwardRef(
40483
40815
  }
40484
40816
  );
40485
40817
  DialogOverlay$1.displayName = OVERLAY_NAME;
40486
- var Slot$2 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
40818
+ var Slot$2 = /* @__PURE__ */ createSlot$2("DialogOverlay.RemoveScroll");
40487
40819
  var DialogOverlayImpl = reactExports.forwardRef(
40488
40820
  (props, forwardedRef) => {
40489
40821
  const { __scopeDialog, ...overlayProps } = props;
@@ -40492,7 +40824,7 @@ var DialogOverlayImpl = reactExports.forwardRef(
40492
40824
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
40493
40825
  // ie. when `Overlay` and `Content` are siblings
40494
40826
  /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
40495
- Primitive.div,
40827
+ Primitive$1.div,
40496
40828
  {
40497
40829
  "data-state": getState$3(context.open),
40498
40830
  ...overlayProps,
@@ -40630,7 +40962,7 @@ var DialogTitle$1 = reactExports.forwardRef(
40630
40962
  (props, forwardedRef) => {
40631
40963
  const { __scopeDialog, ...titleProps } = props;
40632
40964
  const context = useDialogContext(TITLE_NAME, __scopeDialog);
40633
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
40965
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
40634
40966
  }
40635
40967
  );
40636
40968
  DialogTitle$1.displayName = TITLE_NAME;
@@ -40639,7 +40971,7 @@ var DialogDescription$1 = reactExports.forwardRef(
40639
40971
  (props, forwardedRef) => {
40640
40972
  const { __scopeDialog, ...descriptionProps } = props;
40641
40973
  const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
40642
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
40974
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
40643
40975
  }
40644
40976
  );
40645
40977
  DialogDescription$1.displayName = DESCRIPTION_NAME;
@@ -40649,7 +40981,7 @@ var DialogClose = reactExports.forwardRef(
40649
40981
  const { __scopeDialog, ...closeProps } = props;
40650
40982
  const context = useDialogContext(CLOSE_NAME$1, __scopeDialog);
40651
40983
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
40652
- Primitive.button,
40984
+ Primitive$1.button,
40653
40985
  {
40654
40986
  type: "button",
40655
40987
  ...closeProps,
@@ -40838,7 +41170,7 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
40838
41170
  }, se = (e) => {
40839
41171
  e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1);
40840
41172
  };
40841
- return reactExports.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
41173
+ return reactExports.createElement(Primitive$1.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
40842
41174
  var s;
40843
41175
  (s = O.onKeyDown) == null || s.call(O, e);
40844
41176
  let a = e.nativeEvent.isComposing || e.keyCode === 229;
@@ -40899,20 +41231,20 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
40899
41231
  }
40900
41232
  if (!x) return null;
40901
41233
  let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r2;
40902
- return reactExports.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r2.children);
41234
+ return reactExports.createElement(Primitive$1.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r2.children);
40903
41235
  }), Ee = reactExports.forwardRef((r2, o) => {
40904
41236
  let { heading: n, children: u2, forceMount: c, ...d } = r2, f = useId(), p2 = reactExports.useRef(null), b = reactExports.useRef(null), m2 = useId(), R = K(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
40905
41237
  k(() => R.group(f), []), ve(f, p2, [r2.value, r2.heading, b]);
40906
41238
  let C = reactExports.useMemo(() => ({ id: f, forceMount: c }), [c]);
40907
- return reactExports.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r2, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, reactExports.createElement(fe.Provider, { value: C }, S))));
41239
+ return reactExports.createElement(Primitive$1.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r2, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, reactExports.createElement(fe.Provider, { value: C }, S))));
40908
41240
  }), ye = reactExports.forwardRef((r2, o) => {
40909
41241
  let { alwaysRender: n, ...u2 } = r2, c = reactExports.useRef(null), d = P((f) => !f.search);
40910
- return !n && !d ? null : reactExports.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
41242
+ return !n && !d ? null : reactExports.createElement(Primitive$1.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
40911
41243
  }), Se = reactExports.forwardRef((r2, o) => {
40912
41244
  let { onValueChange: n, ...u2 } = r2, c = r2.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K();
40913
41245
  return reactExports.useEffect(() => {
40914
41246
  r2.value != null && d.setState("search", r2.value);
40915
- }, [r2.value]), reactExports.createElement(Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r2.value : f, onChange: (m2) => {
41247
+ }, [r2.value]), reactExports.createElement(Primitive$1.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r2.value : f, onChange: (m2) => {
40916
41248
  c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
40917
41249
  } });
40918
41250
  }), Ce = reactExports.forwardRef((r2, o) => {
@@ -40929,13 +41261,13 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
40929
41261
  cancelAnimationFrame(x), C.unobserve(m2);
40930
41262
  };
40931
41263
  }
40932
- }, []), reactExports.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r2, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
41264
+ }, []), reactExports.createElement(Primitive$1.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r2, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
40933
41265
  }), xe = reactExports.forwardRef((r2, o) => {
40934
41266
  let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r2;
40935
41267
  return reactExports.createElement(Root$3, { open: n, onOpenChange: u2 }, reactExports.createElement(Portal$2, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c }), reactExports.createElement(Content$1, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me, { ref: o, ...p2 }))));
40936
- }), Ie = reactExports.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? reactExports.createElement(Primitive.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null), Pe = reactExports.forwardRef((r2, o) => {
41268
+ }), Ie = reactExports.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? reactExports.createElement(Primitive$1.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null), Pe = reactExports.forwardRef((r2, o) => {
40937
41269
  let { progress: n, children: u2, label: c = "Loading...", ...d } = r2;
40938
- return reactExports.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B(r2, (f) => reactExports.createElement("div", { "aria-hidden": true }, f)));
41270
+ return reactExports.createElement(Primitive$1.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B(r2, (f) => reactExports.createElement("div", { "aria-hidden": true }, f)));
40939
41271
  }), _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
40940
41272
  function we(r2, o) {
40941
41273
  let n = r2.nextElementSibling;
@@ -43026,7 +43358,7 @@ var NAME$1 = "Arrow";
43026
43358
  var Arrow$1 = reactExports.forwardRef((props, forwardedRef) => {
43027
43359
  const { children, width = 10, height = 5, ...arrowProps } = props;
43028
43360
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
43029
- Primitive.svg,
43361
+ Primitive$1.svg,
43030
43362
  {
43031
43363
  ...arrowProps,
43032
43364
  ref: forwardedRef,
@@ -43098,7 +43430,7 @@ var PopperAnchor = reactExports.forwardRef(
43098
43430
  context.onAnchorChange(anchorRef.current);
43099
43431
  }
43100
43432
  });
43101
- return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
43433
+ return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { ...anchorProps, ref: composedRefs });
43102
43434
  }
43103
43435
  );
43104
43436
  PopperAnchor.displayName = ANCHOR_NAME$1;
@@ -43225,7 +43557,7 @@ var PopperContent = reactExports.forwardRef(
43225
43557
  arrowY,
43226
43558
  shouldHideArrow: cannotCenterArrow,
43227
43559
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43228
- Primitive.div,
43560
+ Primitive$1.div,
43229
43561
  {
43230
43562
  "data-side": placedSide,
43231
43563
  "data-align": placedAlign,
@@ -43343,6 +43675,88 @@ var Root2$2 = Popper;
43343
43675
  var Anchor = PopperAnchor;
43344
43676
  var Content = PopperContent;
43345
43677
  var Arrow = PopperArrow;
43678
+ // @__NO_SIDE_EFFECTS__
43679
+ function createSlot$1(ownerName) {
43680
+ const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
43681
+ const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
43682
+ const { children, ...slotProps } = props;
43683
+ const childrenArray = reactExports.Children.toArray(children);
43684
+ const slottable = childrenArray.find(isSlottable$1);
43685
+ if (slottable) {
43686
+ const newElement = slottable.props.children;
43687
+ const newChildren = childrenArray.map((child) => {
43688
+ if (child === slottable) {
43689
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
43690
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
43691
+ } else {
43692
+ return child;
43693
+ }
43694
+ });
43695
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
43696
+ }
43697
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
43698
+ });
43699
+ Slot2.displayName = `${ownerName}.Slot`;
43700
+ return Slot2;
43701
+ }
43702
+ // @__NO_SIDE_EFFECTS__
43703
+ function createSlotClone$1(ownerName) {
43704
+ const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
43705
+ const { children, ...slotProps } = props;
43706
+ if (reactExports.isValidElement(children)) {
43707
+ const childrenRef = getElementRef$1(children);
43708
+ const props2 = mergeProps$1(slotProps, children.props);
43709
+ if (children.type !== reactExports.Fragment) {
43710
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
43711
+ }
43712
+ return reactExports.cloneElement(children, props2);
43713
+ }
43714
+ return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
43715
+ });
43716
+ SlotClone.displayName = `${ownerName}.SlotClone`;
43717
+ return SlotClone;
43718
+ }
43719
+ var SLOTTABLE_IDENTIFIER$2 = Symbol("radix.slottable");
43720
+ function isSlottable$1(child) {
43721
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$2;
43722
+ }
43723
+ function mergeProps$1(slotProps, childProps) {
43724
+ const overrideProps = { ...childProps };
43725
+ for (const propName in childProps) {
43726
+ const slotPropValue = slotProps[propName];
43727
+ const childPropValue = childProps[propName];
43728
+ const isHandler = /^on[A-Z]/.test(propName);
43729
+ if (isHandler) {
43730
+ if (slotPropValue && childPropValue) {
43731
+ overrideProps[propName] = (...args) => {
43732
+ const result = childPropValue(...args);
43733
+ slotPropValue(...args);
43734
+ return result;
43735
+ };
43736
+ } else if (slotPropValue) {
43737
+ overrideProps[propName] = slotPropValue;
43738
+ }
43739
+ } else if (propName === "style") {
43740
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
43741
+ } else if (propName === "className") {
43742
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
43743
+ }
43744
+ }
43745
+ return { ...slotProps, ...overrideProps };
43746
+ }
43747
+ function getElementRef$1(element) {
43748
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
43749
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
43750
+ if (mayWarn) {
43751
+ return element.ref;
43752
+ }
43753
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
43754
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
43755
+ if (mayWarn) {
43756
+ return element.props.ref;
43757
+ }
43758
+ return element.props.ref || element.ref;
43759
+ }
43346
43760
  var POPOVER_NAME = "Popover";
43347
43761
  var [createPopoverContext] = createContextScope(POPOVER_NAME, [
43348
43762
  createPopperScope
@@ -43408,7 +43822,7 @@ var PopoverTrigger$1 = reactExports.forwardRef(
43408
43822
  const popperScope = usePopperScope$2(__scopePopover);
43409
43823
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
43410
43824
  const trigger = /* @__PURE__ */ jsxRuntimeExports.jsx(
43411
- Primitive.button,
43825
+ Primitive$1.button,
43412
43826
  {
43413
43827
  type: "button",
43414
43828
  "aria-haspopup": "dialog",
@@ -43444,7 +43858,7 @@ var PopoverContent$1 = reactExports.forwardRef(
43444
43858
  }
43445
43859
  );
43446
43860
  PopoverContent$1.displayName = CONTENT_NAME$2;
43447
- var Slot$1 = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
43861
+ var Slot$1 = /* @__PURE__ */ createSlot$1("PopoverContent.RemoveScroll");
43448
43862
  var PopoverContentModal = reactExports.forwardRef(
43449
43863
  (props, forwardedRef) => {
43450
43864
  const context = usePopoverContext(CONTENT_NAME$2, props.__scopePopover);
@@ -43594,7 +44008,7 @@ var PopoverClose = reactExports.forwardRef(
43594
44008
  const { __scopePopover, ...closeProps } = props;
43595
44009
  const context = usePopoverContext(CLOSE_NAME, __scopePopover);
43596
44010
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
43597
- Primitive.button,
44011
+ Primitive$1.button,
43598
44012
  {
43599
44013
  type: "button",
43600
44014
  ...closeProps,
@@ -43718,6 +44132,38 @@ function Combobox({
43718
44132
  ] }) })
43719
44133
  ] });
43720
44134
  }
44135
+ var NODES = [
44136
+ "a",
44137
+ "button",
44138
+ "div",
44139
+ "form",
44140
+ "h2",
44141
+ "h3",
44142
+ "img",
44143
+ "input",
44144
+ "label",
44145
+ "li",
44146
+ "nav",
44147
+ "ol",
44148
+ "p",
44149
+ "select",
44150
+ "span",
44151
+ "svg",
44152
+ "ul"
44153
+ ];
44154
+ var Primitive = NODES.reduce((primitive, node) => {
44155
+ const Slot2 = /* @__PURE__ */ createSlot$3(`Primitive.${node}`);
44156
+ const Node2 = reactExports.forwardRef((props, forwardedRef) => {
44157
+ const { asChild, ...primitiveProps } = props;
44158
+ const Comp = asChild ? Slot2 : node;
44159
+ if (typeof window !== "undefined") {
44160
+ window[Symbol.for("radix-ui")] = true;
44161
+ }
44162
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
44163
+ });
44164
+ Node2.displayName = `Primitive.${node}`;
44165
+ return { ...primitive, [node]: Node2 };
44166
+ }, {});
43721
44167
  var NAME = "Label";
43722
44168
  var Label$2 = reactExports.forwardRef((props, forwardedRef) => {
43723
44169
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -47181,6 +47627,88 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
47181
47627
  function clamp(value, [min2, max2]) {
47182
47628
  return Math.min(max2, Math.max(min2, value));
47183
47629
  }
47630
+ // @__NO_SIDE_EFFECTS__
47631
+ function createSlot(ownerName) {
47632
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
47633
+ const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
47634
+ const { children, ...slotProps } = props;
47635
+ const childrenArray = reactExports.Children.toArray(children);
47636
+ const slottable = childrenArray.find(isSlottable);
47637
+ if (slottable) {
47638
+ const newElement = slottable.props.children;
47639
+ const newChildren = childrenArray.map((child) => {
47640
+ if (child === slottable) {
47641
+ if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
47642
+ return reactExports.isValidElement(newElement) ? newElement.props.children : null;
47643
+ } else {
47644
+ return child;
47645
+ }
47646
+ });
47647
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
47648
+ }
47649
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
47650
+ });
47651
+ Slot2.displayName = `${ownerName}.Slot`;
47652
+ return Slot2;
47653
+ }
47654
+ // @__NO_SIDE_EFFECTS__
47655
+ function createSlotClone(ownerName) {
47656
+ const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
47657
+ const { children, ...slotProps } = props;
47658
+ if (reactExports.isValidElement(children)) {
47659
+ const childrenRef = getElementRef(children);
47660
+ const props2 = mergeProps(slotProps, children.props);
47661
+ if (children.type !== reactExports.Fragment) {
47662
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
47663
+ }
47664
+ return reactExports.cloneElement(children, props2);
47665
+ }
47666
+ return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
47667
+ });
47668
+ SlotClone.displayName = `${ownerName}.SlotClone`;
47669
+ return SlotClone;
47670
+ }
47671
+ var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
47672
+ function isSlottable(child) {
47673
+ return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
47674
+ }
47675
+ function mergeProps(slotProps, childProps) {
47676
+ const overrideProps = { ...childProps };
47677
+ for (const propName in childProps) {
47678
+ const slotPropValue = slotProps[propName];
47679
+ const childPropValue = childProps[propName];
47680
+ const isHandler = /^on[A-Z]/.test(propName);
47681
+ if (isHandler) {
47682
+ if (slotPropValue && childPropValue) {
47683
+ overrideProps[propName] = (...args) => {
47684
+ const result = childPropValue(...args);
47685
+ slotPropValue(...args);
47686
+ return result;
47687
+ };
47688
+ } else if (slotPropValue) {
47689
+ overrideProps[propName] = slotPropValue;
47690
+ }
47691
+ } else if (propName === "style") {
47692
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
47693
+ } else if (propName === "className") {
47694
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
47695
+ }
47696
+ }
47697
+ return { ...slotProps, ...overrideProps };
47698
+ }
47699
+ function getElementRef(element) {
47700
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
47701
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
47702
+ if (mayWarn) {
47703
+ return element.ref;
47704
+ }
47705
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
47706
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
47707
+ if (mayWarn) {
47708
+ return element.props.ref;
47709
+ }
47710
+ return element.props.ref || element.ref;
47711
+ }
47184
47712
  function usePrevious(value) {
47185
47713
  const ref2 = reactExports.useRef({ value, previous: value });
47186
47714
  return reactExports.useMemo(() => {
@@ -47332,7 +47860,7 @@ var SelectTrigger$1 = reactExports.forwardRef(
47332
47860
  }
47333
47861
  };
47334
47862
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
47335
- Primitive.button,
47863
+ Primitive$1.button,
47336
47864
  {
47337
47865
  type: "button",
47338
47866
  role: "combobox",
@@ -47391,7 +47919,7 @@ var SelectValue$1 = reactExports.forwardRef(
47391
47919
  onValueNodeHasChildrenChange(hasChildren);
47392
47920
  }, [onValueNodeHasChildrenChange, hasChildren]);
47393
47921
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
47394
- Primitive.span,
47922
+ Primitive$1.span,
47395
47923
  {
47396
47924
  ...valueProps,
47397
47925
  ref: composedRefs,
@@ -47406,7 +47934,7 @@ var ICON_NAME = "SelectIcon";
47406
47934
  var SelectIcon = reactExports.forwardRef(
47407
47935
  (props, forwardedRef) => {
47408
47936
  const { __scopeSelect, children, ...iconProps } = props;
47409
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
47937
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
47410
47938
  }
47411
47939
  );
47412
47940
  SelectIcon.displayName = ICON_NAME;
@@ -47815,7 +48343,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
47815
48343
  zIndex: contentZIndex
47816
48344
  },
47817
48345
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
47818
- Primitive.div,
48346
+ Primitive$1.div,
47819
48347
  {
47820
48348
  ...popperProps,
47821
48349
  ref: composedRefs,
@@ -47889,7 +48417,7 @@ var SelectViewport = reactExports.forwardRef(
47889
48417
  }
47890
48418
  ),
47891
48419
  /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
47892
- Primitive.div,
48420
+ Primitive$1.div,
47893
48421
  {
47894
48422
  "data-radix-select-viewport": "",
47895
48423
  role: "presentation",
@@ -47944,7 +48472,7 @@ var SelectGroup = reactExports.forwardRef(
47944
48472
  (props, forwardedRef) => {
47945
48473
  const { __scopeSelect, ...groupProps } = props;
47946
48474
  const groupId = useId();
47947
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
48475
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
47948
48476
  }
47949
48477
  );
47950
48478
  SelectGroup.displayName = GROUP_NAME;
@@ -47953,7 +48481,7 @@ var SelectLabel$1 = reactExports.forwardRef(
47953
48481
  (props, forwardedRef) => {
47954
48482
  const { __scopeSelect, ...labelProps } = props;
47955
48483
  const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
47956
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
48484
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
47957
48485
  }
47958
48486
  );
47959
48487
  SelectLabel$1.displayName = LABEL_NAME;
@@ -48009,7 +48537,7 @@ var SelectItem$1 = reactExports.forwardRef(
48009
48537
  disabled,
48010
48538
  textValue,
48011
48539
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48012
- Primitive.div,
48540
+ Primitive$1.div,
48013
48541
  {
48014
48542
  role: "option",
48015
48543
  "aria-labelledby": textId,
@@ -48086,7 +48614,7 @@ var SelectItemText = reactExports.forwardRef(
48086
48614
  return () => onNativeOptionRemove(nativeOption);
48087
48615
  }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
48088
48616
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
48089
- /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
48617
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
48090
48618
  itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? reactDomExports.createPortal(itemTextProps.children, context.valueNode) : null
48091
48619
  ] });
48092
48620
  }
@@ -48097,7 +48625,7 @@ var SelectItemIndicator = reactExports.forwardRef(
48097
48625
  (props, forwardedRef) => {
48098
48626
  const { __scopeSelect, ...itemIndicatorProps } = props;
48099
48627
  const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
48100
- return itemContext.isSelected ? /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
48628
+ return itemContext.isSelected ? /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
48101
48629
  }
48102
48630
  );
48103
48631
  SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
@@ -48187,7 +48715,7 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
48187
48715
  activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
48188
48716
  }, [getItems]);
48189
48717
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
48190
- Primitive.div,
48718
+ Primitive$1.div,
48191
48719
  {
48192
48720
  "aria-hidden": true,
48193
48721
  ...scrollIndicatorProps,
@@ -48214,7 +48742,7 @@ var SEPARATOR_NAME = "SelectSeparator";
48214
48742
  var SelectSeparator$1 = reactExports.forwardRef(
48215
48743
  (props, forwardedRef) => {
48216
48744
  const { __scopeSelect, ...separatorProps } = props;
48217
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
48745
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
48218
48746
  }
48219
48747
  );
48220
48748
  SelectSeparator$1.displayName = SEPARATOR_NAME;
@@ -48251,7 +48779,7 @@ var SelectBubbleInput = reactExports.forwardRef(
48251
48779
  }
48252
48780
  }, [prevValue, value]);
48253
48781
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
48254
- Primitive.select,
48782
+ Primitive$1.select,
48255
48783
  {
48256
48784
  ...props,
48257
48785
  style: { ...VISUALLY_HIDDEN_STYLES, ...props.style },
@@ -48464,7 +48992,17 @@ const useTheme = () => {
48464
48992
  [theme, setThemeWithSideEffect]
48465
48993
  );
48466
48994
  };
48467
- const version = "1.7.1";
48995
+ const version = "1.7.2";
48996
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
48997
+ // @__NO_SIDE_EFFECTS__
48998
+ function createSlottable(ownerName) {
48999
+ const Slottable2 = ({ children }) => {
49000
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
49001
+ };
49002
+ Slottable2.displayName = `${ownerName}.Slottable`;
49003
+ Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
49004
+ return Slottable2;
49005
+ }
48468
49006
  var [createTooltipContext] = createContextScope("Tooltip", [
48469
49007
  createPopperScope
48470
49008
  ]);
@@ -48624,7 +49162,7 @@ var TooltipTrigger$1 = reactExports.forwardRef(
48624
49162
  return () => document.removeEventListener("pointerup", handlePointerUp);
48625
49163
  }, [handlePointerUp]);
48626
49164
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48627
- Primitive.button,
49165
+ Primitive$1.button,
48628
49166
  {
48629
49167
  "aria-describedby": context.open ? context.contentId : void 0,
48630
49168
  "data-state": context.stateAttribute,
@@ -48992,7 +49530,7 @@ var Switch$1 = reactExports.forwardRef(
48992
49530
  });
48993
49531
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
48994
49532
  /* @__PURE__ */ jsxRuntimeExports.jsx(
48995
- Primitive.button,
49533
+ Primitive$1.button,
48996
49534
  {
48997
49535
  type: "button",
48998
49536
  role: "switch",
@@ -49037,7 +49575,7 @@ var SwitchThumb = reactExports.forwardRef(
49037
49575
  const { __scopeSwitch, ...thumbProps } = props;
49038
49576
  const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
49039
49577
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
49040
- Primitive.span,
49578
+ Primitive$1.span,
49041
49579
  {
49042
49580
  "data-state": getState$1(context.checked),
49043
49581
  "data-disabled": context.disabled ? "" : void 0,
@@ -50165,7 +50703,7 @@ var CheckboxTrigger = reactExports.forwardRef(
50165
50703
  }
50166
50704
  }, [control, setChecked]);
50167
50705
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
50168
- Primitive.button,
50706
+ Primitive$1.button,
50169
50707
  {
50170
50708
  type: "button",
50171
50709
  role: "checkbox",
@@ -50249,7 +50787,7 @@ var CheckboxIndicator = reactExports.forwardRef(
50249
50787
  {
50250
50788
  present: forceMount || isIndeterminate(context.checked) || context.checked === true,
50251
50789
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
50252
- Primitive.span,
50790
+ Primitive$1.span,
50253
50791
  {
50254
50792
  "data-state": getState(context.checked),
50255
50793
  "data-disabled": context.disabled ? "" : void 0,
@@ -50301,7 +50839,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
50301
50839
  }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
50302
50840
  const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
50303
50841
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
50304
- Primitive.input,
50842
+ Primitive$1.input,
50305
50843
  {
50306
50844
  type: "checkbox",
50307
50845
  "aria-hidden": true,
@@ -51367,7 +51905,7 @@ class MCPSpecComplianceAssessor extends BaseAssessor {
51367
51905
  ajv;
51368
51906
  constructor(config2) {
51369
51907
  super(config2);
51370
- this.ajv = new Ajv({ allErrors: true });
51908
+ this.ajv = new Ajv$1({ allErrors: true });
51371
51909
  }
51372
51910
  /**
51373
51911
  * Assess MCP Specification Compliance - Hybrid Approach
@@ -51824,22 +52362,66 @@ class MCPSpecComplianceAssessor extends BaseAssessor {
51824
52362
  return recommendations;
51825
52363
  }
51826
52364
  }
52365
+ function createConcurrencyLimit(concurrency) {
52366
+ if (concurrency < 1) {
52367
+ throw new Error("Concurrency must be at least 1");
52368
+ }
52369
+ let activeCount = 0;
52370
+ const queue = [];
52371
+ const next = () => {
52372
+ if (activeCount < concurrency && queue.length > 0) {
52373
+ const { fn, resolve: resolve2, reject } = queue.shift();
52374
+ activeCount++;
52375
+ fn().then((result) => {
52376
+ activeCount--;
52377
+ resolve2(result);
52378
+ next();
52379
+ }).catch((error) => {
52380
+ activeCount--;
52381
+ reject(error);
52382
+ next();
52383
+ });
52384
+ }
52385
+ };
52386
+ return (fn) => {
52387
+ return new Promise((resolve2, reject) => {
52388
+ queue.push({
52389
+ fn,
52390
+ resolve: resolve2,
52391
+ reject
52392
+ });
52393
+ next();
52394
+ });
52395
+ };
52396
+ }
51827
52397
  class ErrorHandlingAssessor extends BaseAssessor {
51828
52398
  async assess(context) {
51829
52399
  this.log("Starting error handling assessment");
51830
52400
  const testDetails = [];
51831
52401
  let passedTests = 0;
51832
52402
  const toolsToTest = this.selectToolsForTesting(context.tools);
51833
- for (const tool of toolsToTest) {
51834
- const toolTests = await this.testToolErrorHandling(
51835
- tool,
51836
- context.callTool
51837
- );
52403
+ const concurrency = this.config.maxParallelTests ?? 5;
52404
+ const limit2 = createConcurrencyLimit(concurrency);
52405
+ this.log(
52406
+ `Testing ${toolsToTest.length} tools for error handling with concurrency limit of ${concurrency}`
52407
+ );
52408
+ const allToolTests = await Promise.all(
52409
+ toolsToTest.map(
52410
+ (tool) => limit2(async () => {
52411
+ const toolTests = await this.testToolErrorHandling(
52412
+ tool,
52413
+ context.callTool
52414
+ );
52415
+ if (this.config.delayBetweenTests && this.config.delayBetweenTests > 0) {
52416
+ await this.sleep(this.config.delayBetweenTests);
52417
+ }
52418
+ return toolTests;
52419
+ })
52420
+ )
52421
+ );
52422
+ for (const toolTests of allToolTests) {
51838
52423
  testDetails.push(...toolTests);
51839
52424
  passedTests += toolTests.filter((t) => t.passed).length;
51840
- if (this.config.delayBetweenTests && this.config.delayBetweenTests > 0) {
51841
- await this.sleep(this.config.delayBetweenTests);
51842
- }
51843
52425
  }
51844
52426
  this.testCount = testDetails.length;
51845
52427
  const metrics = this.calculateMetrics(testDetails, passedTests);
@@ -53195,19 +53777,33 @@ class FunctionalityAssessor extends BaseAssessor {
53195
53777
  const brokenTools = [];
53196
53778
  let workingTools = 0;
53197
53779
  const toolsToTest = this.selectToolsForTesting(context.tools);
53198
- for (const tool of toolsToTest) {
53199
- this.testCount++;
53200
- const result = await this.testTool(tool, context.callTool);
53780
+ const concurrency = this.config.maxParallelTests ?? 5;
53781
+ const limit2 = createConcurrencyLimit(concurrency);
53782
+ this.log(
53783
+ `Testing ${toolsToTest.length} tools with concurrency limit of ${concurrency}`
53784
+ );
53785
+ const results = await Promise.all(
53786
+ toolsToTest.map(
53787
+ (tool) => limit2(async () => {
53788
+ this.testCount++;
53789
+ const result = await this.testTool(tool, context.callTool);
53790
+ if (this.config.delayBetweenTests && this.config.delayBetweenTests > 0) {
53791
+ await this.sleep(this.config.delayBetweenTests);
53792
+ }
53793
+ return result;
53794
+ })
53795
+ )
53796
+ );
53797
+ for (const result of results) {
53201
53798
  toolResults.push(result);
53202
- if (this.config.delayBetweenTests && this.config.delayBetweenTests > 0) {
53203
- await this.sleep(this.config.delayBetweenTests);
53204
- }
53205
53799
  if (result.status === "working") {
53206
53800
  workingTools++;
53207
53801
  } else if (result.status === "broken") {
53208
- brokenTools.push(tool.name);
53802
+ brokenTools.push(result.toolName);
53209
53803
  if (this.config.skipBrokenTools) {
53210
- this.log(`Skipping further tests for broken tool: ${tool.name}`);
53804
+ this.log(
53805
+ `Skipping further tests for broken tool: ${result.toolName}`
53806
+ );
53211
53807
  }
53212
53808
  }
53213
53809
  }
@@ -54245,59 +54841,70 @@ class SecurityAssessor extends BaseAssessor {
54245
54841
  const results = [];
54246
54842
  const attackPatterns = getAllAttackPatterns();
54247
54843
  const toolsToTest = this.selectToolsForTesting(context.tools);
54844
+ const concurrency = this.config.maxParallelTests ?? 5;
54845
+ const limit2 = createConcurrencyLimit(concurrency);
54248
54846
  this.log(
54249
- `Starting ADVANCED security assessment - testing ${toolsToTest.length} tools with ${attackPatterns.length} security patterns (~${toolsToTest.length * attackPatterns.length * 3} tests)`
54847
+ `Starting ADVANCED security assessment - testing ${toolsToTest.length} tools with ${attackPatterns.length} security patterns (~${toolsToTest.length * attackPatterns.length * 3} tests) [concurrency: ${concurrency}]`
54250
54848
  );
54251
- for (const tool of toolsToTest) {
54252
- if (!this.hasInputParameters(tool)) {
54253
- this.log(
54254
- `${tool.name} has no input parameters - adding passing results`
54255
- );
54256
- for (const attackPattern of attackPatterns) {
54257
- const payloads = getPayloadsForAttack(attackPattern.attackName);
54258
- for (const payload of payloads) {
54259
- results.push({
54260
- testName: attackPattern.attackName,
54261
- description: payload.description,
54262
- payload: payload.payload,
54263
- riskLevel: payload.riskLevel,
54264
- toolName: tool.name,
54265
- vulnerable: false,
54266
- evidence: "Tool has no input parameters - cannot be exploited via payload injection"
54267
- });
54268
- }
54269
- }
54270
- continue;
54271
- }
54272
- this.log(`Testing ${tool.name} with all attack patterns`);
54273
- for (const attackPattern of attackPatterns) {
54274
- const payloads = getPayloadsForAttack(attackPattern.attackName);
54275
- for (const payload of payloads) {
54276
- this.testCount++;
54277
- try {
54278
- const result = await this.testPayload(
54279
- tool,
54280
- attackPattern.attackName,
54281
- payload,
54282
- context.callTool
54849
+ const allToolResults = await Promise.all(
54850
+ toolsToTest.map(
54851
+ (tool) => limit2(async () => {
54852
+ const toolResults = [];
54853
+ if (!this.hasInputParameters(tool)) {
54854
+ this.log(
54855
+ `${tool.name} has no input parameters - adding passing results`
54283
54856
  );
54284
- results.push(result);
54285
- if (result.vulnerable) {
54286
- this.log(
54287
- `🚨 VULNERABILITY: ${tool.name} - ${attackPattern.attackName} (${payload.payloadType}: ${payload.description})`
54288
- );
54857
+ for (const attackPattern of attackPatterns) {
54858
+ const payloads = getPayloadsForAttack(attackPattern.attackName);
54859
+ for (const payload of payloads) {
54860
+ toolResults.push({
54861
+ testName: attackPattern.attackName,
54862
+ description: payload.description,
54863
+ payload: payload.payload,
54864
+ riskLevel: payload.riskLevel,
54865
+ toolName: tool.name,
54866
+ vulnerable: false,
54867
+ evidence: "Tool has no input parameters - cannot be exploited via payload injection"
54868
+ });
54869
+ }
54289
54870
  }
54290
- } catch (error) {
54291
- this.logError(
54292
- `Error testing ${tool.name} with ${attackPattern.attackName}`,
54293
- error
54294
- );
54871
+ return toolResults;
54295
54872
  }
54296
- if (this.testCount % 5 === 0) {
54297
- await this.sleep(100);
54873
+ this.log(`Testing ${tool.name} with all attack patterns`);
54874
+ for (const attackPattern of attackPatterns) {
54875
+ const payloads = getPayloadsForAttack(attackPattern.attackName);
54876
+ for (const payload of payloads) {
54877
+ this.testCount++;
54878
+ try {
54879
+ const result = await this.testPayload(
54880
+ tool,
54881
+ attackPattern.attackName,
54882
+ payload,
54883
+ context.callTool
54884
+ );
54885
+ toolResults.push(result);
54886
+ if (result.vulnerable) {
54887
+ this.log(
54888
+ `🚨 VULNERABILITY: ${tool.name} - ${attackPattern.attackName} (${payload.payloadType}: ${payload.description})`
54889
+ );
54890
+ }
54891
+ } catch (error) {
54892
+ this.logError(
54893
+ `Error testing ${tool.name} with ${attackPattern.attackName}`,
54894
+ error
54895
+ );
54896
+ }
54897
+ if (this.testCount % 5 === 0) {
54898
+ await this.sleep(100);
54899
+ }
54900
+ }
54298
54901
  }
54299
- }
54300
- }
54902
+ return toolResults;
54903
+ })
54904
+ )
54905
+ );
54906
+ for (const toolResults of allToolResults) {
54907
+ results.push(...toolResults);
54301
54908
  }
54302
54909
  this.log(
54303
54910
  `ADVANCED security assessment complete: ${results.length} tests executed, ${results.filter((r2) => r2.vulnerable).length} vulnerabilities found`
@@ -59490,7 +60097,7 @@ const ElicitationRequest = ({
59490
60097
  if (!validateFormData(formData, request.request.requestedSchema)) {
59491
60098
  return;
59492
60099
  }
59493
- const ajv2 = new Ajv();
60100
+ const ajv2 = new Ajv$1();
59494
60101
  const validate2 = ajv2.compile(request.request.requestedSchema);
59495
60102
  const isValid2 = validate2(formData);
59496
60103
  if (!isValid2) {
@@ -60340,13 +60947,13 @@ const App = () => {
60340
60947
  ) });
60341
60948
  if (window.location.pathname === "/oauth/callback") {
60342
60949
  const OAuthCallback = React.lazy(
60343
- () => __vitePreload(() => import("./OAuthCallback-cGhwkoyY.js"), true ? [] : void 0)
60950
+ () => __vitePreload(() => import("./OAuthCallback-Dk69OAHS.js"), true ? [] : void 0)
60344
60951
  );
60345
60952
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
60346
60953
  }
60347
60954
  if (window.location.pathname === "/oauth/callback/debug") {
60348
60955
  const OAuthDebugCallback = React.lazy(
60349
- () => __vitePreload(() => import("./OAuthDebugCallback-2rmUqser.js"), true ? [] : void 0)
60956
+ () => __vitePreload(() => import("./OAuthDebugCallback-Do2NIUkY.js"), true ? [] : void 0)
60350
60957
  );
60351
60958
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
60352
60959
  }