@cmdoss/suipay-mcp 0.2.2-dev.23 → 0.2.2-dev.25

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,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 `@cmdoss/suipay-mcp@0.2.2-dev.23` in MCP config for the `latest` dist-tag.
8
+ Pin `@cmdoss/suipay-mcp@0.2.2-dev.25` in MCP config for the `latest` dist-tag.
9
9
  `npx -y @cmdoss/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 @cmdoss/suipay-mcp@0.2.2-dev.23
16
+ claude mcp add --scope user suipay -- npx -y @cmdoss/suipay-mcp@0.2.2-dev.25
17
17
  ```
18
18
 
19
19
  `@dev` installs the Railway-dev gateway/console defaults. A workspace
@@ -107,6 +107,42 @@ is an extra display hint when the type is `image/*`; hosts such as Claude
107
107
  Code's TUI may not render it. Always quote `savedTo` when present. If
108
108
  `savedTo` is null, quote `saveError` and do not call `pay` again.
109
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
+ | `supportCode` | Always present. The gateway's when it produced the failure; otherwise minted by this MCP server and written, with the failure, to its stderr log. Find the cause in the MCP host's log by searching for it. |
123
+ | `detail` | Developer text that states the fix. |
124
+ | `txDigest`, `paymentId` | When known. |
125
+
126
+ The text block holds the same object as JSON. When money moved or may have
127
+ moved it **starts** with a line for the model:
128
+
129
+ ```
130
+ You were charged. Do not pay again for this request.
131
+ { "status": "ambiguous", "paid": true, "code": "delivery.seller_unreachable", "paymentState": "charged", ... }
132
+ ```
133
+
134
+ (`This payment may have gone through. Do not pay again until it is resolved.`
135
+ when `paymentState` is `unknown`.) A result whose `status` is `ok` or
136
+ `prepared` is never an error, including a free response that needed no
137
+ payment.
138
+
139
+ Common local codes: `auth.login_required` (run `suipay_login`),
140
+ `request.file_outside_root` / `request.file_root_unset` (set
141
+ `SUIPAY_MCP_FILE_ROOT`), `client.local_credentials_invalid` (log in again),
142
+ `client.gateway_unreachable` (retry later). An unknown tool name is a JSON-RPC
143
+ error, not a tool result; an invalid argument such as a relative `url` is a
144
+ tool error with a `request.*` code and `nextAction: "fix_request"`.
145
+
110
146
  ## Targets
111
147
 
112
148
  Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
@@ -118,10 +154,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
118
154
 
119
155
  ```bash
120
156
  # Railway suipay-dev (default)
121
- npx @cmdoss/suipay-mcp@0.2.2-dev.23
157
+ npx @cmdoss/suipay-mcp@0.2.2-dev.25
122
158
 
123
159
  # Laptop stack
124
- npx @cmdoss/suipay-mcp@0.2.2-dev.23 --local
160
+ npx @cmdoss/suipay-mcp@0.2.2-dev.25 --local
125
161
  ```
126
162
 
127
163
  `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-IBRMIXCG.js";
5
- import "../chunk-6VFKI2BY.js";
4
+ } from "../chunk-74KH4ITB.js";
5
+ import "../chunk-NL2IYRLH.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-6VFKI2BY.js";
7
+ } from "./chunk-NL2IYRLH.js";
8
8
 
9
9
  // src/index.ts
10
10
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";