@itpay/cli 2.0.13 → 2.0.14

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.
Files changed (60) hide show
  1. package/README.md +14 -7
  2. package/dist/src/commands/docs.js +1 -0
  3. package/dist/src/commands/guidance.js +3 -8
  4. package/dist/src/commands/install.js +2 -2
  5. package/dist/src/commands/readyz.js +2 -2
  6. package/dist/src/commands/skill.js +10 -10
  7. package/dist/src/main.js +8 -10
  8. package/dist/src/state/config.js +4 -3
  9. package/docs/agent/buyer/cart-checkout.json +16 -3
  10. package/docs/agent/buyer/catalog-list.json +1 -0
  11. package/docs/agent/buyer/identity-and-sessions.json +35 -14
  12. package/docs/agent/buyer/install-and-setup.json +26 -8
  13. package/docs/agent/buyer/orders-refunds.json +13 -2
  14. package/docs/agent/buyer/payment-flow.json +17 -3
  15. package/docs/agent/buyer/quickstart.json +48 -13
  16. package/docs/agent/buyer/render-hosts.json +14 -2
  17. package/docs/cli-reference/agent-types.md +2 -0
  18. package/docs/cli-reference/commands/buy.md +2 -0
  19. package/docs/cli-reference/commands/cart/add.md +2 -0
  20. package/docs/cli-reference/commands/cart/clear.md +2 -0
  21. package/docs/cli-reference/commands/cart/index.md +2 -0
  22. package/docs/cli-reference/commands/cart/next.md +2 -0
  23. package/docs/cli-reference/commands/cart/remove.md +3 -1
  24. package/docs/cli-reference/commands/cart/show.md +2 -0
  25. package/docs/cli-reference/commands/catalog/index.md +2 -0
  26. package/docs/cli-reference/commands/catalog/list.md +2 -0
  27. package/docs/cli-reference/commands/checkout.md +2 -0
  28. package/docs/cli-reference/commands/device.md +3 -1
  29. package/docs/cli-reference/commands/docs/index.md +2 -0
  30. package/docs/cli-reference/commands/docs/list.md +2 -0
  31. package/docs/cli-reference/commands/docs/search.md +2 -0
  32. package/docs/cli-reference/commands/docs/show.md +2 -0
  33. package/docs/cli-reference/commands/install.md +4 -2
  34. package/docs/cli-reference/commands/next.md +2 -0
  35. package/docs/cli-reference/commands/order.md +2 -0
  36. package/docs/cli-reference/commands/orders.md +2 -0
  37. package/docs/cli-reference/commands/pay.md +2 -0
  38. package/docs/cli-reference/commands/readyz.md +12 -10
  39. package/docs/cli-reference/commands/refund/cancel.md +2 -0
  40. package/docs/cli-reference/commands/refund/create.md +2 -0
  41. package/docs/cli-reference/commands/refund/get.md +2 -0
  42. package/docs/cli-reference/commands/refund/index.md +2 -0
  43. package/docs/cli-reference/commands/refund/list.md +2 -0
  44. package/docs/cli-reference/commands/refund/watch.md +2 -0
  45. package/docs/cli-reference/commands/services/action.md +2 -0
  46. package/docs/cli-reference/commands/services/checkout.md +2 -0
  47. package/docs/cli-reference/commands/services/events.md +2 -0
  48. package/docs/cli-reference/commands/services/get.md +2 -0
  49. package/docs/cli-reference/commands/services/index.md +2 -0
  50. package/docs/cli-reference/commands/services/invoke.md +2 -0
  51. package/docs/cli-reference/commands/services/list.md +2 -0
  52. package/docs/cli-reference/commands/services/next.md +2 -0
  53. package/docs/cli-reference/commands/services/quote.md +2 -0
  54. package/docs/cli-reference/commands/services/read-result.md +2 -0
  55. package/docs/cli-reference/commands/services/start.md +2 -0
  56. package/docs/cli-reference/commands/skill.md +5 -3
  57. package/docs/cli-reference/conventions.md +2 -0
  58. package/docs/cli-reference/index.md +3 -1
  59. package/package.json +6 -3
  60. package/skills/{itpay-buyer → itpay}/SKILL.md +39 -17
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "schema_version": "itp.agent_doc.v1",
3
3
  "role": "buyer",
