@settlemint/sdk-mcp 2.3.2-pr90f9d5ad → 2.3.2-pr9af086a1

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"),
@@ -54283,26 +54284,16 @@ var ListToolsRequestSchema = PaginatedRequestSchema.extend({
54283
54284
  var ListToolsResultSchema = PaginatedResultSchema.extend({
54284
54285
  tools: exports_external.array(ToolSchema)
54285
54286
  });
54286
- var ContentListSchema = exports_external.array(exports_external.union([
54287
- TextContentSchema,
54288
- ImageContentSchema,
54289
- AudioContentSchema,
54290
- EmbeddedResourceSchema
54291
- ]));
54292
- var CallToolUnstructuredResultSchema = ResultSchema.extend({
54293
- content: ContentListSchema,
54294
- structuredContent: exports_external.never().optional(),
54295
- isError: exports_external.optional(exports_external.boolean())
54296
- });
54297
- var CallToolStructuredResultSchema = ResultSchema.extend({
54298
- structuredContent: exports_external.object({}).passthrough(),
54299
- content: exports_external.optional(ContentListSchema),
54287
+ var CallToolResultSchema = ResultSchema.extend({
54288
+ content: exports_external.array(exports_external.union([
54289
+ TextContentSchema,
54290
+ ImageContentSchema,
54291
+ AudioContentSchema,
54292
+ EmbeddedResourceSchema
54293
+ ])).default([]),
54294
+ structuredContent: exports_external.object({}).passthrough().optional(),
54300
54295
  isError: exports_external.optional(exports_external.boolean())
54301
54296
  });
54302
- var CallToolResultSchema = exports_external.union([
54303
- CallToolUnstructuredResultSchema,
54304
- CallToolStructuredResultSchema
54305
- ]);
54306
54297
  var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
54307
54298
  toolResult: exports_external.unknown()
54308
54299
  }));
@@ -56281,23 +56272,12 @@ class McpServer {
56281
56272
  }
56282
56273
  }
56283
56274
  if (tool.outputSchema) {
56284
- if (!result.structuredContent && !result.isError) {
56285
- throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has outputSchema but returned no structuredContent`);
56286
- }
56287
- if (result.structuredContent && !result.content) {
56288
- result.content = [
56289
- {
56290
- type: "text",
56291
- text: JSON.stringify(result.structuredContent, null, 2)
56292
- }
56293
- ];
56294
- }
56295
- } else {
56296
- if (!result.content && !result.isError) {
56297
- throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has no outputSchema and must return content`);
56275
+ if (!result.structuredContent) {
56276
+ throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`);
56298
56277
  }
56299
- if (result.structuredContent) {
56300
- throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has no outputSchema but returned structuredContent`);
56278
+ const parseResult = await tool.outputSchema.safeParseAsync(result.structuredContent);
56279
+ if (!parseResult.success) {
56280
+ throw new McpError(ErrorCode.InvalidParams, `Invalid structured content for tool ${request.params.name}: ${parseResult.error.message}`);
56301
56281
  }
56302
56282
  }
56303
56283
  return result;
@@ -72475,7 +72455,7 @@ var {
72475
72455
  var package_default = {
72476
72456
  name: "@settlemint/sdk-mcp",
72477
72457
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
72478
- version: "2.3.2-pr90f9d5ad",
72458
+ version: "2.3.2-pr9af086a1",
72479
72459
  type: "module",
72480
72460
  private: false,
72481
72461
  license: "FSL-1.1-MIT",
@@ -72516,9 +72496,9 @@ var package_default = {
72516
72496
  dependencies: {
72517
72497
  "@graphql-tools/load": "8.1.0",
72518
72498
  "@graphql-tools/url-loader": "8.0.31",
72519
- "@modelcontextprotocol/sdk": "1.11.4",
72520
- "@settlemint/sdk-js": "2.3.2-pr90f9d5ad",
72521
- "@settlemint/sdk-utils": "2.3.2-pr90f9d5ad",
72499
+ "@modelcontextprotocol/sdk": "1.12.0",
72500
+ "@settlemint/sdk-js": "2.3.2-pr9af086a1",
72501
+ "@settlemint/sdk-utils": "2.3.2-pr9af086a1",
72522
72502
  "@commander-js/extra-typings": "14.0.0",
72523
72503
  commander: "14.0.0",
72524
72504
  zod: "^3.25.0"
@@ -73648,24 +73628,83 @@ ${Object.keys(rawSchemaInfo.queries).join(`
73648
73628
  };
73649
73629
 
73650
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();
73651
73688
  async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
73652
73689
  let attempt = 0;
73653
- while (attempt < maxRetries) {
73690
+ while (attempt < maxRetries + 1) {
73654
73691
  try {
73655
73692
  return await fn();
73656
73693
  } catch (e3) {
73694
+ const error35 = e3;
73657
73695
  if (typeof stopOnError === "function") {
73658
- const error35 = e3;
73659
73696
  if (stopOnError(error35)) {
73660
73697
  throw error35;
73661
73698
  }
73662
73699
  }
73663
- attempt += 1;
73664
73700
  if (attempt >= maxRetries) {
73665
73701
  throw e3;
73666
73702
  }
73667
- const jitter = Math.random();
73668
- const delay = 2 ** attempt * initialSleepTime * jitter;
73703
+ const baseDelay = 2 ** attempt * initialSleepTime;
73704
+ const jitterAmount = initialSleepTime * (Math.random() / 10);
73705
+ const delay = baseDelay + jitterAmount;
73706
+ attempt += 1;
73707
+ logger.warn(`An error occurred ${error35.message}, retrying in ${delay.toFixed(0)}ms...`);
73669
73708
  await new Promise((resolve) => setTimeout(resolve, delay));
73670
73709
  }
73671
73710
  }
@@ -78288,4 +78327,4 @@ await main().catch((error36) => {
78288
78327
  process.exit(1);
78289
78328
  });
78290
78329
 
78291
- //# debugId=D33BE72F7C91285364756E2164756E21
78330
+ //# debugId=D69F0CC79AE56C5264756E2164756E21