@itpay/cli 2.0.13 → 2.0.15

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 (64) hide show
  1. package/README.md +15 -7
  2. package/dist/src/commands/docs.js +1 -0
  3. package/dist/src/commands/guidance.js +8 -12
  4. package/dist/src/commands/install.js +2 -2
  5. package/dist/src/commands/readyz.js +7 -3
  6. package/dist/src/commands/skill.js +10 -10
  7. package/dist/src/main.js +22 -18
  8. package/dist/src/state/config.js +41 -6
  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 +34 -13
  12. package/docs/agent/buyer/install-and-setup.json +25 -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 +49 -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 +40 -11
  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/docs/skill-bundle-rollout/01-mcp-authentication.md +256 -0
  60. package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +282 -0
  61. package/docs/skill-bundle-rollout/03-platform-publishing.md +270 -0
  62. package/docs/skill-bundle-rollout/README.md +98 -0
  63. package/package.json +6 -3
  64. package/skills/{itpay-buyer → itpay}/SKILL.md +39 -17
@@ -1,9 +1,10 @@
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": "install-and-setup",
5
6
  "title": "Install And Identify The ItPay Agent Runtime",
6
- "purpose": "Install the CLI, load the complete Buyer Skill, and select one stable Agent Type without confusing identity, Backend, Host, target, or chat window.",
7
+ "purpose": "Install the CLI, load the complete ItPay Skill, and select one stable Agent Type without confusing identity, Backend, Host, target, or chat window.",
7
8
  "when_to_use": [
8
9
  "The CLI is being installed or upgraded.",
9
10
  "The agent needs to confirm its stable runtime identity and default output Host."
@@ -12,11 +13,11 @@
12
13
  {
13
14
  "intent": "verify the API and enter packaged onboarding",
14
15
  "command": "itpay readyz --json",
15
- "success_signal": "status is ready and next points to skill show itpay-buyer"
16
+ "success_signal": "status is ready and next points to skill show itpay"
16
17
  },
17
18
  {
18
19
  "intent": "read the complete packaged operating contract",
19
- "command": "itpay skill show itpay-buyer --json",
20
+ "command": "itpay skill show itpay --json",
20
21
  "success_signal": "status is shown, result.content contains the complete Skill, and next selects Agent Type or Catalog"
21
22
  },
22
23
  {
@@ -32,23 +33,39 @@
32
33
  ],
33
34
  "agent_rules": [
34
35
  "Install with npm install -g @itpay/cli.",
36
+ "Production defaults to https://app.itpay.ai. Testing may set ITPAY_BACKEND_URL to the exact official URL https://dev.itpay.ai; no other Backend is allowed.",
35
37
  "If backend_contract_incompatible includes result.required_cli_version, stop all ItPay business commands and run only the exact npm install recovery returned by the CLI; never replace its version with latest.",
36
38
  "After upgrading, require itpay --version to equal result.required_cli_version before running readyz again; never change Agent Type or Device identity to recover compatibility.",
37
- "Use the default https://app.itpay.ai API unless an environment override is deliberate.",
38
39
  "Use one exact type: codex-desktop, codex-cli, claude-code-desktop, claude-code-cli, or workbuddy.",
39
- "One local private key is reused, but each exact Backend API base URL has its own server registration and quota lineage.",
40
- "Within one Backend registration, each Agent Type has one Agent Instance; all windows and chats of the same type reuse it.",
40
+ "One local private key is reused, while Device registrations and quota lineage remain separate for app.itpay.ai and dev.itpay.ai.",
41
+ "Within each official Backend registration, each Agent Type has one Agent Instance; all windows and chats of the same type reuse it.",
41
42
  "Agent Type identifies the runtime. Host controls rendering and target only identifies a presentation destination.",
42
43
  "Keep the exact Agent Type in every next or recovery command; do not fall back to a type previously used by another runtime.",
43
44
  "Do not change Agent Type or rotate local identity to reset quota or recover a failed command."
44
45
  ],
45
46
  "forbidden": [
46
47
  "Do not use codex, terminal, claude-code, or plain-chat as Agent Types.",
48
+ "Do not set or suggest any Backend except the default https://app.itpay.ai or the exact test override https://dev.itpay.ai.",
47
49
  "Do not claim that install writes host configuration or registers a device; it only prints instructions.",
48
50
  "Do not create a new identity for a different window, task, chat, or process of the same Agent Type."
49
51
  ],
50
52
  "next_docs": [
51
- { "condition": "Installation is verified", "topic": "quickstart" }
53
+ {
54
+ "condition": "Installation is verified",
55
+ "topic": "quickstart"
56
+ }
52
57
  ],
53
- "search_terms": ["install", "agent type", "host", "target", "device", "session", "identity", "backend", "codex", "claude code", "workbuddy"]
58
+ "search_terms": [
59
+ "install",
60
+ "agent type",
61
+ "host",
62
+ "target",
63
+ "device",
64
+ "session",
65
+ "identity",
66
+ "backend",
67
+ "codex",
68
+ "claude code",
69
+ "workbuddy"
70
+ ]
54
71
  }