4
+ "product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.",
4
5
  "topic": "render-hosts",
5
6
  "title": "Agent Type And Checkout Handoff Rendering",
6
7
  "purpose": "Use only the handoff fields returned for the current Agent Type and make the human Checkout visible on that surface.",
@@ -61,7 +62,18 @@
61
62
  "Do not inspect, download, or regenerate a local QR file for WorkBuddy."
62
63
  ],
63
64
  "next_docs": [
64
- { "condition": "Need payment verification rules", "topic": "payment-flow" }
65
+ {
66
+ "condition": "Need payment verification rules",
67
+ "topic": "payment-flow"
68
+ }
65
69
  ],
66
- "search_terms": ["host", "agent type", "QR", "markdown", "terminal", "desktop", "workbuddy"]
70
+ "search_terms": [
71
+ "host",
72
+ "agent type",
73
+ "QR",
74
+ "markdown",
75
+ "terminal",
76
+ "desktop",
77
+ "workbuddy"
78
+ ]
67
79
  }
@@ -1,5 +1,7 @@
1
1
  # Agent Type And Host Contract
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  `--agent-type` 表示哪类运行时在运行 CLI,用于 Agent 实例归属和定制 instruction。`--host` 表示输出展示在哪里;`--target` 只是在某些 Host 中指定 chat/channel/open ID。三者不可混用,窗口、任务和对话也不是身份。
4
6
 
5
7
  本地只保存一把 Ed25519 私钥。每个规范化 Backend API base URL 独立登记 Device,因此 dev/test/app 分别拥有自己的 device ID、quota lineage、Agent instances 和 sessions。同一 Backend 下每个 `agent_type` 只有一个 Agent Instance;同类型的不同窗口、任务或聊天复用它,不追踪窗口 ID。
@@ -1,5 +1,7 @@
1
1
  # `itpay buy`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  为普通 Catalog 项目或已绑定 Service Quote 的 canonical Cart 创建一个 ItPay Checkout,并按当前 Agent Type 把付款入口交给用户。命令只创建或恢复 ItPay Checkout,不把“用户说已付款”当作付款成功。
@@ -1,5 +1,7 @@
1
1
  # `itpay cart add`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  把一个已发布 Catalog offer 或一个已准备的 Service Quote 加入 canonical server Cart。Catalog 服务行先进入 `services next`;Quote 行已经锁定输入和价格,可以与其他独立 Execution 的 Quote 一起结算。
@@ -1,5 +1,7 @@
1
1
  # `itpay cart clear`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  放弃未锁定的 canonical cart。`--local` 只清理本地句柄和草稿,不声称服务端资源已取消。
@@ -1,5 +1,7 @@
1
1
  # `itpay cart`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 命令范围
4
6
 
5
7
  管理 canonical server Cart。Catalog line 可以创建 Service Execution;已准备好的 Service Quote 则通过 `cart add --quote` 加入 Cart。Cart 聚合交易,但不合并 Execution、候选归属或交付。
@@ -1,5 +1,7 @@
1
1
  # `itpay cart next`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取当前 canonical cart 对应的唯一首选动作。它不修改 cart。
@@ -1,5 +1,7 @@
1
1
  # `itpay cart remove`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  从未锁定的 canonical cart 删除一个 line。删除不会影响已创建的 Checkout 或订单;如果该 line 是某个未付款 Service Execution 在 Cart 中的最后一个引用,Backend 会在同一事务中取消该 execution。
