@itpay/cli 2.0.7 → 2.0.8

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/dist/src/main.js CHANGED
@@ -94,6 +94,7 @@ function reportCLIError(error, contract) {
94
94
  error.code === "client_compatibility_headers_required" ||
95
95
  error.code === "platform_release_unavailable" ||
96
96
  (error.status === 404 && error.code === "unknown_error"));
97
+ const backendInternal = error instanceof HttpError && error.status === 500 && error.code === "internal_error";
97
98
  const deviceRecovery = deviceError ? [{
98
99
  command: "itpay skill show itpay-buyer --json",
99
100
  reason: "读取身份边界;该错误需要用户或运营恢复 Backend 登记,不能通过换类型或删除本地身份绕过",
@@ -120,9 +121,11 @@ function reportCLIError(error, contract) {
120
121
  },
121
122
  instruction: incompatible
122
123
  ? "当前 Backend 不支持本 CLI 所需的交易合同。立即停止;不要尝试 services quote、services checkout、cart、buy 或 pay 作为替代路径。需要先同步 CLI 与 Backend 版本。"
123
- : commandError?.instruction ?? authorizationInstruction ?? contract?.instruction ?? "检查命令参数后重试。",
124
+ : backendInternal
125
+ ? "Backend 内部故障;立即停止并向用户报告。不要重试、检查或删除 Device 身份、创建替代 Execution、切换 Backend,或尝试 quote、checkout、cart、buy、pay 等付费路径。"
126
+ : commandError?.instruction ?? authorizationInstruction ?? contract?.instruction ?? "检查命令参数后重试。",
124
127
  next: null,
125
- recovery: incompatible ? [] : commandError?.recovery ?? (stateError ? stateRecovery : deviceError ? deviceRecovery : identityRecovery ? httpRecovery : contract?.recovery ?? []),
128
+ recovery: incompatible || backendInternal ? [] : commandError?.recovery ?? (stateError ? stateRecovery : deviceError ? deviceRecovery : identityRecovery ? httpRecovery : contract?.recovery ?? []),
126
129
  }, {
127
130
  ...(contract?.jsonOutput !== undefined ? { jsonOutput: contract.jsonOutput } : {}),
128
131
  output: (text) => { process.stderr.write(text); },
@@ -10,7 +10,7 @@ import { declaredAgentType } from "./agent_type.js";
10
10
  import { DeviceAuthority } from "./device_authority.js";
11
11
  import { OperationJournal } from "./operation_journal.js";
12
12
  export const DEFAULT_BASE_URL = "https://app.itpay.ai";
13
- export const CLI_VERSION = "2.0.7";
13
+ export const CLI_VERSION = "2.0.8";
14
14
  export const API_CONTRACT_REVISION = "sha256:47d42ab7bbe74a806b9ec989384b28ad715ffcf05a5eb913449b8bc224ffcf49";
15
15
  const CART_SESSION_DEFAULT_DIR = ".itpay-v3";
16
16
  const CART_SESSION_FILENAME = "cart.json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itpay/cli",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "ItPay CLI for V3 checkout, payment, order, refund, and agent-facing render flows.",
5
5
  "type": "module",
6
6
  "bin": {