@settlemint/sdk-mcp 2.3.2-prf63bb3f0 → 2.3.2-prf6c4f06f

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
@@ -54118,7 +54118,8 @@ var PingRequestSchema = RequestSchema.extend({
54118
54118
  });
54119
54119
  var ProgressSchema = exports_external.object({
54120
54120
  progress: exports_external.number(),
54121
- total: exports_external.optional(exports_external.number())
54121
+ total: exports_external.optional(exports_external.number()),
54122
+ message: exports_external.optional(exports_external.string())
54122
54123
  }).passthrough();
54123
54124
  var ProgressNotificationSchema = NotificationSchema.extend({
54124
54125
  method: exports_external.literal("notifications/progress"),
@@ -56270,7 +56271,10 @@ class McpServer {
56270
56271
  };
56271
56272
  }
56272
56273
  }
56273
- if (tool.outputSchema && result.structuredContent) {
56274
+ if (tool.outputSchema) {
56275
+ if (!result.structuredContent) {
56276
+ throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`);
56277
+ }
56274
56278
  const parseResult = await tool.outputSchema.safeParseAsync(result.structuredContent);
56275
56279
  if (!parseResult.success) {
56276
56280
  throw new McpError(ErrorCode.InvalidParams, `Invalid structured content for tool ${request.params.name}: ${parseResult.error.message}`);
@@ -72453,7 +72457,7 @@ var {
72453
72457
  var package_default = {
72454
72458
  name: "@settlemint/sdk-mcp",
72455
72459
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
72456
- version: "2.3.2-prf63bb3f0",
72460
+ version: "2.3.2-prf6c4f06f",
72457
72461
  type: "module",
72458
72462
  private: false,
72459
72463
  license: "FSL-1.1-MIT",
@@ -72494,9 +72498,9 @@ var package_default = {
72494
72498
  dependencies: {
72495
72499
  "@graphql-tools/load": "8.1.0",
72496
72500
  "@graphql-tools/url-loader": "8.0.31",
72497
- "@modelcontextprotocol/sdk": "1.11.5",
72498
- "@settlemint/sdk-js": "2.3.2-prf63bb3f0",
72499
- "@settlemint/sdk-utils": "2.3.2-prf63bb3f0",
72501
+ "@modelcontextprotocol/sdk": "1.12.0",
72502
+ "@settlemint/sdk-js": "2.3.2-prf6c4f06f",
72503
+ "@settlemint/sdk-utils": "2.3.2-prf6c4f06f",
72500
72504
  "@commander-js/extra-typings": "14.0.0",
72501
72505
  commander: "14.0.0",
72502
72506
  zod: "^3.25.0"
@@ -73626,24 +73630,84 @@ ${Object.keys(rawSchemaInfo.queries).join(`
73626
73630
  };
73627
73631
 
73628
73632
  // ../utils/dist/http.mjs
73633
+ var maskTokens2 = (output) => {
73634
+ return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
73635
+ };
73636
+ function createLogger(options = {}) {
73637
+ const { level = "warn", prefix = "" } = options;
73638
+ const logLevels = {
73639
+ debug: 0,
73640
+ info: 1,
73641
+ warn: 2,
73642
+ error: 3,
73643
+ none: 4
73644
+ };
73645
+ const currentLevelValue = logLevels[level];
73646
+ const formatArgs = (args) => {
73647
+ if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
73648
+ return "";
73649
+ }
73650
+ const formatted = args.map((arg) => {
73651
+ if (arg instanceof Error) {
73652
+ return `
73653
+ ${arg.stack || arg.message}`;
73654
+ }
73655
+ if (typeof arg === "object" && arg !== null) {
73656
+ return `
73657
+ ${JSON.stringify(arg, null, 2)}`;
73658
+ }
73659
+ return ` ${String(arg)}`;
73660
+ }).join("");
73661
+ return `, args:${formatted}`;
73662
+ };
73663
+ const shouldLog = (level2) => {
73664
+ return logLevels[level2] >= currentLevelValue;
73665
+ };
73666
+ return {
73667
+ debug: (message, ...args) => {
73668
+ if (shouldLog("debug")) {
73669
+ console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73670
+ }
73671
+ },
73672
+ info: (message, ...args) => {
73673
+ if (shouldLog("info")) {
73674
+ console.info(`\x1B[34m${prefix}[INFO] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73675
+ }
73676
+ },
73677
+ warn: (message, ...args) => {
73678
+ if (shouldLog("warn")) {
73679
+ console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73680
+ }
73681
+ },
73682
+ error: (message, ...args) => {
73683
+ if (shouldLog("error")) {
73684
+ console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73685
+ }
73686
+ }
73687
+ };
73688
+ }
73689
+ var logger = createLogger();
73629
73690
  async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
73630
- let attempt = 0;
73631
- while (attempt < maxRetries) {
73691
+ let retries = 0;
73692
+ const maxAttempts = maxRetries + 1;
73693
+ while (retries < maxAttempts) {
73632
73694
  try {
73633
73695
  return await fn();
73634
73696
  } catch (e3) {
73697
+ const error35 = e3;
73635
73698
  if (typeof stopOnError === "function") {
73636
- const error35 = e3;
73637
73699
  if (stopOnError(error35)) {
73638
73700
  throw error35;
73639
73701
  }
73640
73702
  }
73641
- attempt += 1;
73642
- if (attempt >= maxRetries) {
73703
+ if (retries >= maxRetries) {
73643
73704
  throw e3;
73644
73705
  }
73645
- const jitter = Math.random();
73646
- const delay = 2 ** attempt * initialSleepTime * jitter;
73706
+ const baseDelay = 2 ** retries * initialSleepTime;
73707
+ const jitterAmount = initialSleepTime * (Math.random() / 10);
73708
+ const delay = baseDelay + jitterAmount;
73709
+ retries += 1;
73710
+ logger.warn(`An error occurred ${error35.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
73647
73711
  await new Promise((resolve) => setTimeout(resolve, delay));
73648
73712
  }
73649
73713
  }
@@ -76341,6 +76405,13 @@ function getPincodeVerificationChallengeResponse({
76341
76405
  }
76342
76406
  function createSettleMintClient(options) {
76343
76407
  ensureServer();
76408
+ if (options.instance === STANDALONE_INSTANCE2) {
76409
+ if (options.anonymous) {
76410
+ options.instance = "https://console.settlemint.com";
76411
+ } else {
76412
+ throw new Error("Standalone instances cannot connect to the SettleMint platform");
76413
+ }
76414
+ }
76344
76415
  const validatedOptions = options.anonymous ? validate3(exports_external2.object({
76345
76416
  ...ClientOptionsSchema.shape,
76346
76417
  accessToken: exports_external2.literal("")
@@ -78266,4 +78337,4 @@ await main().catch((error36) => {
78266
78337
  process.exit(1);
78267
78338
  });
78268
78339
 
78269
- //# debugId=501DD5B2C07D3CDC64756E2164756E21
78340
+ //# debugId=3596F71B3A0F759364756E2164756E21