@@ -16,7 +18,7 @@ itpay cart remove --local --variant <catalog_variant_id> --offer <offer_id> [--j
16
18
 
17
19
  | 参数 | 必填 | 说明 |
18
20
  | --- | --- | --- |
19
- | `--line <cart_item_id>` | 否 | canonical Cart line;省略时使用当前 Backend URL 下最后保存的 line。 |
21
+ | `--line <cart_item_id>` | 否 | canonical Cart line;省略时使用固定 `https://app.itpay.ai` 后端下最后保存的 line。 |
20
22
  | `--local` | 否 | 只修改显式本地草稿,不请求 Backend。 |
21
23
  | `--variant <catalog_variant_id>` | local 时是 | 与 `--offer` 一起标识本地草稿 line。 |
22
24
  | `--offer <offer_id>` | local 时是 | 与 `--variant` 一起标识本地草稿 line。 |
@@ -1,5 +1,7 @@
1
1
  # `itpay cart show`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  显示 canonical server cart 的紧凑摘要和 line 句柄。默认不展开完整 Service Execution。
@@ -1,5 +1,7 @@
1
1
  # `itpay catalog`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 命令范围
4
6
 
5
7
  读取已发布的服务目录,帮助 Agent 发现可启动的通用服务。Catalog 只描述产品和入口,不执行服务、不创建购物车。
@@ -1,5 +1,7 @@
1
1
  # `itpay catalog list`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  列出当前 published Catalog。每个项目先说明用户真正购买的主服务,再说明免费或付费的辅助能力,避免把辅助消歧误称为最终服务。
@@ -1,5 +1,7 @@
1
1
  # `itpay checkout`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取并恢复一笔已存在 Checkout 的公开展示状态。它不创建新 Checkout,也不把“用户说已付款”当作付款成功。
@@ -1,5 +1,7 @@
1
1
  # `itpay device recover`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围
4
6
 
5
7
  仅在运营明确确认当前 Backend 的 Device 登记数据库已重建或清空后,删除本地该 Backend 的 v2 registration:
@@ -8,6 +10,6 @@
8
10
  itpay --agent-type <agent_type> device recover --confirm-backend-reset --json
9
11
  ```
10
12
 
11
- 命令使用 `ITPAY_BACKEND_URL` 选择唯一作用域,保留本地 Ed25519 私钥、其他 Backend registrations、Cart 和业务资源。它不访问 Backend,不自动创建新身份;返回的只读 `services list` 是重新登记入口。
13
+ 命令只作用于固定生产后端 `https://app.itpay.ai` Device registration,并保留本地 Ed25519 私钥、Cart 和业务资源。CLI 不接受 Backend URL 覆盖。该命令不访问 Backend、不自动创建新身份;返回的只读 `services list` 是重新登记入口。
12
14
 
13
15
  缺少确认参数返回 `backend_reset_confirmation_required`。普通 session 失效由 CLI 自动续期;revoked、quota、权限或未知 Backend 故障不得使用本命令。所有 Agent Type 使用相同输入和输出合同。
@@ -1,5 +1,7 @@
1
1
  # `itpay docs`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 命令范围
4
6
 
5
7
  浏览 npm 包内置的 Agent 操作文档。它是运行时自助说明,不读取服务端业务数据。
@@ -1,5 +1,7 @@
1
1
  # `itpay docs list`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  按稳定 topic 名称列出 npm 包内置的 Agent 文档,只返回标题和一句用途,不加载完整内容,也不访问 Backend。
@@ -1,5 +1,7 @@
1
1
  # `itpay docs search`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  在内置 topic 的名称、标题、用途和 `search_terms` 中进行不区分大小写的包含搜索。它不搜索完整正文或业务数据。
@@ -1,5 +1,7 @@
1
1
  # `itpay docs show`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取一个指定 Agent 文档 topic。这是 docs 命令族中唯一返回完整文档内容的命令;不会级联读取其他 topic,也不访问 Backend。
@@ -1,5 +1,7 @@
1
1
  # `itpay install`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取当前 CLI 内置的 Agent Type 安装合同。它只说明 npm 安装、默认 API、默认 Host 和下一条验证命令;不修改宿主配置、不登记设备,也不调用 Backend。
@@ -35,12 +37,12 @@ itpay install [target] [--json]
35
37
  "instruction": "在 Codex Desktop 中始终传这个 Agent Type;付款时把返回的二维码和链接实际展示到当前对话。",
36
38
  "next": {
37
39
  "command": "itpay --agent-type codex-desktop readyz --json",
38
- "reason": "验证 CLI 与默认 ItPay API 的兼容性"
40
+ "reason": "验证固定生产 ItPay API 的可用性"
39
41
  },
40
42
  "recovery": [
41
43
  {
42
44
  "command": "itpay docs show install-and-setup",
43
- "reason": "查看环境覆盖和首次使用说明"
45
+ "reason": "查看固定生产后端和首次使用说明"
44
46
  }
45
47
  ]
46
48
  }
