@cmdoss/suipay-mcp 0.2.2-dev.1 → 0.2.2-dev.10

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,13 +5,13 @@ 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. `1.0.1` remains on the
8
+ Pin `@cmdoss/suipay-mcp@0.2.2-dev.10` in MCP config. `1.0.1` remains on the
9
9
  registry as a historical release; do not install it for new agents.
10
10
 
11
11
  ## Install
12
12
 
13
13
  ```bash
14
- claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2
14
+ claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2-dev.10
15
15
  ```
16
16
 
17
17
  No wallet secret belongs in this command or MCP config. There is no
@@ -51,7 +51,7 @@ missing, expired, or revoked.
51
51
  | Tool | Purpose |
52
52
  | --- | --- |
53
53
  | `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 |
54
+ | `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
55
  | `receipts` | List settlement receipts, optionally by challenge ID |
56
56
  | `access_context` | Report current session / delegate / policy state (no secret material) |
57
57
  | `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 +76,30 @@ json: {"prompt":"a cat"}
76
76
  maxAmount: 50000
77
77
  ```
78
78
 
79
- `pay` uses SDK `createPayer` internally. A delivered image is returned as an MCP
80
- image block, not as a base64 wall in the JSON summary.
79
+ To store local bytes (Walrus), do not paste base64. Name the file and field.
80
+ Set `SUIPAY_MCP_FILE_ROOT` to an absolute directory; `file` must resolve inside
81
+ it (unset disables attach). Paths under `~/.suipay` are refused even if that
82
+ directory falls inside the root.
83
+
84
+ ```
85
+ Pay this SuiPay resource with the suipay MCP `pay` tool. Do not write SDK code.
86
+
87
+ url: https://gateway.example/v1/walrus/store
88
+ method: POST
89
+ json: {"contentType":"text/plain"}
90
+ file: /absolute/path/to/note.txt
91
+ fileField: contentBase64
92
+ maxAmount: 50000
93
+ ```
94
+
95
+ `pay` uses SDK `createPayer` internally. When this process settles, a binary
96
+ body is written once under `~/.suipay/deliveries/` and named first in the
97
+ JSON as `savedTo` (absolute path) and `savedToUrl` (`file://`). Hosted `/mcp`
98
+ is prepare-only and does not write a buyer file. Any MIME — image, audio,
99
+ pdf, octet-stream. JSON stays compact (no base64 wall). An MCP `image` block
100
+ is an extra display hint when the type is `image/*`; hosts such as Claude
101
+ Code's TUI may not render it. Always quote `savedTo` when present. If
102
+ `savedTo` is null, quote `saveError` and do not call `pay` again.
81
103
 
82
104
  ## Targets
83
105
 
@@ -90,10 +112,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
90
112
 
91
113
  ```bash
92
114
  # Railway suipay-dev (default)
93
- npx @cmdoss/suipay-mcp@0.2.2
115
+ npx @cmdoss/suipay-mcp@0.2.2-dev.10
94
116
 
95
117
  # Laptop stack
96
- npx @cmdoss/suipay-mcp@0.2.2 --local
118
+ npx @cmdoss/suipay-mcp@0.2.2-dev.10 --local
97
119
  ```
98
120
 
99
121
  `SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../chunk-K6WM4Z7H.js";
5
- import "../chunk-NVTYOOMY.js";
4
+ } from "../chunk-LQOZBRH6.js";
5
+ import "../chunk-NDJ7BFI4.js";
6
6
 
7
7
  // src/bin/suipay.ts
8
8
  main().catch((err) => {
@@ -4,7 +4,7 @@ import {
4
4
  loadLocalSigningKeyRecord,
5
5
  loadMcpConfig,
6
6
  loadPaymentProfile
7
- } from "./chunk-NVTYOOMY.js";
7
+ } from "./chunk-NDJ7BFI4.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;