@settlemint/sdk-mcp 2.3.2-pr38014794 → 2.3.2-pr3dad35bd
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 +82 -13
- package/dist/mcp.js.map +6 -6
- package/package.json +3 -3
package/dist/mcp.js
CHANGED
|
@@ -72278,8 +72278,9 @@ var UrlPathSchema = exports_external2.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[
|
|
|
72278
72278
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
72279
72279
|
});
|
|
72280
72280
|
var UrlOrPathSchema = exports_external2.union([UrlSchema, UrlPathSchema]);
|
|
72281
|
+
var STANDALONE_INSTANCE = "standalone";
|
|
72281
72282
|
var DotEnvSchema = exports_external2.object({
|
|
72282
|
-
SETTLEMINT_INSTANCE: UrlSchema.default("https://console.settlemint.com"),
|
|
72283
|
+
SETTLEMINT_INSTANCE: exports_external2.union([UrlSchema, exports_external2.literal(STANDALONE_INSTANCE)]).default("https://console.settlemint.com"),
|
|
72283
72284
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema.optional(),
|
|
72284
72285
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema.optional(),
|
|
72285
72286
|
SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
|
|
@@ -72388,8 +72389,9 @@ var UrlPathSchema2 = exports_external2.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/
|
|
|
72388
72389
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
72389
72390
|
});
|
|
72390
72391
|
var UrlOrPathSchema2 = exports_external2.union([UrlSchema2, UrlPathSchema2]);
|
|
72392
|
+
var STANDALONE_INSTANCE2 = "standalone";
|
|
72391
72393
|
var DotEnvSchema2 = exports_external2.object({
|
|
72392
|
-
SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
|
|
72394
|
+
SETTLEMINT_INSTANCE: exports_external2.union([UrlSchema2, exports_external2.literal(STANDALONE_INSTANCE2)]).default("https://console.settlemint.com"),
|
|
72393
72395
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
|
|
72394
72396
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
|
|
72395
72397
|
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
|
@@ -72455,7 +72457,7 @@ var {
|
|
|
72455
72457
|
var package_default = {
|
|
72456
72458
|
name: "@settlemint/sdk-mcp",
|
|
72457
72459
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
72458
|
-
version: "2.3.2-
|
|
72460
|
+
version: "2.3.2-pr3dad35bd",
|
|
72459
72461
|
type: "module",
|
|
72460
72462
|
private: false,
|
|
72461
72463
|
license: "FSL-1.1-MIT",
|
|
@@ -72497,8 +72499,8 @@ var package_default = {
|
|
|
72497
72499
|
"@graphql-tools/load": "8.1.0",
|
|
72498
72500
|
"@graphql-tools/url-loader": "8.0.31",
|
|
72499
72501
|
"@modelcontextprotocol/sdk": "1.12.0",
|
|
72500
|
-
"@settlemint/sdk-js": "2.3.2-
|
|
72501
|
-
"@settlemint/sdk-utils": "2.3.2-
|
|
72502
|
+
"@settlemint/sdk-js": "2.3.2-pr3dad35bd",
|
|
72503
|
+
"@settlemint/sdk-utils": "2.3.2-pr3dad35bd",
|
|
72502
72504
|
"@commander-js/extra-typings": "14.0.0",
|
|
72503
72505
|
commander: "14.0.0",
|
|
72504
72506
|
zod: "^3.25.0"
|
|
@@ -73628,24 +73630,84 @@ ${Object.keys(rawSchemaInfo.queries).join(`
|
|
|
73628
73630
|
};
|
|
73629
73631
|
|
|
73630
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();
|
|
73631
73690
|
async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
|
|
73632
|
-
let
|
|
73633
|
-
|
|
73691
|
+
let retries = 0;
|
|
73692
|
+
const maxAttempts = maxRetries + 1;
|
|
73693
|
+
while (retries < maxAttempts) {
|
|
73634
73694
|
try {
|
|
73635
73695
|
return await fn();
|
|
73636
73696
|
} catch (e3) {
|
|
73697
|
+
const error35 = e3;
|
|
73637
73698
|
if (typeof stopOnError === "function") {
|
|
73638
|
-
const error35 = e3;
|
|
73639
73699
|
if (stopOnError(error35)) {
|
|
73640
73700
|
throw error35;
|
|
73641
73701
|
}
|
|
73642
73702
|
}
|
|
73643
|
-
|
|
73644
|
-
if (attempt >= maxRetries) {
|
|
73703
|
+
if (retries >= maxRetries) {
|
|
73645
73704
|
throw e3;
|
|
73646
73705
|
}
|
|
73647
|
-
const
|
|
73648
|
-
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})...`);
|
|
73649
73711
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
73650
73712
|
}
|
|
73651
73713
|
}
|
|
@@ -76343,6 +76405,13 @@ function getPincodeVerificationChallengeResponse({
|
|
|
76343
76405
|
}
|
|
76344
76406
|
function createSettleMintClient(options) {
|
|
76345
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
|
+
}
|
|
76346
76415
|
const validatedOptions = options.anonymous ? validate3(exports_external2.object({
|
|
76347
76416
|
...ClientOptionsSchema.shape,
|
|
76348
76417
|
accessToken: exports_external2.literal("")
|
|
@@ -78268,4 +78337,4 @@ await main().catch((error36) => {
|
|
|
78268
78337
|
process.exit(1);
|
|
78269
78338
|
});
|
|
78270
78339
|
|
|
78271
|
-
//# debugId=
|
|
78340
|
+
//# debugId=E31DA8FE0C6E704364756E2164756E21
|