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