@xiashe/cli 0.1.10 → 0.1.11

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
@@ -53,4 +53,4 @@ Production defaults:
53
53
 
54
54
  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
55
 
56
- For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.10 payment doctor`. No global `xiashe` installation is required for that path.
56
+ For a clean Codex Task, the XiaShe MCP response provides a version-pinned ephemeral command such as `npx -y @xiashe/cli@0.1.11 payment doctor`. No global `xiashe` installation is required for that path.
package/bin/xiashe.mjs CHANGED
@@ -96,7 +96,7 @@ Usage:
96
96
  ${c} files list
97
97
 
98
98
  ${c} payment doctor
99
- ${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm
99
+ ${c} payment pay --resource-url <https-url> --intent-summary <text> --confirm [--wallet-timeout-ms <ms>]
100
100
  ${c} payment status --resource-url <https-url>
101
101
 
102
102
  ${c} ops doctor
@@ -126,7 +126,8 @@ function parseGlobal(argv) {
126
126
  actionsUrl: '',
127
127
  market: '',
128
128
  locale: '',
129
- timeoutMs: 20_000
129
+ timeoutMs: 20_000,
130
+ timeoutMsExplicit: false
130
131
  };
131
132
  for (let i = 0; i < argv.length; i += 1) {
132
133
  const value = argv[i];
@@ -173,6 +174,7 @@ function parseGlobal(argv) {
173
174
  if (!Number.isFinite(global.timeoutMs) || global.timeoutMs < 1000) {
174
175
  fail('Invalid --timeout-ms value.', EXIT_USAGE);
175
176
  }
177
+ global.timeoutMsExplicit = true;
176
178
  i += 1;
177
179
  continue;
178
180
  }
@@ -1143,6 +1145,13 @@ async function cmdFiles(sub, args, global) {
1143
1145
 
1144
1146
  async function cmdPayment(sub, args, global) {
1145
1147
  const flags = parseFlags(args);
1148
+ const walletTimeoutValue = flags['wallet-timeout-ms'] ?? flags.walletTimeoutMs ?? (global.timeoutMsExplicit ? global.timeoutMs : undefined);
1149
+ const walletTimeoutMs = walletTimeoutValue === undefined
1150
+ ? undefined
1151
+ : numericFlag({ walletTimeoutMs: walletTimeoutValue }, 'walletTimeoutMs', 0);
1152
+ if (walletTimeoutValue !== undefined && !walletTimeoutMs) {
1153
+ fail('Invalid --wallet-timeout-ms value.', EXIT_USAGE);
1154
+ }
1146
1155
  if (sub === 'doctor' || sub === 'wallet' || sub === 'wallet-status') {
1147
1156
  const result = await checkAlipayWallet({ timeoutMs: global.timeoutMs });
1148
1157
  print(result, global);
@@ -1155,7 +1164,7 @@ async function cmdPayment(sub, args, global) {
1155
1164
  resourceUrl,
1156
1165
  intentSummary,
1157
1166
  confirm: flags.confirm === true
1158
- }, { timeoutMs: global.timeoutMs });
1167
+ }, walletTimeoutMs ? { timeoutMs: walletTimeoutMs } : {});
1159
1168
  print(result, global);
1160
1169
  return;
1161
1170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiashe/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
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.10"
13
+ "@xiashe/sdk": "0.1.11"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=20"