@xiashe/cli 0.1.11 → 0.1.13
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 +6 -5
- package/bin/xiashe.mjs +8 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ xiashe chat send --chat "New Chat" --content "帮我处理这个文件" --file .
|
|
|
23
23
|
xiashe skills publish draft . --source xiashe
|
|
24
24
|
xiashe skills publish doctor "<submission-id>"
|
|
25
25
|
xiashe skills publish submit "<submission-id>"
|
|
26
|
-
|
|
26
|
+
# This checks only that the bridge CLI is present; it does not query a wallet.
|
|
27
|
+
xiashe payment bridge-info
|
|
27
28
|
# After the Agent shows the Skill and purpose and the user explicitly agrees:
|
|
28
29
|
xiashe payment pay --resource-url "https://<actions-site>/payment/alipay-ai-collect?orderId=<id>" --intent-summary "使用付费 Skill:<name>" --confirm
|
|
29
30
|
xiashe payment status --resource-url "https://<actions-site>/payment/alipay-ai-collect?orderId=<id>"
|
|
@@ -47,10 +48,10 @@ Production defaults:
|
|
|
47
48
|
|
|
48
49
|
`xiashe payment` is the shell-capable Agent path for Alipay AI Pay. It delegates only to the official local `alipay-bot` supplied by `@alipay/agent-payment`; it does not implement or expose `Payment-Needed` / `Payment-Proof` itself.
|
|
49
50
|
|
|
50
|
-
- `xiashe payment
|
|
51
|
-
- `xiashe payment pay` requires an HTTPS AI-Collect resource URL, a visible purchase-purpose summary, and `--confirm`.
|
|
52
|
-
- `xiashe payment status` returns a normalized status only. No wallet protocol payload or proof is printed.
|
|
51
|
+
- `xiashe payment bridge-info` checks that the official buyer CLI is available without querying the wallet. `payment doctor` remains a manual diagnostic only.
|
|
52
|
+
- `xiashe payment pay` requests the resource once, saves its exact 402 request in a private local file, and passes that file plus one stable session id to the official buyer CLI. It requires an HTTPS AI-Collect resource URL, a visible purchase-purpose summary, and `--confirm`.
|
|
53
|
+
- `xiashe payment status` resumes the same local attempt with its official query credential and returns a normalized status only. No wallet protocol payload or proof is printed.
|
|
53
54
|
|
|
54
55
|
An Agent must never add `--confirm` before the user has explicitly agreed to the displayed purpose. If the wallet is unavailable, obtain permission before running the official `@alipay/agent-payment` setup, then run `payment doctor` again.
|
|
55
56
|
|
|
56
|
-
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.
|
|
57
|
+
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.13 payment bridge-info`. No global `xiashe` installation is required for that path. The Agent must run the subsequent payment and status commands exactly as supplied, in the foreground: it must inspect the bridge JSON instead of suppressing output or guessing status from shell text.
|
package/bin/xiashe.mjs
CHANGED
|
@@ -36,6 +36,7 @@ const {
|
|
|
36
36
|
decodeMcpToolResult,
|
|
37
37
|
nowIso,
|
|
38
38
|
checkAlipayWallet,
|
|
39
|
+
getAlipayWalletBridgeInfo,
|
|
39
40
|
payAlipay402Resource,
|
|
40
41
|
queryAlipay402Resource
|
|
41
42
|
} = sdk;
|
|
@@ -95,7 +96,7 @@ Usage:
|
|
|
95
96
|
${c} files upload <path>
|
|
96
97
|
${c} files list
|
|
97
98
|
|
|
98
|
-
${c} payment doctor
|
|
99
|
+
${c} payment bridge-info|doctor
|
|
99
100
|
${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
|
|
100
101
|
${c} payment status --resource-url <https-url>
|
|
101
102
|
|
|
@@ -1145,6 +1146,11 @@ async function cmdFiles(sub, args, global) {
|
|
|
1145
1146
|
|
|
1146
1147
|
async function cmdPayment(sub, args, global) {
|
|
1147
1148
|
const flags = parseFlags(args);
|
|
1149
|
+
if (sub === 'bridge-info' || sub === 'bridge' || sub === 'prepare') {
|
|
1150
|
+
const result = await getAlipayWalletBridgeInfo({ timeoutMs: global.timeoutMs });
|
|
1151
|
+
print(result, global);
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1148
1154
|
const walletTimeoutValue = flags['wallet-timeout-ms'] ?? flags.walletTimeoutMs ?? (global.timeoutMsExplicit ? global.timeoutMs : undefined);
|
|
1149
1155
|
const walletTimeoutMs = walletTimeoutValue === undefined
|
|
1150
1156
|
? undefined
|
|
@@ -1174,7 +1180,7 @@ async function cmdPayment(sub, args, global) {
|
|
|
1174
1180
|
print(result, global);
|
|
1175
1181
|
return;
|
|
1176
1182
|
}
|
|
1177
|
-
fail(`Usage: ${COMMAND_NAME} payment doctor|pay|status`, EXIT_USAGE);
|
|
1183
|
+
fail(`Usage: ${COMMAND_NAME} payment bridge-info|doctor|pay|status`, EXIT_USAGE);
|
|
1178
1184
|
}
|
|
1179
1185
|
|
|
1180
1186
|
async function cmdOps(sub, args, global) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiashe/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"xiashe": "bin/xiashe.mjs"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xiashe/sdk": "0.1.
|
|
13
|
+
"@xiashe/sdk": "0.1.13"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|