@mysten-incubation/suipay-mcp 0.3.0-dev.15 → 0.3.0-dev.17
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-VLN3ZX5D.js → chunk-OZSWGGG4.js} +28 -6
- package/dist/{chunk-PQVBESG2.js → chunk-VNC7KWFM.js} +1 -1
- package/dist/{http-UzIPB5sy.d.ts → http-BJFB-Yhm.d.ts} +1 -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 +1 -1
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.17` 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.17
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`@dev` installs the Railway-dev gateway/console defaults. A workspace
|
|
@@ -155,10 +155,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
|
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
157
|
# Railway suipay-dev (default)
|
|
158
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
158
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.17
|
|
159
159
|
|
|
160
160
|
# Laptop stack
|
|
161
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
161
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.17 --local
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
`SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
|
package/dist/bin/suipay.js
CHANGED
|
@@ -4059,7 +4059,7 @@ var LIMIT_CODES = {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
},
|
|
4061
4061
|
"limit.rate_limited": {
|
|
4062
|
-
surfaces: ["gateway", "console_server"],
|
|
4062
|
+
surfaces: ["gateway", "console_server", "sdk"],
|
|
4063
4063
|
status: 429,
|
|
4064
4064
|
title: "Rate limit exceeded",
|
|
4065
4065
|
paymentState: "not_charged",
|
|
@@ -5831,6 +5831,8 @@ var CONTEXT_ALLOWLIST = /* @__PURE__ */ new Set([
|
|
|
5831
5831
|
"seedId",
|
|
5832
5832
|
"grantId",
|
|
5833
5833
|
"grantObjectId",
|
|
5834
|
+
"policyId",
|
|
5835
|
+
"onChainPolicyId",
|
|
5834
5836
|
"sameGrantObjectId",
|
|
5835
5837
|
"verifiedGrant",
|
|
5836
5838
|
"poolObjectId",
|
|
@@ -10896,6 +10898,22 @@ async function settlePreparedMcpPayment(args) {
|
|
|
10896
10898
|
});
|
|
10897
10899
|
}
|
|
10898
10900
|
|
|
10901
|
+
// src/mcp-client-header.ts
|
|
10902
|
+
var MCP_CLIENT_HEADER = "x-suipay-client";
|
|
10903
|
+
var MCP_CLIENT_HEADER_VALUE = "mcp";
|
|
10904
|
+
function withMcpClientFetch(base = fetch) {
|
|
10905
|
+
return (input, init) => {
|
|
10906
|
+
const headers = new Headers(input instanceof Request ? input.headers : void 0);
|
|
10907
|
+
if (init?.headers) {
|
|
10908
|
+
new Headers(init.headers).forEach((value, key) => headers.set(key, value));
|
|
10909
|
+
}
|
|
10910
|
+
if (!headers.has(MCP_CLIENT_HEADER)) {
|
|
10911
|
+
headers.set(MCP_CLIENT_HEADER, MCP_CLIENT_HEADER_VALUE);
|
|
10912
|
+
}
|
|
10913
|
+
return base(input, { ...init, headers });
|
|
10914
|
+
};
|
|
10915
|
+
}
|
|
10916
|
+
|
|
10899
10917
|
// ../sdk/dist/agent-sdk/delegate-agent.js
|
|
10900
10918
|
import { normalizeSuiAddress as normalizeSuiAddress12 } from "@mysten/sui/utils";
|
|
10901
10919
|
|
|
@@ -11816,7 +11834,9 @@ async function resolvePayerSession(options) {
|
|
|
11816
11834
|
ok: false,
|
|
11817
11835
|
// The gateway's stable code, never a raw body — the read client already
|
|
11818
11836
|
// sanitized it, and an operator needs to tell 429 from 401.
|
|
11819
|
-
|
|
11837
|
+
// A 429 is the gateway's rate limit, not a manifest the agent can fix, so
|
|
11838
|
+
// it keeps the retryable code instead of the manifest default.
|
|
11839
|
+
error: manifestError(MANIFEST_ERROR_CODES.MALFORMED_MANIFEST, `bootstrap was refused (${bootstrap.error}${bootstrap.code ? `: ${bootstrap.code}` : ""})`, bootstrap.status === 429 ? "limit.rate_limited" : void 0)
|
|
11820
11840
|
};
|
|
11821
11841
|
}
|
|
11822
11842
|
const whole = manifestToSession({
|
|
@@ -12699,7 +12719,7 @@ async function prepareSpendAccountPayment(args) {
|
|
|
12699
12719
|
...refundConfigInitialSharedVersion ? { refundConfigInitialSharedVersion } : {}
|
|
12700
12720
|
});
|
|
12701
12721
|
};
|
|
12702
|
-
const rawFetch = deps.fetchImpl ?? fetch;
|
|
12722
|
+
const rawFetch = withMcpClientFetch(deps.fetchImpl ?? fetch);
|
|
12703
12723
|
const wrappedFetch = (input, init) => {
|
|
12704
12724
|
const probeUrl = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
12705
12725
|
if (probeUrl === request.url || probeUrl === args.url) {
|
|
@@ -13894,7 +13914,7 @@ async function pay(args, cfg, deps = {}) {
|
|
|
13894
13914
|
cfg,
|
|
13895
13915
|
...intent.dialect ? { preferredDialect: intent.dialect } : {},
|
|
13896
13916
|
deps: {
|
|
13897
|
-
|
|
13917
|
+
fetchImpl: withMcpClientFetch(deps.fetchImpl ?? fetch),
|
|
13898
13918
|
...trace ? { trace } : {},
|
|
13899
13919
|
...deps.resolveExclusionRegistry ? { resolveExclusionRegistry: deps.resolveExclusionRegistry } : {},
|
|
13900
13920
|
...deps.buildPayKind ? { buildPayKind: deps.buildPayKind } : liveKindBuilder ? {
|
|
@@ -13946,7 +13966,9 @@ async function pay(args, cfg, deps = {}) {
|
|
|
13946
13966
|
cfg: { gatewayUrl: cfg.gatewayUrl },
|
|
13947
13967
|
deps: {
|
|
13948
13968
|
...deps.agentHeld.payerDeps,
|
|
13949
|
-
|
|
13969
|
+
fetchImpl: withMcpClientFetch(
|
|
13970
|
+
deps.agentHeld.payerDeps.fetchImpl ?? deps.fetchImpl ?? fetch
|
|
13971
|
+
)
|
|
13950
13972
|
}
|
|
13951
13973
|
});
|
|
13952
13974
|
return renderSettled(settled);
|
|
@@ -14173,7 +14195,7 @@ async function stdioPayerAndReader(cfg, deps) {
|
|
|
14173
14195
|
gatewayUrl,
|
|
14174
14196
|
keypair,
|
|
14175
14197
|
...select ? { select } : {},
|
|
14176
|
-
|
|
14198
|
+
fetchImpl: withMcpClientFetch(deps.fetchImpl ?? fetch),
|
|
14177
14199
|
...cfg.rpcUrl ? { fullnodeUrl: cfg.rpcUrl } : {}
|
|
14178
14200
|
});
|
|
14179
14201
|
if (!built.ok) {
|
|
@@ -1368,7 +1368,7 @@ declare const ERRORS: {
|
|
|
1368
1368
|
};
|
|
1369
1369
|
};
|
|
1370
1370
|
readonly 'limit.rate_limited': {
|
|
1371
|
-
readonly surfaces: readonly ["gateway", "console_server"];
|
|
1371
|
+
readonly surfaces: readonly ["gateway", "console_server", "sdk"];
|
|
1372
1372
|
readonly status: 429;
|
|
1373
1373
|
readonly title: "Rate limit exceeded";
|
|
1374
1374
|
readonly paymentState: "not_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-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
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-VNC7KWFM.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-OZSWGGG4.js";
|
|
30
30
|
export {
|
|
31
31
|
MCP_TARGET_PRESETS,
|
|
32
32
|
PACKAGE_NAME,
|
package/package.json
CHANGED