@@ -1,5 +1,7 @@
1
1
  # `itpay next`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  从本机保存的 canonical Cart、Checkout 或 Service Execution 句柄恢复一个首选动作。它是中断后的总入口,不替代具体资源的 `next/get`,也不读取或复制 Backend DTO。
@@ -1,5 +1,7 @@
1
1
  # `itpay order`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取一笔当前 Buyer 或已绑定 Agent 可见的订单摘要、交付模式和退款访问锁。它不会返回受保护交付内容、Vault ID、内部 delivery artifact 或 Checkout token。
@@ -1,5 +1,7 @@
1
1
  # `itpay orders`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  列出当前 account-scoped Buyer session 可见的订单摘要,用于恢复订单,不返回交付 payload。
@@ -1,5 +1,7 @@
1
1
  # `itpay pay`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  为一个已存在的 Checkout 显式创建或刷新 Payment Intent。它只用于 Checkout 页面无法完成渠道动作时的受控集成恢复,不是普通 Buyer 流程。
@@ -1,11 +1,13 @@
1
1
  # `itpay readyz`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
- 检查当前配置的 ItPay API 是否可用。它只做环境诊断,不登记设备、不创建业务资源。
7
+ 检查固定生产 Backend `https://app.itpay.ai` 是否可用。它只调用 `/v1/readyz` 做 liveness 诊断,不执行平台兼容性 gate、不登记设备、不创建业务资源;需要服务端合同的命令仍会在各自入口严格检查 compatibility。
6
8
 
7
- **上游:** CLI 安装和 Backend URL 配置。
8
- **下游:** 完整 `itpay-buyer` Skill,随后选择 Agent Type 或读取 Catalog。
9
+ **上游:** CLI 安装;Backend 固定为 `https://app.itpay.ai`,不可由运行时环境覆盖。
10
+ **下游:** 完整 `itpay` Skill,随后选择 Agent Type 或进入当前已支持的 Buyer Catalog。
9
11
 
10
12
  ## 语法与参数
11
13
 
@@ -23,15 +25,15 @@ itpay readyz [--json]
23
25
  {
24
26
  "status": "ready",
25
27
  "result": { "backend": "available" },
26
- "instruction": "ItPay 可用;先完整读取内置 Buyer Skill,再开始服务流程。",
27
- "next": { "command": "itpay skill show itpay-buyer --json", "reason": "加载完整操作与安全规则" },
28
+ "instruction": "ItPay 可用;先完整读取内置 ItPay Skill,再进入当前已支持的 buy 流程。sell 将来也使用同一入口,但当前尚未实现。",
29
+ "next": { "command": "itpay skill show itpay --json", "reason": "加载完整操作与安全规则" },
28
30
  "recovery": []
29
31
  }
