@cmdoss/suipay-mcp 0.2.2-dev.9 → 0.3.0-dev.0

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,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-dev.9` in MCP config. `1.0.1` remains on the
9
- registry as a historical release; do not install it for new agents.
8
+ Pin `@cmdoss/suipay-mcp@0.3.0-dev.0` 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-dev.9
16
+ claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.3.0-dev.0
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
@@ -101,6 +107,41 @@ is an extra display hint when the type is `image/*`; hosts such as Claude
101
107
  Code's TUI may not render it. Always quote `savedTo` when present. If
102
108
  `savedTo` is null, quote `saveError` and do not call `pay` again.
103
109
 
110
+ ## Tool errors — branch on `code`
111
+
112
+ A tool result whose `status` is `failed` or `ambiguous` sets `isError: true`
113
+ and puts the error model in `structuredContent`:
114
+
115
+ | Field | Meaning |
116
+ | --- | --- |
117
+ | `status`, `paid` | As before. `paid` is `true`, `false` or `'unknown'`. |
118
+ | `code` | Registered error code, e.g. `request.file_outside_root`. **Branch on this**, never on the text. |
119
+ | `paymentState` | `charged`, `unknown` or `not_charged`; always agrees with `paid`. |
120
+ | `retryable` | `true` only when a retry cannot charge twice. |
121
+ | `nextAction` | `retry`, `retry_later`, `fix_request`, `sign_in`, `approve_access`, `add_funds`, `reconcile`, `contact_support` or `none`. |
122
+ | `detail` | Developer text that states the fix. |
123
+ | `txDigest`, `paymentId` | When known. |
124
+
125
+ The text block holds the same object as JSON. When money moved or may have
126
+ moved it **starts** with a line for the model:
127
+
128
+ ```
129
+ You were charged. Do not pay again for this request.
130
+ { "status": "ambiguous", "paid": true, "code": "delivery.seller_unreachable", "paymentState": "charged", ... }
131
+ ```
132
+
133
+ (`This payment may have gone through. Do not pay again until it is resolved.`
134
+ when `paymentState` is `unknown`.) A result whose `status` is `ok` or
135
+ `prepared` is never an error, including a free response that needed no
136
+ payment.
137
+
138
+ Common local codes: `auth.login_required` (run `suipay_login`),
139
+ `request.file_outside_root` / `request.file_root_unset` (set
140
+ `SUIPAY_MCP_FILE_ROOT`), `client.local_credentials_invalid` (log in again),
141
+ `client.gateway_unreachable` (retry later). An unknown tool name is a JSON-RPC
142
+ error, not a tool result; an invalid argument such as a relative `url` is a
143
+ tool error with a `request.*` code and `nextAction: "fix_request"`.
144
+
104
145
  ## Targets
105
146
 
106
147
  Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
@@ -112,10 +153,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
112
153
 
113
154
  ```bash
114
155
  # Railway suipay-dev (default)
115
- npx @cmdoss/suipay-mcp@0.2.2-dev.9
156
+ npx @cmdoss/suipay-mcp@0.3.0-dev.0
116
157
 
117
158
  # Laptop stack
118
- npx @cmdoss/suipay-mcp@0.2.2-dev.9 --local
159
+ npx @cmdoss/suipay-mcp@0.3.0-dev.0 --local
119
160
  ```
120
161
 
121
162
  `SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
@@ -175,4 +216,8 @@ node packages/mcp/dist/bin/suipay.js
175
216
  Binary writes status banner to stderr only. Stdout stays reserved for
176
217
  MCP protocol.
177
218
 
178
- Do not publish `@cmdoss/suipay-mcp` from this change.
219
+ Publishing is the `release-npm` workflow: merge to `dev` publishes
220
+ `@cmdoss/suipay-mcp@<version>-dev.N` with dist-tag `dev` (OIDC, pack gate,
221
+ provenance). `latest` is a gated dispatch from `main` (`dry_run` default
222
+ true). Do not `npm publish` from a laptop. See
223
+ [`docs/guide/npm-release.md`](../../docs/guide/npm-release.md).
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "../chunk-LQOZBRH6.js";
5
- import "../chunk-NDJ7BFI4.js";
4
+ } from "../chunk-W4RIN664.js";
5
+ import {
6
+ logError
7
+ } from "../chunk-FKDC22O6.js";
6
8
 
7
9
  // src/bin/suipay.ts
8
10
  main().catch((err) => {
9
- console.error(err instanceof Error ? err.message : String(err));
11
+ logError({ scope: "suipay-mcp", code: "client.unexpected", withStack: true }, err);
10
12
  process.exit(1);
11
13
  });