@cmdoss/suipay-mcp 0.2.2-dev.1 → 0.2.2-dev.11
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 +41 -9
- package/dist/bin/suipay.js +2 -2
- package/dist/{chunk-K6WM4Z7H.js → chunk-6GJ7IGYM.js} +2 -2
- package/dist/{chunk-NVTYOOMY.js → chunk-WRN7FRUI.js} +2180 -301
- package/dist/{http-B4YTVw0k.d.ts → http-RP-Xlg60.d.ts} +257 -4
- package/dist/http.d.ts +4 -1
- package/dist/http.js +1 -1
- package/dist/index.d.ts +14 -215
- package/dist/index.js +2 -2
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -5,15 +5,21 @@ 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 `@cmdoss/suipay-mcp@0.2.2` in MCP config
|
|
9
|
-
|
|
8
|
+
Pin `@cmdoss/suipay-mcp@0.2.2-dev.11` in MCP config for the `latest` dist-tag.
|
|
9
|
+
`npx -y @cmdoss/suipay-mcp@dev` tracks the `dev` prerelease line.
|
|
10
|
+
`1.0.1` remains on the registry as a historical release; do not install it
|
|
11
|
+
for new agents.
|
|
10
12
|
|
|
11
13
|
## Install
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2
|
|
16
|
+
claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2-dev.11
|
|
15
17
|
```
|
|
16
18
|
|
|
19
|
+
`@dev` installs the Railway-dev gateway/console defaults. A workspace
|
|
20
|
+
checkout still defaults to localhost. `SUIPAY_GATEWAY_URL` and
|
|
21
|
+
`SUIPAY_CONSOLE_URL` always override.
|
|
22
|
+
|
|
17
23
|
No wallet secret belongs in this command or MCP config. There is no
|
|
18
24
|
Sign-In With Sui (SIWS) step. To reuse an existing delegate seed locally,
|
|
19
25
|
set `SUIPAY_MCP_KEY` (64-hex or `suiprivkey1…`) in the MCP env — never in
|
|
@@ -51,7 +57,7 @@ missing, expired, or revoked.
|
|
|
51
57
|
| Tool | Purpose |
|
|
52
58
|
| --- | --- |
|
|
53
59
|
| `discover` | Search live gateway resources. After login: `name`, `path`, `url`, `targetHash`, catalog price, and `affordable` (can this session cover one call — not authorization). `pay({ url })` still settles |
|
|
54
|
-
| `pay` | Fetch resource, prepare `spend_account` settlement, settle when this process holds the grant key |
|
|
60
|
+
| `pay` | Fetch resource, prepare `spend_account` settlement, settle when this process holds the grant key. POST `json` is the paid body. Optional stdio `file` + `fileField` fill one JSON key from a local file as canonical base64 (Walrus `contentBase64`); requires `SUIPAY_MCP_FILE_ROOT`; hosted `/mcp` refuses `file` |
|
|
55
61
|
| `receipts` | List settlement receipts, optionally by challenge ID |
|
|
56
62
|
| `access_context` | Report current session / delegate / policy state (no secret material) |
|
|
57
63
|
| `suipay_login` | Mint or reuse the local delegate key and return a clickable console URL (does not wait for the wallet). Default target is Railway suipay-dev; pass `target: "local"` for the laptop stack |
|
|
@@ -76,8 +82,30 @@ json: {"prompt":"a cat"}
|
|
|
76
82
|
maxAmount: 50000
|
|
77
83
|
```
|
|
78
84
|
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
To store local bytes (Walrus), do not paste base64. Name the file and field.
|
|
86
|
+
Set `SUIPAY_MCP_FILE_ROOT` to an absolute directory; `file` must resolve inside
|
|
87
|
+
it (unset disables attach). Paths under `~/.suipay` are refused even if that
|
|
88
|
+
directory falls inside the root.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Pay this SuiPay resource with the suipay MCP `pay` tool. Do not write SDK code.
|
|
92
|
+
|
|
93
|
+
url: https://gateway.example/v1/walrus/store
|
|
94
|
+
method: POST
|
|
95
|
+
json: {"contentType":"text/plain"}
|
|
96
|
+
file: /absolute/path/to/note.txt
|
|
97
|
+
fileField: contentBase64
|
|
98
|
+
maxAmount: 50000
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`pay` uses SDK `createPayer` internally. When this process settles, a binary
|
|
102
|
+
body is written once under `~/.suipay/deliveries/` and named first in the
|
|
103
|
+
JSON as `savedTo` (absolute path) and `savedToUrl` (`file://`). Hosted `/mcp`
|
|
104
|
+
is prepare-only and does not write a buyer file. Any MIME — image, audio,
|
|
105
|
+
pdf, octet-stream. JSON stays compact (no base64 wall). An MCP `image` block
|
|
106
|
+
is an extra display hint when the type is `image/*`; hosts such as Claude
|
|
107
|
+
Code's TUI may not render it. Always quote `savedTo` when present. If
|
|
108
|
+
`savedTo` is null, quote `saveError` and do not call `pay` again.
|
|
81
109
|
|
|
82
110
|
## Targets
|
|
83
111
|
|
|
@@ -90,10 +118,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
|
|
|
90
118
|
|
|
91
119
|
```bash
|
|
92
120
|
# Railway suipay-dev (default)
|
|
93
|
-
npx @cmdoss/suipay-mcp@0.2.2
|
|
121
|
+
npx @cmdoss/suipay-mcp@0.2.2-dev.11
|
|
94
122
|
|
|
95
123
|
# Laptop stack
|
|
96
|
-
npx @cmdoss/suipay-mcp@0.2.2 --local
|
|
124
|
+
npx @cmdoss/suipay-mcp@0.2.2-dev.11 --local
|
|
97
125
|
```
|
|
98
126
|
|
|
99
127
|
`SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
|
|
@@ -153,4 +181,8 @@ node packages/mcp/dist/bin/suipay.js
|
|
|
153
181
|
Binary writes status banner to stderr only. Stdout stays reserved for
|
|
154
182
|
MCP protocol.
|
|
155
183
|
|
|
156
|
-
|
|
184
|
+
Publishing is the `release-npm` workflow: merge to `dev` publishes
|
|
185
|
+
`@cmdoss/suipay-mcp@<version>-dev.N` with dist-tag `dev` (OIDC, pack gate,
|
|
186
|
+
provenance). `latest` is a gated dispatch from `main` (`dry_run` default
|
|
187
|
+
true). Do not `npm publish` from a laptop. See
|
|
188
|
+
[`docs/guide/npm-release.md`](../../docs/guide/npm-release.md).
|
package/dist/bin/suipay.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
loadLocalSigningKeyRecord,
|
|
5
5
|
loadMcpConfig,
|
|
6
6
|
loadPaymentProfile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WRN7FRUI.js";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -19,7 +19,7 @@ async function main() {
|
|
|
19
19
|
const argv = process.argv.slice(2);
|
|
20
20
|
const cfg = loadMcpConfig(process.env, argv);
|
|
21
21
|
const target = cfg.target ?? "dev";
|
|
22
|
-
const server = createServer(cfg);
|
|
22
|
+
const server = createServer(cfg, void 0, void 0, { transport: "stdio" });
|
|
23
23
|
await server.connect(new StdioServerTransport());
|
|
24
24
|
try {
|
|
25
25
|
const boundGateway = loadLocalSigningKeyRecord()?.gatewayUrl ?? cfg.gatewayUrl;
|