30
32
  ```
31
33
 
32
34
  ## 异常处理
33
35
 
34
- 连接失败时返回 `backend_unavailable`,要求核对 `ITPAY_BACKEND_URL` 后重试同一命令,不得继续下单。
36
+ 连接失败时返回 `backend_unavailable`,要求等待 `https://app.itpay.ai` 恢复后重试同一命令,不得切换后端或继续下单。
35
37
 
36
38
  CLI 已取得 Backend 的兼容性合同、但当前版本或 contract hash 不匹配时,返回一个可执行且版本固定的恢复动作:
37
39
 
@@ -40,17 +42,17 @@ CLI 已取得 Backend 的兼容性合同、但当前版本或 contract hash 不
40
42
  "status": "error",
41
43
  "error": {
42
44
  "code": "backend_contract_incompatible",
43
- "message": "CLI 2.0.13 contract sha256:client is incompatible with platform v3.example contract sha256:server (minimum CLI 2.0.14, maximum major 2)"
45
+ "message": "CLI 2.0.14 contract sha256:client is incompatible with platform v3.example contract sha256:server (minimum CLI 2.0.15, maximum major 2)"
44
46
  },
45
47
  "result": {
46
- "current_cli_version": "2.0.13",
47
- "required_cli_version": "2.0.14"
48
+ "current_cli_version": "2.0.14",
49
+ "required_cli_version": "2.0.15"
48
50
  },
49
51
  "instruction": "当前 CLI 与 Backend 合约不兼容。停止所有 ItPay 业务命令;只执行 recovery.command,将 @itpay/cli 更新到 Backend 指定的精确版本。安装完成后确认 itpay --version 与 result.required_cli_version 完全一致,再重新运行 readyz。不要安装 latest、猜测版本、切换 Agent Type 或删除 Device 身份。",
50
52
  "next": null,
51
53
  "recovery": [
52
54
  {
53
- "command": "npm install -g @itpay/cli@2.0.14",
55
+ "command": "npm install -g @itpay/cli@2.0.15",
54
56
  "reason": "安装 Backend 指定的兼容 CLI 版本"
55
57
  }
56
58
  ]
@@ -1,5 +1,7 @@
1
1
  # `itpay refund cancel`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  在 Refund Owner 允许时取消 active refund。取消成功后释放访问锁,但不复活旧 Agent grant。
@@ -1,5 +1,7 @@
1
1
  # `itpay refund create`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  为一笔订单提交退款意图。Refund Owner 从订单推导 Buyer、支付、金额、币种、消费事实和审核策略;Agent 只提交订单和用户原因。
@@ -1,5 +1,7 @@
1
1
  # `itpay refund get`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取一笔当前身份可见退款的权威快照、交付锁和可取消性。它只请求一次,不轮询、不改变退款状态。
@@ -1,5 +1,7 @@
1
1
  # `itpay refund`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 命令范围
4
6
 
5
7
  创建、恢复、跟踪和取消退款申请。Refund Owner 决定政策和状态;CLI 只提交用户意图并展示服务端事实。
@@ -1,5 +1,7 @@
1
1
  # `itpay refund list`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  列出指定订单的退款记录,按最新到最旧排序。
@@ -1,5 +1,7 @@
1
1
  # `itpay refund watch`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  轮询同一退款直到终态或 timeout。命令内部可以读取多次,但对外只输出一个最终信封,不把无变化轮询刷入 Agent 上下文。中断后可无副作用重跑。
@@ -1,5 +1,7 @@
1
1
  # `itpay services action`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  记录用户或 Agent 对 Service Execution 的结构化动作,例如选择候选、批准、拒绝或取消。它不直接调用付费 Provider。
@@ -1,5 +1,7 @@
1
1
  # `itpay services checkout`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  为单个 Service Execution 快速创建或恢复 Checkout,并按 Host 向人交接付款入口。它是 `services quote -> cart add --quote -> buy --cart` 的单项快捷方式,必须复用相同的 Quote、Cart 和 Checkout Use Case。
