@xiashe/cli 0.1.28 → 0.1.30
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 -1
- package/bin/xiashe.mjs +10 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ xiashe payment bridge-info
|
|
|
28
28
|
# After the Agent shows the Skill and purpose and the user explicitly agrees:
|
|
29
29
|
xiashe payment pay --resource-url "https://<payment-resource-site>/payment/alipay-ai-collect/skills/<skillCatalogId>?orderId=<id>" --intent-summary "使用付费 Skill:<name>" --confirm
|
|
30
30
|
xiashe payment status --resource-url "https://<payment-resource-site>/payment/alipay-ai-collect/skills/<skillCatalogId>?orderId=<id>"
|
|
31
|
+
# Only for an Alipay support-assisted read-only query. This is not out_trade_no or Payment-Proof.
|
|
32
|
+
xiashe payment status --resource-url "https://<payment-resource-site>/payment/alipay-ai-collect/skills/<skillCatalogId>?orderId=<id>" --business-no "<32-character outShakeNo>"
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Local state is stored in `~/.xiashe/config.json`.
|
|
@@ -50,7 +52,7 @@ Production defaults:
|
|
|
50
52
|
|
|
51
53
|
- `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
54
|
- `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. 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.
|
|
55
|
+
- `xiashe payment status` resumes the same local attempt with its official query credential and returns a normalized status only. If Alipay support provides the documented 32-character `outShakeNo` (sometimes called a business order number), use `--out-shake-no` or `--business-no` for one read-only status query; it is validated, never stored, and cannot create a payment or acknowledge fulfillment. 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
56
|
- `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
57
|
|
|
56
58
|
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.
|
package/bin/xiashe.mjs
CHANGED
|
@@ -104,7 +104,7 @@ Usage:
|
|
|
104
104
|
${c} payment bridge-info|doctor
|
|
105
105
|
${c} payment preflight --resource-url <https-url>
|
|
106
106
|
${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
|
|
107
|
-
${c} payment status --resource-url <https-url>
|
|
107
|
+
${c} payment status --resource-url <https-url> [--out-shake-no <32-char>|--business-no <32-char>]
|
|
108
108
|
${c} payment diagnose --resource-url <https-url>
|
|
109
109
|
${c} payment support-report --resource-url <https-url>
|
|
110
110
|
|
|
@@ -1218,7 +1218,15 @@ async function cmdPayment(sub, args, global) {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
if (sub === 'status') {
|
|
1220
1220
|
const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
|
|
1221
|
-
const
|
|
1221
|
+
const outShakeNo = flags['out-shake-no'] || flags.outShakeNo;
|
|
1222
|
+
const businessNo = flags['business-no'] || flags.businessNo;
|
|
1223
|
+
if (outShakeNo && businessNo && String(outShakeNo) !== String(businessNo)) {
|
|
1224
|
+
fail('Use one matching --out-shake-no or --business-no value.', EXIT_USAGE);
|
|
1225
|
+
}
|
|
1226
|
+
const result = await queryAlipay402Resource({
|
|
1227
|
+
resourceUrl,
|
|
1228
|
+
...(outShakeNo || businessNo ? { outShakeNo: outShakeNo || businessNo } : {})
|
|
1229
|
+
}, { timeoutMs: global.timeoutMs });
|
|
1222
1230
|
print(result, global);
|
|
1223
1231
|
return;
|
|
1224
1232
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiashe/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
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.30"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|