@settlemint/sdk-mcp 2.3.2-pr6c3d348a → 2.3.2-pr6cb5dd2e

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}`);
@@ -72274,9 +72278,8 @@ var UrlPathSchema = exports_external2.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[
72274
72278
  message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
72275
72279
  });
72276
72280
  var UrlOrPathSchema = exports_external2.union([UrlSchema, UrlPathSchema]);
72277
- var STANDALONE_INSTANCE = "standalone";
72278
72281
  var DotEnvSchema = exports_external2.object({
72279
- SETTLEMINT_INSTANCE: exports_external2.union([UrlSchema, exports_external2.literal(STANDALONE_INSTANCE)]).default("https://console.settlemint.com"),
72282
+ SETTLEMINT_INSTANCE: UrlSchema.default("https://console.settlemint.com"),
72280
72283
  SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema.optional(),
72281
72284
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema.optional(),
72282
72285
  SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
@@ -72385,9 +72388,8 @@ var UrlPathSchema2 = exports_external2.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/
72385
72388
  message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
72386
72389
  });
72387
72390
  var UrlOrPathSchema2 = exports_external2.union([UrlSchema2, UrlPathSchema2]);
72388
- var STANDALONE_INSTANCE2 = "standalone";
72389
72391
  var DotEnvSchema2 = exports_external2.object({
72390
- SETTLEMINT_INSTANCE: exports_external2.union([UrlSchema2, exports_external2.literal(STANDALONE_INSTANCE2)]).default("https://console.settlemint.com"),
72392
+ SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
72391
72393
  SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
72392
72394
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
72393
72395
  SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
@@ -72453,7 +72455,7 @@ var {
72453
72455
  var package_default = {
72454
72456
  name: "@settlemint/sdk-mcp",
72455
72457
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
72456
- version: "2.3.2-pr6c3d348a",
72458
+ version: "2.3.2-pr6cb5dd2e",
72457
72459
  type: "module",
72458
72460
  private: false,
72459
72461
  license: "FSL-1.1-MIT",
@@ -72494,9 +72496,9 @@ var package_default = {
72494
72496
  dependencies: {
72495
72497
  "@graphql-tools/load": "8.1.0",
72496
72498
  "@graphql-tools/url-loader": "8.0.31",
72497
- "@modelcontextprotocol/sdk": "1.11.5",
72498
- "@settlemint/sdk-js": "2.3.2-pr6c3d348a",
72499
- "@settlemint/sdk-utils": "2.3.2-pr6c3d348a",
72499
+ "@modelcontextprotocol/sdk": "1.12.0",
72500
+ "@settlemint/sdk-js": "2.3.2-pr6cb5dd2e",
72501
+ "@settlemint/sdk-utils": "2.3.2-pr6cb5dd2e",
72500
72502
  "@commander-js/extra-typings": "14.0.0",
72501
72503
  commander: "14.0.0",
72502
72504
  zod: "^3.25.0"
@@ -73626,24 +73628,84 @@ ${Object.keys(rawSchemaInfo.queries).join(`
73626
73628
  };
73627
73629
 
73628
73630
  // ../utils/dist/http.mjs
73631
+ var maskTokens2 = (output) => {
73632
+ return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
73633
+ };
73634
+ function createLogger(options = {}) {
73635
+ const { level = "warn", prefix = "" } = options;
73636
+ const logLevels = {
73637
+ debug: 0,
73638
+ info: 1,
73639
+ warn: 2,
73640
+ error: 3,
73641
+ none: 4
73642
+ };
73643
+ const currentLevelValue = logLevels[level];
73644
+ const formatArgs = (args) => {
73645
+ if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
73646
+ return "";
73647
+ }
73648
+ const formatted = args.map((arg) => {
73649
+ if (arg instanceof Error) {
73650
+ return `
73651
+ ${arg.stack || arg.message}`;
73652
+ }
73653
+ if (typeof arg === "object" && arg !== null) {
73654
+ return `
73655
+ ${JSON.stringify(arg, null, 2)}`;
73656
+ }
73657
+ return ` ${String(arg)}`;
73658
+ }).join("");
73659
+ return `, args:${formatted}`;
73660
+ };
73661
+ const shouldLog = (level2) => {
73662
+ return logLevels[level2] >= currentLevelValue;
73663
+ };
73664
+ return {
73665
+ debug: (message, ...args) => {
73666
+ if (shouldLog("debug")) {
73667
+ console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73668
+ }
73669
+ },
73670
+ info: (message, ...args) => {
73671
+ if (shouldLog("info")) {
73672
+ console.info(`\x1B[34m${prefix}[INFO] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73673
+ }
73674
+ },
73675
+ warn: (message, ...args) => {
73676
+ if (shouldLog("warn")) {
73677
+ console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73678
+ }
73679
+ },
73680
+ error: (message, ...args) => {
73681
+ if (shouldLog("error")) {
73682
+ console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens2(message)}${maskTokens2(formatArgs(args))}\x1B[0m`);
73683
+ }
73684
+ }
73685
+ };
73686
+ }
73687
+ var logger = createLogger();
73629
73688
  async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
73630
- let attempt = 0;
73631
- while (attempt < maxRetries) {
73689
+ let retries = 0;
73690
+ const maxAttempts = maxRetries + 1;
73691
+ while (retries < maxAttempts) {
73632
73692
  try {
73633
73693
  return await fn();
73634
73694
  } catch (e3) {
73695
+ const error35 = e3;
73635
73696
  if (typeof stopOnError === "function") {
73636
- const error35 = e3;
73637
73697
  if (stopOnError(error35)) {
73638
73698
  throw error35;
73639
73699
  }
73640
73700
  }
73641
- attempt += 1;
73642
- if (attempt >= maxRetries) {
73701
+ if (retries >= maxRetries) {
73643
73702
  throw e3;
73644
73703
  }
73645
- const jitter = Math.random();
73646
- const delay = 2 ** attempt * initialSleepTime * jitter;
73704
+ const baseDelay = 2 ** retries * initialSleepTime;
73705
+ const jitterAmount = initialSleepTime * (Math.random() / 10);
73706
+ const delay = baseDelay + jitterAmount;
73707
+ retries += 1;
73708
+ logger.warn(`An error occurred ${error35.message}, retrying in ${delay.toFixed(0)}ms (retry ${retries} of ${maxRetries})...`);
73647
73709
  await new Promise((resolve) => setTimeout(resolve, delay));
73648
73710
  }
73649
73711
  }
@@ -78266,4 +78328,4 @@ await main().catch((error36) => {
78266
78328
  process.exit(1);
78267
78329
  });
78268
78330
 
78269
- //# debugId=5EEDF6987617442864756E2164756E21
78331
+ //# debugId=18DC1F03720E8E3664756E2164756E21