@enactprotocol/mcp-server 1.2.5 → 1.2.7

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
@@ -223620,10 +223620,11 @@ class Protocol {
223620
223620
  Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
223621
223621
  }
223622
223622
  _onrequest(request, extra) {
223623
- var _a, _b, _c, _d;
223623
+ var _a, _b;
223624
223624
  const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== undefined ? _a : this.fallbackRequestHandler;
223625
+ const capturedTransport = this._transport;
223625
223626
  if (handler === undefined) {
223626
- (_b = this._transport) === null || _b === undefined || _b.send({
223627
+ capturedTransport === null || capturedTransport === undefined || capturedTransport.send({
223627
223628
  jsonrpc: "2.0",
223628
223629
  id: request.id,
223629
223630
  error: {
@@ -223637,8 +223638,8 @@ class Protocol {
223637
223638
  this._requestHandlerAbortControllers.set(request.id, abortController);
223638
223639
  const fullExtra = {
223639
223640
  signal: abortController.signal,
223640
- sessionId: (_c = this._transport) === null || _c === undefined ? undefined : _c.sessionId,
223641
- _meta: (_d = request.params) === null || _d === undefined ? undefined : _d._meta,
223641
+ sessionId: capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId,
223642
+ _meta: (_b = request.params) === null || _b === undefined ? undefined : _b._meta,
223642
223643
  sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }),
223643
223644
  sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
223644
223645
  authInfo: extra === null || extra === undefined ? undefined : extra.authInfo,
@@ -223646,26 +223647,25 @@ class Protocol {
223646
223647
  requestInfo: extra === null || extra === undefined ? undefined : extra.requestInfo
223647
223648
  };
223648
223649
  Promise.resolve().then(() => handler(request, fullExtra)).then((result) => {
223649
- var _a2;
223650
223650
  if (abortController.signal.aborted) {
223651
223651
  return;
223652
223652
  }
223653
- return (_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.send({
223653
+ return capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send({
223654
223654
  result,
223655
223655
  jsonrpc: "2.0",
223656
223656
  id: request.id
223657
223657
  });
223658
223658
  }, (error) => {
223659
- var _a2, _b2;
223659
+ var _a2;
223660
223660
  if (abortController.signal.aborted) {
223661
223661
  return;
223662
223662
  }
223663
- return (_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.send({
223663
+ return capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send({
223664
223664
  jsonrpc: "2.0",
223665
223665
  id: request.id,
223666
223666
  error: {
223667
223667
  code: Number.isSafeInteger(error["code"]) ? error["code"] : ErrorCode.InternalError,
223668
- message: (_b2 = error.message) !== null && _b2 !== undefined ? _b2 : "Internal error"
223668
+ message: (_a2 = error.message) !== null && _a2 !== undefined ? _a2 : "Internal error"
223669
223669
  }
223670
223670
  });
223671
223671
  }).catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))).finally(() => {
@@ -239028,7 +239028,10 @@ class EnactCore {
239028
239028
  throw new Error(`Tool ${tool.name} does not have any signatures`);
239029
239029
  }
239030
239030
  const documentForVerification = {
239031
- command: tool.command
239031
+ command: tool.command,
239032
+ description: tool.description,
239033
+ from: tool.from,
239034
+ name: tool.name
239032
239035
  };
239033
239036
  const referenceSignature = {
239034
239037
  signature: tool.signatures[0].value,
@@ -239036,11 +239039,11 @@ class EnactCore {
239036
239039
  algorithm: tool.signatures[0].algorithm,
239037
239040
  timestamp: new Date(tool.signatures[0].created).getTime()
239038
239041
  };
239039
- const canonicalDoc = SigningService.getCanonicalDocument(documentForVerification, { includeFields: ["command"] });
239042
+ const canonicalDoc = SigningService.getCanonicalDocument(documentForVerification, { includeFields: ["command", "description", "from", "name"] });
239040
239043
  const docString = JSON.stringify(canonicalDoc);
239041
239044
  const messageHash = CryptoUtils.hash(docString);
239042
239045
  const directVerify = CryptoUtils.verify(referenceSignature.publicKey, messageHash, referenceSignature.signature);
239043
- const isValid2 = SigningService.verifyDocument(documentForVerification, referenceSignature, { includeFields: ["command"] });
239046
+ const isValid2 = SigningService.verifyDocument(documentForVerification, referenceSignature, { includeFields: ["command", "description", "from", "name"] });
239044
239047
  if (!isValid2) {
239045
239048
  throw new Error(`Tool ${tool.name} has invalid signatures`);
239046
239049
  }
package/dist/index.js.bak CHANGED
@@ -223619,10 +223619,11 @@ class Protocol {
223619
223619
  Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
223620
223620
  }
223621
223621
  _onrequest(request, extra) {
223622
- var _a, _b, _c, _d;
223622
+ var _a, _b;
223623
223623
  const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== undefined ? _a : this.fallbackRequestHandler;
223624
+ const capturedTransport = this._transport;
223624
223625
  if (handler === undefined) {
223625
- (_b = this._transport) === null || _b === undefined || _b.send({
223626
+ capturedTransport === null || capturedTransport === undefined || capturedTransport.send({
223626
223627
  jsonrpc: "2.0",
223627
223628
  id: request.id,
223628
223629
  error: {
@@ -223636,8 +223637,8 @@ class Protocol {
223636
223637
  this._requestHandlerAbortControllers.set(request.id, abortController);
223637
223638
  const fullExtra = {
223638
223639
  signal: abortController.signal,
223639
- sessionId: (_c = this._transport) === null || _c === undefined ? undefined : _c.sessionId,
223640
- _meta: (_d = request.params) === null || _d === undefined ? undefined : _d._meta,
223640
+ sessionId: capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.sessionId,
223641
+ _meta: (_b = request.params) === null || _b === undefined ? undefined : _b._meta,
223641
223642
  sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }),
223642
223643
  sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
223643
223644
  authInfo: extra === null || extra === undefined ? undefined : extra.authInfo,
@@ -223645,26 +223646,25 @@ class Protocol {
223645
223646
  requestInfo: extra === null || extra === undefined ? undefined : extra.requestInfo
223646
223647
  };
223647
223648
  Promise.resolve().then(() => handler(request, fullExtra)).then((result) => {
223648
- var _a2;
223649
223649
  if (abortController.signal.aborted) {
223650
223650
  return;
223651
223651
  }
223652
- return (_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.send({
223652
+ return capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send({
223653
223653
  result,
223654
223654
  jsonrpc: "2.0",
223655
223655
  id: request.id
223656
223656
  });
223657
223657
  }, (error) => {
223658
- var _a2, _b2;
223658
+ var _a2;
223659
223659
  if (abortController.signal.aborted) {
223660
223660
  return;
223661
223661
  }
223662
- return (_a2 = this._transport) === null || _a2 === undefined ? undefined : _a2.send({
223662
+ return capturedTransport === null || capturedTransport === undefined ? undefined : capturedTransport.send({
223663
223663
  jsonrpc: "2.0",
223664
223664
  id: request.id,
223665
223665
  error: {
223666
223666
  code: Number.isSafeInteger(error["code"]) ? error["code"] : ErrorCode.InternalError,
223667
- message: (_b2 = error.message) !== null && _b2 !== undefined ? _b2 : "Internal error"
223667
+ message: (_a2 = error.message) !== null && _a2 !== undefined ? _a2 : "Internal error"
223668
223668
  }
223669
223669
  });
223670
223670
  }).catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))).finally(() => {
@@ -239027,7 +239027,10 @@ class EnactCore {
239027
239027
  throw new Error(`Tool ${tool.name} does not have any signatures`);
239028
239028
  }
239029
239029
  const documentForVerification = {
239030
- command: tool.command
239030
+ command: tool.command,
239031
+ description: tool.description,
239032
+ from: tool.from,
239033
+ name: tool.name
239031
239034
  };
239032
239035
  const referenceSignature = {
239033
239036
  signature: tool.signatures[0].value,
@@ -239035,11 +239038,11 @@ class EnactCore {
239035
239038
  algorithm: tool.signatures[0].algorithm,
239036
239039
  timestamp: new Date(tool.signatures[0].created).getTime()
239037
239040
  };
239038
- const canonicalDoc = SigningService.getCanonicalDocument(documentForVerification, { includeFields: ["command"] });
239041
+ const canonicalDoc = SigningService.getCanonicalDocument(documentForVerification, { includeFields: ["command", "description", "from", "name"] });
239039
239042
  const docString = JSON.stringify(canonicalDoc);
239040
239043
  const messageHash = CryptoUtils.hash(docString);
239041
239044
  const directVerify = CryptoUtils.verify(referenceSignature.publicKey, messageHash, referenceSignature.signature);
239042
- const isValid2 = SigningService.verifyDocument(documentForVerification, referenceSignature, { includeFields: ["command"] });
239045
+ const isValid2 = SigningService.verifyDocument(documentForVerification, referenceSignature, { includeFields: ["command", "description", "from", "name"] });
239043
239046
  if (!isValid2) {
239044
239047
  throw new Error(`Tool ${tool.name} has invalid signatures`);
239045
239048
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enactprotocol/mcp-server",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "MCP server for the Enact Protocol - enables AI tools integration via Model Context Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "node": ">=18.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@enactprotocol/shared": "1.2.5",
41
+ "@enactprotocol/shared": "1.2.7",
42
42
  "@modelcontextprotocol/sdk": "^1.13.0",
43
43
  "zod": "^3.25.67"
44
44
  },