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