@@ -1,5 +1,7 @@
1
1
  # `itpay services events`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  按 sequence 升序读取一笔 Service Execution 的受限诊断事件。它只用于解释异常或支持排查,不是正常业务流程,不返回事件 ID、内部摘要、Provider 数据或受保护交付内容。
@@ -1,5 +1,7 @@
1
1
  # `itpay services get`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取一笔 Service Execution 的紧凑状态、关键节点和当前首选动作。它面向恢复和用户解释,不是原始 event dump。
@@ -1,5 +1,7 @@
1
1
  # `itpay services`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 命令范围
4
6
 
5
7
  操作通用 Service Execution。CLI 不知道某个服务的业务流程;它读取服务合同中的 capability、input schema、价格、交付模式和服务端 next action。
@@ -1,5 +1,7 @@
1
1
  # `itpay services invoke`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  调用当前 phase 允许的非付费 Agent-visible capability。输入先按 capability schema 校验,校验失败不得迁移 execution 或记录 Provider 已调用。
@@ -1,5 +1,7 @@
1
1
  # `itpay services list`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  恢复当前已登记设备或账号可见的 Service Execution 摘要。它不是批量 timeline 导出。
@@ -1,5 +1,7 @@
1
1
  # `itpay services next`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  读取一笔 Service Execution 的当前状态,并只返回一个首选下一步。若交付模式允许 Agent 直接读取,本命令同时返回完整 safe result。
@@ -1,5 +1,7 @@
1
1
  # `itpay services quote`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  为当前 Service Execution 的一个付费 Capability 准备 Quote Lock。它只锁定可信输入、候选来源、价格、币种和有效期,不创建 Cart、Checkout、订单或 Provider 调用。
@@ -1,5 +1,7 @@
1
1
  # `itpay services read-result`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  使用当前 Agent Device Authority,在用户创建的有效、未过期且范围匹配的 grant 内读取 Vault 保护结果。它不适用于 `agent_visible_result`。
@@ -1,5 +1,7 @@
1
1
  # `itpay services start`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
7
  按 Catalog 中的 `service_id` 启动一次 Service Execution,并返回当前可执行的唯一首选动作。不会调用 Provider、创建 Checkout 或订单。
@@ -1,14 +1,16 @@
1
1
  # `itpay skill show`
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 范围与意义
4
6
 
5
- 读取 npm 包内置的完整 Agent Skill。与按 topic 渐进读取的 `docs` 不同,本命令故意一次返回完整 `SKILL.md`,用于首次 onboarding 和身份/session 规则恢复;不访问 Backend,不修改宿主配置或本地身份。
7
+ 读取 npm 包内置的完整 ItPay Agent Skill。与按 topic 渐进读取的 `docs` 不同,本命令故意一次返回完整 `SKILL.md`,用于首次 onboarding 和身份/session 规则恢复;不访问 Backend,不修改宿主配置或本地身份。
6
8
 
7
9
  ```bash
8
- itpay [--agent-type <agent_type>] skill show itpay-buyer [--json]
10
+ itpay [--agent-type <agent_type>] skill show itpay [--json]
9
11
  ```
10
12
 
11
- 当前只内置 `itpay-buyer`。`--json` 时完整 Markdown 位于 `result.content`;文本模式直接输出完整内容。
13
+ 当前只内置 `itpay`。该 Skill 是 Buyer 与未来 Seller 的共同入口,不再按角色拆分名称。`--json` 时完整 Markdown 位于 `result.content`;文本模式直接输出完整内容。
12
14
 
13
15
  未声明 Agent Type 时,`next` 是 `itpay install --json`。已声明时,`next` 是保留同一类型的 `catalog list --json`。未知名称返回 `skill_not_found`;包内文件缺失或损坏返回 `skill_unavailable` 并要求重装同版本 CLI。
