@xiashe/cli 0.1.22 → 0.1.24
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 +3 -3
- package/bin/xiashe.mjs +9 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,11 +48,11 @@ Production defaults:
|
|
|
48
48
|
|
|
49
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.
|
|
50
50
|
|
|
51
|
-
- `xiashe payment bridge-info` checks that the official buyer CLI
|
|
51
|
+
- `xiashe payment bridge-info` checks only that the official buyer CLI can run. It does not check wallet authorization, merchant activation, or whether a transaction can be created. `payment doctor` remains a manual wallet-status diagnostic only.
|
|
52
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
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. A QR or confirmation image is exposed only as `officialMedia` when the official wallet emitted that image in the same invocation; the bridge never generates one itself.
|
|
54
|
-
- `xiashe payment diagnose` is read-only. It reports the last stored safe diagnosis for that local attempt, without contacting Alipay, replaying the resource, or exposing its local query credential.
|
|
54
|
+
- `xiashe payment preflight` requests the seller resource once and validates the public field shape of its 402 bill without opening a wallet or creating a trade. It does not prove that Alipay accepts the seller signature, service binding, or merchant activation. `xiashe payment diagnose` is read-only. It reports the last stored safe diagnosis for that local attempt, including allow-listed official error/sub-codes, message, and request/trace identifiers when present, without contacting Alipay, replaying the resource, or exposing its local query credential.
|
|
55
55
|
|
|
56
56
|
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.
|
|
57
57
|
|
|
58
|
-
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.
|
|
58
|
+
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.24 payment bridge-info`. No global `xiashe` installation is required for that path. Run the supplied preflight command before requesting payment confirmation, then run the payment and status commands exactly as supplied in the foreground. The Agent must inspect bridge JSON instead of suppressing output or guessing status from shell text. Failed attempts include a redacted `diagnosis` object and `userVisible` next step; do not replace them with a generic payment-failed message.
|
package/bin/xiashe.mjs
CHANGED
|
@@ -37,6 +37,7 @@ const {
|
|
|
37
37
|
nowIso,
|
|
38
38
|
checkAlipayWallet,
|
|
39
39
|
getAlipayWalletBridgeInfo,
|
|
40
|
+
preflightAlipay402Resource,
|
|
40
41
|
payAlipay402Resource,
|
|
41
42
|
queryAlipay402Resource,
|
|
42
43
|
diagnoseAlipay402Resource
|
|
@@ -98,6 +99,7 @@ Usage:
|
|
|
98
99
|
${c} files list
|
|
99
100
|
|
|
100
101
|
${c} payment bridge-info|doctor
|
|
102
|
+
${c} payment preflight --resource-url <https-url>
|
|
101
103
|
${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
|
|
102
104
|
${c} payment status --resource-url <https-url>
|
|
103
105
|
${c} payment diagnose --resource-url <https-url>
|
|
@@ -1165,6 +1167,12 @@ async function cmdPayment(sub, args, global) {
|
|
|
1165
1167
|
print(result, global);
|
|
1166
1168
|
return;
|
|
1167
1169
|
}
|
|
1170
|
+
if (sub === 'preflight') {
|
|
1171
|
+
const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
|
|
1172
|
+
const result = await preflightAlipay402Resource({ resourceUrl }, { timeoutMs: global.timeoutMs });
|
|
1173
|
+
print(result, global);
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1168
1176
|
if (sub === 'pay') {
|
|
1169
1177
|
const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
|
|
1170
1178
|
const intentSummary = requireArg(flags['intent-summary'] || flags.intentSummary || flags.i, '--intent-summary');
|
|
@@ -1188,7 +1196,7 @@ async function cmdPayment(sub, args, global) {
|
|
|
1188
1196
|
print(result, global);
|
|
1189
1197
|
return;
|
|
1190
1198
|
}
|
|
1191
|
-
fail(`Usage: ${COMMAND_NAME} payment bridge-info|doctor|pay|status|diagnose`, EXIT_USAGE);
|
|
1199
|
+
fail(`Usage: ${COMMAND_NAME} payment bridge-info|doctor|preflight|pay|status|diagnose`, EXIT_USAGE);
|
|
1192
1200
|
}
|
|
1193
1201
|
|
|
1194
1202
|
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.24",
|
|
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.24"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|