@kentico/management-api-mcp 31.1.0-preview → 31.1.2-preview
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 +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24322,6 +24322,9 @@ var Protocol = class {
|
|
|
24322
24322
|
* 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.
|
|
24323
24323
|
*/
|
|
24324
24324
|
async connect(transport2) {
|
|
24325
|
+
if (this._transport) {
|
|
24326
|
+
throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
|
|
24327
|
+
}
|
|
24325
24328
|
this._transport = transport2;
|
|
24326
24329
|
const _onclose = this.transport?.onclose;
|
|
24327
24330
|
this._transport.onclose = () => {
|
|
@@ -24354,6 +24357,10 @@ var Protocol = class {
|
|
|
24354
24357
|
this._progressHandlers.clear();
|
|
24355
24358
|
this._taskProgressTokens.clear();
|
|
24356
24359
|
this._pendingDebouncedNotifications.clear();
|
|
24360
|
+
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
24361
|
+
controller.abort();
|
|
24362
|
+
}
|
|
24363
|
+
this._requestHandlerAbortControllers.clear();
|
|
24357
24364
|
const error2 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
|
|
24358
24365
|
this._transport = void 0;
|
|
24359
24366
|
this.onclose?.();
|
|
@@ -24404,6 +24411,8 @@ var Protocol = class {
|
|
|
24404
24411
|
sessionId: capturedTransport?.sessionId,
|
|
24405
24412
|
_meta: request.params?._meta,
|
|
24406
24413
|
sendNotification: async (notification) => {
|
|
24414
|
+
if (abortController.signal.aborted)
|
|
24415
|
+
return;
|
|
24407
24416
|
const notificationOptions = { relatedRequestId: request.id };
|
|
24408
24417
|
if (relatedTaskId) {
|
|
24409
24418
|
notificationOptions.relatedTask = { taskId: relatedTaskId };
|
|
@@ -24411,6 +24420,9 @@ var Protocol = class {
|
|
|
24411
24420
|
await this.notification(notification, notificationOptions);
|
|
24412
24421
|
},
|
|
24413
24422
|
sendRequest: async (r, resultSchema, options) => {
|
|
24423
|
+
if (abortController.signal.aborted) {
|
|
24424
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
24425
|
+
}
|
|
24414
24426
|
const requestOptions = { ...options, relatedRequestId: request.id };
|
|
24415
24427
|
if (relatedTaskId && !requestOptions.relatedTask) {
|
|
24416
24428
|
requestOptions.relatedTask = { taskId: relatedTaskId };
|
package/package.json
CHANGED