@settlemint/sdk-mcp 2.3.2-pr47750fa1 → 2.3.2-pr588e13f8
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 +71 -11
- package/dist/mcp.js.map +3 -3
- package/package.json +3 -3
package/dist/mcp.js
CHANGED
|
@@ -72457,7 +72457,7 @@ var {
|
|
|
72457
72457
|
var package_default = {
|
|
72458
72458
|
name: "@settlemint/sdk-mcp",
|
|
72459
72459
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
72460
|
-
version: "2.3.2-
|
|
72460
|
+
version: "2.3.2-pr588e13f8",
|
|
72461
72461
|
type: "module",
|
|
72462
72462
|
private: false,
|
|
72463
72463
|
license: "FSL-1.1-MIT",
|
|
@@ -72499,8 +72499,8 @@ var package_default = {
|
|
|
72499
72499
|
"@graphql-tools/load": "8.1.0",
|
|
72500
72500
|
"@graphql-tools/url-loader": "8.0.31",
|
|
72501
72501
|
"@modelcontextprotocol/sdk": "1.12.0",
|
|
72502
|
-
"@settlemint/sdk-js": "2.3.2-
|
|
72503
|
-
"@settlemint/sdk-utils": "2.3.2-
|
|
72502
|
+
"@settlemint/sdk-js": "2.3.2-pr588e13f8",
|
|
72503
|
+
"@settlemint/sdk-utils": "2.3.2-pr588e13f8",
|
|
72504
72504
|
"@commander-js/extra-typings": "14.0.0",
|
|
72505
72505
|
commander: "14.0.0",
|
|
72506
72506
|
zod: "^3.25.0"
|
|
@@ -73630,24 +73630,84 @@ ${Object.keys(rawSchemaInfo.queries).join(`
|
|
|
73630
73630
|
};
|
|
73631
73631
|
|
|
73632
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();
|
|
73633
73690
|
async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
|
|
73634
|
-
let
|
|
73635
|
-
|
|
73691
|
+
let retries = 0;
|
|
73692
|
+
const maxAttempts = maxRetries + 1;
|
|
73693
|
+
while (retries < maxAttempts) {
|
|
73636
73694
|
try {
|
|
73637
73695
|
return await fn();
|
|
73638
73696
|
} catch (e3) {
|
|
73697
|
+
const error35 = e3;
|
|
73639
73698
|
if (typeof stopOnError === "function") {
|
|
73640
|
-
const error35 = e3;
|
|
73641
73699
|
if (stopOnError(error35)) {
|
|
73642
73700
|
throw error35;
|
|
73643
73701
|
}
|
|
73644
73702
|
}
|
|
73645
|
-
|
|
73646
|
-
if (attempt >= maxRetries) {
|
|
73703
|
+
if (retries >= maxRetries) {
|
|
73647
73704
|
throw e3;
|
|
73648
73705
|
}
|
|
73649
|
-
const
|
|
73650
|
-
const
|
|
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})...`);
|
|
73651
73711
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
73652
73712
|
}
|
|
73653
73713
|
}
|
|
@@ -78277,4 +78337,4 @@ await main().catch((error36) => {
|
|
|
78277
78337
|
process.exit(1);
|
|
78278
78338
|
});
|
|
78279
78339
|
|
|
78280
|
-
//# debugId=
|
|
78340
|
+
//# debugId=89301E8C3B3A424464756E2164756E21
|