@xiashe/cli 0.1.29 → 0.1.31
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 +7 -5
- package/bin/xiashe.mjs +13 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,8 +26,10 @@ xiashe skills publish submit "<submission-id>"
|
|
|
26
26
|
# This checks only that the bridge CLI is present; it does not query a wallet.
|
|
27
27
|
xiashe payment bridge-info
|
|
28
28
|
# After the Agent shows the Skill and purpose and the user explicitly agrees:
|
|
29
|
-
xiashe payment pay --resource-url "https://<payment-resource-site>/payment/alipay-ai-collect/skills/<skillCatalogId>?orderId=<id>" --intent-summary "使用付费 Skill:<name>" --confirm
|
|
29
|
+
xiashe payment pay --resource-url "https://<payment-resource-site>/payment/alipay-ai-collect/skills/<skillCatalogId>?orderId=<id>" --intent-summary "使用付费 Skill:<name>" --session-id "<active-agent-session>" --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-digit outShakeNo with 8282 in positions 11–14>"
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Local state is stored in `~/.xiashe/config.json`.
|
|
@@ -48,11 +50,11 @@ Production defaults:
|
|
|
48
50
|
|
|
49
51
|
`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
52
|
|
|
51
|
-
- `xiashe payment bridge-info` checks
|
|
52
|
-
- `xiashe payment pay` requests the resource once, saves its exact 402 request in a private local file, and passes that file plus
|
|
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.
|
|
53
|
+
- `xiashe payment bridge-info` checks that the official buyer CLI can run and exposes the buyer-pay/status command contract required by the bridge. It does not check wallet authorization, merchant activation, or whether a transaction can be created. `payment doctor` remains a manual wallet-status diagnostic only.
|
|
54
|
+
- `xiashe payment pay` requests the resource once, saves its exact 402 request in a private local file, and passes that file plus the current Agent business-session ID to the official buyer CLI. It requires an HTTPS AI-Collect resource URL, a visible purchase-purpose summary, `--session-id`, and `--confirm`; it never generates a replacement session ID.
|
|
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-digit `outShakeNo` (with `8282` in positions 11–14, 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.
|
|
57
59
|
|
|
58
|
-
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.
|
|
60
|
+
For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.31 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
|
@@ -103,8 +103,8 @@ Usage:
|
|
|
103
103
|
|
|
104
104
|
${c} payment bridge-info|doctor
|
|
105
105
|
${c} payment preflight --resource-url <https-url>
|
|
106
|
-
${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
|
|
107
|
-
${c} payment status --resource-url <https-url>
|
|
106
|
+
${c} payment pay --resource-url <https-url> --intent-summary <text> --session-id <active-agent-session> --confirm [--wallet-timeout-ms <ms>]
|
|
107
|
+
${c} payment status --resource-url <https-url> [--out-shake-no <32-digit-8282>|--business-no <32-digit-8282>]
|
|
108
108
|
${c} payment diagnose --resource-url <https-url>
|
|
109
109
|
${c} payment support-report --resource-url <https-url>
|
|
110
110
|
|
|
@@ -1208,9 +1208,11 @@ async function cmdPayment(sub, args, global) {
|
|
|
1208
1208
|
if (sub === 'pay') {
|
|
1209
1209
|
const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
|
|
1210
1210
|
const intentSummary = requireArg(flags['intent-summary'] || flags.intentSummary || flags.i, '--intent-summary');
|
|
1211
|
+
const sessionId = requireArg(flags['session-id'] || flags.sessionId, '--session-id');
|
|
1211
1212
|
const result = await payAlipay402Resource({
|
|
1212
1213
|
resourceUrl,
|
|
1213
1214
|
intentSummary,
|
|
1215
|
+
sessionId,
|
|
1214
1216
|
confirm: flags.confirm === true
|
|
1215
1217
|
}, walletTimeoutMs ? { timeoutMs: walletTimeoutMs } : {});
|
|
1216
1218
|
print(result, global);
|
|
@@ -1218,7 +1220,15 @@ async function cmdPayment(sub, args, global) {
|
|
|
1218
1220
|
}
|
|
1219
1221
|
if (sub === 'status') {
|
|
1220
1222
|
const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
|
|
1221
|
-
const
|
|
1223
|
+
const outShakeNo = flags['out-shake-no'] || flags.outShakeNo;
|
|
1224
|
+
const businessNo = flags['business-no'] || flags.businessNo;
|
|
1225
|
+
if (outShakeNo && businessNo && String(outShakeNo) !== String(businessNo)) {
|
|
1226
|
+
fail('Use one matching --out-shake-no or --business-no value.', EXIT_USAGE);
|
|
1227
|
+
}
|
|
1228
|
+
const result = await queryAlipay402Resource({
|
|
1229
|
+
resourceUrl,
|
|
1230
|
+
...(outShakeNo || businessNo ? { outShakeNo: outShakeNo || businessNo } : {})
|
|
1231
|
+
}, { timeoutMs: global.timeoutMs });
|
|
1222
1232
|
print(result, global);
|
|
1223
1233
|
return;
|
|
1224
1234
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiashe/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
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.31"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=20"
|