@payments-ai/mcp 2.6.0 → 2.7.0
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/main.http.js +98 -77
- package/package.json +1 -1
package/dist/main.http.js
CHANGED
|
@@ -274,7 +274,11 @@ function isExplicitGrantScope(scope) {
|
|
|
274
274
|
}
|
|
275
275
|
var DEFAULT_OAUTH_SCOPES = OAUTH_CONSENT_READ_SCOPES.filter((scope) => !isExplicitGrantScope(scope));
|
|
276
276
|
var OAUTH_RESPONSE_TYPES_SUPPORTED = ["code"];
|
|
277
|
-
var
|
|
277
|
+
var OAUTH_DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
278
|
+
var OAUTH_GRANT_TYPES_SUPPORTED = [
|
|
279
|
+
"authorization_code",
|
|
280
|
+
OAUTH_DEVICE_CODE_GRANT_TYPE
|
|
281
|
+
];
|
|
278
282
|
var OAUTH_CODE_CHALLENGE_METHODS_SUPPORTED = ["S256"];
|
|
279
283
|
function buildOAuthAuthorizationServerMetadata(issuerUrl, options2) {
|
|
280
284
|
return {
|
|
@@ -283,6 +287,7 @@ function buildOAuthAuthorizationServerMetadata(issuerUrl, options2) {
|
|
|
283
287
|
token_endpoint: `${issuerUrl}/api/v1/oauth/token`,
|
|
284
288
|
revocation_endpoint: `${issuerUrl}/api/v1/oauth/revoke`,
|
|
285
289
|
registration_endpoint: `${issuerUrl}/api/v1/oauth/register`,
|
|
290
|
+
device_authorization_endpoint: `${issuerUrl}/api/v1/oauth/device_authorization`,
|
|
286
291
|
scopes_supported: SUPPORTED_OAUTH_SCOPES,
|
|
287
292
|
response_types_supported: OAUTH_RESPONSE_TYPES_SUPPORTED,
|
|
288
293
|
grant_types_supported: OAUTH_GRANT_TYPES_SUPPORTED,
|
|
@@ -296,12 +301,67 @@ function buildOAuthAuthorizationServerMetadata(issuerUrl, options2) {
|
|
|
296
301
|
var MCP_OAUTH_AUTHORIZATION_WINDOW_MINUTES = 30;
|
|
297
302
|
var MCP_OAUTH_AUTHORIZATION_WINDOW_MS = MCP_OAUTH_AUTHORIZATION_WINDOW_MINUTES * 60 * 1e3;
|
|
298
303
|
|
|
304
|
+
// ../../packages/mcp-contracts/dist/device-user-code.js
|
|
305
|
+
var DEVICE_USER_CODE_ALPHABET = "BCDFGHJKLMNPQRSTVWXZ";
|
|
306
|
+
var DEVICE_USER_CODE_LENGTH = 8;
|
|
307
|
+
var DEVICE_USER_CODE_PATTERN = new RegExp(`^[${DEVICE_USER_CODE_ALPHABET}]{${DEVICE_USER_CODE_LENGTH}}$`);
|
|
308
|
+
|
|
299
309
|
// ../../packages/mcp-contracts/dist/order-limits.js
|
|
300
310
|
var import_currency2 = __toESM(require_currency(), 1);
|
|
301
311
|
|
|
302
312
|
// ../../packages/mcp-contracts/dist/currency-precision.js
|
|
303
313
|
var import_currency = __toESM(require_currency(), 1);
|
|
304
314
|
|
|
315
|
+
// ../../packages/mcp-contracts/dist/precision-messages.js
|
|
316
|
+
function formatAmountPrecisionMessage(currency5, fractionDigits) {
|
|
317
|
+
const code = currency5.trim().toUpperCase();
|
|
318
|
+
if (fractionDigits === 0) {
|
|
319
|
+
return `Amount must be a whole number of ${code}, which has no minor unit. Recovery: round the amount to whole ${code}, e.g. 500 rather than 500.5.`;
|
|
320
|
+
}
|
|
321
|
+
return `Amount must have at most ${fractionDigits} decimal places in ${code}. Recovery: round the amount to ${fractionDigits} decimal places.`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ../../packages/mcp-contracts/dist/currency-precision.js
|
|
325
|
+
function currencyFractionDigits(currencyCode3) {
|
|
326
|
+
const code = currencyCode3.trim().toUpperCase();
|
|
327
|
+
let digits;
|
|
328
|
+
try {
|
|
329
|
+
digits = new Intl.NumberFormat("en-US", {
|
|
330
|
+
style: "currency",
|
|
331
|
+
currency: code
|
|
332
|
+
}).resolvedOptions().maximumFractionDigits;
|
|
333
|
+
} catch {
|
|
334
|
+
throw new Error(`Unsupported currency "${currencyCode3}"`);
|
|
335
|
+
}
|
|
336
|
+
if (typeof digits !== "number") {
|
|
337
|
+
throw new Error(`Unsupported currency "${currencyCode3}"`);
|
|
338
|
+
}
|
|
339
|
+
return digits;
|
|
340
|
+
}
|
|
341
|
+
var MINOR_UNIT_RELATIVE_TOLERANCE = Number.EPSILON * 16;
|
|
342
|
+
function amountExceedsCurrencyPrecision(amount, currencyCode3) {
|
|
343
|
+
const minorUnits = amount * 10 ** currencyFractionDigits(currencyCode3);
|
|
344
|
+
const drift = Math.abs(minorUnits - Math.round(minorUnits));
|
|
345
|
+
return drift > Math.abs(minorUnits) * MINOR_UNIT_RELATIVE_TOLERANCE;
|
|
346
|
+
}
|
|
347
|
+
function describeAmountPrecisionViolation(amount, currencyCode3) {
|
|
348
|
+
const fractionDigits = resolveFractionDigits(currencyCode3);
|
|
349
|
+
if (fractionDigits === void 0 || !amountExceedsCurrencyPrecision(amount, currencyCode3)) {
|
|
350
|
+
return void 0;
|
|
351
|
+
}
|
|
352
|
+
return formatAmountPrecisionMessage(currencyCode3, fractionDigits);
|
|
353
|
+
}
|
|
354
|
+
function describeRequestAmountPrecisionViolation(amount, currencyCode3) {
|
|
355
|
+
return describeAmountPrecisionViolation((0, import_currency.default)(amount).value, currencyCode3);
|
|
356
|
+
}
|
|
357
|
+
function resolveFractionDigits(currencyCode3) {
|
|
358
|
+
try {
|
|
359
|
+
return currencyFractionDigits(currencyCode3);
|
|
360
|
+
} catch {
|
|
361
|
+
return void 0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
305
365
|
// ../../packages/mcp-contracts/dist/plan-amount-limits.js
|
|
306
366
|
var DEFAULT_MIN_PAID_PLAN_AMOUNT = 1;
|
|
307
367
|
var MIN_PAID_PLAN_AMOUNT_BY_CURRENCY = {
|
|
@@ -334,13 +394,6 @@ function formatMinPaidPlanAmountMessage(currency5, minAmount) {
|
|
|
334
394
|
const code = currency5.trim().toUpperCase() || "USD";
|
|
335
395
|
return `Amount must be at least ${minAmount} ${code} for paid plans`;
|
|
336
396
|
}
|
|
337
|
-
function formatAmountPrecisionMessage(currency5, fractionDigits) {
|
|
338
|
-
const code = currency5.trim().toUpperCase();
|
|
339
|
-
if (fractionDigits === 0) {
|
|
340
|
-
return `Amount must be a whole number of ${code}, which has no minor unit. Recovery: round the amount to whole ${code}, e.g. 500 rather than 500.5.`;
|
|
341
|
-
}
|
|
342
|
-
return `Amount must have at most ${fractionDigits} decimal places in ${code}. Recovery: round the amount to ${fractionDigits} decimal places.`;
|
|
343
|
-
}
|
|
344
397
|
var LOWEST_MIN_PAID_PLAN_AMOUNT = Math.min(...Object.values(MIN_PAID_PLAN_AMOUNT_BY_CURRENCY));
|
|
345
398
|
var PAID_PLAN_NOT_FREE_BY_ZERO_AMOUNT = "A paid plan cannot be made free by setting its amount to 0; create a free-access plan instead.";
|
|
346
399
|
function formatAmountBelowLowestFloorMessage() {
|
|
@@ -391,47 +444,6 @@ function formatPeriodLengthRecovery(maxLength) {
|
|
|
391
444
|
}
|
|
392
445
|
var MAX_FREE_TRIAL_DAYS = 730;
|
|
393
446
|
|
|
394
|
-
// ../../packages/mcp-contracts/dist/currency-precision.js
|
|
395
|
-
function currencyFractionDigits(currencyCode3) {
|
|
396
|
-
const code = currencyCode3.trim().toUpperCase();
|
|
397
|
-
let digits;
|
|
398
|
-
try {
|
|
399
|
-
digits = new Intl.NumberFormat("en-US", {
|
|
400
|
-
style: "currency",
|
|
401
|
-
currency: code
|
|
402
|
-
}).resolvedOptions().maximumFractionDigits;
|
|
403
|
-
} catch {
|
|
404
|
-
throw new Error(`Unsupported currency "${currencyCode3}"`);
|
|
405
|
-
}
|
|
406
|
-
if (typeof digits !== "number") {
|
|
407
|
-
throw new Error(`Unsupported currency "${currencyCode3}"`);
|
|
408
|
-
}
|
|
409
|
-
return digits;
|
|
410
|
-
}
|
|
411
|
-
var MINOR_UNIT_RELATIVE_TOLERANCE = Number.EPSILON * 16;
|
|
412
|
-
function amountExceedsCurrencyPrecision(amount, currencyCode3) {
|
|
413
|
-
const minorUnits = amount * 10 ** currencyFractionDigits(currencyCode3);
|
|
414
|
-
const drift = Math.abs(minorUnits - Math.round(minorUnits));
|
|
415
|
-
return drift > Math.abs(minorUnits) * MINOR_UNIT_RELATIVE_TOLERANCE;
|
|
416
|
-
}
|
|
417
|
-
function describeAmountPrecisionViolation(amount, currencyCode3) {
|
|
418
|
-
const fractionDigits = resolveFractionDigits(currencyCode3);
|
|
419
|
-
if (fractionDigits === void 0 || !amountExceedsCurrencyPrecision(amount, currencyCode3)) {
|
|
420
|
-
return void 0;
|
|
421
|
-
}
|
|
422
|
-
return formatAmountPrecisionMessage(currencyCode3, fractionDigits);
|
|
423
|
-
}
|
|
424
|
-
function describeRequestAmountPrecisionViolation(amount, currencyCode3) {
|
|
425
|
-
return describeAmountPrecisionViolation((0, import_currency.default)(amount).value, currencyCode3);
|
|
426
|
-
}
|
|
427
|
-
function resolveFractionDigits(currencyCode3) {
|
|
428
|
-
try {
|
|
429
|
-
return currencyFractionDigits(currencyCode3);
|
|
430
|
-
} catch {
|
|
431
|
-
return void 0;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
447
|
// ../../packages/mcp-contracts/dist/order-limits.js
|
|
436
448
|
function getMaxOrderAmount(currency5) {
|
|
437
449
|
return getMaxPlanAmount(currency5);
|
|
@@ -20725,11 +20737,15 @@ var credentialExpiryWarningSchema = external_exports.object({
|
|
|
20725
20737
|
|
|
20726
20738
|
// ../../packages/mcp-contracts/dist/whoami.js
|
|
20727
20739
|
var mcpConnectionHostSchema = external_exports.enum(["sandbox", "live"]);
|
|
20740
|
+
var EMBEDDED_EMAIL_ADDRESS_PATTERN = /[^\s@]+@[^\s@]+\.[^\s@]+/;
|
|
20741
|
+
var MCP_ACCOUNT_NAME_MAX_LENGTH = 255;
|
|
20742
|
+
var mcpAccountNameSchema = external_exports.string().min(1).max(MCP_ACCOUNT_NAME_MAX_LENGTH).refine((value) => value.length <= MCP_ACCOUNT_NAME_MAX_LENGTH && !EMBEDDED_EMAIL_ADDRESS_PATTERN.test(value), { message: "An account name must not contain an email address" });
|
|
20728
20743
|
var mcpConnectionProofSchema = external_exports.object({
|
|
20729
20744
|
userId: external_exports.uuid(),
|
|
20730
20745
|
scopes: external_exports.array(external_exports.string()).nullable(),
|
|
20731
20746
|
host: mcpConnectionHostSchema.describe(`The class of MCP URL this client is connected to: "live" for the main MCP URL, "sandbox" for the sandbox-only MCP URL. Not the environment (dev, stage or prod) and not a merchant's deployment.`),
|
|
20732
20747
|
endpoint: external_exports.url(),
|
|
20748
|
+
accountName: mcpAccountNameSchema.nullable().describe("The business name of the account you are connected to, never an email address. Quote it with host (live or sandbox) and ask the developer to confirm it is their business; null when the account has no business yet."),
|
|
20733
20749
|
merchantIds: external_exports.array(external_exports.uuid()).describe("Ids of the merchants this credential is a member of, as returned when the credential was validated. Call get_my_merchant for names and per-deployment state; on the main MCP URL a merchant that exists on sandbox only is listed there, not here."),
|
|
20734
20750
|
credentialExpiresAt: external_exports.iso.datetime().nullable().describe("When this MCP credential stops working (ISO 8601, UTC); null when unknown."),
|
|
20735
20751
|
credentialExpiresInSeconds: external_exports.number().int().nonnegative().nullable().describe("Seconds of validity left on this MCP credential; null when the expiry is unknown."),
|
|
@@ -25502,7 +25518,7 @@ var TRANSACTION_SCOPE_RULE = 'Requires the "transaction:read" scope, which exist
|
|
|
25502
25518
|
var LIST_TRANSACTIONS_SUMMARY = `List a merchant's transactions, newest first, narrowed by the optional filters in the input schema. For the full lookup guide, call search_payments_ai_docs with "transaction lookup".`;
|
|
25503
25519
|
var GET_TRANSACTION_DETAIL = "Get one transaction by transactionId from list_transactions: the same fields plus the refunded amount and the order's line items. items is empty for a single-plan purchase, where plan names what was bought.";
|
|
25504
25520
|
var TOOL_DESCRIPTIONS = {
|
|
25505
|
-
[MCP_TOOL_NAMES.WHOAMI]: `Prove which account and which MCP server this connection reaches. Takes no arguments. Returns { userId, scopes, host, endpoint, merchantIds, credentialExpiresAt, credentialExpiresInSeconds, credentialExpiryWarning? }, read from the validated token and the server that answered. "scopes" null means the token holds every scope except "transaction:read", which must be granted by name. "host" is the class of MCP URL this client is connected to: "live" for the main MCP URL, which serves every merchant at its own deployment, or "sandbox" for the sandbox-only MCP URL. It is not the environment (dev, stage or prod) and not a merchant's deployment: on a "live" host a merchant that has not gone live still reports deployment "sandbox" in get_my_merchant, which is expected. To prove the connection, quote userId, host and endpoint from this result rather than the client's connected label. "merchantIds" are the merchants this credential is a member of; credentialExpiresAt and credentialExpiresInSeconds say when it stops working (null when unknown). credentialExpiryWarning is present only when the credential expires within ` + CREDENTIAL_EXPIRY_WARNING_WINDOW_DAYS + " days: tell the user and share its reapproveUrl, and expect the same warning appended to every other tool result until they re-approve. Needs no scope: any valid token can call it. Call get_my_merchant next to find the merchants this connection owns.",
|
|
25521
|
+
[MCP_TOOL_NAMES.WHOAMI]: `Prove which account and which MCP server this connection reaches. Takes no arguments. Returns { userId, scopes, host, endpoint, accountName, merchantIds, credentialExpiresAt, credentialExpiresInSeconds, credentialExpiryWarning? }, read from the validated token and the server that answered. "scopes" null means the token holds every scope except "transaction:read", which must be granted by name. "host" is the class of MCP URL this client is connected to: "live" for the main MCP URL, which serves every merchant at its own deployment, or "sandbox" for the sandbox-only MCP URL. It is not the environment (dev, stage or prod) and not a merchant's deployment: on a "live" host a merchant that has not gone live still reports deployment "sandbox" in get_my_merchant, which is expected. To prove the connection, quote userId, host and endpoint from this result rather than the client's connected label. "accountName" is the business name of the account you are connected to, never an email address: quote it with host (live or sandbox) and ask the developer to confirm it is their business; when it is null, the account has no business yet, so say so and quote userId. "merchantIds" are the merchants this credential is a member of; credentialExpiresAt and credentialExpiresInSeconds say when it stops working (null when unknown). credentialExpiryWarning is present only when the credential expires within ` + CREDENTIAL_EXPIRY_WARNING_WINDOW_DAYS + " days: tell the user and share its reapproveUrl, and expect the same warning appended to every other tool result until they re-approve. Needs no scope: any valid token can call it. Call get_my_merchant next to find the merchants this connection owns.",
|
|
25506
25522
|
[MCP_TOOL_NAMES.GET_MY_MERCHANT]: 'List the merchant accounts this connection already owns. Call this BEFORE create_merchant_account: a new agent session cannot remember a merchant created in an earlier one, and creating again produces a second merchant with its own products and its own checkout links. Takes no arguments \u2014 the merchants come from the authorization on the connection itself. Returns { merchants: [{ merchantId, name, deployment }] }. "deployment" is "sandbox" before go_live and "live" after it has succeeded, and it matches where create_product and list_products will route for that merchant right now. An empty merchants array is a normal result, not an error: this connection owns no merchant yet, so call create_merchant_account. When more than one merchant comes back, ask which one to use \u2014 do not pick for the user. Requires the "merchant:read" scope.',
|
|
25507
25523
|
[MCP_TOOL_NAMES.CREATE_MERCHANT_ACCOUNT]: "Create a merchant account on PAI Managed. Call get_my_merchant first: if it returns a merchant, reuse that merchantId instead of creating another, because a duplicate merchant gets its own products and checkout links. " + CREATE_MERCHANT_CONTACT_GUIDANCE + " The business name is a display label and is not globally unique \u2014 every downstream tool (create_product, list_products, checkout) keys on merchantId, so if two merchants happen to share a name, disambiguate them by merchantId (do not pick a distinct name here to work around it). No identity verification (KYC/KYB) is needed to use sandbox \u2014 products, checkout links and test transactions all work without it; verification is required on live. " + IDENTITY_VERIFICATION_RULE + " Dual-provisions live and sandbox with a shared merchantId. On partial dual-provision failure (one backend created it, the other did not), retry without a merchantId to finish it. When both backends fail, the returned error names the appropriate recovery \u2014 follow it as-is rather than repeating the same call in a loop, and treat repeated identical failures as needing escalation to support. Returns that merchant ID. Without a merchantId, a merchant this account already owns is returned with existing: true instead of a new one being created, and whichever of live or sandbox is missing it gets a copy with the details the existing copy holds; a merchantId this account already owns is finished the same way, and the copy that exists is never changed. Next: create_product (and checkout tools) on sandbox, then go_live when ready.",
|
|
25508
25524
|
[MCP_TOOL_NAMES.GET_MERCHANT_ACTIVATION_STATUS]: 'Get the production activation status of a merchant account on PAI Managed. Returns { status, identityVerification }. status "pending": the merchant has not been promoted to live yet; this is the only status where go_live is the next step, once the user confirms the merchant is ready, and polling this tool will not change it on its own. status "verification_pending": the merchant is promoted to live and identity verification (KYC) is not complete yet; do not call go_live again. status "active": live and identity verified. status "not_provisioned": no live merchant record exists (dual provision never finished on live); recovery: re-run create_merchant_account without a merchantId, which finds this merchant and creates the missing live copy with the details the sandbox copy holds \u2014 go_live cannot fix this and fails while the live twin is missing. ' + IDENTITY_VERIFICATION_RULE + ' identityVerification is the KYC state: "not_started", "pending", "in_review", "verified" or "rejected".',
|
|
@@ -25614,11 +25630,13 @@ var QUICKSTART_SKILL_SECTIONS = [
|
|
|
25614
25630
|
"",
|
|
25615
25631
|
'Do not trust the client\'s "Connected" label. Call `whoami` and report what it returns. `whoami` takes no arguments and needs no scope: every valid token can call it.',
|
|
25616
25632
|
"",
|
|
25617
|
-
"| Result | Meaning | Tell the developer
|
|
25618
|
-
"| -------------- | --------------------------------------------------------- |
|
|
25619
|
-
"| Success | Connected. | Quote `userId`, `host` (`sandbox` or `live`: the MCP URL connected to, not the merchant deployment) and `endpoint`. `scopes: null` means every scope except `transaction:read`. |",
|
|
25620
|
-
"| HTTP 401 | Not connected. | Quote the 401 `message` verbatim (for `code: token_expired` it says
|
|
25621
|
-
"| Any tool error | Connected, but the server could not prove the connection. | Quote the error. Do not say disconnected and do not paste the connect config.
|
|
25633
|
+
"| Result | Meaning | Tell the developer |",
|
|
25634
|
+
"| -------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |",
|
|
25635
|
+
"| Success | Connected. | Quote `accountName` (the business name of the account you are connected to, never an email) and ask the developer to confirm it, together with `host` (live or sandbox), is their own business account. Then quote `userId`, `host` (`sandbox` or `live`: the MCP URL connected to, not the merchant deployment) and `endpoint`. `accountName: null` means no label is known: say so. `scopes: null` means every scope except `transaction:read`. |",
|
|
25636
|
+
"| HTTP 401 | Not connected. | Quote the 401 `message` verbatim (for `code: token_expired` it says how to reconnect: re-approve in the client for OAuth, run the device grant again and replace the `Authorization` header if connected that way, or generate a new token if connected with a token), then show the MCP config above. |",
|
|
25637
|
+
"| Any tool error | Connected, but the server could not prove the connection. | Quote the error. Do not say disconnected and do not paste the connect config. |",
|
|
25638
|
+
"",
|
|
25639
|
+
'If `whoami` returns a `credentialExpiryWarning`, or a tool result carries one under `_meta["ai.payments/credentialExpiryWarning"]` with a closing text block (OAuth connections only, within 14 days of expiry), tell the user and share its re-approve link, which opens the connect page. If you connected with the device grant, run it again and replace the `Authorization` header instead (see "Connect without a terminal"). `credentialExpiresAt` and `credentialExpiresInSeconds` say when the credential stops working; `null` means unknown.',
|
|
25622
25640
|
"",
|
|
25623
25641
|
"## Before you mutate anything",
|
|
25624
25642
|
"",
|
|
@@ -25680,26 +25698,26 @@ var QUICKSTART_SKILL_SECTIONS = [
|
|
|
25680
25698
|
"",
|
|
25681
25699
|
"## Tools",
|
|
25682
25700
|
"",
|
|
25683
|
-
"| Tool | Use
|
|
25684
|
-
"| -------------------------------- |
|
|
25685
|
-
"| `whoami` | `userId`, `scopes`, `host`, `endpoint`; any valid token
|
|
25686
|
-
"| `search_payments_ai_docs` | Search developer docs
|
|
25687
|
-
"| `get_my_merchant` | Owned merchants
|
|
25688
|
-
"| `create_merchant_account` | Dual-provision live + sandbox merchant
|
|
25689
|
-
"| `get_merchant_activation_status` | Activation status (see below)
|
|
25690
|
-
"| `go_live` | Promote to live; a repeat returns current status
|
|
25691
|
-
"| `create_product` | Product + plans (sandbox until go-live)
|
|
25692
|
-
"| `create_order` | Multi-item or caller-priced checkout
|
|
25693
|
-
"| `update_product` | Merge-update a product's name, description or status
|
|
25694
|
-
"| `update_plan` | Merge-update a plan's name, description, price, billing period or free trial
|
|
25695
|
-
"| `list_products` | List products, plans, checkout URLs
|
|
25696
|
-
"| `list_transactions` | Look up transactions (needs `transaction:read`)
|
|
25697
|
-
"| `get_transaction` | One transaction's details and line items
|
|
25698
|
-
"| `get_product_image_upload_url` | Presigned POST for product image
|
|
25699
|
-
"| `confirm_product_image` | Attach uploaded product image
|
|
25700
|
-
"| `get_checkout_customization` | Read hosted checkout branding
|
|
25701
|
-
"| `update_checkout_customization` | Merge-update branding
|
|
25702
|
-
"| `set_checkout_logo` | Mint \u2192 PUT \u2192 confirm checkout logo
|
|
25701
|
+
"| Tool | Use |",
|
|
25702
|
+
"| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |",
|
|
25703
|
+
"| `whoami` | `accountName`, `userId`, `scopes`, `host`, `endpoint`, `merchantIds`, `credentialExpiresAt`, `credentialExpiresInSeconds`, `credentialExpiryWarning`; any valid token |",
|
|
25704
|
+
"| `search_payments_ai_docs` | Search developer docs |",
|
|
25705
|
+
"| `get_my_merchant` | Owned merchants |",
|
|
25706
|
+
"| `create_merchant_account` | Dual-provision live + sandbox merchant |",
|
|
25707
|
+
"| `get_merchant_activation_status` | Activation status (see below) |",
|
|
25708
|
+
"| `go_live` | Promote to live; a repeat returns current status |",
|
|
25709
|
+
"| `create_product` | Product + plans (sandbox until go-live) |",
|
|
25710
|
+
"| `create_order` | Multi-item or caller-priced checkout |",
|
|
25711
|
+
"| `update_product` | Merge-update a product's name, description or status |",
|
|
25712
|
+
"| `update_plan` | Merge-update a plan's name, description, price, billing period or free trial |",
|
|
25713
|
+
"| `list_products` | List products, plans, checkout URLs |",
|
|
25714
|
+
"| `list_transactions` | Look up transactions (needs `transaction:read`) |",
|
|
25715
|
+
"| `get_transaction` | One transaction's details and line items |",
|
|
25716
|
+
"| `get_product_image_upload_url` | Presigned POST for product image |",
|
|
25717
|
+
"| `confirm_product_image` | Attach uploaded product image |",
|
|
25718
|
+
"| `get_checkout_customization` | Read hosted checkout branding |",
|
|
25719
|
+
"| `update_checkout_customization` | Merge-update branding |",
|
|
25720
|
+
"| `set_checkout_logo` | Mint \u2192 PUT \u2192 confirm checkout logo |",
|
|
25703
25721
|
"",
|
|
25704
25722
|
"### Activation status",
|
|
25705
25723
|
"",
|
|
@@ -26831,6 +26849,7 @@ function buildConnectionProof(input2) {
|
|
|
26831
26849
|
scopes: payload.scopes,
|
|
26832
26850
|
host: host2,
|
|
26833
26851
|
endpoint,
|
|
26852
|
+
accountName: payload.accountName ?? null,
|
|
26834
26853
|
merchantIds: payload.merchantIds,
|
|
26835
26854
|
credentialExpiresAt: credentialExpiry.credentialExpiresAt,
|
|
26836
26855
|
credentialExpiresInSeconds: credentialExpiry.credentialExpiresInSeconds,
|
|
@@ -28247,18 +28266,20 @@ function parseMcpTokenPayload(parsed) {
|
|
|
28247
28266
|
if (typeof parsed !== "object" || parsed === null) {
|
|
28248
28267
|
return void 0;
|
|
28249
28268
|
}
|
|
28250
|
-
const { userId, cognitoSub, merchantIds, scopes, expiresAt, oauthIssued } = parsed;
|
|
28269
|
+
const { userId, cognitoSub, merchantIds, scopes, expiresAt, oauthIssued, accountName } = parsed;
|
|
28251
28270
|
if (typeof userId !== "string" || typeof cognitoSub !== "string" || !isStringArray(merchantIds)) {
|
|
28252
28271
|
return void 0;
|
|
28253
28272
|
}
|
|
28254
28273
|
const expiry = parseExpiresAt(expiresAt);
|
|
28274
|
+
const label = mcpAccountNameSchema.safeParse(accountName);
|
|
28255
28275
|
return {
|
|
28256
28276
|
userId,
|
|
28257
28277
|
cognitoSub,
|
|
28258
28278
|
merchantIds,
|
|
28259
28279
|
scopes: Array.isArray(scopes) ? scopes : null,
|
|
28260
28280
|
oauthIssued: oauthIssued === true,
|
|
28261
|
-
...expiry === void 0 ? {} : { expiresAt: expiry }
|
|
28281
|
+
...expiry === void 0 ? {} : { expiresAt: expiry },
|
|
28282
|
+
...label.success ? { accountName: label.data } : {}
|
|
28262
28283
|
};
|
|
28263
28284
|
}
|
|
28264
28285
|
function parseExpiresAt(value) {
|