@mysten-incubation/suipay-mcp 0.3.0-dev.31 → 0.3.0-dev.33

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 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.31` in MCP config for the `latest` dist-tag.
8
+ Pin `@mysten-incubation/suipay-mcp@0.3.0-dev.33` 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.31
16
+ claude mcp add --scope user suipay -- npx -y @mysten-incubation/suipay-mcp@0.3.0-dev.33
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.31
164
+ npx @mysten-incubation/suipay-mcp@0.3.0-dev.33
165
165
 
166
166
  # Laptop stack
167
- npx @mysten-incubation/suipay-mcp@0.3.0-dev.31 --local
167
+ npx @mysten-incubation/suipay-mcp@0.3.0-dev.33 --local
168
168
  ```
169
169
 
170
170
  `SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../chunk-U4VGOG67.js";
4
+ } from "../chunk-TCPF3ONF.js";
5
5
  import {
6
6
  logError
7
- } from "../chunk-XQW6WNT3.js";
7
+ } from "../chunk-5S4MJN2A.js";
8
8
 
9
9
  // src/bin/suipay.ts
10
10
  main().catch((err) => {
@@ -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
 
@@ -3819,6 +3829,25 @@ var SERVICE_STATE_TRANSITIONS = Object.freeze([
3819
3829
  to: "none",
3820
3830
  actors: ["system"],
3821
3831
  requires: ["reason_code"]
3832
+ },
3833
+ // System listing moves for permissionless services: auto-list after
3834
+ // proof-of-settle (never lifts an operator delist) and reset to unlisted
3835
+ // when a revision changes the published seller URL.
3836
+ {
3837
+ id: "T26",
3838
+ dimension: "listing",
3839
+ from: ["unlisted"],
3840
+ to: "listed",
3841
+ actors: ["system"],
3842
+ requires: ["admission_admitted"]
3843
+ },
3844
+ {
3845
+ id: "T27",
3846
+ dimension: "listing",
3847
+ from: ["listed"],
3848
+ to: "unlisted",
3849
+ actors: ["system"],
3850
+ requires: ["reason_code"]
3822
3851
  }
3823
3852
  ]);
3824
3853
 
@@ -8559,6 +8588,8 @@ var DELEGATED_PAY_ERROR_CODE_SET = new Set(Object.values(DELEGATED_PAY_ERROR_COD
8559
8588
  function isDelegatedPayErrorCode(value) {
8560
8589
  return typeof value === "string" && DELEGATED_PAY_ERROR_CODE_SET.has(value);
8561
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.";
8562
8593
  var PUBLIC_DETAIL = {
8563
8594
  OFFER_SECRET_REQUIRED: "offer verification material is unavailable",
8564
8595
  CHALLENGE_TAMPERED: "offer digest does not verify",
@@ -8725,14 +8756,15 @@ function withReconcileKeys(error, extras) {
8725
8756
  };
8726
8757
  }
8727
8758
  async function gatewayDeliveryFailure(response, log, local) {
8759
+ const timedOut = response.status === 504;
8728
8760
  const result = gatewayFailure(await readGatewayAnswer(response), {
8729
- code: DELEGATED_PAY_CODES[local.code],
8761
+ code: timedOut ? "delivery.seller_timeout" : DELEGATED_PAY_CODES[local.code],
8730
8762
  paymentState: "charged",
8731
- detail: PUBLIC_DETAIL[local.code]
8763
+ detail: timedOut ? DELIVERY_SELLER_TIMEOUT_DETAIL : PUBLIC_DETAIL[local.code]
8732
8764
  }, { paymentId: local.paymentId, txDigest: local.txDigest, settlement: local.settlement });
8733
8765
  logInternal(log, {
8734
- code: "delivery.proof_rejected",
8735
- 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",
8736
8768
  context: {
8737
8769
  status: response.status,
8738
8770
  header: response.headers.get(ERROR_CODE_HEADER),
@@ -10396,22 +10428,23 @@ async function recordX402Answer(ctx, answer) {
10396
10428
  if (answer.kind === "undelivered") {
10397
10429
  const stated = parseErrorPayload(answer.answer)?.paymentState;
10398
10430
  const charged = answer.receipt !== null || stated === "charged";
10431
+ const timedOut = answer.answer.status === 504;
10399
10432
  const settlement2 = answer.receipt ? { ...ctx.settlement, txDigest: answer.receipt.txDigest } : void 0;
10400
10433
  const result = gatewayFailure(answer.answer, charged ? {
10401
- code: DELEGATED_PAY_CODES.GATEWAY_REFUSED,
10434
+ code: timedOut ? "delivery.seller_timeout" : DELEGATED_PAY_CODES.GATEWAY_REFUSED,
10402
10435
  paymentState: "charged",
10403
- detail: PUBLIC_DETAIL.GATEWAY_REFUSED
10436
+ detail: timedOut ? DELIVERY_SELLER_TIMEOUT_DETAIL : PUBLIC_DETAIL.GATEWAY_REFUSED
10404
10437
  } : {
10405
10438
  code: DELEGATED_PAY_CODES.EXECUTE_AMBIGUOUS,
10406
10439
  paymentState: "unknown",
10407
- detail: PUBLIC_DETAIL.EXECUTE_AMBIGUOUS
10440
+ detail: timedOut ? EXECUTE_TIMEOUT_DETAIL : PUBLIC_DETAIL.EXECUTE_AMBIGUOUS
10408
10441
  }, {
10409
10442
  paymentId,
10410
10443
  ...settlement2 ? { txDigest: settlement2.txDigest, settlement: settlement2 } : answer.txDigest ? { txDigest: answer.txDigest } : {}
10411
10444
  });
10412
10445
  logInternal(log, {
10413
- code: "delivery.proof_rejected",
10414
- 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",
10415
10448
  context: { status: answer.answer.status, code: result.code }
10416
10449
  });
10417
10450
  return completeAttempt(ledger, paymentId, result, log);
@@ -5,7 +5,7 @@ import {
5
5
  loadMcpConfig,
6
6
  loadPaymentProfile,
7
7
  logError
8
- } from "./chunk-XQW6WNT3.js";
8
+ } from "./chunk-5S4MJN2A.js";
9
9
 
10
10
  // src/index.ts
11
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -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
@@ -1,4 +1,4 @@
1
- export { I as handleSuipayMcpHttpRequest } from './http-BfRuw7wl.js';
1
+ export { I as handleSuipayMcpHttpRequest } from './http-DRQ838c6.js';
2
2
  import '@modelcontextprotocol/sdk/server/index.js';
3
3
  import '@mysten/sui/keypairs/ed25519';
4
4
  import 'node:crypto';
package/dist/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleSuipayMcpHttpRequest
3
- } from "./chunk-XQW6WNT3.js";
3
+ } from "./chunk-5S4MJN2A.js";
4
4
  export {
5
5
  handleSuipayMcpHttpRequest
6
6
  };
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-BfRuw7wl.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-BfRuw7wl.js';
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-U4VGOG67.js";
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-XQW6WNT3.js";
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.31",
3
+ "version": "0.3.0-dev.33",
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": {