@settlemint/sdk-mcp 2.4.0-pr7c98613c → 2.4.0-pr7dabb22d

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/mcp.js CHANGED
@@ -16722,11 +16722,9 @@ var require_websocket_server = __commonJS((exports, module) => {
16722
16722
  abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
16723
16723
  return;
16724
16724
  }
16725
- if (version !== 13 && version !== 8) {
16725
+ if (version !== 8 && version !== 13) {
16726
16726
  const message = "Missing or invalid Sec-WebSocket-Version header";
16727
- abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
16728
- "Sec-WebSocket-Version": "13, 8"
16729
- });
16727
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
16730
16728
  return;
16731
16729
  }
16732
16730
  if (!this.shouldHandle(req)) {
@@ -16865,13 +16863,13 @@ var require_websocket_server = __commonJS((exports, module) => {
16865
16863
  \r
16866
16864
  ` + message);
16867
16865
  }
16868
- function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) {
16866
+ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
16869
16867
  if (server.listenerCount("wsClientError")) {
16870
16868
  const err = new Error(message);
16871
16869
  Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
16872
16870
  server.emit("wsClientError", err, socket, req);
16873
16871
  } else {
16874
- abortHandshake(socket, code, message, headers);
16872
+ abortHandshake(socket, code, message);
16875
16873
  }
16876
16874
  }
16877
16875
  });
@@ -59941,21 +59939,14 @@ class Protocol {
59941
59939
  }
59942
59940
  }
59943
59941
  async connect(transport) {
59944
- var _a, _b, _c;
59945
59942
  this._transport = transport;
59946
- const _onclose = (_a = this.transport) === null || _a === undefined ? undefined : _a.onclose;
59947
59943
  this._transport.onclose = () => {
59948
- _onclose === null || _onclose === undefined || _onclose();
59949
59944
  this._onclose();
59950
59945
  };
59951
- const _onerror = (_b = this.transport) === null || _b === undefined ? undefined : _b.onerror;
59952
59946
  this._transport.onerror = (error) => {
59953
- _onerror === null || _onerror === undefined || _onerror(error);
59954
59947
  this._onerror(error);
59955
59948
  };
59956
- const _onmessage = (_c = this._transport) === null || _c === undefined ? undefined : _c.onmessage;
59957
59949
  this._transport.onmessage = (message, extra) => {
59958
- _onmessage === null || _onmessage === undefined || _onmessage(message, extra);
59959
59950
  if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
59960
59951
  this._onresponse(message);
59961
59952
  } else if (isJSONRPCRequest(message)) {
@@ -60015,8 +60006,7 @@ class Protocol {
60015
60006
  sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }),
60016
60007
  sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
60017
60008
  authInfo: extra === null || extra === undefined ? undefined : extra.authInfo,
60018
- requestId: request.id,
60019
- requestInfo: extra === null || extra === undefined ? undefined : extra.requestInfo
60009
+ requestId: request.id
60020
60010
  };
60021
60011
  Promise.resolve().then(() => handler(request, fullExtra)).then((result) => {
60022
60012
  var _a2;
@@ -61731,7 +61721,7 @@ class McpServer {
61731
61721
  };
61732
61722
  }
61733
61723
  }
61734
- if (tool.outputSchema && !result.isError) {
61724
+ if (tool.outputSchema) {
61735
61725
  if (!result.structuredContent) {
61736
61726
  throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`);
61737
61727
  }
@@ -62161,8 +62151,7 @@ class McpServer {
62161
62151
  }
62162
62152
  }
62163
62153
  var EMPTY_OBJECT_JSON_SCHEMA = {
62164
- type: "object",
62165
- properties: {}
62154
+ type: "object"
62166
62155
  };
62167
62156
  function isZodRawShape(obj) {
62168
62157
  if (typeof obj !== "object" || obj === null)
@@ -73575,7 +73564,7 @@ function tryParseJson(value, defaultValue = null) {
73575
73564
  return defaultValue;
73576
73565
  }
73577
73566
  return parsed;
73578
- } catch (_err) {
73567
+ } catch (err) {
73579
73568
  return defaultValue;
73580
73569
  }
73581
73570
  }
@@ -90316,7 +90305,7 @@ function tryParseJson2(value, defaultValue = null) {
90316
90305
  return defaultValue;
90317
90306
  }
90318
90307
  return parsed;
90319
- } catch (_err) {
90308
+ } catch (err) {
90320
90309
  return defaultValue;
90321
90310
  }
90322
90311
  }
