@mysten-incubation/suipay-mcp 0.3.0-dev.2 → 0.3.0-dev.20

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.
@@ -865,6 +865,17 @@ declare const ERRORS: {
865
865
  readonly user: null;
866
866
  readonly logOnly: true;
867
867
  };
868
+ readonly 'indexer.native_settlement_deferred': {
869
+ readonly surfaces: readonly ["indexer"];
870
+ readonly status: null;
871
+ readonly title: "Native settlement is deferred; holding the checkpoint";
872
+ readonly paymentState: "not_charged";
873
+ readonly retry: "after_delay";
874
+ readonly retryAfterSeconds: 5;
875
+ readonly nextAction: "retry_later";
876
+ readonly user: null;
877
+ readonly logOnly: true;
878
+ };
868
879
  readonly 'indexer.config_invalid': {
869
880
  readonly surfaces: readonly ["indexer"];
870
881
  readonly status: null;
@@ -1357,7 +1368,7 @@ declare const ERRORS: {
1357
1368
  };
1358
1369
  };
1359
1370
  readonly 'limit.rate_limited': {
1360
- readonly surfaces: readonly ["gateway", "console_server"];
1371
+ readonly surfaces: readonly ["gateway", "console_server", "sdk"];
1361
1372
  readonly status: 429;
1362
1373
  readonly title: "Rate limit exceeded";
1363
1374
  readonly paymentState: "not_charged";
@@ -3514,6 +3525,55 @@ declare const ERRORS: {
3514
3525
  readonly message: "That web address doesn't exist. Check the spelling and try again.";
3515
3526
  };
3516
3527
  };
3528
+ readonly 'request.recipient_changed': {
3529
+ readonly surfaces: readonly ["gateway"];
3530
+ readonly status: 409;
3531
+ readonly title: "Pay-to address changed while its registry was being checked";
3532
+ readonly paymentState: "not_charged";
3533
+ readonly retry: "never";
3534
+ readonly nextAction: "fix_request";
3535
+ readonly user: {
3536
+ readonly title: "Retry this publish";
3537
+ readonly message: "The payout address changed while its payment registry was being checked. Retry so the current address is checked.";
3538
+ };
3539
+ };
3540
+ readonly 'request.recipient_registry_invalid': {
3541
+ readonly surfaces: readonly ["gateway"];
3542
+ readonly status: 409;
3543
+ readonly title: "Payment registry does not verify for this deployment";
3544
+ readonly paymentState: "not_charged";
3545
+ readonly retry: "never";
3546
+ readonly nextAction: "fix_request";
3547
+ readonly user: {
3548
+ readonly title: "Registry does not match";
3549
+ readonly message: "The payout address's payment registry does not match this deployment. Fix it, then publish again.";
3550
+ };
3551
+ };
3552
+ readonly 'request.recipient_registry_missing': {
3553
+ readonly surfaces: readonly ["gateway"];
3554
+ readonly status: 409;
3555
+ readonly title: "Pay-to address has no payment registry";
3556
+ readonly paymentState: "not_charged";
3557
+ readonly retry: "never";
3558
+ readonly nextAction: "fix_request";
3559
+ readonly user: {
3560
+ readonly title: "Create a payment registry";
3561
+ readonly message: "This payout address has no payment registry on this network yet. Create it in the seller console, then publish again.";
3562
+ };
3563
+ };
3564
+ readonly 'request.recipient_registry_unreadable': {
3565
+ readonly surfaces: readonly ["gateway"];
3566
+ readonly status: 503;
3567
+ readonly title: "Payment registry could not be read";
3568
+ readonly paymentState: "not_charged";
3569
+ readonly retry: "after_delay";
3570
+ readonly retryAfterSeconds: 5;
3571
+ readonly nextAction: "retry_later";
3572
+ readonly user: {
3573
+ readonly title: "Registry unread";
3574
+ readonly message: "The payment registry could not be read just now. Wait a moment and try again.";
3575
+ };
3576
+ };
3517
3577
  readonly 'request.redirect_refused': {
3518
3578
  readonly surfaces: readonly ["console_server", "sdk"];
3519
3579
  readonly status: 422;
@@ -4874,6 +4934,11 @@ declare const TOOLS: readonly [{
4874
4934
  readonly type: "string";
4875
4935
  readonly description: "Atomic ceiling you will spend on this call. The payment is refused, unsigned, if the offer costs more.";
4876
4936
  };
4937
+ readonly dialect: {
4938
+ readonly type: "string";
4939
+ readonly enum: readonly ["mpp", "x402"];
4940
+ readonly description: "Payment dialect to settle in when the 402 offers both. Defaults to mpp. A declared dialect the payment cannot use is refused, unsigned.";
4941
+ };
4877
4942
  };
4878
4943
  readonly required: readonly ["url"];
4879
4944
  };
