gogcli-mcp-contacts 4.5.0 → 4.5.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.
package/dist/index.js CHANGED
@@ -19763,7 +19763,7 @@ function date4(params) {
19763
19763
  return _coercedDate(ZodDate, params);
19764
19764
  }
19765
19765
 
19766
- // ../../node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs
19766
+ // ../../node_modules/@modelcontextprotocol/server/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs
19767
19767
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
19768
19768
  var SUPPORTED_PROTOCOL_VERSIONS = [
19769
19769
  LATEST_PROTOCOL_VERSION,
@@ -20600,7 +20600,8 @@ var OAuthMetadataSchema = looseObject({
20600
20600
  introspection_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
20601
20601
  code_challenge_methods_supported: array(string2()).optional(),
20602
20602
  client_id_metadata_document_supported: boolean2().optional(),
20603
- authorization_response_iss_parameter_supported: boolean2().optional().catch(void 0)
20603
+ authorization_response_iss_parameter_supported: boolean2().optional().catch(void 0),
20604
+ dpop_signing_alg_values_supported: array(string2()).optional()
20604
20605
  });
20605
20606
  var OpenIdProviderMetadataSchema = looseObject({
20606
20607
  issuer: string2(),
@@ -20701,7 +20702,7 @@ var OAuthTokenRevocationRequestSchema = object({
20701
20702
  token_type_hint: string2().optional()
20702
20703
  }).strip();
20703
20704
 
20704
- // ../../node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs
20705
+ // ../../node_modules/@modelcontextprotocol/server/dist/src-D-y6h4N7.mjs
20705
20706
  var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
20706
20707
  function stampErrorBrands(instance, ctor) {
20707
20708
  const brands = /* @__PURE__ */ new Set();
@@ -20815,8 +20816,18 @@ var SdkError = class extends Error {
20815
20816
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
20816
20817
  return brandedHasInstance(this, value);
20817
20818
  }
20818
- constructor(code, message, data) {
20819
- super(message);
20819
+ /**
20820
+ * @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
20821
+ * @param message - Human-readable description.
20822
+ * @param data - Optional structured payload (for example the HTTP status carried by
20823
+ * {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
20824
+ * promoted to `Error.cause`.
20825
+ * @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
20826
+ * failure as `{ cause }` so it is reachable through the `Error.cause` chain that
20827
+ * loggers and error trackers walk.
20828
+ */
20829
+ constructor(code, message, data, options) {
20830
+ super(message, options);
20820
20831
  this.code = code;
20821
20832
  this.data = data;
20822
20833
  this.name = "SdkError";
@@ -20827,8 +20838,11 @@ var SdkHttpError = class extends SdkError {
20827
20838
  static {
20828
20839
  Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
20829
20840
  }
20830
- constructor(code, message, data) {
20831
- super(code, message, data);
20841
+ /**
20842
+ * @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).
20843
+ */
20844
+ constructor(code, message, data, options) {
20845
+ super(code, message, data, options);
20832
20846
  this.name = "SdkHttpError";
20833
20847
  }
20834
20848
  get status() {
@@ -23779,7 +23793,7 @@ var INBOUND_VALIDATION_LADDER = [
23779
23793
  evaluatedAt: "pre-dispatch",
23780
23794
  codes: [HEADER_MISMATCH_ERROR_CODE],
23781
23795
  conformance: ["http-header-validation"],
23782
- rationale: "SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."
23796
+ rationale: "SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."
23783
23797
  },
23784
23798
  {
23785
23799
  rung: "client-capabilities",
@@ -24549,7 +24563,7 @@ var Protocol = class {
24549
24563
  return this._requestHandlers.get(method);
24550
24564
  }
24551
24565
  async _oncancel(notification) {
24552
- if (!notification.params.requestId) return;
24566
+ if (notification.params.requestId === void 0) return;
24553
24567
  this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
24554
24568
  }
24555
24569
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
@@ -24948,19 +24962,20 @@ var Protocol = class {
24948
24962
  const cancel = (reason) => {
24949
24963
  if (responseReceived) return;
24950
24964
  this._progressHandlers.delete(messageId);
24951
- if (requestAbort === void 0) this._transport?.send(this._envelopeOutbound({
24952
- jsonrpc: "2.0",
24953
- method: "notifications/cancelled",
24954
- params: {
24955
- requestId: messageId,
24956
- reason: String(reason)
24957
- }
24958
- }), {
24959
- relatedRequestId,
24960
- resumptionToken,
24961
- onresumptiontoken
24962
- }).catch((error62) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error62}`)));
24963
- else requestAbort.abort();
24965
+ if (requestAbort === void 0) {
24966
+ if (request.method !== "initialize") this._transport?.send(this._envelopeOutbound({
24967
+ jsonrpc: "2.0",
24968
+ method: "notifications/cancelled",
24969
+ params: {
24970
+ requestId: messageId,
24971
+ reason: String(reason)
24972
+ }
24973
+ }), {
24974
+ relatedRequestId,
24975
+ resumptionToken,
24976
+ onresumptiontoken
24977
+ }).catch((error62) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error62}`)));
24978
+ } else requestAbort.abort();
24964
24979
  reject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));
24965
24980
  };
24966
24981
  this._responseHandlers.set(messageId, (response) => {
@@ -25040,7 +25055,7 @@ var Protocol = class {
25040
25055
  jsonrpc: "2.0",
25041
25056
  ...notification
25042
25057
  });
25043
- if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && !options?.relatedRequestId) {
25058
+ if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {
25044
25059
  if (this._pendingDebouncedNotifications.has(notification.method)) return;
25045
25060
  this._pendingDebouncedNotifications.add(notification.method);
25046
25061
  Promise.resolve().then(() => {
@@ -32343,7 +32358,7 @@ var Ajv = import_ajv.Ajv;
32343
32358
  // ../../node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
32344
32359
  import process2 from "node:process";
32345
32360
 
32346
- // ../../node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs
32361
+ // ../../node_modules/@modelcontextprotocol/server/dist/mcp-Dw2OlZ1f.mjs
32347
32362
  var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
32348
32363
  function isCompletable(schema) {
32349
32364
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
@@ -32536,6 +32551,9 @@ function notificationToServerEvent(method, uri) {
32536
32551
  };
32537
32552
  }
32538
32553
  }
32554
+ function supportsScopeChallengeResolver(transport) {
32555
+ return typeof transport === "object" && transport !== null && "setScopeChallengeResolver" in transport && typeof transport.setScopeChallengeResolver === "function";
32556
+ }
32539
32557
  var DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;
32540
32558
  var DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;
32541
32559
  function resolveLegacyShimOptions(options) {
@@ -33346,6 +33364,7 @@ var McpServer = class {
33346
33364
  * ```
33347
33365
  */
33348
33366
  async connect(transport) {
33367
+ if (supportsScopeChallengeResolver(transport)) transport.setScopeChallengeResolver((context) => this.resolveScopeChallenge(context));
33349
33368
  return await this.server.connect(transport);
33350
33369
  }
33351
33370
  /**
@@ -33354,6 +33373,41 @@ var McpServer = class {
33354
33373
  async close() {
33355
33374
  await this.server.close();
33356
33375
  }
33376
+ /** @internal */
33377
+ resolveScopeChallenge = (context) => {
33378
+ switch (context.request.method) {
33379
+ case "tools/call": {
33380
+ const toolName = context.request.params?.name;
33381
+ if (typeof toolName !== "string") return;
33382
+ const tool = this._registeredTools[toolName];
33383
+ if (tool === void 0 || !tool.enabled) return;
33384
+ return tool.scopeChallenge?.(context);
33385
+ }
33386
+ case "resources/read": {
33387
+ const resourceUri = context.request.params?.uri;
33388
+ if (typeof resourceUri !== "string") return;
33389
+ let uri;
33390
+ try {
33391
+ uri = new URL(resourceUri);
33392
+ } catch {
33393
+ return;
33394
+ }
33395
+ const resource = this._registeredResources[uri.toString()];
33396
+ if (resource !== void 0) return resource.enabled ? resource.scopeChallenge?.(context) : void 0;
33397
+ for (const template of Object.values(this._registeredResourceTemplates)) if (template.resourceTemplate.uriTemplate.match(uri.toString())) return template.enabled ? template.scopeChallenge?.(context) : void 0;
33398
+ return;
33399
+ }
33400
+ case "prompts/get": {
33401
+ const promptName = context.request.params?.name;
33402
+ if (typeof promptName !== "string") return;
33403
+ const prompt = this._registeredPrompts[promptName];
33404
+ if (prompt === void 0 || !prompt.enabled) return;
33405
+ return prompt.scopeChallenge?.(context);
33406
+ }
33407
+ default:
33408
+ return;
33409
+ }
33410
+ };
33357
33411
  _toolHandlersInitialized = false;
33358
33412
  setToolRequestHandlers() {
33359
33413
  if (this._toolHandlersInitialized) return;
@@ -33520,7 +33574,10 @@ var McpServer = class {
33520
33574
  }
33521
33575
  for (const template of Object.values(this._registeredResourceTemplates)) {
33522
33576
  const variables = template.resourceTemplate.uriTemplate.match(uri.toString());
33523
- if (variables) return attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);
33577
+ if (variables) {
33578
+ if (!template.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${template.resourceTemplate.uriTemplate} disabled`);
33579
+ return attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);
33580
+ }
33524
33581
  }
33525
33582
  throw new ResourceNotFoundError(request.params.uri);
33526
33583
  });
@@ -33551,36 +33608,32 @@ var McpServer = class {
33551
33608
  this._promptHandlersInitialized = true;
33552
33609
  }
33553
33610
  registerResource(name, uriOrTemplate, config2, readCallback) {
33554
- const cacheHint = config2.cacheHint;
33555
- let metadata = config2;
33556
- if (cacheHint !== void 0) {
33557
- assertValidCacheHint(cacheHint, `resource ${name}`);
33558
- const rest = { ...config2 };
33559
- delete rest.cacheHint;
33560
- metadata = rest;
33561
- }
33611
+ const { cacheHint, scopeChallenge, ...resourceMetadata } = config2;
33612
+ const metadata = resourceMetadata;
33613
+ if (cacheHint !== void 0) assertValidCacheHint(cacheHint, `resource ${name}`);
33562
33614
  if (typeof uriOrTemplate === "string") {
33563
33615
  if (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);
33564
- const registeredResource = this._createRegisteredResource(name, config2.title, uriOrTemplate, metadata, readCallback);
33616
+ const registeredResource = this._createRegisteredResource(name, config2.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
33565
33617
  if (cacheHint !== void 0) registeredResource.cacheHint = cacheHint;
33566
33618
  this.setResourceRequestHandlers();
33567
33619
  this.sendResourceListChanged();
33568
33620
  return registeredResource;
33569
33621
  } else {
33570
33622
  if (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);
33571
- const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config2.title, uriOrTemplate, metadata, readCallback);
33623
+ const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config2.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
33572
33624
  if (cacheHint !== void 0) registeredResourceTemplate.cacheHint = cacheHint;
33573
33625
  this.setResourceRequestHandlers();
33574
33626
  this.sendResourceListChanged();
33575
33627
  return registeredResourceTemplate;
33576
33628
  }
33577
33629
  }
33578
- _createRegisteredResource(name, title, uri, metadata, readCallback) {
33630
+ _createRegisteredResource(name, title, uri, metadata, scopeChallenge, readCallback) {
33579
33631
  const registeredResource = {
33580
33632
  name,
33581
33633
  title,
33582
33634
  metadata,
33583
33635
  readCallback,
33636
+ scopeChallenge,
33584
33637
  enabled: true,
33585
33638
  disable: () => registeredResource.update({ enabled: false }),
33586
33639
  enable: () => registeredResource.update({ enabled: true }),
@@ -33594,6 +33647,7 @@ var McpServer = class {
33594
33647
  if (updates.title !== void 0) registeredResource.title = updates.title;
33595
33648
  if (updates.metadata !== void 0) registeredResource.metadata = updates.metadata;
33596
33649
  if (updates.callback !== void 0) registeredResource.readCallback = updates.callback;
33650
+ if (updates.scopeChallenge !== void 0) registeredResource.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
33597
33651
  if (updates.enabled !== void 0) registeredResource.enabled = updates.enabled;
33598
33652
  this.sendResourceListChanged();
33599
33653
  }
@@ -33601,12 +33655,13 @@ var McpServer = class {
33601
33655
  this._registeredResources[uri] = registeredResource;
33602
33656
  return registeredResource;
33603
33657
  }
33604
- _createRegisteredResourceTemplate(name, title, template, metadata, readCallback) {
33658
+ _createRegisteredResourceTemplate(name, title, template, metadata, scopeChallenge, readCallback) {
33605
33659
  const registeredResourceTemplate = {
33606
33660
  resourceTemplate: template,
33607
33661
  title,
33608
33662
  metadata,
33609
33663
  readCallback,
33664
+ scopeChallenge,
33610
33665
  enabled: true,
33611
33666
  disable: () => registeredResourceTemplate.update({ enabled: false }),
33612
33667
  enable: () => registeredResourceTemplate.update({ enabled: true }),
@@ -33620,6 +33675,7 @@ var McpServer = class {
33620
33675
  if (updates.template !== void 0) registeredResourceTemplate.resourceTemplate = updates.template;
33621
33676
  if (updates.metadata !== void 0) registeredResourceTemplate.metadata = updates.metadata;
33622
33677
  if (updates.callback !== void 0) registeredResourceTemplate.readCallback = updates.callback;
33678
+ if (updates.scopeChallenge !== void 0) registeredResourceTemplate.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
33623
33679
  if (updates.enabled !== void 0) registeredResourceTemplate.enabled = updates.enabled;
33624
33680
  this.sendResourceListChanged();
33625
33681
  }
@@ -33629,7 +33685,7 @@ var McpServer = class {
33629
33685
  if (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();
33630
33686
  return registeredResourceTemplate;
33631
33687
  }
33632
- _createRegisteredPrompt(name, title, description, argsSchema, callback, icons, _meta) {
33688
+ _createRegisteredPrompt(name, title, description, argsSchema, callback, icons, scopeChallenge, _meta) {
33633
33689
  let currentArgsSchema = argsSchema;
33634
33690
  let currentCallback = callback;
33635
33691
  const registeredPrompt = {
@@ -33637,6 +33693,7 @@ var McpServer = class {
33637
33693
  description,
33638
33694
  argsSchema,
33639
33695
  icons,
33696
+ scopeChallenge,
33640
33697
  _meta,
33641
33698
  handler: createPromptHandler(name, argsSchema, callback),
33642
33699
  enabled: true,
@@ -33651,6 +33708,7 @@ var McpServer = class {
33651
33708
  if (updates.title !== void 0) registeredPrompt.title = updates.title;
33652
33709
  if (updates.description !== void 0) registeredPrompt.description = updates.description;
33653
33710
  if (updates.icons !== void 0) registeredPrompt.icons = updates.icons;
33711
+ if (updates.scopeChallenge !== void 0) registeredPrompt.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
33654
33712
  if (updates._meta !== void 0) registeredPrompt._meta = updates._meta;
33655
33713
  let needsHandlerRegen = false;
33656
33714
  if (updates.argsSchema !== void 0) {
@@ -33678,7 +33736,7 @@ var McpServer = class {
33678
33736
  }
33679
33737
  return registeredPrompt;
33680
33738
  }
33681
- _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, _meta, handler) {
33739
+ _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
33682
33740
  validateAndWarnToolName(name);
33683
33741
  if (inputSchema !== void 0) try {
33684
33742
  const json2 = standardSchemaToJsonSchema(inputSchema, "input");
@@ -33697,6 +33755,7 @@ var McpServer = class {
33697
33755
  annotations,
33698
33756
  icons,
33699
33757
  execution,
33758
+ scopeChallenge,
33700
33759
  _meta,
33701
33760
  handler,
33702
33761
  executor: createToolExecutor(inputSchema, handler),
@@ -33735,6 +33794,7 @@ var McpServer = class {
33735
33794
  }
33736
33795
  if (updates.annotations !== void 0) registeredTool.annotations = updates.annotations;
33737
33796
  if (updates.icons !== void 0) registeredTool.icons = updates.icons;
33797
+ if (updates.scopeChallenge !== void 0) registeredTool.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
33738
33798
  if (updates._meta !== void 0) registeredTool._meta = updates._meta;
33739
33799
  if (updates.enabled !== void 0) registeredTool.enabled = updates.enabled;
33740
33800
  this.sendToolListChanged();
@@ -33747,13 +33807,13 @@ var McpServer = class {
33747
33807
  }
33748
33808
  registerTool(name, config2, cb) {
33749
33809
  if (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);
33750
- const { title, description, inputSchema, outputSchema, annotations, icons, _meta } = config2;
33751
- return this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, _meta, cb);
33810
+ const { title, description, inputSchema, outputSchema, annotations, icons, scopeChallenge, _meta } = config2;
33811
+ return this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, scopeChallenge, _meta, cb);
33752
33812
  }
33753
33813
  registerPrompt(name, config2, cb) {
33754
33814
  if (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);
33755
- const { title, description, argsSchema, icons, _meta } = config2;
33756
- const registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, _meta);
33815
+ const { title, description, argsSchema, icons, scopeChallenge, _meta } = config2;
33816
+ const registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, scopeChallenge, _meta);
33757
33817
  this.setPromptRequestHandlers();
33758
33818
  this.sendPromptListChanged();
33759
33819
  return registeredPrompt;
@@ -33865,6 +33925,7 @@ function unwrapOptionalSchema(schema) {
33865
33925
  }
33866
33926
 
33867
33927
  // ../../node_modules/@modelcontextprotocol/server/dist/stdio.mjs
33928
+ var swallowsErrorsAfterClose = /* @__PURE__ */ Symbol("swallowsErrorsAfterClose");
33868
33929
  var StdioServerTransport = class {
33869
33930
  _readBuffer;
33870
33931
  _started = false;
@@ -33891,18 +33952,27 @@ var StdioServerTransport = class {
33891
33952
  this.onerror?.(error62);
33892
33953
  };
33893
33954
  _onstdouterror = (error62) => {
33955
+ if (this._closed) return;
33894
33956
  this.onerror?.(error62);
33895
33957
  this.close().catch(() => {
33896
33958
  });
33897
33959
  };
33960
+ _onstdinclose = () => {
33961
+ this.close().catch(() => {
33962
+ });
33963
+ };
33898
33964
  /**
33899
33965
  * Starts listening for messages on `stdin`.
33900
33966
  */
33901
33967
  async start() {
33902
33968
  if (this._started) throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
33903
33969
  this._started = true;
33970
+ for (const listener of this._stdout.listeners("error")) if (listener[swallowsErrorsAfterClose]) this._stdout.off("error", listener);
33971
+ if (this._stdin.readableEnded || this._stdin.destroyed) setImmediate(this._onstdinclose);
33904
33972
  this._stdin.on("data", this._ondata);
33905
33973
  this._stdin.on("error", this._onerror);
33974
+ this._stdin.on("end", this._onstdinclose);
33975
+ this._stdin.on("close", this._onstdinclose);
33906
33976
  this._stdout.on("error", this._onstdouterror);
33907
33977
  }
33908
33978
  processReadBuffer() {
@@ -33919,7 +33989,9 @@ var StdioServerTransport = class {
33919
33989
  this._closed = true;
33920
33990
  this._stdin.off("data", this._ondata);
33921
33991
  this._stdin.off("error", this._onerror);
33922
- this._stdout.off("error", this._onstdouterror);
33992
+ this._stdin.off("end", this._onstdinclose);
33993
+ this._stdin.off("close", this._onstdinclose);
33994
+ this._onstdouterror[swallowsErrorsAfterClose] = true;
33923
33995
  if (this._stdin.listenerCount("data") === 0) this._stdin.pause();
33924
33996
  this._readBuffer.clear();
33925
33997
  this.onclose?.();
@@ -34196,6 +34268,7 @@ function serveStdio(factory, options = {}) {
34196
34268
  return;
34197
34269
  }
34198
34270
  if (state.era === "modern" && await tryServeListen(message)) return;
34271
+ if (isTornDown()) return;
34199
34272
  state.instance.channel.deliver(message);
34200
34273
  return;
34201
34274
  }
@@ -34262,6 +34335,7 @@ function serveStdio(factory, options = {}) {
34262
34335
  };
34263
34336
  }
34264
34337
  if (await tryServeListen(message)) return;
34338
+ if (isTornDown()) return;
34265
34339
  state.instance.channel.deliver(message, { classification: opening.classification });
34266
34340
  return;
34267
34341
  case "legacy": {
@@ -34348,6 +34422,9 @@ function toError(value) {
34348
34422
  return value instanceof Error ? value : new Error(String(value));
34349
34423
  }
34350
34424
 
34425
+ // ../../node_modules/@modelcontextprotocol/server/dist/index.mjs
34426
+ var DEFAULT_MAX_REQUEST_BODY_SIZE = 4 * 1024 * 1024;
34427
+
34351
34428
  // ../../node_modules/@chrischall/mcp-utils/dist/errors/index.js
34352
34429
  var McpToolError = class extends Error {
34353
34430
  /** Actionable remediation text, when one applies. */
@@ -35484,6 +35561,7 @@ async function diagnose(err) {
35484
35561
  const isAuthError = !isTransientError && AUTH_ERROR_PATTERN.test(errText);
35485
35562
  const isGridLimitError = GRID_LIMIT_ERROR_PATTERN.test(errText);
35486
35563
  const hint = isInvalidGrant ? INVALID_GRANT_HINT : isAuthError ? AUTH_HINT : isTransientError ? TRANSIENT_HINT : isGridLimitError ? GRID_LIMIT_HINT : "";
35564
+ if (!isAuthError && !isInvalidGrant) return errorResult(`${errText}${hint}`);
35487
35565
  try {
35488
35566
  const accounts = formatAccountList(await run(["auth", "list"]));
35489
35567
  return errorResult(`${errText}
@@ -35710,6 +35788,27 @@ function authToolsFor(defaultServices) {
35710
35788
  }
35711
35789
 
35712
35790
  // ../gogcli-mcp/src/tools/calendar.ts
35791
+ var ASKS = (tool) => `Use ${tool}, which asks the user to confirm.`;
35792
+ var CALENDAR_REFUSED = {
35793
+ create: { does: "can change what guests see", instead: ASKS("gog_calendar_create") },
35794
+ add: { does: "can change what guests see", instead: ASKS("gog_calendar_create") },
35795
+ new: { does: "can change what guests see", instead: ASKS("gog_calendar_create") },
35796
+ update: { does: "can change what guests see", instead: ASKS("gog_calendar_update") },
35797
+ edit: { does: "can change what guests see", instead: ASKS("gog_calendar_update") },
35798
+ set: { does: "can change what guests see", instead: ASKS("gog_calendar_update") },
35799
+ respond: { does: "can change what guests see", instead: ASKS("gog_calendar_respond") },
35800
+ rsvp: { does: "can change what guests see", instead: ASKS("gog_calendar_respond") },
35801
+ reply: { does: "can change what guests see", instead: ASKS("gog_calendar_respond") },
35802
+ move: { does: "moves an event off guests' calendars (and can email them)", instead: ASKS("gog_calendar_move") },
35803
+ transfer: { does: "moves an event off guests' calendars (and can email them)", instead: ASKS("gog_calendar_move") },
35804
+ delete: { does: "removes an event from every guest's calendar (the whole series by default)", instead: ASKS("gog_calendar_delete") },
35805
+ del: { does: "removes an event from every guest's calendar (the whole series by default)", instead: ASKS("gog_calendar_delete") },
35806
+ rm: { does: "removes an event from every guest's calendar (the whole series by default)", instead: ASKS("gog_calendar_delete") },
35807
+ remove: { does: "removes an event from every guest's calendar (the whole series by default)", instead: ASKS("gog_calendar_delete") },
35808
+ "delete-calendar": { does: "deletes a calendar and every event on it", instead: ASKS("gog_calendar_delete_calendar") },
35809
+ "out-of-office": { does: "auto-declines invitations and notifies their organizers", instead: ASKS("gog_calendar_out_of_office") },
35810
+ ooo: { does: "auto-declines invitations and notifies their organizers", instead: ASKS("gog_calendar_out_of_office") }
35811
+ };
35713
35812
  var reminderParams = {
35714
35813
  reminders: external_exports.array(external_exports.string()).max(5).optional().describe(
35715
35814
  `Reminders as method:duration, e.g. ["popup:30m", "email:1d"]. Method is popup or email; duration accepts m/h/d (max 40320 minutes = 4 weeks). Google allows at most 5. These REPLACE the event's reminders \u2014 on update, pass an EMPTY array to drop custom reminders and go back to the calendar's defaults. Cannot be combined with noReminders.`
@@ -35827,7 +35926,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
35827
35926
  );
35828
35927
 
35829
35928
  // ../gogcli-mcp/src/server.ts
35830
- var VERSION = true ? "4.5.0" : "0.0.0";
35929
+ var VERSION = true ? "4.5.2" : "0.0.0";
35831
35930
 
35832
35931
  // ../gogcli-mcp/src/bootstrap-auth.ts
35833
35932
  import { join as join5 } from "node:path";
@@ -36120,7 +36219,7 @@ await runMcp({
36120
36219
  });
36121
36220
  /*! Bundled license information:
36122
36221
 
36123
- @modelcontextprotocol/server/dist/src-CX2iR2pK.mjs:
36222
+ @modelcontextprotocol/server/dist/src-D-y6h4N7.mjs:
36124
36223
  (*!
36125
36224
  * content-type
36126
36225
  * Copyright(c) 2015 Douglas Christopher Wilson
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-contacts",
5
5
  "display_name": "gogcli (Contacts)",
6
- "version": "4.5.0",
6
+ "version": "4.5.2",
7
7
  "description": "Extended Google Contacts for Claude via gogcli — auth + Contacts + Workspace directory (People API)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-contacts",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-contacts",
5
5
  "description": "Extended Google Contacts + People MCP server via gogcli — auth + Contacts + Workspace directory (People API)",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@chrischall/mcp-utils": "^2.6.0",
28
- "@modelcontextprotocol/server": "^2.0.0",
28
+ "@modelcontextprotocol/server": "^2.1.0",
29
29
  "zod": "^4.6.1"
30
30
  },
31
31
  "license": "MIT",