@cmdoss/suipay-mcp 0.2.2-dev.3 → 0.2.2-dev.5
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
|
@@ -76,13 +76,14 @@ json: {"prompt":"a cat"}
|
|
|
76
76
|
maxAmount: 50000
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
`pay` uses SDK `createPayer` internally.
|
|
80
|
-
`~/.suipay/deliveries/` and named first in the
|
|
81
|
-
path) and `savedToUrl` (`file://`).
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
`pay` uses SDK `createPayer` internally. When this process settles, a binary
|
|
80
|
+
body is written once under `~/.suipay/deliveries/` and named first in the
|
|
81
|
+
JSON as `savedTo` (absolute path) and `savedToUrl` (`file://`). Hosted `/mcp`
|
|
82
|
+
is prepare-only and does not write a buyer file. Any MIME — image, audio,
|
|
83
|
+
pdf, octet-stream. JSON stays compact (no base64 wall). An MCP `image` block
|
|
84
|
+
is an extra display hint when the type is `image/*`; hosts such as Claude
|
|
85
|
+
Code's TUI may not render it. Always quote `savedTo` when present. If
|
|
86
|
+
`savedTo` is null, quote `saveError` and do not call `pay` again.
|
|
86
87
|
|
|
87
88
|
## Targets
|
|
88
89
|
|
package/dist/bin/suipay.js
CHANGED
|
@@ -6909,12 +6909,19 @@ function saveDeliveredBody(input) {
|
|
|
6909
6909
|
if (input.bytes.byteLength === 0) return void 0;
|
|
6910
6910
|
const dir = mcpDeliveriesDir();
|
|
6911
6911
|
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
6912
|
+
try {
|
|
6913
|
+
chmodSync2(dir, 448);
|
|
6914
|
+
} catch {
|
|
6915
|
+
}
|
|
6912
6916
|
const path = join3(
|
|
6913
6917
|
dir,
|
|
6914
6918
|
`${fileStem(input.digest, input.challengeId)}${extensionFor(input.contentType)}`
|
|
6915
6919
|
);
|
|
6916
6920
|
writeFileSync(path, input.bytes, { mode: 384 });
|
|
6917
|
-
|
|
6921
|
+
try {
|
|
6922
|
+
chmodSync2(path, 384);
|
|
6923
|
+
} catch {
|
|
6924
|
+
}
|
|
6918
6925
|
return path;
|
|
6919
6926
|
}
|
|
6920
6927
|
|
|
@@ -6944,6 +6951,7 @@ function receiptChallengeId(receipt) {
|
|
|
6944
6951
|
const id = receipt.challengeId;
|
|
6945
6952
|
return typeof id === "string" && id.length > 0 ? id : void 0;
|
|
6946
6953
|
}
|
|
6954
|
+
var MCP_SAVE_ERROR = "delivery file was not written; do not call pay again";
|
|
6947
6955
|
function paidResult(result) {
|
|
6948
6956
|
if (!isBinaryBody(result.body)) return text(result);
|
|
6949
6957
|
const body = result.body;
|
|
@@ -6968,7 +6976,12 @@ function paidResult(result) {
|
|
|
6968
6976
|
savedToUrl: pathToFileURL(savedTo).href,
|
|
6969
6977
|
...result,
|
|
6970
6978
|
body: shape
|
|
6971
|
-
} : {
|
|
6979
|
+
} : {
|
|
6980
|
+
savedTo: null,
|
|
6981
|
+
saveError: MCP_SAVE_ERROR,
|
|
6982
|
+
...result,
|
|
6983
|
+
body: shape
|
|
6984
|
+
};
|
|
6972
6985
|
const content = [
|
|
6973
6986
|
{
|
|
6974
6987
|
type: "text",
|
|
@@ -7597,7 +7610,7 @@ var TOOLS = [
|
|
|
7597
7610
|
},
|
|
7598
7611
|
{
|
|
7599
7612
|
name: "pay",
|
|
7600
|
-
description: "Pay a HTTP resource via delegate. On hosted /mcp the gateway PREPARES an unsigned transaction and returns it (prepare-only \u2014 it never holds the delegate key and cannot settle). Only a process holding the delegate key the grant names can complete settlement (e.g. local stdio MCP, or any self-hosted process with the matching key). Pass recipient and/or maxAmount to state who you intend to pay and what you will spend; both are checked before anything is signed or handed back. Local V1 allowance pay is retired.
|
|
7613
|
+
description: "Pay a HTTP resource via delegate. On hosted /mcp the gateway PREPARES an unsigned transaction and returns it (prepare-only \u2014 it never holds the delegate key and cannot settle). Only a process holding the delegate key the grant names can complete settlement (e.g. local stdio MCP, or any self-hosted process with the matching key). Pass recipient and/or maxAmount to state who you intend to pay and what you will spend; both are checked before anything is signed or handed back. Local V1 allowance pay is retired. When this process settles a paid binary body, it writes the bytes under ~/.suipay/deliveries/ and names savedTo (absolute path) and savedToUrl (file://) first in the JSON. Hosted /mcp is prepare-only and does not write a buyer file. Always quote savedTo when present. If savedTo is null, quote saveError and do not call pay again. Do not assume the host rendered an image block. Never call pay again to display or save a delivery that already settled.",
|
|
7601
7614
|
inputSchema: {
|
|
7602
7615
|
type: "object",
|
|
7603
7616
|
properties: {
|
package/dist/http.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadBootProfile,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P54ZYBPN.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-THLDEMGS.js";
|
|
30
30
|
export {
|
|
31
31
|
MCP_TARGET_PRESETS,
|
|
32
32
|
PACKAGE_NAME,
|
package/package.json
CHANGED