@@ -4922,6 +4987,13 @@ declare const TOOLS: readonly [{
4922
4987
  };
4923
4988
  };
4924
4989
  };
4990
+ }, {
4991
+ readonly name: "suipay_login_status";
4992
+ readonly description: string;
4993
+ readonly inputSchema: {
4994
+ readonly type: "object";
4995
+ readonly properties: {};
4996
+ };
4925
4997
  }, {
4926
4998
  readonly name: "suipay_logout";
4927
4999
  readonly description: "Remove the local delegate-key credentials file. Missing file is success. Force clears a corrupt file without printing the seed.";
package/dist/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { I as handleSuipayMcpHttpRequest } from './http-BUaEV9I3.js';
1
+ export { I as handleSuipayMcpHttpRequest } from './http-BJFB-Yhm.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-HIBLRYTW.js";
3
+ } from "./chunk-JHBXXJ6X.js";
4
4
  export {
5
5
  handleSuipayMcpHttpRequest
6
6
  };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- 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-BUaEV9I3.js';
2
- 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-BUaEV9I3.js';
3
- import { SuiGrpcClient } from '@mysten/sui/grpc';
4
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-BJFB-Yhm.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-BJFB-Yhm.js';
4
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
5
5
  import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
6
6
  import '@modelcontextprotocol/sdk/server/index.js';
7
7
  import 'node:crypto';
@@ -65,6 +65,8 @@ declare function loadLocalSigner(): {
65
65
  signTransaction: (txBytes: string) => Promise<string>;
66
66
  signPersonalMessage: (message: Uint8Array) => Promise<string>;
67
67
  } | null;
68
+ /** Ed25519 keypair from the persisted seed. Null when this process holds no key. */
69
+ declare function loadLocalKeypair(): Ed25519Keypair | null;
68
70
 
69
71
  /**
70
72
  * Client-side completion of an MCP prepared payment.
@@ -581,6 +583,10 @@ interface ToolDeps {
581
583
  createPayer?: typeof createPayer;
582
584
  createReader?: typeof createReader;
583
585
  startStdioLogin?: typeof startStdioLogin;
586
+ loadLocalKeypair?: typeof loadLocalKeypair;
587
+ checkLiveDelegateGrant?: typeof checkLiveDelegateGrant;
588
+ bypassCache?: boolean;
589
+ cacheTtlMs?: number;
584
590
  }
585
591
  declare function pay(args: {
586
592
  url: string;
@@ -590,7 +596,27 @@ declare function pay(args: {
590
596
  fileField?: unknown;
591
597
  recipient?: unknown;
592
598
  maxAmount?: unknown;
599
+ dialect?: unknown;
593
600
  }, cfg: McpConfig, deps?: ToolDeps): Promise<ToolResult>;
601
+ type LiveGrantCheck = {
602
+ kind: 'live';
603
+ grantObjectId: string;
604
+ } | {
605
+ kind: 'ambiguous';
606
+ } | {
607
+ kind: 'absent';
608
+ } | {
609
+ kind: 'expired';
610
+ } | {
611
+ kind: 'unknown';
612
+ detail: string;
613
+ };
614
+ declare function checkLiveDelegateGrant(args: {
615
+ gatewayUrl: string;
616
+ delegateAddress: string;
617
+ signPersonalMessage: (message: Uint8Array) => Promise<string>;
618
+ fetchImpl?: typeof fetch;
619
+ }): Promise<LiveGrantCheck>;
594
620
  declare function receipts(args: {
595
621
  challengeId?: string;
596
622
  }, cfg: McpConfig, deps?: ToolDeps): Promise<ToolResult>;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadBootProfile,
3
3
  main
4
- } from "./chunk-OAHWW4H7.js";
4
+ } from "./chunk-4HWODHQ4.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-HIBLRYTW.js";
29
+ } from "./chunk-JHBXXJ6X.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.2",
3
+ "version": "0.3.0-dev.20",
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": {