@settlemint/sdk-mcp 2.3.2-pr68b82778 → 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
@@ -72455,7 +72455,7 @@ var {
72455
72455
  var package_default = {
72456
72456
  name: "@settlemint/sdk-mcp",
72457
72457
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
72458
- version: "2.3.2-pr68b82778",
72458
+ version: "2.3.2-pr6cb5dd2e",
72459
72459
  type: "module",
72460
72460
  private: false,
72461
72461
  license: "FSL-1.1-MIT",
@@ -72497,8 +72497,8 @@ var package_default = {
72497
72497
  "@graphql-tools/load": "8.1.0",
72498
72498
  "@graphql-tools/url-loader": "8.0.31",
72499
72499
  "@modelcontextprotocol/sdk": "1.12.0",
72500
- "@settlemint/sdk-js": "2.3.2-pr68b82778",
72501
- "@settlemint/sdk-utils": "2.3.2-pr68b82778",
72500
+ "@settlemint/sdk-js": "2.3.2-pr6cb5dd2e",
72501
+ "@settlemint/sdk-utils": "2.3.2-pr6cb5dd2e",
72502
72502
  "@commander-js/extra-typings": "14.0.0",
72503
72503
  commander: "14.0.0",
72504
72504
  zod: "^3.25.0"
@@ -73628,24 +73628,84 @@ ${Object.keys(rawSchemaInfo.queries).join(`
73628
73628
  };
73629
73629
 
73630
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();
73631
73688
  async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
73632
- let attempt = 0;
73633
- while (attempt < maxRetries) {
73689
+ let retries = 0;
73690
+ const maxAttempts = maxRetries + 1;
73691
+ while (retries < maxAttempts) {
73634
73692
  try {
73635
73693
  return await fn();
73636
73694
  } catch (e3) {
73695
+ const error35 = e3;
73637
73696
  if (typeof stopOnError === "function") {
73638
- const error35 = e3;
73639
73697
  if (stopOnError(error35)) {
73640
73698
  throw error35;
73641
73699
  }
73642
73700
  }
73643
- attempt += 1;
73644
- if (attempt >= maxRetries) {
73701
+ if (retries >= maxRetries) {
73645
73702
  throw e3;
73646
73703
  }
73647
- const jitter = Math.random();
73648
- 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})...`);
73649
73709
  await new Promise((resolve) => setTimeout(resolve, delay));
73650
73710
  }
73651
73711
  }
@@ -78268,4 +78328,4 @@ await main().catch((error36) => {
78268
78328
  process.exit(1);
78269
78329
  });
78270
78330
 
78271
- //# debugId=D4FC6B65D8F3A2B064756E2164756E21
78331
+ //# debugId=18DC1F03720E8E3664756E2164756E21