@xiashe/cli 0.1.18 → 0.1.20

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
@@ -51,7 +51,8 @@ Production defaults:
51
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
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
55
 
55
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.
56
57
 
57
- For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.18 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. Failed attempts include a redacted `diagnosis` object and `userVisible` next step; do not replace them with a generic payment-failed message.
58
+ For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.20 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. 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
@@ -38,7 +38,8 @@ const {
38
38
  checkAlipayWallet,
39
39
  getAlipayWalletBridgeInfo,
40
40
  payAlipay402Resource,
41
- queryAlipay402Resource
41
+ queryAlipay402Resource,
42
+ diagnoseAlipay402Resource
42
43
  } = sdk;
43
44
 
44
45
  const EXIT_USAGE = 2;
@@ -99,6 +100,7 @@ Usage:
99
100
  ${c} payment bridge-info|doctor
100
101
  ${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
101
102
  ${c} payment status --resource-url <https-url>
103
+ ${c} payment diagnose --resource-url <https-url>
102
104
 
103
105
  ${c} ops doctor
104
106
 
@@ -1180,7 +1182,13 @@ async function cmdPayment(sub, args, global) {
1180
1182
  print(result, global);
1181
1183
  return;
1182
1184
  }
1183
- fail(`Usage: ${COMMAND_NAME} payment bridge-info|doctor|pay|status`, EXIT_USAGE);
1185
+ if (sub === 'diagnose') {
1186
+ const resourceUrl = requireArg(flags['resource-url'] || flags.resourceUrl || flags.r, '--resource-url');
1187
+ const result = await diagnoseAlipay402Resource({ resourceUrl });
1188
+ print(result, global);
1189
+ return;
1190
+ }
1191
+ fail(`Usage: ${COMMAND_NAME} payment bridge-info|doctor|pay|status|diagnose`, EXIT_USAGE);
1184
1192
  }
1185
1193
 
1186
1194
  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.18",
3
+ "version": "0.1.20",
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.18"
13
+ "@xiashe/sdk": "0.1.20"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=20"