@@ -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": "orders-refunds",
5
6
  "title": "Order, Delivery And Refund Recovery",
6
7
  "purpose": "Read owned orders and manage refunds through signed Agent authority without guessing payment or refund state.",
@@ -48,7 +49,17 @@
48
49
  "Do not claim a refund succeeded before the Refund Owner says succeeded."
49
50
  ],
50
51
  "next_docs": [
51
- { "condition": "Need the original purchase path", "topic": "quickstart" }
52
+ {
53
+ "condition": "Need the original purchase path",
54
+ "topic": "quickstart"
55
+ }
52
56
  ],
53
- "search_terms": ["order", "refund", "cancel", "watch", "delivery lock", "grant"]
57
+ "search_terms": [
58
+ "order",
59
+ "refund",
60
+ "cancel",
61
+ "watch",
62
+ "delivery lock",
63
+ "grant"
64
+ ]
54
65
  }
@@ -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": "payment-flow",
5
6
  "title": "Human Checkout Handoff And Payment Verification",
6
7
  "purpose": "Show the ItPay Checkout to the human and recover authoritative payment state without creating duplicate payment resources.",
@@ -42,8 +43,21 @@
42
43
  "Do not start another Service Execution to bypass quota, candidate, quote, checkout, or delivery state."
43
44
  ],
44
45
  "next_docs": [
45
- { "condition": "Payment is verified", "topic": "orders-refunds" },
46
- { "condition": "The current Host cannot display the handoff", "topic": "render-hosts" }
46
+ {
47
+ "condition": "Payment is verified",
48
+ "topic": "orders-refunds"
49
+ },
50
+ {
51
+ "condition": "The current Host cannot display the handoff",
52
+ "topic": "render-hosts"
53
+ }
47
54
  ],
48
- "search_terms": ["payment", "checkout", "QR", "display token", "resume", "verified"]
55
+ "search_terms": [
56
+ "payment",
57
+ "checkout",
58
+ "QR",
59
+ "display token",
60
+ "resume",
61
+ "verified"
62
+ ]
49
63
  }
@@ -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": "quickstart",
5
6
  "title": "ItPay CLI Buyer Quickstart",
6
7
  "purpose": "Run the shortest safe discovery, Service Execution, Checkout, delivery, and refund flow using server-returned next commands.",
@@ -11,19 +12,23 @@
11
12
  "required_state": {
12
13
  "needs": [
13
14
  "the real supported Agent Type",
14
- "the default API or an intentional ITPAY_BACKEND_URL override"
15
+ "one official Backend: production https://app.itpay.ai by default, or explicit test https://dev.itpay.ai"
15
16
  ],
16
- "must_not_need": ["Admin access", "Provider secrets", "raw payload access"]
17
+ "must_not_need": [
18
+ "Admin access",
19
+ "Provider secrets",
20
+ "raw payload access"
21
+ ]
17
22
  },
