open-mcp-app 0.0.13 → 0.0.14

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.
@@ -403,7 +403,7 @@ var ChatGptWebHostClient = class _ChatGptWebHostClient extends Subscribable {
403
403
  }
404
404
  };
405
405
 
406
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
406
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
407
407
  import * as z3rt from "zod/v3";
408
408
  import * as z4mini from "zod/v4-mini";
409
409
  function isZ4Schema(s2) {
@@ -468,7 +468,7 @@ function getLiteralValue(schema) {
468
468
  return void 0;
469
469
  }
470
470
 
471
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
471
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
472
472
  import * as z from "zod/v4";
473
473
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
474
474
  var JSONRPC_VERSION = "2.0";
@@ -1973,27 +1973,27 @@ var UrlElicitationRequiredError = class extends McpError {
1973
1973
  }
1974
1974
  };
1975
1975
 
1976
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
1976
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
1977
1977
  function isTerminal(status) {
1978
1978
  return status === "completed" || status === "failed" || status === "cancelled";
1979
1979
  }
1980
1980
 
1981
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
1981
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
1982
1982
  import * as z4mini2 from "zod/v4-mini";
1983
1983
 
1984
- // ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
1984
+ // node_modules/zod-to-json-schema/dist/esm/selectParser.js
1985
1985
  import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod/v3";
1986
1986
 
1987
- // ../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js
1987
+ // node_modules/zod-to-json-schema/dist/esm/parsers/array.js
1988
1988
  import { ZodFirstPartyTypeKind } from "zod/v3";
1989
1989
 
1990
- // ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
1990
+ // node_modules/zod-to-json-schema/dist/esm/parsers/record.js
1991
1991
  import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod/v3";
1992
1992
 
1993
- // ../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js
1993
+ // node_modules/zod-to-json-schema/dist/esm/parsers/string.js
1994
1994
  var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
1995
1995
 
1996
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
1996
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
1997
1997
  function getMethodLiteral(schema) {
1998
1998
  const shape = getObjectShape(schema);
1999
1999
  const methodSchema = shape?.method;
@@ -2014,7 +2014,7 @@ function parseWithCompat(schema, data) {
2014
2014
  return result.data;
2015
2015
  }
2016
2016
 
2017
- // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
2017
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
2018
2018
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
2019
2019
  var Protocol = class {
2020
2020
  constructor(_options) {
@@ -2191,6 +2191,9 @@ var Protocol = class {
2191
2191
  * 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.
2192
2192
  */
2193
2193
  async connect(transport) {
2194
+ if (this._transport) {
2195
+ throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
2196
+ }
2194
2197
  this._transport = transport;
2195
2198
  const _onclose = this.transport?.onclose;
2196
2199
  this._transport.onclose = () => {
@@ -2223,6 +2226,10 @@ var Protocol = class {
2223
2226
  this._progressHandlers.clear();
2224
2227
  this._taskProgressTokens.clear();
2225
2228
  this._pendingDebouncedNotifications.clear();
2229
+ for (const controller of this._requestHandlerAbortControllers.values()) {
2230
+ controller.abort();
2231
+ }
2232
+ this._requestHandlerAbortControllers.clear();
2226
2233
  const error = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
2227
2234
  this._transport = void 0;
2228
2235
  this.onclose?.();
@@ -2273,6 +2280,8 @@ var Protocol = class {
2273
2280
  sessionId: capturedTransport?.sessionId,
2274
2281
  _meta: request.params?._meta,
2275
2282
  sendNotification: async (notification) => {
2283
+ if (abortController.signal.aborted)
2284
+ return;
2276
2285
  const notificationOptions = { relatedRequestId: request.id };
2277
2286
  if (relatedTaskId) {
2278
2287
  notificationOptions.relatedTask = { taskId: relatedTaskId };
@@ -2280,6 +2289,9 @@ var Protocol = class {
2280
2289
  await this.notification(notification, notificationOptions);
2281
2290
  },
2282
2291
  sendRequest: async (r, resultSchema, options) => {
2292
+ if (abortController.signal.aborted) {
2293
+ throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
2294
+ }
2283
2295
  const requestOptions = { ...options, relatedRequestId: request.id };
2284
2296
  if (relatedTaskId && !requestOptions.relatedTask) {
2285
2297
  requestOptions.relatedTask = { taskId: relatedTaskId };
@@ -2931,7 +2943,7 @@ var Protocol = class {
2931
2943
  }
2932
2944
  };
2933
2945
 
2934
- // ../../node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js
2946
+ // node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js
2935
2947
  var S4 = Object.defineProperty;
2936
2948
  var d = (r, v) => {
2937
2949
  for (var o in v) S4(r, o, { get: v[o], enumerable: true, configurable: true, set: ($) => v[o] = () => $ });