@mysten-incubation/suipay-mcp 0.3.0-dev.32 → 0.3.0-dev.34
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/README.md +4 -4
- package/dist/bin/suipay.js +2 -2
- package/dist/{chunk-KZJICXEF.js → chunk-5S4MJN2A.js} +24 -10
- package/dist/{chunk-A5SQBSLF.js → chunk-TCPF3ONF.js} +1 -1
- package/dist/{http-BfRuw7wl.d.ts → http-DRQ838c6.d.ts} +11 -1
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ buyer-funded spend account. The buyer owns the account. The agent holds the
|
|
|
5
5
|
delegate key and can spend only under the on-chain grant (recipient bind,
|
|
6
6
|
per-payment cap, budget).
|
|
7
7
|
|
|
8
|
-
Pin `@mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
8
|
+
Pin `@mysten-incubation/suipay-mcp@0.3.0-dev.34` in MCP config for the `latest` dist-tag.
|
|
9
9
|
`npx -y @mysten-incubation/suipay-mcp@dev` tracks the `dev` prerelease line.
|
|
10
10
|
`1.0.1` remains on the registry as a historical release; do not install it
|
|
11
11
|
for new agents.
|
|
@@ -13,7 +13,7 @@ for new agents.
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
claude mcp add --scope user suipay -- npx -y @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
16
|
+
claude mcp add --scope user suipay -- npx -y @mysten-incubation/suipay-mcp@0.3.0-dev.34
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`@dev` installs the Railway-dev gateway/console defaults. A workspace
|
|
@@ -161,10 +161,10 @@ Default is Railway **suipay-dev**. Start with `--local` for the laptop stack.
|
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
163
|
# Railway suipay-dev (default)
|
|
164
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
164
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.34
|
|
165
165
|
|
|
166
166
|
# Laptop stack
|
|
167
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
167
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.34 --local
|
|
168
168
|
```
|
|
169
169
|
|
|
170
170
|
`SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
|
package/dist/bin/suipay.js
CHANGED
|
@@ -1072,7 +1072,7 @@ var DELIVERY_CODES = {
|
|
|
1072
1072
|
user: { title: "Something went wrong", message: "No result came back from the service." }
|
|
1073
1073
|
},
|
|
1074
1074
|
"delivery.seller_timeout": {
|
|
1075
|
-
surfaces: ["gateway"],
|
|
1075
|
+
surfaces: ["gateway", "sdk", "mcp_local", "mcp_hosted"],
|
|
1076
1076
|
status: 504,
|
|
1077
1077
|
title: "Seller timed out after payment",
|
|
1078
1078
|
paymentState: "charged",
|
|
@@ -1313,6 +1313,16 @@ var INDEXER_CODES = {
|
|
|
1313
1313
|
nextAction: "contact_support",
|
|
1314
1314
|
user: null,
|
|
1315
1315
|
logOnly: true
|
|
1316
|
+
},
|
|
1317
|
+
"indexer.unsettled_delivery": {
|
|
1318
|
+
surfaces: ["indexer"],
|
|
1319
|
+
status: null,
|
|
1320
|
+
title: "Delivered call has no matching on-chain settlement",
|
|
1321
|
+
paymentState: "not_charged",
|
|
1322
|
+
retry: "never",
|
|
1323
|
+
nextAction: "contact_support",
|
|
1324
|
+
user: null,
|
|
1325
|
+
logOnly: true
|
|
1316
1326
|
}
|
|
1317
1327
|
};
|
|
1318
1328
|
|
|
@@ -8578,6 +8588,8 @@ var DELEGATED_PAY_ERROR_CODE_SET = new Set(Object.values(DELEGATED_PAY_ERROR_COD
|
|
|
8578
8588
|
function isDelegatedPayErrorCode(value) {
|
|
8579
8589
|
return typeof value === "string" && DELEGATED_PAY_ERROR_CODE_SET.has(value);
|
|
8580
8590
|
}
|
|
8591
|
+
var DELIVERY_SELLER_TIMEOUT_DETAIL = "Gateway timed out waiting for the paid service to deliver.";
|
|
8592
|
+
var EXECUTE_TIMEOUT_DETAIL = "Gateway timed out before confirming whether payment settled; check status before retrying.";
|
|
8581
8593
|
var PUBLIC_DETAIL = {
|
|
8582
8594
|
OFFER_SECRET_REQUIRED: "offer verification material is unavailable",
|
|
8583
8595
|
CHALLENGE_TAMPERED: "offer digest does not verify",
|
|
@@ -8744,14 +8756,15 @@ function withReconcileKeys(error, extras) {
|
|
|
8744
8756
|
};
|
|
8745
8757
|
}
|
|
8746
8758
|
async function gatewayDeliveryFailure(response, log, local) {
|
|
8759
|
+
const timedOut = response.status === 504;
|
|
8747
8760
|
const result = gatewayFailure(await readGatewayAnswer(response), {
|
|
8748
|
-
code: DELEGATED_PAY_CODES[local.code],
|
|
8761
|
+
code: timedOut ? "delivery.seller_timeout" : DELEGATED_PAY_CODES[local.code],
|
|
8749
8762
|
paymentState: "charged",
|
|
8750
|
-
detail: PUBLIC_DETAIL[local.code]
|
|
8763
|
+
detail: timedOut ? DELIVERY_SELLER_TIMEOUT_DETAIL : PUBLIC_DETAIL[local.code]
|
|
8751
8764
|
}, { paymentId: local.paymentId, txDigest: local.txDigest, settlement: local.settlement });
|
|
8752
8765
|
logInternal(log, {
|
|
8753
|
-
code: "delivery.proof_rejected",
|
|
8754
|
-
msg: "gateway did not deliver after settlement",
|
|
8766
|
+
code: timedOut ? "delivery.seller_timeout" : "delivery.proof_rejected",
|
|
8767
|
+
msg: timedOut ? "gateway timed out delivering after settlement" : "gateway did not deliver after settlement",
|
|
8755
8768
|
context: {
|
|
8756
8769
|
status: response.status,
|
|
8757
8770
|
header: response.headers.get(ERROR_CODE_HEADER),
|
|
@@ -10415,22 +10428,23 @@ async function recordX402Answer(ctx, answer) {
|
|
|
10415
10428
|
if (answer.kind === "undelivered") {
|
|
10416
10429
|
const stated = parseErrorPayload(answer.answer)?.paymentState;
|
|
10417
10430
|
const charged = answer.receipt !== null || stated === "charged";
|
|
10431
|
+
const timedOut = answer.answer.status === 504;
|
|
10418
10432
|
const settlement2 = answer.receipt ? { ...ctx.settlement, txDigest: answer.receipt.txDigest } : void 0;
|
|
10419
10433
|
const result = gatewayFailure(answer.answer, charged ? {
|
|
10420
|
-
code: DELEGATED_PAY_CODES.GATEWAY_REFUSED,
|
|
10434
|
+
code: timedOut ? "delivery.seller_timeout" : DELEGATED_PAY_CODES.GATEWAY_REFUSED,
|
|
10421
10435
|
paymentState: "charged",
|
|
10422
|
-
detail: PUBLIC_DETAIL.GATEWAY_REFUSED
|
|
10436
|
+
detail: timedOut ? DELIVERY_SELLER_TIMEOUT_DETAIL : PUBLIC_DETAIL.GATEWAY_REFUSED
|
|
10423
10437
|
} : {
|
|
10424
10438
|
code: DELEGATED_PAY_CODES.EXECUTE_AMBIGUOUS,
|
|
10425
10439
|
paymentState: "unknown",
|
|
10426
|
-
detail: PUBLIC_DETAIL.EXECUTE_AMBIGUOUS
|
|
10440
|
+
detail: timedOut ? EXECUTE_TIMEOUT_DETAIL : PUBLIC_DETAIL.EXECUTE_AMBIGUOUS
|
|
10427
10441
|
}, {
|
|
10428
10442
|
paymentId,
|
|
10429
10443
|
...settlement2 ? { txDigest: settlement2.txDigest, settlement: settlement2 } : answer.txDigest ? { txDigest: answer.txDigest } : {}
|
|
10430
10444
|
});
|
|
10431
10445
|
logInternal(log, {
|
|
10432
|
-
code: "delivery.proof_rejected",
|
|
10433
|
-
msg: "gateway did not deliver against an x402 credential",
|
|
10446
|
+
code: charged && timedOut ? "delivery.seller_timeout" : "delivery.proof_rejected",
|
|
10447
|
+
msg: charged && timedOut ? "gateway timed out delivering against an x402 credential" : "gateway did not deliver against an x402 credential",
|
|
10434
10448
|
context: { status: answer.answer.status, code: result.code }
|
|
10435
10449
|
});
|
|
10436
10450
|
return completeAttempt(ledger, paymentId, result, log);
|
|
@@ -968,6 +968,16 @@ declare const ERRORS: {
|
|
|
968
968
|
readonly user: null;
|
|
969
969
|
readonly logOnly: true;
|
|
970
970
|
};
|
|
971
|
+
readonly 'indexer.unsettled_delivery': {
|
|
972
|
+
readonly surfaces: readonly ["indexer"];
|
|
973
|
+
readonly status: null;
|
|
974
|
+
readonly title: "Delivered call has no matching on-chain settlement";
|
|
975
|
+
readonly paymentState: "not_charged";
|
|
976
|
+
readonly retry: "never";
|
|
977
|
+
readonly nextAction: "contact_support";
|
|
978
|
+
readonly user: null;
|
|
979
|
+
readonly logOnly: true;
|
|
980
|
+
};
|
|
971
981
|
readonly 'client.agent_handoff_failed': {
|
|
972
982
|
readonly surfaces: readonly ["browser", "mcp_local"];
|
|
973
983
|
readonly status: null;
|
|
@@ -2060,7 +2070,7 @@ declare const ERRORS: {
|
|
|
2060
2070
|
};
|
|
2061
2071
|
};
|
|
2062
2072
|
readonly 'delivery.seller_timeout': {
|
|
2063
|
-
readonly surfaces: readonly ["gateway"];
|
|
2073
|
+
readonly surfaces: readonly ["gateway", "sdk", "mcp_local", "mcp_hosted"];
|
|
2064
2074
|
readonly status: 504;
|
|
2065
2075
|
readonly title: "Seller timed out after payment";
|
|
2066
2076
|
readonly paymentState: "charged";
|
package/dist/http.d.ts
CHANGED
package/dist/http.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
|
-
import { S as SpendAccountSigningRequest, P as PaidHttpRequest, D as DelegatedKeySigner, G as GetObjectJson, a as DelegatedPayerSession, b as DelegatedPayerConfig, c as DelegatedPayerDeps, d as SpendIntent, e as DelegatedPayResult, f as DelegationScope, C as CodeFor, N as NextAction, g as GrantPolicyBinding, h as PaymentAttemptLedger, O as OfferPublicKeySource, i as DelegatedPayerLog, j as PreparedSettlementTerms, X as X402PayProgress, k as Offer, M as McpConfig, l as McpAuthContext, m as McpTraceHooks, n as SpendAccountPayDeps, o as createReader } from './http-
|
|
3
|
-
export { A as AgentHeldResolver, p as AgentHeldSettlement, q as MCP_TARGET_PRESETS, r as McpEnvelope, s as McpEnvelopeEntry, t as McpServerOptions, u as McpTarget, v as McpTraceContext, w as McpTraceRuntime, x as PACKAGE_NAME, y as PreparedPayment, z as SpendAccountPrepareResult, B as SpendAccountPrepareSession, T as TOOLS, E as buildSpendAccountPayKind, F as canonicalMcpRequestId, H as createServer, I as handleSuipayMcpHttpRequest, J as inspectMcpEnvelope, K as loadMcpConfig, L as parseMcpTargetFlag, Q as prepareSpendAccountPayment, R as resetAgentHeldProcessLedger, U as resolveAgentHeldSettlement, V as resolveGrantTarget, W as resolveMcpTarget, Y as sameMcpGateway, Z as traceMcpHttpRequest, _ as verifySpendAccountPayReconstructs } from './http-
|
|
2
|
+
import { S as SpendAccountSigningRequest, P as PaidHttpRequest, D as DelegatedKeySigner, G as GetObjectJson, a as DelegatedPayerSession, b as DelegatedPayerConfig, c as DelegatedPayerDeps, d as SpendIntent, e as DelegatedPayResult, f as DelegationScope, C as CodeFor, N as NextAction, g as GrantPolicyBinding, h as PaymentAttemptLedger, O as OfferPublicKeySource, i as DelegatedPayerLog, j as PreparedSettlementTerms, X as X402PayProgress, k as Offer, M as McpConfig, l as McpAuthContext, m as McpTraceHooks, n as SpendAccountPayDeps, o as createReader } from './http-DRQ838c6.js';
|
|
3
|
+
export { A as AgentHeldResolver, p as AgentHeldSettlement, q as MCP_TARGET_PRESETS, r as McpEnvelope, s as McpEnvelopeEntry, t as McpServerOptions, u as McpTarget, v as McpTraceContext, w as McpTraceRuntime, x as PACKAGE_NAME, y as PreparedPayment, z as SpendAccountPrepareResult, B as SpendAccountPrepareSession, T as TOOLS, E as buildSpendAccountPayKind, F as canonicalMcpRequestId, H as createServer, I as handleSuipayMcpHttpRequest, J as inspectMcpEnvelope, K as loadMcpConfig, L as parseMcpTargetFlag, Q as prepareSpendAccountPayment, R as resetAgentHeldProcessLedger, U as resolveAgentHeldSettlement, V as resolveGrantTarget, W as resolveMcpTarget, Y as sameMcpGateway, Z as traceMcpHttpRequest, _ as verifySpendAccountPayReconstructs } from './http-DRQ838c6.js';
|
|
4
4
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
5
5
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import '@modelcontextprotocol/sdk/server/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadBootProfile,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TCPF3ONF.js";
|
|
5
5
|
import {
|
|
6
6
|
MCP_TARGET_PRESETS,
|
|
7
7
|
PACKAGE_NAME,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
settlePreparedMcpPayment,
|
|
27
27
|
traceMcpHttpRequest,
|
|
28
28
|
verifySpendAccountPayReconstructs
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5S4MJN2A.js";
|
|
30
30
|
export {
|
|
31
31
|
MCP_TARGET_PRESETS,
|
|
32
32
|
PACKAGE_NAME,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten-incubation/suipay-mcp",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "SuiPay MCP — pay MPP-gated APIs from a spend-account grant with an agent-held delegate key.",
|
|
6
6
|
"repository": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"tsup": "^8.0.0",
|
|
43
43
|
"typescript": "^6.0.3",
|
|
44
44
|
"vitest": "^4.1.10",
|
|
45
|
-
"@cmdoss/suipay-
|
|
46
|
-
"@cmdoss/suipay-
|
|
45
|
+
"@cmdoss/suipay-sdk": "0.1.0",
|
|
46
|
+
"@cmdoss/suipay-core": "0.1.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup",
|