18
23
  "commands": [
19
24
  {
20
- "intent": "verify compatibility",
25
+ "intent": "verify the selected official Backend availability",
21
26
  "command": "itpay --agent-type <agent_type> readyz --json",
22
- "success_signal": "status is ready and next points to the complete packaged Buyer Skill"
27
+ "success_signal": "status is ready and next points to the complete packaged ItPay Skill"
23
28
  },
24
29
  {
25
30
  "intent": "load the complete operating contract",
26
- "command": "itpay --agent-type <agent_type> skill show itpay-buyer --json",
31
+ "command": "itpay --agent-type <agent_type> skill show itpay --json",
27
32
  "success_signal": "status is shown and next points to catalog list with the same Agent Type"
28
33
  },
29
34
  {
@@ -52,6 +57,7 @@
52
57
  "Treat result as current facts, instruction as how to use those facts, next as the preferred executable action, and recovery as exceptional paths.",
53
58
  "Run one state-changing command at a time. Treat next.command as the preferred continuation: execute it unchanged after filling required user data only when the current result has not already satisfied the user's goal.",
54
59
  "Keep the same explicit Agent Type through next and recovery commands; same-type windows reuse one Backend Agent Instance.",
60
+ "When testing dev, execute every returned command unchanged so its ITPAY_BACKEND_URL=https://dev.itpay.ai prefix is preserved.",
55
61
  "Use --target only for a Host presentation destination. Put capability business values in --input key=value exactly as required by the schema.",
56
62
  "Start a separate Service Execution for each independent service intent; quota remains shared according to Backend identity policy.",
57
63
  "Ask the user for required email or contact values and explain their purpose; never invent them.",
@@ -65,13 +71,43 @@
65
71
  "Do not bypass a grant, refund lock, ownership error or compatibility gate."
66
72
  ],
67
73
  "next_docs": [
68
- { "condition": "Need service catalog language", "topic": "catalog-list" },
69
- { "condition": "Need Cart and Checkout routing", "topic": "cart-checkout" },
70
- { "condition": "Need payment recovery", "topic": "payment-flow" },
71
- { "condition": "Need Host-specific presentation", "topic": "render-hosts" },
72
- { "condition": "Need order or refund recovery", "topic": "orders-refunds" },
73
- { "condition": "Need install or identity details", "topic": "install-and-setup" },
74
- { "condition": "Need device session recovery rules", "topic": "identity-and-sessions" }
74
+ {
75
+ "condition": "Need service catalog language",
76
+ "topic": "catalog-list"
77
+ },
78
+ {
79
+ "condition": "Need Cart and Checkout routing",
80
+ "topic": "cart-checkout"
81
+ },
82
+ {
83
+ "condition": "Need payment recovery",
84
+ "topic": "payment-flow"
85
+ },
86
+ {
87
+ "condition": "Need Host-specific presentation",
88
+ "topic": "render-hosts"
89
+ },
90
+ {
91
+ "condition": "Need order or refund recovery",
92
+ "topic": "orders-refunds"
93
+ },
94
+ {
95
+ "condition": "Need install or identity details",
96
+ "topic": "install-and-setup"
97
+ },
98
+ {
99
+ "condition": "Need device session recovery rules",
100
+ "topic": "identity-and-sessions"
101
+ }
75
102
  ],
76
- "search_terms": ["quickstart", "service", "next", "recovery", "delivery", "refund", "target", "input"]
103
+ "search_terms": [
104
+ "quickstart",
105
+ "service",
106
+ "next",
107
+ "recovery",
108
+ "delivery",
109
+ "refund",
110
+ "target",
111
+ "input"
112
+ ]
77
113
  }
@@ -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;省略时使用当前官方 Backend 对应本地状态中最后保存的 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
+ 命令只作用于当前官方 Backend Device registration,并保留本地 Ed25519 私钥、Cart 和业务资源。默认是 `https://app.itpay.ai`;显式测试可使用准确的 `ITPAY_BACKEND_URL=https://dev.itpay.ai`。该命令不访问 Backend、不自动创建新身份;返回的只读 `services list` 会保留同一 Backend,是重新登记入口。
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": "查看官方 Backend 和首次使用说明"
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`;仅测试时可通过 `ITPAY_BACKEND_URL=https://dev.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` 或 `https://dev.itpay.ai`,其他 override 在网络或本地状态写入前被拒绝。
10
+ **下游:** 完整 `itpay` Skill,随后选择 Agent Type 或进入当前已支持的 Buyer Catalog。
9
11
 
10
12
  ## 语法与参数
11
13
 