14
16
 
@@ -1,5 +1,7 @@
1
1
  # Output And Error Contract
2
2
 
3
+ > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
4
+
3
5
  ## 目标
4
6
 
5
7
  CLI 输出是给 Agent 执行的协议,不是后端 DTO 的调试转储。默认输出适合人阅读;`--json` 使用同一语义的稳定机器合同。调试事实只由明确的诊断命令返回。
@@ -2,6 +2,8 @@
2
2
 
3
3
  本目录是 ItPay CLI 的规范性命令合同。它定义命令应向人和 Agent 返回什么、如何指导下一步,以及失败后如何恢复。当前实现与本文档不一致时,以本文档作为后续校准目标。
4
4
 
5
+ > **统一产品边界:** `itpay` 是唯一公开的 CLI 入口,`$itpay` 是对应的用户侧 Skill 调用方式。在同一个产品入口下,两个顶层 commerce 动作是 `buy` 和 `sell`:Buyer 流程当前可用;Seller 流程未来仍使用同一入口,当前尚未实现。不得拆分出独立 Buyer 或 Seller 产品入口。
6
+
5
7
  企知道可以作为示例数据出现,但任何命令、字段、状态和 instruction 都不得依赖某个服务。服务差异只能来自 Catalog、Service Contract、Capability metadata 和服务端状态。
6
8
 
7
9
  ## 使用约定
@@ -21,7 +23,7 @@
21
23
  - [`itpay catalog`](commands/catalog/index.md)
22
24
  - [`itpay catalog list`](commands/catalog/list.md)
23
25
  - [`itpay install`](commands/install.md) - 查看指定 Agent 的安装说明
24
- - [`itpay skill show`](commands/skill.md) - 一次读取完整内置 Buyer Skill
26
+ - [`itpay skill show`](commands/skill.md) - 一次读取完整内置 ItPay Skill
25
27
  - [`itpay docs`](commands/docs/index.md)
26
28
  - [`itpay docs list`](commands/docs/list.md)
27
29
  - [`itpay docs show`](commands/docs/show.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@itpay/cli",
3
- "version": "2.0.13",
4
- "description": "ItPay CLI for V3 checkout, payment, order, refund, and agent-facing render flows.",
3
+ "version": "2.0.14",
4
+ "description": "The single ItPay CLI entry point for buy workflows and future sell workflows.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "itp": "bin/itp",
@@ -43,6 +43,7 @@
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.7.5",
45
45
  "@types/qrcode": "^1.5.5",
46
+ "c8": "^10.1.3",
46
47
  "tsx": "^4.19.2",
47
48
  "typescript": "^5.6.3"
48
49
  },
@@ -52,12 +53,14 @@
52
53
  "start": "node dist/src/main.js",
53
54
  "lint": "tsc -p tsconfig.json --noEmit",
54
55
  "clean": "rm -rf dist",
55
- "check": "npm run lint && npm test && npm run test:package",
56
+ "check": "npm run lint && npm run test:coverage && npm run test:package",
56
57
  "pack:dry-run": "npm run clean && npm run build && npm pack --dry-run --ignore-scripts",
58
+ "prepare": "node scripts/install-git-hooks.mjs",
57
59
  "test:package": "npm run clean && npm run build && node scripts/package-smoke.mjs",
58
60
  "prepack": "npm run clean && npm run build",
59
61
  "prepublishOnly": "npm run check",
60
62
  "test": "tsx --test tests/*.test.ts",
63
+ "test:coverage": "c8 --all --src src --extension .ts --exclude=src/client/types.ts --exclude=tests/** --exclude=scripts/** --reporter=text --reporter=lcov --check-coverage --lines 85 --statements 85 --functions 90 --branches 70 npm test",
61
64
  "typecheck": "tsc -p tsconfig.json --noEmit"
62
65
  }
63
66
  }