@google-cloud/storage-mcp 0.3.1 → 0.3.3

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.
package/dist/bundle.js CHANGED
@@ -16422,7 +16422,7 @@ ZodNaN.create = (params) => {
16422
16422
  ...processCreateParams(params)
16423
16423
  });
16424
16424
  };
16425
- var BRAND = Symbol("zod_brand");
16425
+ var BRAND = /* @__PURE__ */ Symbol("zod_brand");
16426
16426
  var ZodBranded = class extends ZodType {
16427
16427
  _parse(input) {
16428
16428
  const { ctx } = this._processInputParams(input);
@@ -16682,7 +16682,6 @@ function $constructor(name, initializer3, params) {
16682
16682
  Object.defineProperty(_, "name", { value: name });
16683
16683
  return _;
16684
16684
  }
16685
- var $brand = Symbol("zod_brand");
16686
16685
  var $ZodAsyncError = class extends Error {
16687
16686
  constructor() {
16688
16687
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
@@ -19186,8 +19185,6 @@ function en_default2() {
19186
19185
  }
19187
19186
 
19188
19187
  // ../../node_modules/zod/v4/core/registries.js
19189
- var $output = Symbol("ZodOutput");
19190
- var $input = Symbol("ZodInput");
19191
19188
  var $ZodRegistry = class {
19192
19189
  constructor() {
19193
19190
  this._map = /* @__PURE__ */ new Map();
@@ -20523,13 +20520,12 @@ async function safeParseAsync2(schema, data) {
20523
20520
  return result;
20524
20521
  }
20525
20522
  function getObjectShape(schema) {
20526
- var _a2, _b2;
20527
20523
  if (!schema)
20528
20524
  return void 0;
20529
20525
  let rawShape;
20530
20526
  if (isZ4Schema(schema)) {
20531
20527
  const v4Schema = schema;
20532
- rawShape = (_b2 = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def) === null || _b2 === void 0 ? void 0 : _b2.shape;
20528
+ rawShape = v4Schema._zod?.def?.shape;
20533
20529
  } else {
20534
20530
  const v3Schema = schema;
20535
20531
  rawShape = v3Schema.shape;
@@ -20539,14 +20535,13 @@ function getObjectShape(schema) {
20539
20535
  if (typeof rawShape === "function") {
20540
20536
  try {
20541
20537
  return rawShape();
20542
- } catch (_c2) {
20538
+ } catch {
20543
20539
  return void 0;
20544
20540
  }
20545
20541
  }
20546
20542
  return rawShape;
20547
20543
  }
20548
20544
  function normalizeObjectSchema(schema) {
20549
- var _a2;
20550
20545
  if (!schema)
20551
20546
  return void 0;
20552
20547
  if (typeof schema === "object") {
@@ -20561,7 +20556,7 @@ function normalizeObjectSchema(schema) {
20561
20556
  }
20562
20557
  if (isZ4Schema(schema)) {
20563
20558
  const v4Schema = schema;
20564
- const def = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def;
20559
+ const def = v4Schema._zod?.def;
20565
20560
  if (def && (def.type === "object" || def.shape !== void 0)) {
20566
20561
  return schema;
20567
20562
  }
@@ -20586,38 +20581,30 @@ function getParseErrorMessage(error2) {
20586
20581
  }
20587
20582
  try {
20588
20583
  return JSON.stringify(error2);
20589
- } catch (_a2) {
20584
+ } catch {
20590
20585
  return String(error2);
20591
20586
  }
20592
20587
  }
20593
20588
  return String(error2);
20594
20589
  }
20595
20590
  function getSchemaDescription(schema) {
20596
- var _a2, _b2, _c2, _d;
20597
- if (isZ4Schema(schema)) {
20598
- const v4Schema = schema;
20599
- return (_b2 = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def) === null || _b2 === void 0 ? void 0 : _b2.description;
20600
- }
20601
- const v3Schema = schema;
20602
- return (_c2 = schema.description) !== null && _c2 !== void 0 ? _c2 : (_d = v3Schema._def) === null || _d === void 0 ? void 0 : _d.description;
20591
+ return schema.description;
20603
20592
  }
20604
20593
  function isSchemaOptional(schema) {
20605
- var _a2, _b2, _c2;
20606
20594
  if (isZ4Schema(schema)) {
20607
20595
  const v4Schema = schema;
20608
- return ((_b2 = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def) === null || _b2 === void 0 ? void 0 : _b2.type) === "optional";
20596
+ return v4Schema._zod?.def?.type === "optional";
20609
20597
  }
20610
20598
  const v3Schema = schema;
20611
20599
  if (typeof schema.isOptional === "function") {
20612
20600
  return schema.isOptional();
20613
20601
  }
20614
- return ((_c2 = v3Schema._def) === null || _c2 === void 0 ? void 0 : _c2.typeName) === "ZodOptional";
20602
+ return v3Schema._def?.typeName === "ZodOptional";
20615
20603
  }
20616
20604
  function getLiteralValue(schema) {
20617
- var _a2;
20618
20605
  if (isZ4Schema(schema)) {
20619
20606
  const v4Schema = schema;
20620
- const def2 = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def;
20607
+ const def2 = v4Schema._zod?.def;
20621
20608
  if (def2) {
20622
20609
  if (def2.value !== void 0)
20623
20610
  return def2.value;
@@ -21355,7 +21342,10 @@ var TaskCreationParamsSchema = looseObject({
21355
21342
  */
21356
21343
  pollInterval: number2().optional()
21357
21344
  });
21358
- var RelatedTaskMetadataSchema = looseObject({
21345
+ var TaskMetadataSchema = object2({
21346
+ ttl: number2().optional()
21347
+ });
21348
+ var RelatedTaskMetadataSchema = object2({
21359
21349
  taskId: string2()
21360
21350
  });
21361
21351
  var RequestMetaSchema = looseObject({
@@ -21368,48 +21358,45 @@ var RequestMetaSchema = looseObject({
21368
21358
  */
21369
21359
  [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
21370
21360
  });
21371
- var BaseRequestParamsSchema = looseObject({
21372
- /**
21373
- * If specified, the caller is requesting that the receiver create a task to represent the request.
21374
- * Task creation parameters are now at the top level instead of in _meta.
21375
- */
21376
- task: TaskCreationParamsSchema.optional(),
21361
+ var BaseRequestParamsSchema = object2({
21377
21362
  /**
21378
21363
  * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
21379
21364
  */
21380
21365
  _meta: RequestMetaSchema.optional()
21381
21366
  });
21367
+ var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
21368
+ /**
21369
+ * If specified, the caller is requesting task-augmented execution for this request.
21370
+ * The request will return a CreateTaskResult immediately, and the actual result can be
21371
+ * retrieved later via tasks/result.
21372
+ *
21373
+ * Task augmentation is subject to capability negotiation - receivers MUST declare support
21374
+ * for task augmentation of specific request types in their capabilities.
21375
+ */
21376
+ task: TaskMetadataSchema.optional()
21377
+ });
21378
+ var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
21382
21379
  var RequestSchema = object2({
21383
21380
  method: string2(),
21384
- params: BaseRequestParamsSchema.optional()
21381
+ params: BaseRequestParamsSchema.loose().optional()
21385
21382
  });
21386
- var NotificationsParamsSchema = looseObject({
21383
+ var NotificationsParamsSchema = object2({
21387
21384
  /**
21388
21385
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
21389
21386
  * for notes on _meta usage.
21390
21387
  */
21391
- _meta: object2({
21392
- /**
21393
- * If specified, this notification is related to the provided task.
21394
- */
21395
- [RELATED_TASK_META_KEY]: optional(RelatedTaskMetadataSchema)
21396
- }).passthrough().optional()
21388
+ _meta: RequestMetaSchema.optional()
21397
21389
  });
21398
21390
  var NotificationSchema = object2({
21399
21391
  method: string2(),
21400
- params: NotificationsParamsSchema.optional()
21392
+ params: NotificationsParamsSchema.loose().optional()
21401
21393
  });
21402
21394
  var ResultSchema = looseObject({
21403
21395
  /**
21404
21396
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
21405
21397
  * for notes on _meta usage.
21406
21398
  */
21407
- _meta: looseObject({
21408
- /**
21409
- * If specified, this result is related to the provided task.
21410
- */
21411
- [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
21412
- }).optional()
21399
+ _meta: RequestMetaSchema.optional()
21413
21400
  });
21414
21401
  var RequestIdSchema = union([string2(), number2().int()]);
21415
21402
  var JSONRPCRequestSchema = object2({
@@ -21423,12 +21410,12 @@ var JSONRPCNotificationSchema = object2({
21423
21410
  ...NotificationSchema.shape
21424
21411
  }).strict();
21425
21412
  var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
21426
- var JSONRPCResponseSchema = object2({
21413
+ var JSONRPCResultResponseSchema = object2({
21427
21414
  jsonrpc: literal(JSONRPC_VERSION),
21428
21415
  id: RequestIdSchema,
21429
21416
  result: ResultSchema
21430
21417
  }).strict();
21431
- var isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
21418
+ var isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
21432
21419
  var ErrorCode;
21433
21420
  (function(ErrorCode2) {
21434
21421
  ErrorCode2[ErrorCode2["ConnectionClosed"] = -32e3] = "ConnectionClosed";
@@ -21440,9 +21427,9 @@ var ErrorCode;
21440
21427
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
21441
21428
  ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
21442
21429
  })(ErrorCode || (ErrorCode = {}));
21443
- var JSONRPCErrorSchema = object2({
21430
+ var JSONRPCErrorResponseSchema = object2({
21444
21431
  jsonrpc: literal(JSONRPC_VERSION),
21445
- id: RequestIdSchema,
21432
+ id: RequestIdSchema.optional(),
21446
21433
  error: object2({
21447
21434
  /**
21448
21435
  * The error type that occurred.
@@ -21455,11 +21442,17 @@ var JSONRPCErrorSchema = object2({
21455
21442
  /**
21456
21443
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
21457
21444
  */
21458
- data: optional(unknown())
21445
+ data: unknown().optional()
21459
21446
  })
21460
21447
  }).strict();
21461
- var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
21462
- var JSONRPCMessageSchema = union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
21448
+ var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
21449
+ var JSONRPCMessageSchema = union([
21450
+ JSONRPCRequestSchema,
21451
+ JSONRPCNotificationSchema,
21452
+ JSONRPCResultResponseSchema,
21453
+ JSONRPCErrorResponseSchema
21454
+ ]);
21455
+ var JSONRPCResponseSchema = union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
21463
21456
  var EmptyResultSchema = ResultSchema.strict();
21464
21457
  var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
21465
21458
  /**
@@ -21467,7 +21460,7 @@ var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
21467
21460
  *
21468
21461
  * This MUST correspond to the ID of a request previously issued in the same direction.
21469
21462
  */
21470
- requestId: RequestIdSchema,
21463
+ requestId: RequestIdSchema.optional(),
21471
21464
  /**
21472
21465
  * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
21473
21466
  */
@@ -21492,7 +21485,15 @@ var IconSchema = object2({
21492
21485
  *
21493
21486
  * If not provided, the client should assume that the icon can be used at any size.
21494
21487
  */
21495
- sizes: array(string2()).optional()
21488
+ sizes: array(string2()).optional(),
21489
+ /**
21490
+ * Optional specifier for the theme this icon is designed for. `light` indicates
21491
+ * the icon is designed to be used with a light background, and `dark` indicates
21492
+ * the icon is designed to be used with a dark background.
21493
+ *
21494
+ * If not provided, the client should assume the icon can be used with any theme.
21495
+ */
21496
+ theme: _enum(["light", "dark"]).optional()
21496
21497
  });
21497
21498
  var IconsSchema = object2({
21498
21499
  /**
@@ -21528,7 +21529,15 @@ var ImplementationSchema = BaseMetadataSchema.extend({
21528
21529
  /**
21529
21530
  * An optional URL of the website for this implementation.
21530
21531
  */
21531
- websiteUrl: string2().optional()
21532
+ websiteUrl: string2().optional(),
21533
+ /**
21534
+ * An optional human-readable description of what this implementation does.
21535
+ *
21536
+ * This can be used by clients or servers to provide context about their purpose
21537
+ * and capabilities. For example, a server might describe the types of resources
21538
+ * or tools it provides, while a client might describe its intended use case.
21539
+ */
21540
+ description: string2().optional()
21532
21541
  });
21533
21542
  var FormElicitationCapabilitySchema = intersection(object2({
21534
21543
  applyDefaults: boolean2().optional()
@@ -21544,54 +21553,54 @@ var ElicitationCapabilitySchema = preprocess((value) => {
21544
21553
  form: FormElicitationCapabilitySchema.optional(),
21545
21554
  url: AssertObjectSchema.optional()
21546
21555
  }), record(string2(), unknown()).optional()));
21547
- var ClientTasksCapabilitySchema = object2({
21556
+ var ClientTasksCapabilitySchema = looseObject({
21548
21557
  /**
21549
21558
  * Present if the client supports listing tasks.
21550
21559
  */
21551
- list: optional(object2({}).passthrough()),
21560
+ list: AssertObjectSchema.optional(),
21552
21561
  /**
21553
21562
  * Present if the client supports cancelling tasks.
21554
21563
  */
21555
- cancel: optional(object2({}).passthrough()),
21564
+ cancel: AssertObjectSchema.optional(),
21556
21565
  /**
21557
21566
  * Capabilities for task creation on specific request types.
21558
21567
  */
21559
- requests: optional(object2({
21568
+ requests: looseObject({
21560
21569
  /**
21561
21570
  * Task support for sampling requests.
21562
21571
  */
21563
- sampling: optional(object2({
21564
- createMessage: optional(object2({}).passthrough())
21565
- }).passthrough()),
21572
+ sampling: looseObject({
21573
+ createMessage: AssertObjectSchema.optional()
21574
+ }).optional(),
21566
21575
  /**
21567
21576
  * Task support for elicitation requests.
21568
21577
  */
21569
- elicitation: optional(object2({
21570
- create: optional(object2({}).passthrough())
21571
- }).passthrough())
21572
- }).passthrough())
21573
- }).passthrough();
21574
- var ServerTasksCapabilitySchema = object2({
21578
+ elicitation: looseObject({
21579
+ create: AssertObjectSchema.optional()
21580
+ }).optional()
21581
+ }).optional()
21582
+ });
21583
+ var ServerTasksCapabilitySchema = looseObject({
21575
21584
  /**
21576
21585
  * Present if the server supports listing tasks.
21577
21586
  */
21578
- list: optional(object2({}).passthrough()),
21587
+ list: AssertObjectSchema.optional(),
21579
21588
  /**
21580
21589
  * Present if the server supports cancelling tasks.
21581
21590
  */
21582
- cancel: optional(object2({}).passthrough()),
21591
+ cancel: AssertObjectSchema.optional(),
21583
21592
  /**
21584
21593
  * Capabilities for task creation on specific request types.
21585
21594
  */
21586
- requests: optional(object2({
21595
+ requests: looseObject({
21587
21596
  /**
21588
21597
  * Task support for tool requests.
21589
21598
  */
21590
- tools: optional(object2({
21591
- call: optional(object2({}).passthrough())
21592
- }).passthrough())
21593
- }).passthrough())
21594
- }).passthrough();
21599
+ tools: looseObject({
21600
+ call: AssertObjectSchema.optional()
21601
+ }).optional()
21602
+ }).optional()
21603
+ });
21595
21604
  var ClientCapabilitiesSchema = object2({
21596
21605
  /**
21597
21606
  * Experimental, non-standard capabilities that the client supports.
@@ -21627,7 +21636,7 @@ var ClientCapabilitiesSchema = object2({
21627
21636
  /**
21628
21637
  * Present if the client supports task creation.
21629
21638
  */
21630
- tasks: optional(ClientTasksCapabilitySchema)
21639
+ tasks: ClientTasksCapabilitySchema.optional()
21631
21640
  });
21632
21641
  var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
21633
21642
  /**
@@ -21657,12 +21666,12 @@ var ServerCapabilitiesSchema = object2({
21657
21666
  /**
21658
21667
  * Present if the server offers any prompt templates.
21659
21668
  */
21660
- prompts: optional(object2({
21669
+ prompts: object2({
21661
21670
  /**
21662
21671
  * Whether this server supports issuing notifications for changes to the prompt list.
21663
21672
  */
21664
- listChanged: optional(boolean2())
21665
- })),
21673
+ listChanged: boolean2().optional()
21674
+ }).optional(),
21666
21675
  /**
21667
21676
  * Present if the server offers any resources to read.
21668
21677
  */
@@ -21688,8 +21697,8 @@ var ServerCapabilitiesSchema = object2({
21688
21697
  /**
21689
21698
  * Present if the server supports task creation.
21690
21699
  */
21691
- tasks: optional(ServerTasksCapabilitySchema)
21692
- }).passthrough();
21700
+ tasks: ServerTasksCapabilitySchema.optional()
21701
+ });
21693
21702
  var InitializeResultSchema = ResultSchema.extend({
21694
21703
  /**
21695
21704
  * 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.
@@ -21705,10 +21714,12 @@ var InitializeResultSchema = ResultSchema.extend({
21705
21714
  instructions: string2().optional()
21706
21715
  });
21707
21716
  var InitializedNotificationSchema = NotificationSchema.extend({
21708
- method: literal("notifications/initialized")
21717
+ method: literal("notifications/initialized"),
21718
+ params: NotificationsParamsSchema.optional()
21709
21719
  });
21710
21720
  var PingRequestSchema = RequestSchema.extend({
21711
- method: literal("ping")
21721
+ method: literal("ping"),
21722
+ params: BaseRequestParamsSchema.optional()
21712
21723
  });
21713
21724
  var ProgressSchema = object2({
21714
21725
  /**
@@ -21751,11 +21762,12 @@ var PaginatedResultSchema = ResultSchema.extend({
21751
21762
  * An opaque token representing the pagination position after the last returned result.
21752
21763
  * If present, there may be more results available.
21753
21764
  */
21754
- nextCursor: optional(CursorSchema)
21765
+ nextCursor: CursorSchema.optional()
21755
21766
  });
21767
+ var TaskStatusSchema = _enum(["working", "input_required", "completed", "failed", "cancelled"]);
21756
21768
  var TaskSchema = object2({
21757
21769
  taskId: string2(),
21758
- status: _enum(["working", "input_required", "completed", "failed", "cancelled"]),
21770
+ status: TaskStatusSchema,
21759
21771
  /**
21760
21772
  * Time in milliseconds to keep task results available after completion.
21761
21773
  * If null, the task has unlimited lifetime until manually cleaned up.
@@ -21796,6 +21808,7 @@ var GetTaskPayloadRequestSchema = RequestSchema.extend({
21796
21808
  taskId: string2()
21797
21809
  })
21798
21810
  });
21811
+ var GetTaskPayloadResultSchema = ResultSchema.loose();
21799
21812
  var ListTasksRequestSchema = PaginatedRequestSchema.extend({
21800
21813
  method: literal("tasks/list")
21801
21814
  });
@@ -21834,7 +21847,7 @@ var Base64Schema = string2().refine((val) => {
21834
21847
  try {
21835
21848
  atob(val);
21836
21849
  return true;
21837
- } catch (_a2) {
21850
+ } catch {
21838
21851
  return false;
21839
21852
  }
21840
21853
  }, { message: "Invalid Base64 string" });
@@ -21844,11 +21857,12 @@ var BlobResourceContentsSchema = ResourceContentsSchema.extend({
21844
21857
  */
21845
21858
  blob: Base64Schema
21846
21859
  });
21860
+ var RoleSchema = _enum(["user", "assistant"]);
21847
21861
  var AnnotationsSchema = object2({
21848
21862
  /**
21849
21863
  * Intended audience(s) for the resource.
21850
21864
  */
21851
- audience: array(_enum(["user", "assistant"])).optional(),
21865
+ audience: array(RoleSchema).optional(),
21852
21866
  /**
21853
21867
  * Importance hint for the resource, from 0 (least) to 1 (most).
21854
21868
  */
@@ -21941,7 +21955,8 @@ var ReadResourceResultSchema = ResultSchema.extend({
21941
21955
  contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
21942
21956
  });
21943
21957
  var ResourceListChangedNotificationSchema = NotificationSchema.extend({
21944
- method: literal("notifications/resources/list_changed")
21958
+ method: literal("notifications/resources/list_changed"),
21959
+ params: NotificationsParamsSchema.optional()
21945
21960
  });
21946
21961
  var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
21947
21962
  var SubscribeRequestSchema = RequestSchema.extend({
@@ -22086,13 +22101,13 @@ var ToolUseContentSchema = object2({
22086
22101
  * Arguments to pass to the tool.
22087
22102
  * Must conform to the tool's inputSchema.
22088
22103
  */
22089
- input: object2({}).passthrough(),
22104
+ input: record(string2(), unknown()),
22090
22105
  /**
22091
22106
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
22092
22107
  * for notes on _meta usage.
22093
22108
  */
22094
- _meta: optional(object2({}).passthrough())
22095
- }).passthrough();
22109
+ _meta: record(string2(), unknown()).optional()
22110
+ });
22096
22111
  var EmbeddedResourceSchema = object2({
22097
22112
  type: literal("resource"),
22098
22113
  resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
@@ -22117,18 +22132,19 @@ var ContentBlockSchema = union([
22117
22132
  EmbeddedResourceSchema
22118
22133
  ]);
22119
22134
  var PromptMessageSchema = object2({
22120
- role: _enum(["user", "assistant"]),
22135
+ role: RoleSchema,
22121
22136
  content: ContentBlockSchema
22122
22137
  });
22123
22138
  var GetPromptResultSchema = ResultSchema.extend({
22124
22139
  /**
22125
22140
  * An optional description for the prompt.
22126
22141
  */
22127
- description: optional(string2()),
22142
+ description: string2().optional(),
22128
22143
  messages: array(PromptMessageSchema)
22129
22144
  });
22130
22145
  var PromptListChangedNotificationSchema = NotificationSchema.extend({
22131
- method: literal("notifications/prompts/list_changed")
22146
+ method: literal("notifications/prompts/list_changed"),
22147
+ params: NotificationsParamsSchema.optional()
22132
22148
  });
22133
22149
  var ToolAnnotationsSchema = object2({
22134
22150
  /**
@@ -22209,11 +22225,11 @@ var ToolSchema = object2({
22209
22225
  /**
22210
22226
  * Optional additional tool information.
22211
22227
  */
22212
- annotations: optional(ToolAnnotationsSchema),
22228
+ annotations: ToolAnnotationsSchema.optional(),
22213
22229
  /**
22214
22230
  * Execution-related properties for this tool.
22215
22231
  */
22216
- execution: optional(ToolExecutionSchema),
22232
+ execution: ToolExecutionSchema.optional(),
22217
22233
  /**
22218
22234
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
22219
22235
  * for notes on _meta usage.
@@ -22254,12 +22270,12 @@ var CallToolResultSchema = ResultSchema.extend({
22254
22270
  * server does not support tool calls, or any other exceptional conditions,
22255
22271
  * should be reported as an MCP error response.
22256
22272
  */
22257
- isError: optional(boolean2())
22273
+ isError: boolean2().optional()
22258
22274
  });
22259
22275
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
22260
22276
  toolResult: unknown()
22261
22277
  }));
22262
- var CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
22278
+ var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
22263
22279
  /**
22264
22280
  * The name of the tool to call.
22265
22281
  */
@@ -22267,14 +22283,35 @@ var CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
22267
22283
  /**
22268
22284
  * Arguments to pass to the tool.
22269
22285
  */
22270
- arguments: optional(record(string2(), unknown()))
22286
+ arguments: record(string2(), unknown()).optional()
22271
22287
  });
22272
22288
  var CallToolRequestSchema = RequestSchema.extend({
22273
22289
  method: literal("tools/call"),
22274
22290
  params: CallToolRequestParamsSchema
22275
22291
  });
22276
22292
  var ToolListChangedNotificationSchema = NotificationSchema.extend({
22277
- method: literal("notifications/tools/list_changed")
22293
+ method: literal("notifications/tools/list_changed"),
22294
+ params: NotificationsParamsSchema.optional()
22295
+ });
22296
+ var ListChangedOptionsBaseSchema = object2({
22297
+ /**
22298
+ * If true, the list will be refreshed automatically when a list changed notification is received.
22299
+ * The callback will be called with the updated list.
22300
+ *
22301
+ * If false, the callback will be called with null items, allowing manual refresh.
22302
+ *
22303
+ * @default true
22304
+ */
22305
+ autoRefresh: boolean2().default(true),
22306
+ /**
22307
+ * Debounce time in milliseconds for list changed notification processing.
22308
+ *
22309
+ * Multiple notifications received within this timeframe will only trigger one refresh.
22310
+ * Set to 0 to disable debouncing.
22311
+ *
22312
+ * @default 300
22313
+ */
22314
+ debounceMs: number2().int().nonnegative().default(300)
22278
22315
  });
22279
22316
  var LoggingLevelSchema = _enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
22280
22317
  var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -22315,19 +22352,19 @@ var ModelPreferencesSchema = object2({
22315
22352
  /**
22316
22353
  * Optional hints to use for model selection.
22317
22354
  */
22318
- hints: optional(array(ModelHintSchema)),
22355
+ hints: array(ModelHintSchema).optional(),
22319
22356
  /**
22320
22357
  * How much to prioritize cost when selecting a model.
22321
22358
  */
22322
- costPriority: optional(number2().min(0).max(1)),
22359
+ costPriority: number2().min(0).max(1).optional(),
22323
22360
  /**
22324
22361
  * How much to prioritize sampling speed (latency) when selecting a model.
22325
22362
  */
22326
- speedPriority: optional(number2().min(0).max(1)),
22363
+ speedPriority: number2().min(0).max(1).optional(),
22327
22364
  /**
22328
22365
  * How much to prioritize intelligence and capabilities when selecting a model.
22329
22366
  */
22330
- intelligencePriority: optional(number2().min(0).max(1))
22367
+ intelligencePriority: number2().min(0).max(1).optional()
22331
22368
  });
22332
22369
  var ToolChoiceSchema = object2({
22333
22370
  /**
@@ -22336,20 +22373,20 @@ var ToolChoiceSchema = object2({
22336
22373
  * - "required": Model MUST use at least one tool before completing
22337
22374
  * - "none": Model MUST NOT use any tools
22338
22375
  */
22339
- mode: optional(_enum(["auto", "required", "none"]))
22376
+ mode: _enum(["auto", "required", "none"]).optional()
22340
22377
  });
22341
22378
  var ToolResultContentSchema = object2({
22342
22379
  type: literal("tool_result"),
22343
22380
  toolUseId: string2().describe("The unique identifier for the corresponding tool call."),
22344
22381
  content: array(ContentBlockSchema).default([]),
22345
- structuredContent: object2({}).passthrough().optional(),
22346
- isError: optional(boolean2()),
22382
+ structuredContent: object2({}).loose().optional(),
22383
+ isError: boolean2().optional(),
22347
22384
  /**
22348
22385
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
22349
22386
  * for notes on _meta usage.
22350
22387
  */
22351
- _meta: optional(object2({}).passthrough())
22352
- }).passthrough();
22388
+ _meta: record(string2(), unknown()).optional()
22389
+ });
22353
22390
  var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
22354
22391
  var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
22355
22392
  TextContentSchema,
@@ -22359,15 +22396,15 @@ var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
22359
22396
  ToolResultContentSchema
22360
22397
  ]);
22361
22398
  var SamplingMessageSchema = object2({
22362
- role: _enum(["user", "assistant"]),
22399
+ role: RoleSchema,
22363
22400
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
22364
22401
  /**
22365
22402
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
22366
22403
  * for notes on _meta usage.
22367
22404
  */
22368
- _meta: optional(object2({}).passthrough())
22369
- }).passthrough();
22370
- var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
22405
+ _meta: record(string2(), unknown()).optional()
22406
+ });
22407
+ var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
22371
22408
  messages: array(SamplingMessageSchema),
22372
22409
  /**
22373
22410
  * The server's preferences for which model to select. The client MAY modify or omit this request.
@@ -22401,13 +22438,13 @@ var CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
22401
22438
  * Tools that the model may use during generation.
22402
22439
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
22403
22440
  */
22404
- tools: optional(array(ToolSchema)),
22441
+ tools: array(ToolSchema).optional(),
22405
22442
  /**
22406
22443
  * Controls how the model uses tools.
22407
22444
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
22408
22445
  * Default is `{ mode: "auto" }`.
22409
22446
  */
22410
- toolChoice: optional(ToolChoiceSchema)
22447
+ toolChoice: ToolChoiceSchema.optional()
22411
22448
  });
22412
22449
  var CreateMessageRequestSchema = RequestSchema.extend({
22413
22450
  method: literal("sampling/createMessage"),
@@ -22429,7 +22466,7 @@ var CreateMessageResultSchema = ResultSchema.extend({
22429
22466
  * This field is an open string to allow for provider-specific stop reasons.
22430
22467
  */
22431
22468
  stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens"]).or(string2())),
22432
- role: _enum(["user", "assistant"]),
22469
+ role: RoleSchema,
22433
22470
  /**
22434
22471
  * Response content. Single content block (text, image, or audio).
22435
22472
  */
@@ -22452,7 +22489,7 @@ var CreateMessageResultWithToolsSchema = ResultSchema.extend({
22452
22489
  * This field is an open string to allow for provider-specific stop reasons.
22453
22490
  */
22454
22491
  stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string2())),
22455
- role: _enum(["user", "assistant"]),
22492
+ role: RoleSchema,
22456
22493
  /**
22457
22494
  * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
22458
22495
  */
@@ -22536,7 +22573,7 @@ var TitledMultiSelectEnumSchemaSchema = object2({
22536
22573
  var MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
22537
22574
  var EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
22538
22575
  var PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
22539
- var ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
22576
+ var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
22540
22577
  /**
22541
22578
  * The elicitation mode.
22542
22579
  *
@@ -22557,7 +22594,7 @@ var ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
22557
22594
  required: array(string2()).optional()
22558
22595
  })
22559
22596
  });
22560
- var ElicitRequestURLParamsSchema = BaseRequestParamsSchema.extend({
22597
+ var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
22561
22598
  /**
22562
22599
  * The elicitation mode.
22563
22600
  */
@@ -22691,13 +22728,15 @@ var RootSchema = object2({
22691
22728
  _meta: record(string2(), unknown()).optional()
22692
22729
  });
22693
22730
  var ListRootsRequestSchema = RequestSchema.extend({
22694
- method: literal("roots/list")
22731
+ method: literal("roots/list"),
22732
+ params: BaseRequestParamsSchema.optional()
22695
22733
  });
22696
22734
  var ListRootsResultSchema = ResultSchema.extend({
22697
22735
  roots: array(RootSchema)
22698
22736
  });
22699
22737
  var RootsListChangedNotificationSchema = NotificationSchema.extend({
22700
- method: literal("notifications/roots/list_changed")
22738
+ method: literal("notifications/roots/list_changed"),
22739
+ params: NotificationsParamsSchema.optional()
22701
22740
  });
22702
22741
  var ClientRequestSchema = union([
22703
22742
  PingRequestSchema,
@@ -22715,7 +22754,8 @@ var ClientRequestSchema = union([
22715
22754
  ListToolsRequestSchema,
22716
22755
  GetTaskRequestSchema,
22717
22756
  GetTaskPayloadRequestSchema,
22718
- ListTasksRequestSchema
22757
+ ListTasksRequestSchema,
22758
+ CancelTaskRequestSchema
22719
22759
  ]);
22720
22760
  var ClientNotificationSchema = union([
22721
22761
  CancelledNotificationSchema,
@@ -22741,7 +22781,8 @@ var ServerRequestSchema = union([
22741
22781
  ListRootsRequestSchema,
22742
22782
  GetTaskRequestSchema,
22743
22783
  GetTaskPayloadRequestSchema,
22744
- ListTasksRequestSchema
22784
+ ListTasksRequestSchema,
22785
+ CancelTaskRequestSchema
22745
22786
  ]);
22746
22787
  var ServerNotificationSchema = union([
22747
22788
  CancelledNotificationSchema,
@@ -22796,8 +22837,7 @@ var UrlElicitationRequiredError = class extends McpError {
22796
22837
  });
22797
22838
  }
22798
22839
  get elicitations() {
22799
- var _a2, _b2;
22800
- return (_b2 = (_a2 = this.data) === null || _a2 === void 0 ? void 0 : _a2.elicitations) !== null && _b2 !== void 0 ? _b2 : [];
22840
+ return this.data?.elicitations ?? [];
22801
22841
  }
22802
22842
  };
22803
22843
 
@@ -22807,7 +22847,7 @@ function isTerminal(status) {
22807
22847
  }
22808
22848
 
22809
22849
  // ../../node_modules/zod-to-json-schema/dist/esm/Options.js
22810
- var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
22850
+ var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
22811
22851
  var defaultOptions = {
22812
22852
  name: void 0,
22813
22853
  $refStrategy: "root",
@@ -24101,21 +24141,20 @@ function mapMiniTarget(t) {
24101
24141
  return "draft-7";
24102
24142
  }
24103
24143
  function toJsonSchemaCompat(schema, opts) {
24104
- var _a2, _b2, _c2;
24105
24144
  if (isZ4Schema(schema)) {
24106
24145
  return toJSONSchema(schema, {
24107
- target: mapMiniTarget(opts === null || opts === void 0 ? void 0 : opts.target),
24108
- io: (_a2 = opts === null || opts === void 0 ? void 0 : opts.pipeStrategy) !== null && _a2 !== void 0 ? _a2 : "input"
24146
+ target: mapMiniTarget(opts?.target),
24147
+ io: opts?.pipeStrategy ?? "input"
24109
24148
  });
24110
24149
  }
24111
24150
  return zodToJsonSchema(schema, {
24112
- strictUnions: (_b2 = opts === null || opts === void 0 ? void 0 : opts.strictUnions) !== null && _b2 !== void 0 ? _b2 : true,
24113
- pipeStrategy: (_c2 = opts === null || opts === void 0 ? void 0 : opts.pipeStrategy) !== null && _c2 !== void 0 ? _c2 : "input"
24151
+ strictUnions: opts?.strictUnions ?? true,
24152
+ pipeStrategy: opts?.pipeStrategy ?? "input"
24114
24153
  });
24115
24154
  }
24116
24155
  function getMethodLiteral(schema) {
24117
24156
  const shape = getObjectShape(schema);
24118
- const methodSchema = shape === null || shape === void 0 ? void 0 : shape.method;
24157
+ const methodSchema = shape?.method;
24119
24158
  if (!methodSchema) {
24120
24159
  throw new Error("Schema is missing a method literal");
24121
24160
  }
@@ -24159,8 +24198,8 @@ var Protocol = class {
24159
24198
  // Automatic pong by default.
24160
24199
  (_request) => ({})
24161
24200
  );
24162
- this._taskStore = _options === null || _options === void 0 ? void 0 : _options.taskStore;
24163
- this._taskMessageQueue = _options === null || _options === void 0 ? void 0 : _options.taskMessageQueue;
24201
+ this._taskStore = _options?.taskStore;
24202
+ this._taskMessageQueue = _options?.taskMessageQueue;
24164
24203
  if (this._taskStore) {
24165
24204
  this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
24166
24205
  const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
@@ -24173,7 +24212,6 @@ var Protocol = class {
24173
24212
  });
24174
24213
  this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
24175
24214
  const handleTaskResult = async () => {
24176
- var _a2;
24177
24215
  const taskId = request.params.taskId;
24178
24216
  if (this._taskMessageQueue) {
24179
24217
  let queuedMessage;
@@ -24197,7 +24235,7 @@ var Protocol = class {
24197
24235
  }
24198
24236
  continue;
24199
24237
  }
24200
- await ((_a2 = this._transport) === null || _a2 === void 0 ? void 0 : _a2.send(queuedMessage.message, { relatedRequestId: extra.requestId }));
24238
+ await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
24201
24239
  }
24202
24240
  }
24203
24241
  const task = await this._taskStore.getTask(taskId, extra.sessionId);
@@ -24226,9 +24264,8 @@ var Protocol = class {
24226
24264
  return await handleTaskResult();
24227
24265
  });
24228
24266
  this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
24229
- var _a2;
24230
24267
  try {
24231
- const { tasks, nextCursor } = await this._taskStore.listTasks((_a2 = request.params) === null || _a2 === void 0 ? void 0 : _a2.cursor, extra.sessionId);
24268
+ const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
24232
24269
  return {
24233
24270
  tasks,
24234
24271
  nextCursor,
@@ -24267,8 +24304,11 @@ var Protocol = class {
24267
24304
  }
24268
24305
  }
24269
24306
  async _oncancel(notification) {
24307
+ if (!notification.params.requestId) {
24308
+ return;
24309
+ }
24270
24310
  const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
24271
- controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason);
24311
+ controller?.abort(notification.params.reason);
24272
24312
  }
24273
24313
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
24274
24314
  this._timeoutInfo.set(messageId, {
@@ -24309,22 +24349,24 @@ var Protocol = class {
24309
24349
  * 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.
24310
24350
  */
24311
24351
  async connect(transport) {
24312
- var _a2, _b2, _c2;
24352
+ if (this._transport) {
24353
+ throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
24354
+ }
24313
24355
  this._transport = transport;
24314
- const _onclose = (_a2 = this.transport) === null || _a2 === void 0 ? void 0 : _a2.onclose;
24356
+ const _onclose = this.transport?.onclose;
24315
24357
  this._transport.onclose = () => {
24316
- _onclose === null || _onclose === void 0 ? void 0 : _onclose();
24358
+ _onclose?.();
24317
24359
  this._onclose();
24318
24360
  };
24319
- const _onerror = (_b2 = this.transport) === null || _b2 === void 0 ? void 0 : _b2.onerror;
24361
+ const _onerror = this.transport?.onerror;
24320
24362
  this._transport.onerror = (error2) => {
24321
- _onerror === null || _onerror === void 0 ? void 0 : _onerror(error2);
24363
+ _onerror?.(error2);
24322
24364
  this._onerror(error2);
24323
24365
  };
24324
- const _onmessage = (_c2 = this._transport) === null || _c2 === void 0 ? void 0 : _c2.onmessage;
24366
+ const _onmessage = this._transport?.onmessage;
24325
24367
  this._transport.onmessage = (message, extra) => {
24326
- _onmessage === null || _onmessage === void 0 ? void 0 : _onmessage(message, extra);
24327
- if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
24368
+ _onmessage?.(message, extra);
24369
+ if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
24328
24370
  this._onresponse(message);
24329
24371
  } else if (isJSONRPCRequest(message)) {
24330
24372
  this._onrequest(message, extra);
@@ -24337,36 +24379,36 @@ var Protocol = class {
24337
24379
  await this._transport.start();
24338
24380
  }
24339
24381
  _onclose() {
24340
- var _a2;
24341
24382
  const responseHandlers = this._responseHandlers;
24342
24383
  this._responseHandlers = /* @__PURE__ */ new Map();
24343
24384
  this._progressHandlers.clear();
24344
24385
  this._taskProgressTokens.clear();
24345
24386
  this._pendingDebouncedNotifications.clear();
24387
+ for (const controller of this._requestHandlerAbortControllers.values()) {
24388
+ controller.abort();
24389
+ }
24390
+ this._requestHandlerAbortControllers.clear();
24346
24391
  const error2 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
24347
24392
  this._transport = void 0;
24348
- (_a2 = this.onclose) === null || _a2 === void 0 ? void 0 : _a2.call(this);
24393
+ this.onclose?.();
24349
24394
  for (const handler of responseHandlers.values()) {
24350
24395
  handler(error2);
24351
24396
  }
24352
24397
  }
24353
24398
  _onerror(error2) {
24354
- var _a2;
24355
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, error2);
24399
+ this.onerror?.(error2);
24356
24400
  }
24357
24401
  _onnotification(notification) {
24358
- var _a2;
24359
- const handler = (_a2 = this._notificationHandlers.get(notification.method)) !== null && _a2 !== void 0 ? _a2 : this.fallbackNotificationHandler;
24402
+ const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
24360
24403
  if (handler === void 0) {
24361
24404
  return;
24362
24405
  }
24363
24406
  Promise.resolve().then(() => handler(notification)).catch((error2) => this._onerror(new Error(`Uncaught error in notification handler: ${error2}`)));
24364
24407
  }
24365
24408
  _onrequest(request, extra) {
24366
- var _a2, _b2, _c2, _d, _e, _f;
24367
- const handler = (_a2 = this._requestHandlers.get(request.method)) !== null && _a2 !== void 0 ? _a2 : this.fallbackRequestHandler;
24409
+ const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
24368
24410
  const capturedTransport = this._transport;
24369
- const relatedTaskId = (_d = (_c2 = (_b2 = request.params) === null || _b2 === void 0 ? void 0 : _b2._meta) === null || _c2 === void 0 ? void 0 : _c2[RELATED_TASK_META_KEY]) === null || _d === void 0 ? void 0 : _d.taskId;
24411
+ const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
24370
24412
  if (handler === void 0) {
24371
24413
  const errorResponse = {
24372
24414
  jsonrpc: "2.0",
@@ -24381,21 +24423,23 @@ var Protocol = class {
24381
24423
  type: "error",
24382
24424
  message: errorResponse,
24383
24425
  timestamp: Date.now()
24384
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId).catch((error2) => this._onerror(new Error(`Failed to enqueue error response: ${error2}`)));
24426
+ }, capturedTransport?.sessionId).catch((error2) => this._onerror(new Error(`Failed to enqueue error response: ${error2}`)));
24385
24427
  } else {
24386
- capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(errorResponse).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
24428
+ capturedTransport?.send(errorResponse).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
24387
24429
  }
24388
24430
  return;
24389
24431
  }
24390
24432
  const abortController = new AbortController();
24391
24433
  this._requestHandlerAbortControllers.set(request.id, abortController);
24392
- const taskCreationParams = (_e = request.params) === null || _e === void 0 ? void 0 : _e.task;
24393
- const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId) : void 0;
24434
+ const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : void 0;
24435
+ const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : void 0;
24394
24436
  const fullExtra = {
24395
24437
  signal: abortController.signal,
24396
- sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,
24397
- _meta: (_f = request.params) === null || _f === void 0 ? void 0 : _f._meta,
24438
+ sessionId: capturedTransport?.sessionId,
24439
+ _meta: request.params?._meta,
24398
24440
  sendNotification: async (notification) => {
24441
+ if (abortController.signal.aborted)
24442
+ return;
24399
24443
  const notificationOptions = { relatedRequestId: request.id };
24400
24444
  if (relatedTaskId) {
24401
24445
  notificationOptions.relatedTask = { taskId: relatedTaskId };
@@ -24403,25 +24447,27 @@ var Protocol = class {
24403
24447
  await this.notification(notification, notificationOptions);
24404
24448
  },
24405
24449
  sendRequest: async (r, resultSchema, options) => {
24406
- var _a3, _b3;
24450
+ if (abortController.signal.aborted) {
24451
+ throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
24452
+ }
24407
24453
  const requestOptions = { ...options, relatedRequestId: request.id };
24408
24454
  if (relatedTaskId && !requestOptions.relatedTask) {
24409
24455
  requestOptions.relatedTask = { taskId: relatedTaskId };
24410
24456
  }
24411
- const effectiveTaskId = (_b3 = (_a3 = requestOptions.relatedTask) === null || _a3 === void 0 ? void 0 : _a3.taskId) !== null && _b3 !== void 0 ? _b3 : relatedTaskId;
24457
+ const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
24412
24458
  if (effectiveTaskId && taskStore) {
24413
24459
  await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
24414
24460
  }
24415
24461
  return await this.request(r, resultSchema, requestOptions);
24416
24462
  },
24417
- authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo,
24463
+ authInfo: extra?.authInfo,
24418
24464
  requestId: request.id,
24419
- requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo,
24465
+ requestInfo: extra?.requestInfo,
24420
24466
  taskId: relatedTaskId,
24421
24467
  taskStore,
24422
- taskRequestedTtl: taskCreationParams === null || taskCreationParams === void 0 ? void 0 : taskCreationParams.ttl,
24423
- closeSSEStream: extra === null || extra === void 0 ? void 0 : extra.closeSSEStream,
24424
- closeStandaloneSSEStream: extra === null || extra === void 0 ? void 0 : extra.closeStandaloneSSEStream
24468
+ taskRequestedTtl: taskCreationParams?.ttl,
24469
+ closeSSEStream: extra?.closeSSEStream,
24470
+ closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
24425
24471
  };
24426
24472
  Promise.resolve().then(() => {
24427
24473
  if (taskCreationParams) {
@@ -24441,12 +24487,11 @@ var Protocol = class {
24441
24487
  type: "response",
24442
24488
  message: response,
24443
24489
  timestamp: Date.now()
24444
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId);
24490
+ }, capturedTransport?.sessionId);
24445
24491
  } else {
24446
- await (capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(response));
24492
+ await capturedTransport?.send(response);
24447
24493
  }
24448
24494
  }, async (error2) => {
24449
- var _a3;
24450
24495
  if (abortController.signal.aborted) {
24451
24496
  return;
24452
24497
  }
@@ -24455,7 +24500,7 @@ var Protocol = class {
24455
24500
  id: request.id,
24456
24501
  error: {
24457
24502
  code: Number.isSafeInteger(error2["code"]) ? error2["code"] : ErrorCode.InternalError,
24458
- message: (_a3 = error2.message) !== null && _a3 !== void 0 ? _a3 : "Internal error",
24503
+ message: error2.message ?? "Internal error",
24459
24504
  ...error2["data"] !== void 0 && { data: error2["data"] }
24460
24505
  }
24461
24506
  };
@@ -24464,9 +24509,9 @@ var Protocol = class {
24464
24509
  type: "error",
24465
24510
  message: errorResponse,
24466
24511
  timestamp: Date.now()
24467
- }, capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId);
24512
+ }, capturedTransport?.sessionId);
24468
24513
  } else {
24469
- await (capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send(errorResponse));
24514
+ await capturedTransport?.send(errorResponse);
24470
24515
  }
24471
24516
  }).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
24472
24517
  this._requestHandlerAbortControllers.delete(request.id);
@@ -24500,7 +24545,7 @@ var Protocol = class {
24500
24545
  const resolver = this._requestResolvers.get(messageId);
24501
24546
  if (resolver) {
24502
24547
  this._requestResolvers.delete(messageId);
24503
- if (isJSONRPCResponse(response)) {
24548
+ if (isJSONRPCResultResponse(response)) {
24504
24549
  resolver(response);
24505
24550
  } else {
24506
24551
  const error2 = new McpError(response.error.code, response.error.message, response.error.data);
@@ -24516,7 +24561,7 @@ var Protocol = class {
24516
24561
  this._responseHandlers.delete(messageId);
24517
24562
  this._cleanupTimeout(messageId);
24518
24563
  let isTaskResponse = false;
24519
- if (isJSONRPCResponse(response) && response.result && typeof response.result === "object") {
24564
+ if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
24520
24565
  const result = response.result;
24521
24566
  if (result.task && typeof result.task === "object") {
24522
24567
  const task = result.task;
@@ -24529,7 +24574,7 @@ var Protocol = class {
24529
24574
  if (!isTaskResponse) {
24530
24575
  this._progressHandlers.delete(messageId);
24531
24576
  }
24532
- if (isJSONRPCResponse(response)) {
24577
+ if (isJSONRPCResultResponse(response)) {
24533
24578
  handler(response);
24534
24579
  } else {
24535
24580
  const error2 = McpError.fromError(response.error.code, response.error.message, response.error.data);
@@ -24543,8 +24588,7 @@ var Protocol = class {
24543
24588
  * Closes the connection.
24544
24589
  */
24545
24590
  async close() {
24546
- var _a2;
24547
- await ((_a2 = this._transport) === null || _a2 === void 0 ? void 0 : _a2.close());
24591
+ await this._transport?.close();
24548
24592
  }
24549
24593
  /**
24550
24594
  * Sends a request and returns an AsyncGenerator that yields response messages.
@@ -24574,8 +24618,7 @@ var Protocol = class {
24574
24618
  * @experimental Use `client.experimental.tasks.requestStream()` to access this method.
24575
24619
  */
24576
24620
  async *requestStream(request, resultSchema, options) {
24577
- var _a2, _b2, _c2, _d;
24578
- const { task } = options !== null && options !== void 0 ? options : {};
24621
+ const { task } = options ?? {};
24579
24622
  if (!task) {
24580
24623
  try {
24581
24624
  const result = await this.request(request, resultSchema, options);
@@ -24622,9 +24665,9 @@ var Protocol = class {
24622
24665
  yield { type: "result", result };
24623
24666
  return;
24624
24667
  }
24625
- const pollInterval = (_c2 = (_a2 = task2.pollInterval) !== null && _a2 !== void 0 ? _a2 : (_b2 = this._options) === null || _b2 === void 0 ? void 0 : _b2.defaultTaskPollInterval) !== null && _c2 !== void 0 ? _c2 : 1e3;
24668
+ const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
24626
24669
  await new Promise((resolve5) => setTimeout(resolve5, pollInterval));
24627
- (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.throwIfAborted();
24670
+ options?.signal?.throwIfAborted();
24628
24671
  }
24629
24672
  } catch (error2) {
24630
24673
  yield {
@@ -24639,9 +24682,8 @@ var Protocol = class {
24639
24682
  * Do not use this method to emit notifications! Use notification() instead.
24640
24683
  */
24641
24684
  request(request, resultSchema, options) {
24642
- const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options !== null && options !== void 0 ? options : {};
24685
+ const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
24643
24686
  return new Promise((resolve5, reject) => {
24644
- var _a2, _b2, _c2, _d, _e, _f, _g;
24645
24687
  const earlyReject = (error2) => {
24646
24688
  reject(error2);
24647
24689
  };
@@ -24649,7 +24691,7 @@ var Protocol = class {
24649
24691
  earlyReject(new Error("Not connected"));
24650
24692
  return;
24651
24693
  }
24652
- if (((_a2 = this._options) === null || _a2 === void 0 ? void 0 : _a2.enforceStrictCapabilities) === true) {
24694
+ if (this._options?.enforceStrictCapabilities === true) {
24653
24695
  try {
24654
24696
  this.assertCapabilityForMethod(request.method);
24655
24697
  if (task) {
@@ -24660,19 +24702,19 @@ var Protocol = class {
24660
24702
  return;
24661
24703
  }
24662
24704
  }
24663
- (_b2 = options === null || options === void 0 ? void 0 : options.signal) === null || _b2 === void 0 ? void 0 : _b2.throwIfAborted();
24705
+ options?.signal?.throwIfAborted();
24664
24706
  const messageId = this._requestMessageId++;
24665
24707
  const jsonrpcRequest = {
24666
24708
  ...request,
24667
24709
  jsonrpc: "2.0",
24668
24710
  id: messageId
24669
24711
  };
24670
- if (options === null || options === void 0 ? void 0 : options.onprogress) {
24712
+ if (options?.onprogress) {
24671
24713
  this._progressHandlers.set(messageId, options.onprogress);
24672
24714
  jsonrpcRequest.params = {
24673
24715
  ...request.params,
24674
24716
  _meta: {
24675
- ...((_c2 = request.params) === null || _c2 === void 0 ? void 0 : _c2._meta) || {},
24717
+ ...request.params?._meta || {},
24676
24718
  progressToken: messageId
24677
24719
  }
24678
24720
  };
@@ -24687,17 +24729,16 @@ var Protocol = class {
24687
24729
  jsonrpcRequest.params = {
24688
24730
  ...jsonrpcRequest.params,
24689
24731
  _meta: {
24690
- ...((_d = jsonrpcRequest.params) === null || _d === void 0 ? void 0 : _d._meta) || {},
24732
+ ...jsonrpcRequest.params?._meta || {},
24691
24733
  [RELATED_TASK_META_KEY]: relatedTask
24692
24734
  }
24693
24735
  };
24694
24736
  }
24695
24737
  const cancel = (reason) => {
24696
- var _a3;
24697
24738
  this._responseHandlers.delete(messageId);
24698
24739
  this._progressHandlers.delete(messageId);
24699
24740
  this._cleanupTimeout(messageId);
24700
- (_a3 = this._transport) === null || _a3 === void 0 ? void 0 : _a3.send({
24741
+ this._transport?.send({
24701
24742
  jsonrpc: "2.0",
24702
24743
  method: "notifications/cancelled",
24703
24744
  params: {
@@ -24709,8 +24750,7 @@ var Protocol = class {
24709
24750
  reject(error2);
24710
24751
  };
24711
24752
  this._responseHandlers.set(messageId, (response) => {
24712
- var _a3;
24713
- if ((_a3 = options === null || options === void 0 ? void 0 : options.signal) === null || _a3 === void 0 ? void 0 : _a3.aborted) {
24753
+ if (options?.signal?.aborted) {
24714
24754
  return;
24715
24755
  }
24716
24756
  if (response instanceof Error) {
@@ -24727,14 +24767,13 @@ var Protocol = class {
24727
24767
  reject(error2);
24728
24768
  }
24729
24769
  });
24730
- (_e = options === null || options === void 0 ? void 0 : options.signal) === null || _e === void 0 ? void 0 : _e.addEventListener("abort", () => {
24731
- var _a3;
24732
- cancel((_a3 = options === null || options === void 0 ? void 0 : options.signal) === null || _a3 === void 0 ? void 0 : _a3.reason);
24770
+ options?.signal?.addEventListener("abort", () => {
24771
+ cancel(options?.signal?.reason);
24733
24772
  });
24734
- const timeout = (_f = options === null || options === void 0 ? void 0 : options.timeout) !== null && _f !== void 0 ? _f : DEFAULT_REQUEST_TIMEOUT_MSEC;
24773
+ const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
24735
24774
  const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
24736
- 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);
24737
- const relatedTaskId = relatedTask === null || relatedTask === void 0 ? void 0 : relatedTask.taskId;
24775
+ this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
24776
+ const relatedTaskId = relatedTask?.taskId;
24738
24777
  if (relatedTaskId) {
24739
24778
  const responseResolver = (response) => {
24740
24779
  const handler = this._responseHandlers.get(messageId);
@@ -24797,12 +24836,11 @@ var Protocol = class {
24797
24836
  * Emits a notification, which is a one-way message that does not expect a response.
24798
24837
  */
24799
24838
  async notification(notification, options) {
24800
- var _a2, _b2, _c2, _d, _e;
24801
24839
  if (!this._transport) {
24802
24840
  throw new Error("Not connected");
24803
24841
  }
24804
24842
  this.assertNotificationCapability(notification.method);
24805
- const relatedTaskId = (_a2 = options === null || options === void 0 ? void 0 : options.relatedTask) === null || _a2 === void 0 ? void 0 : _a2.taskId;
24843
+ const relatedTaskId = options?.relatedTask?.taskId;
24806
24844
  if (relatedTaskId) {
24807
24845
  const jsonrpcNotification2 = {
24808
24846
  ...notification,
@@ -24810,7 +24848,7 @@ var Protocol = class {
24810
24848
  params: {
24811
24849
  ...notification.params,
24812
24850
  _meta: {
24813
- ...((_b2 = notification.params) === null || _b2 === void 0 ? void 0 : _b2._meta) || {},
24851
+ ...notification.params?._meta || {},
24814
24852
  [RELATED_TASK_META_KEY]: options.relatedTask
24815
24853
  }
24816
24854
  }
@@ -24822,15 +24860,14 @@ var Protocol = class {
24822
24860
  });
24823
24861
  return;
24824
24862
  }
24825
- const debouncedMethods = (_d = (_c2 = this._options) === null || _c2 === void 0 ? void 0 : _c2.debouncedNotificationMethods) !== null && _d !== void 0 ? _d : [];
24826
- 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);
24863
+ const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
24864
+ const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask;
24827
24865
  if (canDebounce) {
24828
24866
  if (this._pendingDebouncedNotifications.has(notification.method)) {
24829
24867
  return;
24830
24868
  }
24831
24869
  this._pendingDebouncedNotifications.add(notification.method);
24832
24870
  Promise.resolve().then(() => {
24833
- var _a3, _b3;
24834
24871
  this._pendingDebouncedNotifications.delete(notification.method);
24835
24872
  if (!this._transport) {
24836
24873
  return;
@@ -24839,19 +24876,19 @@ var Protocol = class {
24839
24876
  ...notification,
24840
24877
  jsonrpc: "2.0"
24841
24878
  };
24842
- if (options === null || options === void 0 ? void 0 : options.relatedTask) {
24879
+ if (options?.relatedTask) {
24843
24880
  jsonrpcNotification2 = {
24844
24881
  ...jsonrpcNotification2,
24845
24882
  params: {
24846
24883
  ...jsonrpcNotification2.params,
24847
24884
  _meta: {
24848
- ...((_a3 = jsonrpcNotification2.params) === null || _a3 === void 0 ? void 0 : _a3._meta) || {},
24885
+ ...jsonrpcNotification2.params?._meta || {},
24849
24886
  [RELATED_TASK_META_KEY]: options.relatedTask
24850
24887
  }
24851
24888
  }
24852
24889
  };
24853
24890
  }
24854
- (_b3 = this._transport) === null || _b3 === void 0 ? void 0 : _b3.send(jsonrpcNotification2, options).catch((error2) => this._onerror(error2));
24891
+ this._transport?.send(jsonrpcNotification2, options).catch((error2) => this._onerror(error2));
24855
24892
  });
24856
24893
  return;
24857
24894
  }
@@ -24859,13 +24896,13 @@ var Protocol = class {
24859
24896
  ...notification,
24860
24897
  jsonrpc: "2.0"
24861
24898
  };
24862
- if (options === null || options === void 0 ? void 0 : options.relatedTask) {
24899
+ if (options?.relatedTask) {
24863
24900
  jsonrpcNotification = {
24864
24901
  ...jsonrpcNotification,
24865
24902
  params: {
24866
24903
  ...jsonrpcNotification.params,
24867
24904
  _meta: {
24868
- ...((_e = jsonrpcNotification.params) === null || _e === void 0 ? void 0 : _e._meta) || {},
24905
+ ...jsonrpcNotification.params?._meta || {},
24869
24906
  [RELATED_TASK_META_KEY]: options.relatedTask
24870
24907
  }
24871
24908
  }
@@ -24941,11 +24978,10 @@ var Protocol = class {
24941
24978
  * simply propagates the error.
24942
24979
  */
24943
24980
  async _enqueueTaskMessage(taskId, message, sessionId) {
24944
- var _a2;
24945
24981
  if (!this._taskStore || !this._taskMessageQueue) {
24946
24982
  throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
24947
24983
  }
24948
- const maxQueueSize = (_a2 = this._options) === null || _a2 === void 0 ? void 0 : _a2.maxTaskQueueSize;
24984
+ const maxQueueSize = this._options?.maxTaskQueueSize;
24949
24985
  await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
24950
24986
  }
24951
24987
  /**
@@ -24978,14 +25014,13 @@ var Protocol = class {
24978
25014
  * @returns Promise that resolves when an update occurs or rejects if aborted
24979
25015
  */
24980
25016
  async _waitForTaskUpdate(taskId, signal) {
24981
- var _a2, _b2, _c2;
24982
- let interval = (_b2 = (_a2 = this._options) === null || _a2 === void 0 ? void 0 : _a2.defaultTaskPollInterval) !== null && _b2 !== void 0 ? _b2 : 1e3;
25017
+ let interval = this._options?.defaultTaskPollInterval ?? 1e3;
24983
25018
  try {
24984
- const task = await ((_c2 = this._taskStore) === null || _c2 === void 0 ? void 0 : _c2.getTask(taskId));
24985
- if (task === null || task === void 0 ? void 0 : task.pollInterval) {
25019
+ const task = await this._taskStore?.getTask(taskId);
25020
+ if (task?.pollInterval) {
24986
25021
  interval = task.pollInterval;
24987
25022
  }
24988
- } catch (_d) {
25023
+ } catch {
24989
25024
  }
24990
25025
  return new Promise((resolve5, reject) => {
24991
25026
  if (signal.aborted) {
@@ -25089,7 +25124,7 @@ function mergeCapabilities(base, additional) {
25089
25124
  var import_ajv = __toESM(require_ajv(), 1);
25090
25125
  var import_ajv_formats = __toESM(require_dist(), 1);
25091
25126
  function createDefaultAjvInstance() {
25092
- const ajv = new import_ajv.Ajv({
25127
+ const ajv = new import_ajv.default({
25093
25128
  strict: false,
25094
25129
  validateFormats: true,
25095
25130
  validateSchema: false,
@@ -25121,7 +25156,7 @@ var AjvJsonSchemaValidator = class {
25121
25156
  * ```
25122
25157
  */
25123
25158
  constructor(ajv) {
25124
- this._ajv = ajv !== null && ajv !== void 0 ? ajv : createDefaultAjvInstance();
25159
+ this._ajv = ajv ?? createDefaultAjvInstance();
25125
25160
  }
25126
25161
  /**
25127
25162
  * Create a validator for the given JSON Schema
@@ -25133,8 +25168,7 @@ var AjvJsonSchemaValidator = class {
25133
25168
  * @returns A validator function that validates input data
25134
25169
  */
25135
25170
  getValidator(schema) {
25136
- var _a2;
25137
- const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? (_a2 = this._ajv.getSchema(schema.$id)) !== null && _a2 !== void 0 ? _a2 : this._ajv.compile(schema) : this._ajv.compile(schema);
25171
+ const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema);
25138
25172
  return (input) => {
25139
25173
  const valid = ajvValidator(input);
25140
25174
  if (valid) {
@@ -25228,13 +25262,12 @@ var ExperimentalServerTasks = class {
25228
25262
 
25229
25263
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
25230
25264
  function assertToolsCallTaskCapability(requests, method, entityName) {
25231
- var _a2;
25232
25265
  if (!requests) {
25233
25266
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
25234
25267
  }
25235
25268
  switch (method) {
25236
25269
  case "tools/call":
25237
- if (!((_a2 = requests.tools) === null || _a2 === void 0 ? void 0 : _a2.call)) {
25270
+ if (!requests.tools?.call) {
25238
25271
  throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
25239
25272
  }
25240
25273
  break;
@@ -25243,18 +25276,17 @@ function assertToolsCallTaskCapability(requests, method, entityName) {
25243
25276
  }
25244
25277
  }
25245
25278
  function assertClientRequestTaskCapability(requests, method, entityName) {
25246
- var _a2, _b2;
25247
25279
  if (!requests) {
25248
25280
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
25249
25281
  }
25250
25282
  switch (method) {
25251
25283
  case "sampling/createMessage":
25252
- if (!((_a2 = requests.sampling) === null || _a2 === void 0 ? void 0 : _a2.createMessage)) {
25284
+ if (!requests.sampling?.createMessage) {
25253
25285
  throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
25254
25286
  }
25255
25287
  break;
25256
25288
  case "elicitation/create":
25257
- if (!((_b2 = requests.elicitation) === null || _b2 === void 0 ? void 0 : _b2.create)) {
25289
+ if (!requests.elicitation?.create) {
25258
25290
  throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
25259
25291
  }
25260
25292
  break;
@@ -25269,7 +25301,6 @@ var Server = class extends Protocol {
25269
25301
  * Initializes this server with the given name and version information.
25270
25302
  */
25271
25303
  constructor(_serverInfo, options) {
25272
- var _a2, _b2;
25273
25304
  super(options);
25274
25305
  this._serverInfo = _serverInfo;
25275
25306
  this._loggingLevels = /* @__PURE__ */ new Map();
@@ -25278,18 +25309,14 @@ var Server = class extends Protocol {
25278
25309
  const currentLevel = this._loggingLevels.get(sessionId);
25279
25310
  return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
25280
25311
  };
25281
- this._capabilities = (_a2 = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a2 !== void 0 ? _a2 : {};
25282
- this._instructions = options === null || options === void 0 ? void 0 : options.instructions;
25283
- this._jsonSchemaValidator = (_b2 = options === null || options === void 0 ? void 0 : options.jsonSchemaValidator) !== null && _b2 !== void 0 ? _b2 : new AjvJsonSchemaValidator();
25312
+ this._capabilities = options?.capabilities ?? {};
25313
+ this._instructions = options?.instructions;
25314
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
25284
25315
  this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));
25285
- this.setNotificationHandler(InitializedNotificationSchema, () => {
25286
- var _a3;
25287
- return (_a3 = this.oninitialized) === null || _a3 === void 0 ? void 0 : _a3.call(this);
25288
- });
25316
+ this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
25289
25317
  if (this._capabilities.logging) {
25290
25318
  this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
25291
- var _a3;
25292
- const transportSessionId = extra.sessionId || ((_a3 = extra.requestInfo) === null || _a3 === void 0 ? void 0 : _a3.headers["mcp-session-id"]) || void 0;
25319
+ const transportSessionId = extra.sessionId || extra.requestInfo?.headers["mcp-session-id"] || void 0;
25293
25320
  const { level } = request.params;
25294
25321
  const parseResult = LoggingLevelSchema.safeParse(level);
25295
25322
  if (parseResult.success) {
@@ -25329,21 +25356,20 @@ var Server = class extends Protocol {
25329
25356
  * Override request handler registration to enforce server-side validation for tools/call.
25330
25357
  */
25331
25358
  setRequestHandler(requestSchema, handler) {
25332
- var _a2, _b2, _c2;
25333
25359
  const shape = getObjectShape(requestSchema);
25334
- const methodSchema = shape === null || shape === void 0 ? void 0 : shape.method;
25360
+ const methodSchema = shape?.method;
25335
25361
  if (!methodSchema) {
25336
25362
  throw new Error("Schema is missing a method literal");
25337
25363
  }
25338
25364
  let methodValue;
25339
25365
  if (isZ4Schema(methodSchema)) {
25340
25366
  const v4Schema = methodSchema;
25341
- const v4Def = (_a2 = v4Schema._zod) === null || _a2 === void 0 ? void 0 : _a2.def;
25342
- methodValue = (_b2 = v4Def === null || v4Def === void 0 ? void 0 : v4Def.value) !== null && _b2 !== void 0 ? _b2 : v4Schema.value;
25367
+ const v4Def = v4Schema._zod?.def;
25368
+ methodValue = v4Def?.value ?? v4Schema.value;
25343
25369
  } else {
25344
25370
  const v3Schema = methodSchema;
25345
25371
  const legacyDef = v3Schema._def;
25346
- methodValue = (_c2 = legacyDef === null || legacyDef === void 0 ? void 0 : legacyDef.value) !== null && _c2 !== void 0 ? _c2 : v3Schema.value;
25372
+ methodValue = legacyDef?.value ?? v3Schema.value;
25347
25373
  }
25348
25374
  if (typeof methodValue !== "string") {
25349
25375
  throw new Error("Schema method literal must be a string");
@@ -25378,20 +25404,19 @@ var Server = class extends Protocol {
25378
25404
  return super.setRequestHandler(requestSchema, handler);
25379
25405
  }
25380
25406
  assertCapabilityForMethod(method) {
25381
- var _a2, _b2, _c2;
25382
25407
  switch (method) {
25383
25408
  case "sampling/createMessage":
25384
- if (!((_a2 = this._clientCapabilities) === null || _a2 === void 0 ? void 0 : _a2.sampling)) {
25409
+ if (!this._clientCapabilities?.sampling) {
25385
25410
  throw new Error(`Client does not support sampling (required for ${method})`);
25386
25411
  }
25387
25412
  break;
25388
25413
  case "elicitation/create":
25389
- if (!((_b2 = this._clientCapabilities) === null || _b2 === void 0 ? void 0 : _b2.elicitation)) {
25414
+ if (!this._clientCapabilities?.elicitation) {
25390
25415
  throw new Error(`Client does not support elicitation (required for ${method})`);
25391
25416
  }
25392
25417
  break;
25393
25418
  case "roots/list":
25394
- if (!((_c2 = this._clientCapabilities) === null || _c2 === void 0 ? void 0 : _c2.roots)) {
25419
+ if (!this._clientCapabilities?.roots) {
25395
25420
  throw new Error(`Client does not support listing roots (required for ${method})`);
25396
25421
  }
25397
25422
  break;
@@ -25400,7 +25425,6 @@ var Server = class extends Protocol {
25400
25425
  }
25401
25426
  }
25402
25427
  assertNotificationCapability(method) {
25403
- var _a2, _b2;
25404
25428
  switch (method) {
25405
25429
  case "notifications/message":
25406
25430
  if (!this._capabilities.logging) {
@@ -25424,7 +25448,7 @@ var Server = class extends Protocol {
25424
25448
  }
25425
25449
  break;
25426
25450
  case "notifications/elicitation/complete":
25427
- if (!((_b2 = (_a2 = this._clientCapabilities) === null || _a2 === void 0 ? void 0 : _a2.elicitation) === null || _b2 === void 0 ? void 0 : _b2.url)) {
25451
+ if (!this._clientCapabilities?.elicitation?.url) {
25428
25452
  throw new Error(`Client does not support URL elicitation (required for ${method})`);
25429
25453
  }
25430
25454
  break;
@@ -25482,15 +25506,13 @@ var Server = class extends Protocol {
25482
25506
  }
25483
25507
  }
25484
25508
  assertTaskCapability(method) {
25485
- var _a2, _b2;
25486
- assertClientRequestTaskCapability((_b2 = (_a2 = this._clientCapabilities) === null || _a2 === void 0 ? void 0 : _a2.tasks) === null || _b2 === void 0 ? void 0 : _b2.requests, method, "Client");
25509
+ assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, "Client");
25487
25510
  }
25488
25511
  assertTaskHandlerCapability(method) {
25489
- var _a2;
25490
25512
  if (!this._capabilities) {
25491
25513
  return;
25492
25514
  }
25493
- assertToolsCallTaskCapability((_a2 = this._capabilities.tasks) === null || _a2 === void 0 ? void 0 : _a2.requests, method, "Server");
25515
+ assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, "Server");
25494
25516
  }
25495
25517
  async _oninitialize(request) {
25496
25518
  const requestedVersion = request.params.protocolVersion;
@@ -25524,9 +25546,8 @@ var Server = class extends Protocol {
25524
25546
  }
25525
25547
  // Implementation
25526
25548
  async createMessage(params, options) {
25527
- var _a2, _b2;
25528
25549
  if (params.tools || params.toolChoice) {
25529
- if (!((_b2 = (_a2 = this._clientCapabilities) === null || _a2 === void 0 ? void 0 : _a2.sampling) === null || _b2 === void 0 ? void 0 : _b2.tools)) {
25550
+ if (!this._clientCapabilities?.sampling?.tools) {
25530
25551
  throw new Error("Client does not support sampling tools capability.");
25531
25552
  }
25532
25553
  }
@@ -25566,18 +25587,17 @@ var Server = class extends Protocol {
25566
25587
  * @returns The result of the elicitation request.
25567
25588
  */
25568
25589
  async elicitInput(params, options) {
25569
- var _a2, _b2, _c2, _d, _e;
25570
- const mode = (_a2 = params.mode) !== null && _a2 !== void 0 ? _a2 : "form";
25590
+ const mode = params.mode ?? "form";
25571
25591
  switch (mode) {
25572
25592
  case "url": {
25573
- if (!((_c2 = (_b2 = this._clientCapabilities) === null || _b2 === void 0 ? void 0 : _b2.elicitation) === null || _c2 === void 0 ? void 0 : _c2.url)) {
25593
+ if (!this._clientCapabilities?.elicitation?.url) {
25574
25594
  throw new Error("Client does not support url elicitation.");
25575
25595
  }
25576
25596
  const urlParams = params;
25577
25597
  return this.request({ method: "elicitation/create", params: urlParams }, ElicitResultSchema, options);
25578
25598
  }
25579
25599
  case "form": {
25580
- if (!((_e = (_d = this._clientCapabilities) === null || _d === void 0 ? void 0 : _d.elicitation) === null || _e === void 0 ? void 0 : _e.form)) {
25600
+ if (!this._clientCapabilities?.elicitation?.form) {
25581
25601
  throw new Error("Client does not support form elicitation.");
25582
25602
  }
25583
25603
  const formParams = params.mode === "form" ? params : { ...params, mode: "form" };
@@ -25609,8 +25629,7 @@ var Server = class extends Protocol {
25609
25629
  * @returns A function that emits the completion notification when awaited.
25610
25630
  */
25611
25631
  createElicitationCompletionNotifier(elicitationId, options) {
25612
- var _a2, _b2;
25613
- if (!((_b2 = (_a2 = this._clientCapabilities) === null || _a2 === void 0 ? void 0 : _a2.elicitation) === null || _b2 === void 0 ? void 0 : _b2.url)) {
25632
+ if (!this._clientCapabilities?.elicitation?.url) {
25614
25633
  throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");
25615
25634
  }
25616
25635
  return () => this.notification({
@@ -25657,13 +25676,13 @@ var Server = class extends Protocol {
25657
25676
  };
25658
25677
 
25659
25678
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
25660
- var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
25679
+ var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
25661
25680
  function isCompletable(schema) {
25662
25681
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
25663
25682
  }
25664
25683
  function getCompleter(schema) {
25665
25684
  const meta = schema[COMPLETABLE_SYMBOL];
25666
- return meta === null || meta === void 0 ? void 0 : meta.complete;
25685
+ return meta?.complete;
25667
25686
  }
25668
25687
  var McpZodTypeKind;
25669
25688
  (function(McpZodTypeKind2) {
@@ -25826,7 +25845,6 @@ var McpServer = class {
25826
25845
  })
25827
25846
  }));
25828
25847
  this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
25829
- var _a2;
25830
25848
  try {
25831
25849
  const tool = this._registeredTools[request.params.name];
25832
25850
  if (!tool) {
@@ -25836,7 +25854,7 @@ var McpServer = class {
25836
25854
  throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
25837
25855
  }
25838
25856
  const isTaskRequest = !!request.params.task;
25839
- const taskSupport = (_a2 = tool.execution) === null || _a2 === void 0 ? void 0 : _a2.taskSupport;
25857
+ const taskSupport = tool.execution?.taskSupport;
25840
25858
  const isTaskHandler = "createTask" in tool.handler;
25841
25859
  if ((taskSupport === "required" || taskSupport === "optional") && !isTaskHandler) {
25842
25860
  throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`);
@@ -25890,7 +25908,7 @@ var McpServer = class {
25890
25908
  return void 0;
25891
25909
  }
25892
25910
  const inputObj = normalizeObjectSchema(tool.inputSchema);
25893
- const schemaToParse = inputObj !== null && inputObj !== void 0 ? inputObj : tool.inputSchema;
25911
+ const schemaToParse = inputObj ?? tool.inputSchema;
25894
25912
  const parseResult = await safeParseAsync2(schemaToParse, args);
25895
25913
  if (!parseResult.success) {
25896
25914
  const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
@@ -25954,7 +25972,6 @@ var McpServer = class {
25954
25972
  * Handles automatic task polling for tools with taskSupport 'optional'.
25955
25973
  */
25956
25974
  async handleAutomaticTaskPolling(tool, request, extra) {
25957
- var _a2;
25958
25975
  if (!extra.taskStore) {
25959
25976
  throw new Error("No task store provided for task-capable tool.");
25960
25977
  }
@@ -25967,7 +25984,7 @@ var McpServer = class {
25967
25984
  );
25968
25985
  const taskId = createTaskResult.task.taskId;
25969
25986
  let task = createTaskResult.task;
25970
- const pollInterval = (_a2 = task.pollInterval) !== null && _a2 !== void 0 ? _a2 : 5e3;
25987
+ const pollInterval = task.pollInterval ?? 5e3;
25971
25988
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
25972
25989
  await new Promise((resolve5) => setTimeout(resolve5, pollInterval));
25973
25990
  const updatedTask = await extra.taskStore.getTask(taskId);
@@ -26012,7 +26029,7 @@ var McpServer = class {
26012
26029
  return EMPTY_COMPLETION_RESULT;
26013
26030
  }
26014
26031
  const promptShape = getObjectShape(prompt.argsSchema);
26015
- const field = promptShape === null || promptShape === void 0 ? void 0 : promptShape[request.params.argument.name];
26032
+ const field = promptShape?.[request.params.argument.name];
26016
26033
  if (!isCompletable(field)) {
26017
26034
  return EMPTY_COMPLETION_RESULT;
26018
26035
  }
@@ -26097,7 +26114,6 @@ var McpServer = class {
26097
26114
  }
26098
26115
  throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} not found`);
26099
26116
  });
26100
- this.setCompletionRequestHandler();
26101
26117
  this._resourceHandlersInitialized = true;
26102
26118
  }
26103
26119
  setPromptRequestHandlers() {
@@ -26145,7 +26161,6 @@ var McpServer = class {
26145
26161
  return await Promise.resolve(cb(extra));
26146
26162
  }
26147
26163
  });
26148
- this.setCompletionRequestHandler();
26149
26164
  this._promptHandlersInitialized = true;
26150
26165
  }
26151
26166
  resource(name, uriOrTemplate, ...rest) {
@@ -26253,6 +26268,11 @@ var McpServer = class {
26253
26268
  }
26254
26269
  };
26255
26270
  this._registeredResourceTemplates[name] = registeredResourceTemplate;
26271
+ const variableNames = template.uriTemplate.variableNames;
26272
+ const hasCompleter = Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v));
26273
+ if (hasCompleter) {
26274
+ this.setCompletionRequestHandler();
26275
+ }
26256
26276
  return registeredResourceTemplate;
26257
26277
  }
26258
26278
  _createRegisteredPrompt(name, title, description, argsSchema, callback) {
@@ -26285,6 +26305,15 @@ var McpServer = class {
26285
26305
  }
26286
26306
  };
26287
26307
  this._registeredPrompts[name] = registeredPrompt;
26308
+ if (argsSchema) {
26309
+ const hasCompletable = Object.values(argsSchema).some((field) => {
26310
+ const inner = field instanceof ZodOptional ? field._def?.innerType : field;
26311
+ return isCompletable(inner);
26312
+ });
26313
+ if (hasCompletable) {
26314
+ this.setCompletionRequestHandler();
26315
+ }
26316
+ }
26288
26317
  return registeredPrompt;
26289
26318
  }
26290
26319
  _createRegisteredTool(name, title, description, inputSchema25, outputSchema, annotations, execution, _meta, handler) {
@@ -26317,6 +26346,8 @@ var McpServer = class {
26317
26346
  registeredTool.description = updates.description;
26318
26347
  if (typeof updates.paramsSchema !== "undefined")
26319
26348
  registeredTool.inputSchema = objectFromShape(updates.paramsSchema);
26349
+ if (typeof updates.outputSchema !== "undefined")
26350
+ registeredTool.outputSchema = objectFromShape(updates.outputSchema);
26320
26351
  if (typeof updates.callback !== "undefined")
26321
26352
  registeredTool.handler = updates.callback;
26322
26353
  if (typeof updates.annotations !== "undefined")
@@ -26491,7 +26522,7 @@ function promptArgumentsFromSchema(schema) {
26491
26522
  }
26492
26523
  function getMethodValue(schema) {
26493
26524
  const shape = getObjectShape(schema);
26494
- const methodSchema = shape === null || shape === void 0 ? void 0 : shape.method;
26525
+ const methodSchema = shape?.method;
26495
26526
  if (!methodSchema) {
26496
26527
  throw new Error("Schema is missing a method literal");
26497
26528
  }
@@ -28789,8 +28820,7 @@ var StdioServerTransport = class {
28789
28820
  this.processReadBuffer();
28790
28821
  };
28791
28822
  this._onerror = (error2) => {
28792
- var _a2;
28793
- (_a2 = this.onerror) === null || _a2 === void 0 ? void 0 : _a2.call(this, error2);
28823
+ this.onerror?.(error2);
28794
28824
  };
28795
28825
  }
28796
28826
  /**
@@ -28805,21 +28835,19 @@ var StdioServerTransport = class {
28805
28835
  this._stdin.on("error", this._onerror);
28806
28836
  }
28807
28837
  processReadBuffer() {
28808
- var _a2, _b2;
28809
28838
  while (true) {
28810
28839
  try {
28811
28840
  const message = this._readBuffer.readMessage();
28812
28841
  if (message === null) {
28813
28842
  break;
28814
28843
  }
28815
- (_a2 = this.onmessage) === null || _a2 === void 0 ? void 0 : _a2.call(this, message);
28844
+ this.onmessage?.(message);
28816
28845
  } catch (error2) {
28817
- (_b2 = this.onerror) === null || _b2 === void 0 ? void 0 : _b2.call(this, error2);
28846
+ this.onerror?.(error2);
28818
28847
  }
28819
28848
  }
28820
28849
  }
28821
28850
  async close() {
28822
- var _a2;
28823
28851
  this._stdin.off("data", this._ondata);
28824
28852
  this._stdin.off("error", this._onerror);
28825
28853
  const remainingDataListeners = this._stdin.listenerCount("data");
@@ -28827,7 +28855,7 @@ var StdioServerTransport = class {
28827
28855
  this._stdin.pause();
28828
28856
  }
28829
28857
  this._readBuffer.clear();
28830
- (_a2 = this.onclose) === null || _a2 === void 0 ? void 0 : _a2.call(this);
28858
+ this.onclose?.();
28831
28859
  }
28832
28860
  send(message) {
28833
28861
  return new Promise((resolve5) => {
@@ -28844,7 +28872,7 @@ var StdioServerTransport = class {
28844
28872
  // package.json
28845
28873
  var package_default = {
28846
28874
  name: "@google-cloud/storage-mcp",
28847
- version: "0.3.1",
28875
+ version: "0.3.3",
28848
28876
  type: "module",
28849
28877
  main: "dist/bundle.js",
28850
28878
  bin: {
@@ -28907,11 +28935,11 @@ var package_default = {
28907
28935
  "@google-cloud/service-usage": "^4.2.0",
28908
28936
  "@google-cloud/storage": "^7.17.1",
28909
28937
  "@google-cloud/storageinsights": "^2.2.0",
28910
- "@modelcontextprotocol/sdk": "^1.24.0",
28938
+ "@modelcontextprotocol/sdk": "^1.26.0",
28911
28939
  "@types/yargs": "^17.0.33",
28912
28940
  chardet: "^2.1.0",
28913
28941
  "google-auth-library": "^9.11.0",
28914
- googleapis: "^168.0.0",
28942
+ googleapis: "^171.0.0",
28915
28943
  "iconv-lite": "^0.7.0",
28916
28944
  "mime-types": "^2.1.35",
28917
28945
  yargs: "^18.0.0",
@@ -32810,42 +32838,42 @@ function YargsFactory(_shim) {
32810
32838
  return yargs;
32811
32839
  };
32812
32840
  }
32813
- var kCopyDoubleDash = Symbol("copyDoubleDash");
32814
- var kCreateLogger = Symbol("copyDoubleDash");
32815
- var kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject");
32816
- var kEmitWarning = Symbol("emitWarning");
32817
- var kFreeze = Symbol("freeze");
32818
- var kGetDollarZero = Symbol("getDollarZero");
32819
- var kGetParserConfiguration = Symbol("getParserConfiguration");
32820
- var kGetUsageConfiguration = Symbol("getUsageConfiguration");
32821
- var kGuessLocale = Symbol("guessLocale");
32822
- var kGuessVersion = Symbol("guessVersion");
32823
- var kParsePositionalNumbers = Symbol("parsePositionalNumbers");
32824
- var kPkgUp = Symbol("pkgUp");
32825
- var kPopulateParserHintArray = Symbol("populateParserHintArray");
32826
- var kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary");
32827
- var kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary");
32828
- var kPopulateParserHintDictionary = Symbol("populateParserHintDictionary");
32829
- var kSanitizeKey = Symbol("sanitizeKey");
32830
- var kSetKey = Symbol("setKey");
32831
- var kUnfreeze = Symbol("unfreeze");
32832
- var kValidateAsync = Symbol("validateAsync");
32833
- var kGetCommandInstance = Symbol("getCommandInstance");
32834
- var kGetContext = Symbol("getContext");
32835
- var kGetHasOutput = Symbol("getHasOutput");
32836
- var kGetLoggerInstance = Symbol("getLoggerInstance");
32837
- var kGetParseContext = Symbol("getParseContext");
32838
- var kGetUsageInstance = Symbol("getUsageInstance");
32839
- var kGetValidationInstance = Symbol("getValidationInstance");
32840
- var kHasParseCallback = Symbol("hasParseCallback");
32841
- var kIsGlobalContext = Symbol("isGlobalContext");
32842
- var kPostProcess = Symbol("postProcess");
32843
- var kRebase = Symbol("rebase");
32844
- var kReset = Symbol("reset");
32845
- var kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands");
32846
- var kRunValidation = Symbol("runValidation");
32847
- var kSetHasOutput = Symbol("setHasOutput");
32848
- var kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys");
32841
+ var kCopyDoubleDash = /* @__PURE__ */ Symbol("copyDoubleDash");
32842
+ var kCreateLogger = /* @__PURE__ */ Symbol("copyDoubleDash");
32843
+ var kDeleteFromParserHintObject = /* @__PURE__ */ Symbol("deleteFromParserHintObject");
32844
+ var kEmitWarning = /* @__PURE__ */ Symbol("emitWarning");
32845
+ var kFreeze = /* @__PURE__ */ Symbol("freeze");
32846
+ var kGetDollarZero = /* @__PURE__ */ Symbol("getDollarZero");
32847
+ var kGetParserConfiguration = /* @__PURE__ */ Symbol("getParserConfiguration");
32848
+ var kGetUsageConfiguration = /* @__PURE__ */ Symbol("getUsageConfiguration");
32849
+ var kGuessLocale = /* @__PURE__ */ Symbol("guessLocale");
32850
+ var kGuessVersion = /* @__PURE__ */ Symbol("guessVersion");
32851
+ var kParsePositionalNumbers = /* @__PURE__ */ Symbol("parsePositionalNumbers");
32852
+ var kPkgUp = /* @__PURE__ */ Symbol("pkgUp");
32853
+ var kPopulateParserHintArray = /* @__PURE__ */ Symbol("populateParserHintArray");
32854
+ var kPopulateParserHintSingleValueDictionary = /* @__PURE__ */ Symbol("populateParserHintSingleValueDictionary");
32855
+ var kPopulateParserHintArrayDictionary = /* @__PURE__ */ Symbol("populateParserHintArrayDictionary");
32856
+ var kPopulateParserHintDictionary = /* @__PURE__ */ Symbol("populateParserHintDictionary");
32857
+ var kSanitizeKey = /* @__PURE__ */ Symbol("sanitizeKey");
32858
+ var kSetKey = /* @__PURE__ */ Symbol("setKey");
32859
+ var kUnfreeze = /* @__PURE__ */ Symbol("unfreeze");
32860
+ var kValidateAsync = /* @__PURE__ */ Symbol("validateAsync");
32861
+ var kGetCommandInstance = /* @__PURE__ */ Symbol("getCommandInstance");
32862
+ var kGetContext = /* @__PURE__ */ Symbol("getContext");
32863
+ var kGetHasOutput = /* @__PURE__ */ Symbol("getHasOutput");
32864
+ var kGetLoggerInstance = /* @__PURE__ */ Symbol("getLoggerInstance");
32865
+ var kGetParseContext = /* @__PURE__ */ Symbol("getParseContext");
32866
+ var kGetUsageInstance = /* @__PURE__ */ Symbol("getUsageInstance");
32867
+ var kGetValidationInstance = /* @__PURE__ */ Symbol("getValidationInstance");
32868
+ var kHasParseCallback = /* @__PURE__ */ Symbol("hasParseCallback");
32869
+ var kIsGlobalContext = /* @__PURE__ */ Symbol("isGlobalContext");
32870
+ var kPostProcess = /* @__PURE__ */ Symbol("postProcess");
32871
+ var kRebase = /* @__PURE__ */ Symbol("rebase");
32872
+ var kReset = /* @__PURE__ */ Symbol("reset");
32873
+ var kRunYargsParserAndExecuteCommands = /* @__PURE__ */ Symbol("runYargsParserAndExecuteCommands");
32874
+ var kRunValidation = /* @__PURE__ */ Symbol("runValidation");
32875
+ var kSetHasOutput = /* @__PURE__ */ Symbol("setHasOutput");
32876
+ var kTrackManuallySetKeys = /* @__PURE__ */ Symbol("kTrackManuallySetKeys");
32849
32877
  var DEFAULT_LOCALE = "en_US";
32850
32878
  var YargsInstance = class {
32851
32879
  constructor(processArgs = [], cwd, parentRequire, shim3) {