@@ -22,16 +24,43 @@ itpay readyz [--json]
22
24
  ```json
23
25
  {
24
26
  "status": "ready",
25
- "result": { "backend": "available" },
26
- "instruction": "ItPay 可用;先完整读取内置 Buyer Skill,再开始服务流程。",
27
- "next": { "command": "itpay skill show itpay-buyer --json", "reason": "加载完整操作与安全规则" },
27
+ "result": { "backend": "available", "backend_url": "https://app.itpay.ai", "environment": "production" },
28
+ "instruction": "ItPay 可用;先完整读取内置 ItPay Skill,再进入当前已支持的 buy 流程。sell 将来也使用同一入口,但当前尚未实现。",
29
+ "next": { "command": "itpay skill show itpay --json", "reason": "加载完整操作与安全规则" },
30
+ "recovery": []
31
+ }
32
+ ```
33
+
34
+ 开发环境返回同一 envelope,但明确标记环境并在每个后续命令中保留 dev Backend:
35
+
36
+ ```json
37
+ {
38
+ "status": "ready",
39
+ "result": { "backend": "available", "backend_url": "https://dev.itpay.ai", "environment": "development" },
40
+ "instruction": "ItPay dev 可用;后续必须执行返回的完整命令,并继续使用同一个 dev Backend。先完整读取内置 ItPay Skill,再进入当前已支持的 buy 流程。",
41
+ "next": { "command": "ITPAY_BACKEND_URL=https://dev.itpay.ai itpay skill show itpay --json", "reason": "加载完整操作与安全规则" },
28
42
  "recovery": []
29
43
  }
30
44
  ```
31
45
 
32
46
  ## 异常处理
33
47
 
34
- 连接失败时返回 `backend_unavailable`,要求核对 `ITPAY_BACKEND_URL` 后重试同一命令,不得继续下单。
48
+ 连接失败时返回 `backend_unavailable`,要求等待当前官方 Backend 恢复后重试同一完整命令,不得在失败时切换环境或继续下单。
49
+
50
+ 非官方 URL 返回 `backend_override_forbidden`,且不提供自动 recovery:
51
+
52
+ ```json
53
+ {
54
+ "status": "error",
55
+ "error": {
56
+ "code": "backend_override_forbidden",
57
+ "message": "ITPAY_BACKEND_URL only supports https://app.itpay.ai or https://dev.itpay.ai"
58
+ },
59
+ "instruction": "移除 ITPAY_BACKEND_URL 使用正式环境,或准确设置为 https://dev.itpay.ai。",
60
+ "next": null,
61
+ "recovery": []
62
+ }
63
+ ```
35
64
 
36
65
  CLI 已取得 Backend 的兼容性合同、但当前版本或 contract hash 不匹配时,返回一个可执行且版本固定的恢复动作:
37
66
 
@@ -40,17 +69,17 @@ CLI 已取得 Backend 的兼容性合同、但当前版本或 contract hash 不
40
69
  "status": "error",
41
70
  "error": {
42
71
  "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)"
72
+ "message": "CLI 2.0.15 contract sha256:client is incompatible with platform v3.example contract sha256:server (minimum CLI 2.0.16, maximum major 2)"
44
73
  },
45
74
  "result": {
46
- "current_cli_version": "2.0.13",
47
- "required_cli_version": "2.0.14"
75
+ "current_cli_version": "2.0.15",
76
+ "required_cli_version": "2.0.16"
48
77
  },
49
78
  "instruction": "当前 CLI 与 Backend 合约不兼容。停止所有 ItPay 业务命令;只执行 recovery.command,将 @itpay/cli 更新到 Backend 指定的精确版本。安装完成后确认 itpay --version 与 result.required_cli_version 完全一致,再重新运行 readyz。不要安装 latest、猜测版本、切换 Agent Type 或删除 Device 身份。",
50
79
  "next": null,
51
80
  "recovery": [
52
81
  {
53
- "command": "npm install -g @itpay/cli@2.0.14",
82
+ "command": "npm install -g @itpay/cli@2.0.16",
54
83
  "reason": "安装 Backend 指定的兼容 CLI 版本"
55
84
  }
56
85
  ]
@@ -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
  列出指定订单的退款记录,按最新到最旧排序。