@@ -90400,7 +90389,7 @@ var {
90400
90389
  var package_default = {
90401
90390
  name: "@settlemint/sdk-mcp",
90402
90391
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
90403
- version: "2.4.0-pr7c98613c",
90392
+ version: "2.4.0-pr7dabb22d",
90404
90393
  type: "module",
90405
90394
  private: false,
90406
90395
  license: "FSL-1.1-MIT",
@@ -90419,9 +90408,7 @@ var package_default = {
90419
90408
  url: "https://github.com/settlemint/sdk/issues",
90420
90409
  email: "support@settlemint.com"
90421
90410
  },
90422
- files: [
90423
- "dist"
90424
- ],
90411
+ files: ["dist"],
90425
90412
  exports: {
90426
90413
  "./*": {
90427
90414
  types: "./dist/*.d.ts",
@@ -90443,9 +90430,9 @@ var package_default = {
90443
90430
  dependencies: {
90444
90431
  "@graphql-tools/load": "8.1.0",
90445
90432
  "@graphql-tools/url-loader": "8.0.31",
90446
- "@modelcontextprotocol/sdk": "1.13.3",
90447
- "@settlemint/sdk-js": "2.4.0-pr7c98613c",
90448
- "@settlemint/sdk-utils": "2.4.0-pr7c98613c",
90433
+ "@modelcontextprotocol/sdk": "1.13.1",
90434
+ "@settlemint/sdk-js": "2.4.0-pr7dabb22d",
90435
+ "@settlemint/sdk-utils": "2.4.0-pr7dabb22d",
90449
90436
  "@commander-js/extra-typings": "14.0.0",
90450
90437
  commander: "14.0.0",
90451
90438
  zod: "^3.25.0"
@@ -91276,7 +91263,7 @@ var processFieldTypes = (fields2, schema, collectedTypes) => {
91276
91263
  }
91277
91264
  };
91278
91265
  var collectCustomTypes = (type, schema, collectedTypes = new Set) => {
91279
- const typeName = type.toString().replace(/[[\]!]/g, "");
91266
+ const typeName = type.toString().replace(/[\[\]!]/g, "");
91280
91267
  if (collectedTypes.has(typeName) || ["String", "Int", "Float", "Boolean", "ID"].includes(typeName)) {
91281
91268
  return collectedTypes;
91282
91269
  }
@@ -103570,9 +103557,8 @@ var workspaceList = (gqlClient) => {
103570
103557
  const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
103571
103558
  const allWorkspaces = workspaces.reduce((acc, workspace) => {
103572
103559
  acc.push(workspace);
103573
- if (workspace.childWorkspaces) {
103560
+ if (workspace.childWorkspaces)
103574
103561
  acc.push(...workspace.childWorkspaces);
103575
- }
103576
103562
  return acc;
103577
103563
  }, []);
103578
103564
  return allWorkspaces.sort((a3, b) => a3.name.localeCompare(b.name));
@@ -103599,9 +103585,8 @@ var workspaceDelete = (gqlClient) => {
103599
103585
  var workspaceAddCredits = (gqlClient) => {
103600
103586
  return async (workspaceId, amount) => {
103601
103587
  const id = validate3(IdSchema2, workspaceId);
103602
- if (amount <= 0) {
103588
+ if (amount <= 0)
103603
103589
  throw new Error("Credit amount must be a positive number");
103604
- }
103605
103590
  const { addCredits: result } = await gqlClient.request(addCredits, {
103606
103591
  workspaceId: id,
103607
103592
  amount
@@ -103723,9 +103708,8 @@ var applicationAccessTokenCreate = (gqlClient) => {
103723
103708
  ...otherArgs,
103724
103709
  applicationId: application.id
103725
103710
  });
103726
- if (!applicationAccessToken.token) {
103711
+ if (!applicationAccessToken.token)
103727
103712
  throw new Error("Failed to create application access token");
103728
- }
103729
103713
  return applicationAccessToken.token;
103730
103714
  };
103731
103715
  };
@@ -103738,7 +103722,7 @@ function setClusterServiceDefaults(args) {
103738
103722
  }
103739
103723
  function setNetworkDefaults(args) {
103740
103724
  const clusterServiceArgs = setClusterServiceDefaults(args);
103741
- if (args.consensusAlgorithm === "BESU_QBFT") {
103725
+ if (args.consensusAlgorithm === "BESU_QBFT")
103742
103726
  return {
103743
103727
  ...clusterServiceArgs,
103744
103728
  chainId: args.chainId ?? 46040,
@@ -103748,7 +103732,6 @@ function setNetworkDefaults(args) {
103748
103732
  gasPrice: args.gasPrice ?? 0,
103749
103733
  secondsPerBlock: args.secondsPerBlock ?? 2
103750
103734
  };
103751
- }
103752
103735
  return clusterServiceArgs;
103753
103736
  }
103754
103737
  var BlockchainNetworkFragment = graphql(`
@@ -105163,30 +105146,26 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
105163
105146
  }
105164
105147
  });
105165
105148
  if (!response.ok) {
105166
- if (response.status === 404) {
105149
+ if (response.status === 404)
105167
105150
  throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
105168
- }
105169
105151
  throw new Error("Failed to get verification challenge");
105170
105152
  }
105171
105153
  const verificationChallenges = await response.json();
105172
105154
  return verificationChallenges;
105173
105155
  }
105174
105156
  function getPincodeVerificationChallengeResponse({ verificationChallenge, pincode }) {
105175
- if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {
105157
+ if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
105176
105158
  throw new Error("Could not authenticate pin code, invalid challenge format");
105177
- }
105178
105159
  const { secret, salt } = verificationChallenge.challenge;
105179
105160
  return generateResponse(pincode, salt, secret);
105180
105161
  }
105181
105162
  function createSettleMintClient(options) {
105182
105163
  ensureServer();
105183
- if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2) {
105184
- if (options.anonymous) {
105164
+ if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2)
105165
+ if (options.anonymous)
105185
105166
  options.instance = "https://console.settlemint.com";
105186
- } else {
105167
+ else
105187
105168
  throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
105188
- }
105189
- }
105190
105169
  const validatedOptions = options.anonymous ? validate3(exports_external2.object({
105191
105170
  ...ClientOptionsSchema.shape,
105192
105171
  accessToken: exports_external2.literal("")
@@ -107118,4 +107097,4 @@ await main().catch((error41) => {
107118
107097
  process.exit(1);
107119
107098
  });
107120
107099
 
107121
- //# debugId=A8C8B6BCBC7FC17E64756E2164756E21
107100
+ //# debugId=769FE23399735C8164756E2164756E21