@itpay/cli 2.1.40 → 2.1.41

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 (148) hide show
  1. package/README.md +5 -12
  2. package/dist/src/client/backend.js +2 -38
  3. package/dist/src/client/http.js +0 -2
  4. package/dist/src/commands/buy.js +58 -17
  5. package/dist/src/commands/cart.js +15 -17
  6. package/dist/src/commands/catalog.js +14 -39
  7. package/dist/src/commands/checkout.js +5 -146
  8. package/dist/src/commands/checkout_handoff.js +61 -11
  9. package/dist/src/commands/docs.js +18 -7
  10. package/dist/src/commands/guidance.js +134 -1
  11. package/dist/src/commands/install.js +3 -6
  12. package/dist/src/commands/order.js +3 -34
  13. package/dist/src/commands/orders.js +9 -4
  14. package/dist/src/commands/pay.js +1 -1
  15. package/dist/src/commands/readyz.js +1 -1
  16. package/dist/src/commands/refund.js +57 -13
  17. package/dist/src/commands/services.js +1068 -14
  18. package/dist/src/commands/skill.js +5 -8
  19. package/dist/src/commands/vault.js +20 -27
  20. package/dist/src/commands/vault_handoff.js +0 -18
  21. package/dist/src/main.js +43 -330
  22. package/dist/src/render/markdown.js +3 -0
  23. package/dist/src/render/qr.js +1 -1
  24. package/dist/src/state/cart_session.js +1 -4
  25. package/dist/src/state/client_context.js +0 -72
  26. package/dist/src/state/config.js +14 -44
  27. package/dist/src/state/device_authority.js +41 -141
  28. package/docs/agent/buyer/cart-checkout.json +6 -8
  29. package/docs/agent/buyer/catalog-list.json +9 -29
  30. package/docs/agent/buyer/identity-and-sessions.json +9 -26
  31. package/docs/agent/buyer/install-and-setup.json +9 -10
  32. package/docs/agent/buyer/orders-refunds.json +9 -25
  33. package/docs/agent/buyer/payment-flow.json +4 -6
  34. package/docs/agent/buyer/purchased-content.json +4 -18
  35. package/docs/agent/buyer/quickstart.json +17 -26
  36. package/docs/agent/buyer/render-hosts.json +12 -23
  37. package/docs/agent/buyer/service-feedback.json +3 -4
  38. package/docs/cli-reference/agent-types.md +2 -7
  39. package/docs/cli-reference/commands/buy.md +1 -2
  40. package/docs/cli-reference/commands/cart/add.md +1 -5
  41. package/docs/cli-reference/commands/cart/clear.md +1 -1
  42. package/docs/cli-reference/commands/cart/index.md +1 -1
  43. package/docs/cli-reference/commands/cart/next.md +1 -5
  44. package/docs/cli-reference/commands/cart/remove.md +1 -1
  45. package/docs/cli-reference/commands/cart/show.md +1 -1
  46. package/docs/cli-reference/commands/catalog/index.md +1 -1
  47. package/docs/cli-reference/commands/catalog/list.md +2 -2
  48. package/docs/cli-reference/commands/checkout.md +2 -12
  49. package/docs/cli-reference/commands/device.md +11 -18
  50. package/docs/cli-reference/commands/docs/index.md +1 -1
  51. package/docs/cli-reference/commands/docs/list.md +1 -1
  52. package/docs/cli-reference/commands/docs/search.md +1 -1
  53. package/docs/cli-reference/commands/docs/show.md +1 -1
  54. package/docs/cli-reference/commands/install.md +6 -8
  55. package/docs/cli-reference/commands/next.md +1 -1
  56. package/docs/cli-reference/commands/order.md +1 -1
  57. package/docs/cli-reference/commands/pay.md +1 -1
  58. package/docs/cli-reference/commands/readyz.md +11 -11
  59. package/docs/cli-reference/commands/refund/cancel.md +1 -1
  60. package/docs/cli-reference/commands/refund/create.md +1 -1
  61. package/docs/cli-reference/commands/refund/get.md +2 -2
  62. package/docs/cli-reference/commands/refund/index.md +1 -1
  63. package/docs/cli-reference/commands/refund/list.md +1 -1
  64. package/docs/cli-reference/commands/refund/watch.md +1 -1
  65. package/docs/cli-reference/commands/services/action.md +3 -24
  66. package/docs/cli-reference/commands/services/checkout.md +2 -17
  67. package/docs/cli-reference/commands/services/events.md +1 -1
  68. package/docs/cli-reference/commands/services/get.md +2 -4
  69. package/docs/cli-reference/commands/services/index.md +3 -4
  70. package/docs/cli-reference/commands/services/invoke.md +4 -6
  71. package/docs/cli-reference/commands/services/list.md +1 -1
  72. package/docs/cli-reference/commands/services/next.md +12 -78
  73. package/docs/cli-reference/commands/services/quote.md +4 -4
  74. package/docs/cli-reference/commands/services/read-result.md +6 -17
  75. package/docs/cli-reference/commands/services/start.md +3 -5
  76. package/docs/cli-reference/commands/vault/access.md +1 -5
  77. package/docs/cli-reference/conventions.md +6 -4
  78. package/docs/cli-reference/index.md +1 -10
  79. package/docs/skill-bundle-rollout/01-mcp-authentication.md +134 -0
  80. package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +210 -0
  81. package/docs/skill-bundle-rollout/03-platform-publishing.md +161 -0
  82. package/docs/skill-bundle-rollout/04-first-wave-platforms.md +69 -0
  83. package/docs/skill-bundle-rollout/05-sync-operations.md +62 -0
  84. package/docs/skill-bundle-rollout/README.md +151 -0
  85. package/package.json +12 -20
  86. package/skills/itpay/SKILL.md +102 -110
  87. package/assets/sell-preview/index.html +0 -6
  88. package/assets/sell-preview/preview.js +0 -9
  89. package/bin/darwin-amd64/itpay-sell +0 -0
  90. package/bin/darwin-arm64/itpay-sell +0 -0
  91. package/bin/linux-amd64/itpay-sell +0 -0
  92. package/bin/linux-arm64/itpay-sell +0 -0
  93. package/bin/windows-amd64/itpay-sell.exe +0 -0
  94. package/dist/src/commands/aftercare.js +0 -12
  95. package/dist/src/commands/presentation.js +0 -153
  96. package/dist/src/commands/rail_catalog.js +0 -1
  97. package/dist/src/commands/services/actions.js +0 -133
  98. package/dist/src/commands/services/commerce.js +0 -197
  99. package/dist/src/commands/services/lifecycle.js +0 -418
  100. package/dist/src/commands/services/results.js +0 -130
  101. package/dist/src/render/browser.js +0 -65
  102. package/dist/src/render/checkout_handoff.js +0 -101
  103. package/dist/src/render/checkout_plan.js +0 -47
  104. package/dist/src/sell/commands.js +0 -80
  105. package/dist/src/sell/contract.js +0 -86
  106. package/dist/src/sell/local.js +0 -260
  107. package/dist/src/sell/mcp.js +0 -49
  108. package/dist/src/sell/preview.js +0 -70
  109. package/dist/src/sell/sync.js +0 -145
  110. package/dist/src/services/adapter.js +0 -1
  111. package/dist/src/services/presentation.js +0 -198
  112. package/dist/src/services/rail/actions.js +0 -51
  113. package/dist/src/services/rail/adapter.js +0 -27
  114. package/dist/src/services/rail/aftercare.js +0 -45
  115. package/dist/src/services/rail/catalog.js +0 -261
  116. package/dist/src/services/rail/checkout.js +0 -19
  117. package/dist/src/services/rail/fulfillment.js +0 -76
  118. package/dist/src/services/rail/guide.js +0 -110
  119. package/dist/src/services/rail/invocation.js +0 -54
  120. package/dist/src/services/rail/page.js +0 -76
  121. package/dist/src/services/rail/pagination.js +0 -6
  122. package/dist/src/services/rail/query.js +0 -71
  123. package/dist/src/services/rail/readers.js +0 -107
  124. package/dist/src/services/rail/reading.js +0 -125
  125. package/dist/src/services/rail/recovery.js +0 -51
  126. package/dist/src/services/rail/results.js +0 -378
  127. package/dist/src/services/rail/review.js +0 -268
  128. package/dist/src/services/rail/saved.js +0 -49
  129. package/dist/src/services/rail/wait.js +0 -11
  130. package/dist/src/services/registry.js +0 -31
  131. package/dist/src/services/schema.js +0 -21
  132. package/dist/src/services/shared/envelope.js +0 -184
  133. package/dist/src/services/shared/input.js +0 -39
  134. package/dist/src/services/shared/pagination.js +0 -28
  135. package/dist/src/services/shared/platform.js +0 -365
  136. package/dist/src/services/shared/refund.js +0 -40
  137. package/dist/src/services/shared/workflow.js +0 -28
  138. package/dist/src/state/account_auth.js +0 -347
  139. package/dist/src/state/task_journal.js +0 -90
  140. package/docs/agent/buyer/rail-booking.json +0 -176
  141. package/docs/agent/buyer/rail-fast-checkout.json +0 -48
  142. package/docs/cli-reference/commands/aftercare.md +0 -15
  143. package/docs/cli-reference/commands/auth.md +0 -96
  144. package/docs/cli-reference/commands/sell.md +0 -1364
  145. package/docs/cli-reference/commands/services/page.md +0 -71
  146. package/docs/cli-reference/commands/services/run.md +0 -152
  147. package/docs/sell.md +0 -84
  148. /package/bin/{itp.mjs → itp} +0 -0
@@ -1,18 +1,18 @@
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 for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
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.",
5
5
  "topic": "identity-and-sessions",
6
6
  "title": "Device Identity And Session Recovery",
7
7
  "purpose": "Explain stable local identity, official Backend-scoped registrations, Agent Type instances, and bounded automatic session recovery.",
8
8
  "when_to_use": [
9
9
  "A different Agent window or runtime starts using an existing CLI installation.",
10
- "The CLI reports device_state_unwritable, or the Backend reports agent_identity_required, agent_device_session_required, agent_device_not_found, or agent_device_revoked.",
10
+ "The CLI reports device_state_unwritable, or the Backend reports agent_identity_required, agent_device_session_required, or agent_device_revoked.",
11
11
  "An operator confirms that the currently selected official Backend registration database was reset."
12
12
  ],
13
13
  "identity_model": {
14
14
  "local_key": "One owner-only Ed25519 private key for the local installation.",
15
- "backend_registration": "One registration per configured official Backend. Follow the current CLI backend allowlist; do not switch to evade failures.",
15
+ "backend_registration": "One registration per official Backend: app.itpay.ai by default and dev.itpay.ai only with the exact test override.",
16
16
  "agent_instance": "One instance per agent_type under each Backend registration; same-type windows and chats reuse it.",
17
17
  "presentation": "Host and target route output only and never identify the Agent or provide business input."
18
18
  },
@@ -21,15 +21,13 @@
21
21
  "On one HTTP 401 with code agent_device_session_required, it invalidates only the current Backend and Agent Type session, renews it, and retries the exact request once.",
22
22
  "A second failure is returned to the Agent. The CLI does not loop, switch Agent Type, rotate the key, or create a replacement v2 device.",
23
23
  "When a previously unseen Agent Type is registered under an existing Device, the CLI skips locally known Agent Instances that the Backend reports as revoked and uses the first remaining valid Instance. It never reactivates a revoked Instance or replaces the Device; if none is valid, registration stops.",
24
- "When the Backend reports agent_device_not_found (HTTP 404) for a locally known registration — for example after the Backend registration database was rebuilt — the CLI drops only that Backend's registration and re-enrolls once with the same private key, re-attaching to the same device and quota lineage where the Backend still holds the key.",
25
- "A revoked v2 registration requires explicit operator recovery; it is never silently replaced.",
26
- "Re-enrolling a public key the Backend already holds re-attaches to the existing device and quota lineage after proof-of-possession; it never creates a duplicate device. An internal_error is a server failure: preserve the key and wait for service recovery. If enrollment returns agent_device_key_rotated or agent_device_key_conflict, stop automatic recovery. Only an explicit human/operator decision to abandon the old identity permits reset-key; old execution access does not migrate."
24
+ "A revoked v2 registration requires explicit operator recovery; it is never silently replaced."
27
25
  ],
28
26
  "local_state_recovery": [
29
- "Device state uses an owner-only atomic file replacement and a lock that the CLI can inspect. On a stale lock, run the returned device repair-lock command; it only reclaims a proven stale owner.",
27
+ "Device state updates use an atomic directory lock and owner-only atomic file replacement; no lock file is opened with fs.open or fs.openSync.",
30
28
  "Operation idempotency uses one immutable owner-only record per operation key. Different commands and Agent processes do not share a global operation-journal lock; legacy operations.json is read only.",
31
29
  "On device_state_unwritable, use the reported operation and errno to diagnose the failing stage without exposing local paths; keep the same Agent Type and CLI/Node launcher, restore Host-approved persistent access to ~/.itpay-v3, then retry the original command.",
32
- "Do not delete a live lock, switch Node runtimes, delete identity, or rotate Agent Type as a retry strategy."
30
+ "Do not manually create or delete state locks, switch Node runtimes, delete identity, or rotate Agent Type as a retry strategy."
33
31
  ],
34
32
  "commands": [
35
33
  {
@@ -46,24 +44,19 @@
46
44
  "intent": "recover after an operator-confirmed reset of the selected official Backend registration database",
47
45
  "command": "itpay --agent-type <agent_type> device recover --confirm-backend-reset --json",
48
46
  "success_signal": "only the selected Backend registration is removed and the private key and other Backend registration remain"
49
- },
50
- {
51
- "intent": "repair only a proven stale local device lock",
52
- "command": "itpay device repair-lock --json",
53
- "success_signal": "the CLI reports whether the lock was stale and reclaimed; an active owner stays protected"
54
47
  }
55
48
  ],
56
49
  "agent_rules": [
57
50
  "Use the real runtime type and keep it stable across every command in the flow.",
58
51
  "Keep the same CLI/Node launcher and Host-approved permission context for the whole flow.",
59
52
  "Treat a new window, chat, task, or process of the same runtime as the same Agent Type, not a new identity.",
60
- "Production defaults to https://app.itpay.ai; explicit sandbox or dev testing uses https://sandbox.itpay.ai or https://dev.itpay.ai. Keep the complete returned Backend-prefixed command for that flow.",
53
+ "Expect production traffic to use https://app.itpay.ai. Use https://dev.itpay.ai only for an explicit test and keep the complete returned Backend-prefixed command for that entire flow.",
61
54
  "After automatic recovery fails, stop and report the exact code, selected official Backend, Agent Type, and command family without exposing private keys or tokens."
62
55
  ],
63
56
  "forbidden": [
64
57
  "Do not delete ~/.itpay-v3, rotate the key, switch Agent Type, or repeatedly retry to obtain fresh quota.",
65
58
  "Do not use device recover for session expiry, revocation, quota recovery, or an unconfirmed Backend failure.",
66
- "Do not switch Backend to evade a failure. Allowed public URLs are app.itpay.ai, sandbox.itpay.ai and dev.itpay.ai; local loopback requires the explicit CLI development flag.",
59
+ "Do not redirect the CLI to test, local, an IP, or any custom Backend; only the exact official dev.itpay.ai test override is allowed.",
67
60
  "Do not use --target as identity or service input."
68
61
  ],
69
62
  "next_docs": [
@@ -90,15 +83,5 @@
90
83
  "lock",
91
84
  "window",
92
85
  "chat"
93
- ],
94
- "auth_session_states": {
95
- "stages": "Report the actual server stage: waiting_provider (show the official handoff), email_verification_required (explicit or legacy identity verification; follow the current official page), merge_confirmation_required (the human must prove both accounts and explicitly confirm or cancel the frozen merge), provider_pending/pending (wait), completed (bind the original session and resume the same service). Ordinary login needs one verified supported identity; do not require both phone and email.",
96
- "terminal_states": "auth_expired/auth_denied/auth_cancelled/auth_failed mean this session is over; say so plainly and respect denial or cancellation. Start a new session only on an explicit login request; never keep polling a dead one.",
97
- "transport_unknown": "auth_status_unknown means a network error while polling — the outcome is unknown. Keep waiting on the SAME session (it may still complete); do NOT restart auth, and do not assume denial.",
98
- "missing": "auth_session_missing means the cached session is gone. An explicit auth login opens one fresh official session in that call; auth status stays read-only.",
99
- "completed_resume": "After login completes, execute the returned command to resume the same paused service execution. Login does not silently run that command.",
100
- "path_b": "A buyer who reaches checkout without a login completes identity inside the protected checkout page; never force a separate itpay auth login first.",
101
- "identity_binding": "Phone is recommended first, wallets next, email is a separate Other options choice. Extra identities are optional bindings. A phone conflict does not prove account ownership: independent target authentication and explicit human merge confirmation are required. Never use the same SMS proof twice, approve a merge for the user, or treat login/identity binding as payment consent. Service-specific contact requirements stay in the service."
102
- },
103
- "key_reset_decision": "Only after explicit user/operator acceptance of abandoning the old identity, consult device reset-key help; this is not automatic error recovery, and old execution access does not migrate."
86
+ ]
104
87
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": "itp.agent_doc.v1",
3
3
  "role": "buyer",
4
- "product_scope": "itpay is the public CLI entry point for Buyer services and existing itpay sell Seller workflows.",
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.",
5
5
  "topic": "install-and-setup",
6
6
  "title": "Install And Identify The ItPay Agent Runtime",
7
7
  "purpose": "Select the real Agent Type, verify one official Backend, and load the packaged Skill through one linear setup path.",
@@ -18,7 +18,7 @@
18
18
  {
19
19
  "intent": "list supported Agent Types",
20
20
  "command": "itpay install --json",
21
- "success_signal": "status is install_targets and exactly nine supported Agent Type definitions are returned"
21
+ "success_signal": "status is install_targets and exactly eight supported Agent Type definitions are returned"
22
22
  },
23
23
  {
24
24
  "intent": "read setup for the real runtime",
@@ -40,21 +40,21 @@
40
40
  "For first setup, read the complete Skill from this installed package before network checks. Select the actual Agent Type once through install and retain the same launcher and Backend. Do not reread the same version Skill, repeat initialization for ordinary tasks, or start login or business to prove setup.",
41
41
  "After setup, tell the human only that ItPay is ready; never ask them to run setup commands or explain technical setup steps.",
42
42
  "Use the CLI distribution already provided by the current npm package, Skill, or plugin; update only through that distribution's own instructions.",
43
- "Production defaults to https://app.itpay.ai. Testing may set ITPAY_BACKEND_URL to the exact official URL the configured official test Backend only when explicitly requested; follow the CLI allowlist.",
44
- "If Backend compatibility cannot be verified, stop this round. minimum_cli_version is a protocol floor, not a verified matching artifact. Ask the maintainer for the matching distribution; do not guess a version or downgrade.",
45
- "Only install a replacement when its exact artifact and Backend contract have been verified; then reread that package Skill. Never change Agent Type or Device identity to recover compatibility.",
46
- "Use one exact type: codex-desktop, codex-cli, claude-code-desktop, claude-code-cli, workbuddy, zcode, doubao-work, kimi-code, or openclaw.",
43
+ "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.",
44
+ "minimum_cli_version is a protocol floor, not a verified matching artifact. If incompatible, stop and ask the maintainer for the matching distribution; do not guess a version or downgrade.",
45
+ "Only use verified matching artifacts; never change Agent Type or Device identity to recover compatibility.",
46
+ "Use one exact type: codex-desktop, codex-cli, claude-code-desktop, claude-code-cli, workbuddy, zcode, kimi-code, or openclaw.",
47
47
  "For compatibility, a global --agent-type codex declaration is normalized immediately to codex-desktop; all registration, output, and returned commands use codex-desktop. Never generate the alias, and do not use codex as an install target.",
48
- "One local private key is reused, while Device registrations and quota lineage remain separate for app.itpay.ai, sandbox.itpay.ai and dev.itpay.ai.",
48
+ "One local private key is reused, while Device registrations and quota lineage remain separate for app.itpay.ai and dev.itpay.ai.",
49
49
  "Within each official Backend registration, each Agent Type has one Agent Instance; all windows and chats of the same type reuse it.",
50
50
  "Agent Type identifies the runtime. Host and target only select a presentation destination; load render-hosts only when a handoff cannot be shown.",
51
51
  "Keep the exact Agent Type in every next or recovery command; do not fall back to a type previously used by another runtime.",
52
52
  "Do not change Agent Type or rotate local identity to reset quota or recover a failed command.",
53
- "Skillhub and local host bundles are separate installed artifacts; verify their version and packaged Skill/docs instead of assuming an npm update changed them."
53
+ "For production setup, itpay device status --json verifies the device against the current Backend. device_ready does not establish account binding; binding is unavailable to this CLI and no auth login action is inferred."
54
54
  ],
55
55
  "forbidden": [
56
56
  "Do not use terminal, claude-code, or plain-chat as Agent Types. Do not generate codex as an Agent Type; it is accepted only as a legacy global declaration and becomes codex-desktop before any request.",
57
- "Do not set or suggest a Backend outside the CLI allowlist: https://app.itpay.ai, https://sandbox.itpay.ai, https://dev.itpay.ai; local loopback requires the CLI development flag. Do not switch Backend to evade a failure.",
57
+ "Do not set or suggest any Backend except the default https://app.itpay.ai or the exact test override https://dev.itpay.ai.",
58
58
  "Do not claim that install writes host configuration or registers a device; it only prints instructions.",
59
59
  "Do not create a new identity for a different window, task, chat, or process of the same Agent Type."
60
60
  ],
@@ -77,7 +77,6 @@
77
77
  "claude code",
78
78
  "workbuddy",
79
79
  "zcode",
80
- "doubao work",
81
80
  "kimi code",
82
81
  "openclaw"
83
82
  ]
@@ -1,7 +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 for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
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.",
5
5
  "topic": "orders-refunds",
6
6
  "title": "Order, Delivery, Customer Care And Refund Recovery",
7
7
  "purpose": "Explain paid-order and delivery problems to the human, then read or manage the same owned Order without guessing payment, consumption, or refund state.",
@@ -16,11 +16,6 @@
16
16
  "command": "itpay --agent-type <agent_type> order <order_id> --json",
17
17
  "success_signal": "one compact owned-order summary and one current next step are returned"
18
18
  },
19
- {
20
- "intent": "read railway refund/change targets and complete current input templates",
21
- "command": "itpay --agent-type <agent_type> aftercare list --order <order_id> --json",
22
- "success_signal": "safe original itinerary, available leg/passenger targets, requests and full refund/change templates"
23
- },
24
19
  {
25
20
  "intent": "request a refund",
26
21
  "command": "itpay --agent-type <agent_type> refund create --order <order_id> --reason buyer_requested --json",
@@ -39,23 +34,19 @@
39
34
  {
40
35
  "intent": "cancel before provider submission",
41
36
  "command": "itpay --agent-type <agent_type> refund cancel <refund_request_id> --json",
42
- "success_signal": "the Refund Owner returns the current cancellation and access state; old grants do not revive"
37
+ "success_signal": "the Refund Owner cancels the request and requires a new delivery authorization"
43
38
  }
44
39
  ],
45
40
  "agent_rules": [
46
41
  "Act as the human's ItPay service representative: explain payment, delivery, access, and refund facts in plain language before giving the next action.",
47
42
  "After verified payment, say the Order is recorded and the human must not pay again. Recover that same Order or Service Execution if delivery is delayed or fails.",
48
43
  "ItPay derives payment, amount, currency, account ownership, and refund policy from the owned order; explain only their user-facing meaning.",
49
- "A railway order can contain 1–3 legs paid together and issued separately. Report all-issued only when every leg is issued; retain issued tickets on a partial failure or unknown result. Railway return and platform refund follow per-leg supplier facts; do not promise a full refund or create replacement tickets.",
50
- "Read this order’s current refund policy. Railway return depends on supplier ticket facts and may require manual review; platform refund status alone does not prove a train ticket was returned.",
44
+ "Unconsumed delivery normally follows the automatic policy; consumed delivery normally requires manual review. These are policy routes, not promises of a successful or instant refund.",
51
45
  "A refund request freezes all delivery paths and revokes existing grants immediately.",
52
- "Cancellation or rejection follows the returned order policy and never reactivates an old grant automatically.",
53
- "Use get after interruption; explicit watch defaults to a bounded 20-second window and returns on change or manual attention. Do not restart watch automatically or infer success from elapsed time.",
46
+ "Cancellation or rejection restores eligibility but never reactivates an old grant.",
47
+ "Use get or watch after interruption; do not infer success from elapsed time.",
54
48
  "Never switch CLI/MCP lanes or identities to recover an order or refund error.",
55
- "A read-only MCP Agent may explain policy and order facts, but directs refund actions to the ItPay Dashboard or a full Local CLI Agent.",
56
- "Railway refund or manual change: use aftercare list for structured ticket targets. Match the user’s explicit legs/passengers; only ask when that scope is missing. Explain the scope and manual handling before create using the returned complete JSON. No supplier reference or amount is needed from the user.",
57
- "Aftercare acceptance, supplier completion and platform money status are separate. Only real scope consent may set user_confirmed_scope=true. A concrete change proposal requires fresh approval of the current proposal revision and fees; the original purchase consent cannot approve it. This release has no automatic change payment link.",
58
- "Partial refunds do not mean every ticket was returned. The platform delivery lock remains; use the safe aftercare journey for remaining-ticket facts, never promise validity from historical issued state. Protected ticket numbers still require account authorization."
49
+ "A read-only MCP Agent may explain policy and order facts, but directs refund actions to the ItPay Dashboard or a full Local CLI Agent."
59
50
  ],
60
51
  "human_explanations": {
61
52
  "payment_verified": "Payment is confirmed and the Order is recorded. Do not ask the human to pay again; continue the same delivery.",
@@ -64,11 +55,11 @@
64
55
  "refund_automatic": "The request is on the automatic policy path because the delivery is reported unconsumed; only the final server status proves success.",
65
56
  "refund_manual": "The request requires human review, commonly because delivery was consumed. Manual review is not a rejection.",
66
57
  "refund_unknown": "The payment channel outcome is unknown. Delivery stays locked while ItPay reconciles; never submit or replay another refund.",
67
- "refund_succeeded": "ItPay confirms this request’s money refund succeeded. Verify its scope and the remaining-ticket facts separately; only the order’s full refunded state establishes all platform money returned."
58
+ "refund_succeeded": "ItPay confirms the refund succeeded and delivery is permanently closed."
68
59
  },
69
60
  "forbidden": [
70
61
  "Do not fabricate Buyer sessions, Device IDs or payment references.",
71
- "Do not consume locked platform delivery; authorized safe remaining-ticket status reads are separate.",
62
+ "Do not read delivery while refund access_locked is true.",
72
63
  "Do not claim a refund succeeded before the Refund Owner says succeeded.",
73
64
  "Do not promise an unconditional refund, instant arrival, or a channel result that ItPay has not confirmed.",
74
65
  "Do not blame the human for a Provider, delivery, platform, or payment-channel failure."
@@ -101,12 +92,5 @@
101
92
  "交付失败",
102
93
  "没有收到结果",
103
94
  "能不能退"
104
- ],
105
- "rail_notifications": {
106
- "channels": "Delivery notices reach the checkout-confirmed contact: email always works; a verified mainland SMS recipient is optional and checkout-scoped. The passenger phone, the login phone and the notification recipient are independent facts.",
107
- "status_read": "Use the current returned reader for ticket state; order summaries do not expose per-leg notification delivery records. Do not infer a sent or delivered notification.",
108
- "truthfulness": "Provider acceptance is not delivery; an uncertain send outcome is reconciled, not silently retried. A notification failure never changes ticket or refund state; report it as a delivery detail, not an order failure.",
109
- "unavailable": "If SMS is not configured or a recipient is unverified, email still satisfies the contact policy — never present an unverified phone as enabled."
110
- },
111
- "consumption_and_access": "Platform content consumption is not train usage; access_locked freezes platform delivery and does not prove ticket validity. Read actual refund/ticket facts; a future departure does not guarantee eligibility."
95
+ ]
112
96
  }
@@ -1,7 +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 for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
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.",
5
5
  "topic": "payment-flow",
6
6
  "title": "Human Checkout Handoff And Payment Verification",
7
7
  "purpose": "Show the ItPay Checkout to the human and recover authoritative payment state without creating duplicate payment resources.",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "intent": "present the Checkout handoff",
15
15
  "command": "<execute the exact command returned by buy or services checkout>",
16
- "success_signal": "the returned official URL and/or QR supported by the actual Host is visible to the human"
16
+ "success_signal": "the human can see both the ItPay Checkout QR or image and the Checkout URL"
17
17
  },
18
18
  {
19
19
  "intent": "read authoritative Checkout state",
@@ -29,8 +29,7 @@
29
29
  "agent_rules": [
30
30
  "Normal buyer flow opens the ItPay Checkout page; itpay pay and buy --pay are operator escape hatches.",
31
31
  "Use only handoff fields returned for the current Host and make them actually visible to the human.",
32
- "Obtain only missing required agreement or material price/term changes. Reuse a valid explicit confirmation for unchanged terms; never invent it.",
33
- "For a railway journey, show one official checkout for all legs: one total/payment, separate issuance. The page shares its authoritative payment_deadline_at/server_now/payment_remaining_seconds; reaching zero requires reading current status, not declaring cancellation.",
32
+ "Before creating a single-Service Checkout, send the exact price confirmation requested by the current instruction, stop, and wait for explicit human agreement.",
34
33
  "After presenting a Checkout, stop. Run the returned next.command only after the human completes the payment action or asks to query the same Checkout.",
35
34
  "Use only the handoff fields returned for the current Host. Load render-hosts if the official handoff is not visible.",
36
35
  "Payment is verified only by Backend Checkout or Order state, never by QR rendering, redirect, or user claim.",
@@ -66,6 +65,5 @@
66
65
  "付款后",
67
66
  "不要重复付款",
68
67
  "支付确认"
69
- ],
70
- "purchase_consent": "Candidate selection is not price approval. Service-backed quote/cart/checkout requires a current scoped approve_purchase record; use the complete server template, default false. Only genuine matching approval allows true; material price/subject/terms changes invalidate it. Restore an existing Checkout before creating anything."
68
+ ]
71
69
  }
@@ -29,34 +29,20 @@
29
29
  "intent_routing": {
30
30
  "previous_content": "Use vault list, optionally with the subject as --query.",
31
31
  "purchase_history": "Use orders.",
32
- "new_service": "For a new railway request, read rail-booking; for other new services, use catalog. No previous-content match does not block a separately requested new railway query.",
32
+ "new_service": "Use catalog only when the human asks for a new query or purchase.",
33
33
  "ambiguous": "Ask whether the human wants an earlier purchase or a new query before calling ItPay."
34
34
  },
35
35
  "authorization_flow": [
36
36
  "Run the original list, orders, or read command.",
37
37
  "OpenClaw must pass its current trusted host and required target on the original command so the authorization continuation preserves the real presentation destination.",
38
- "If it returns human_authorization_required and context is complete, run its executable next.command once. If next is null or context/consent is missing, fill the returned interaction/input_template first; never invent host, target or consent.",
38
+ "If it returns human_authorization_required, run only its next.command once.",
39
39
  "Make the returned handoff genuinely visible and stop.",
40
40
  "After the human says authorization is complete, rerun the original read command unchanged.",
41
41
  "Never rerun vault access as a status check."
42
42
  ],
43
43
  "human_language": {
44
- "prefer": [
45
- "previously purchased content",
46
- "past report",
47
- "purchase history",
48
- "已购内容",
49
- "以前购买的报告",
50
- "购买记录"
51
- ],
52
- "avoid": [
53
- "Vault",
54
- "artifact",
55
- "Device",
56
- "Buyer",
57
- "grant",
58
- "start token"
59
- ]
44
+ "prefer": ["previously purchased content", "past report", "purchase history", "已购内容", "以前购买的报告", "购买记录"],
45
+ "avoid": ["Vault", "artifact", "Device", "Buyer", "grant", "start token"]
60
46
  },
61
47
  "partial_results": {
62
48
  "available": "Explain the returned section normally.",
@@ -1,7 +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 for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
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.",
5
5
  "topic": "quickstart",
6
6
  "title": "Route One Human Intent Through ItPay",
7
7
  "purpose": "Choose the correct first action from the human's words and continue through one authoritative CLI envelope at a time.",
@@ -12,7 +12,7 @@
12
12
  "required_state": {
13
13
  "needs": [
14
14
  "the real supported Agent Type",
15
- "one allowed Backend: production https://app.itpay.ai by default; explicit https://sandbox.itpay.ai or https://dev.itpay.ai for the corresponding test environment"
15
+ "one official Backend: production https://app.itpay.ai by default, or explicit test https://dev.itpay.ai"
16
16
  ],
17
17
  "must_not_need": [
18
18
  "Admin access",
@@ -21,32 +21,29 @@
21
21
  ]
22
22
  },
23
23
  "intent_routing": {
24
- "new_service": "For other new services, use itpay catalog list --json and the selected input contract.",
24
+ "new_service": "Use catalog list only for a new service or query.",
25
25
  "previous_content": "Use vault list, optionally with the subject as --query.",
26
26
  "purchase_history": "Use orders.",
27
27
  "refund_or_paid_problem": "Resume the known Order or Refund before creating anything new.",
28
- "service_feedback": "Finish the original order outcome first, then optionally submit one safe Agent postmortem; include a rating or comment only when the human explicitly gives it.",
29
- "ambiguous": "Ask whether the human wants an earlier purchase or a new query before calling ItPay.",
30
- "railway": "Known railway intent: itpay docs show rail-booking. Read once, then follow its Exact/Smart route."
28
+ "service_feedback": "Finish the original order outcome first, then submit one safe Agent postmortem; include a rating or comment only when the human explicitly gives it.",
29
+ "ambiguous": "Ask whether the human wants an earlier purchase or a new query before calling ItPay."
31
30
  },
32
- "commands": [
33
- {
34
- "intent": "continue the selected flow",
35
- "command": "<execute the exact next.command returned by the previous CLI envelope>",
36
- "success_signal": "the next envelope reports one current state and at most one preferred action"
37
- }
38
- ],
31
+ "commands": [{
32
+ "intent": "continue the selected flow",
33
+ "command": "<execute the exact next.command returned by the previous CLI envelope>",
34
+ "success_signal": "the next envelope reports one current state and at most one preferred action"
35
+ }],
39
36
  "agent_rules": [
40
37
  "Use the CLI as the control surface; infer the human's intent before the first command and never hardcode a service workflow.",
41
38
  "Treat result as current facts, instruction as how to use those facts, next as the preferred executable action, and recovery as exceptional paths.",
42
- "Run one state-changing command at a time. Treat next.command as the preferred continuation: execute it unchanged only when its required values are already present; fill a non-executable input_template separately only when the current result has not already satisfied the user's goal.",
39
+ "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.",
43
40
  "Keep the same explicit Agent Type through next and recovery commands; same-type windows reuse one Backend Agent Instance.",
44
- "When testing sandbox, execute every returned command unchanged so its ITPAY_BACKEND_URL=https://sandbox.itpay.ai prefix is preserved.",
45
- "Use --target only for a Host presentation destination. Use --input key=value only for simple scalars; nested objects use a small JSON file with the existing --input-json command.",
46
- "For non-rail delivery that explicitly requires email, ask only that missing value and explain its purpose. Railway identity and notification contact are handled on the protected official checkout page; never guess them.",
41
+ "When testing dev, execute every returned command unchanged so its ITPAY_BACKEND_URL=https://dev.itpay.ai prefix is preserved.",
42
+ "Use --target only for a Host presentation destination. Put capability business values in --input key=value exactly as required by the schema.",
43
+ "Start a separate Service Execution for each independent service intent; quota remains shared according to Backend identity policy.",
44
+ "Ask the user for required email or contact values and explain their purpose; never invent them.",
47
45
  "Explain useful service facts in ordinary language; never ask the human to run commands or learn internal IDs.",
48
- "Normal payment uses the returned ItPay Checkout handoff.",
49
- "A railway query execution and its separate booking execution may serve one purchase intent; keep both references."
46
+ "Normal payment uses the returned ItPay Checkout handoff."
50
47
  ],
51
48
  "forbidden": [
52
49
  "Do not invent catalog, variant, offer, capability, result item, order or refund IDs.",
@@ -54,10 +51,6 @@
54
51
  "Do not bypass a grant, refund lock, ownership error or compatibility gate."
55
52
  ],
56
53
  "next_docs": [
57
- {
58
- "condition": "Known railway request",
59
- "topic": "rail-booking"
60
- },
61
54
  {
62
55
  "condition": "Need service catalog language",
63
56
  "topic": "catalog-list"
@@ -106,7 +99,5 @@
106
99
  "rating",
107
100
  "target",
108
101
  "input"
109
- ],
110
- "reading_results": "Read normal CLI text directly, or parse the complete --json envelope with the host file reader. If saving stdout to a file, first check the command exit code, then read the whole file with cat or the existing file tool. Keep stderr separate; do not use head, tail, regex or a custom script to recover truncated results. Write complex input as a small JSON file and use --input-json.",
111
- "purchase_consent": "Candidate selection is not price approval. Service-backed quote/cart/checkout requires a current scoped approve_purchase record; use the complete server template, default false. Only genuine matching approval allows true; material price/subject/terms changes invalidate it. Restore an existing Checkout before creating anything."
102
+ ]
112
103
  }
@@ -1,7 +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 for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
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.",
5
5
  "topic": "render-hosts",
6
6
  "title": "Agent Type And Human Handoff Rendering",
7
7
  "purpose": "Use only the handoff fields returned for the current Agent Type and make Checkout or read authorization genuinely visible on that surface.",
@@ -33,17 +33,12 @@
33
33
  {
34
34
  "agent_type": "workbuddy",
35
35
  "default_host": "plain-chat",
36
- "responsibility": "execute handoff.agent_action exactly once to open the fully rendered handoff.url with present_files, then send handoff.mobile_url as a clickable link that jumps straight into Alipay or WeChat Pay on a phone; show the amount and stop"
36
+ "responsibility": "execute handoff.agent_action exactly once to open the fully rendered handoff.url with present_files; show the amount and stop"
37
37
  },
38
38
  {
39
39
  "agent_type": "zcode",
40
40
  "default_host": "plain-chat",
41
- "responsibility": "open handoff.url immediately in the ZCode built-in browser, also send handoff.mobile_url as the phone-friendly entry, then stop; when the built-in browser is unavailable show both clickable links"
42
- },
43
- {
44
- "agent_type": "doubao-work",
45
- "default_host": "plain-chat",
46
- "responsibility": "show handoff.mobile_url as the preferred same-phone checkout or authorization link and handoff.qr_image_url as the labeled save-or-scan fallback; state the amount for Checkout and stop"
41
+ "responsibility": "open handoff.url immediately in the ZCode built-in browser and stop; only show the same clickable URL when the built-in browser is unavailable"
47
42
  },
48
43
  {
49
44
  "agent_type": "kimi-code",
@@ -54,9 +49,7 @@
54
49
  "agent_type": "openclaw",
55
50
  "default_host": null,
56
51
  "host_required": true,
57
- "native_hosts": [
58
- "telegram"
59
- ],
52
+ "native_hosts": ["telegram"],
60
53
  "responsibility": "pass the native OpenClaw entry target explicitly; for Telegram execute handoff.agent_action unchanged, then treat itp:grant_confirmed callbacks only as permission to query the same Checkout and follow Backend grant state; otherwise show the returned HTTPS QR image and Checkout URL"
61
54
  }
62
55
  ],
@@ -73,23 +66,20 @@
73
66
  }
74
67
  ],
75
68
  "agent_rules": [
76
- "Agent Type is stable identity; Host is presentation and may be explicitly overridden. Once the official handoff is available, show it on this host before optional memory/log work; retain necessary safety and permissions.",
77
- "A local QR path is not visible until a desktop Agent attaches or renders that file on the human-facing surface; WorkBuddy Checkout handoff uses its returned Card Link and mobile URL; auth login may separately return a local QR path.",
78
- "For workbuddy with plain-chat, execute handoff.agent_action exactly once; it calls present_files with handoff.url as the only files element and opens the rendered Card Link in the right-side browser, then send handoff.mobile_url so phone users can tap straight into Alipay or WeChat Pay.",
79
- "For zcode with plain-chat, open handoff.url in the built-in browser and also send handoff.mobile_url as the phone entry; do not only paste text, download or rebuild a QR, or invent a private browser-tool payload; when the built-in browser is unavailable show both clickable links.",
80
- "For doubao-work with plain-chat, show two labeled official links: handoff.mobile_url for direct same-phone opening and handoff.qr_image_url for saving or scanning on another device; do not parse credentials, download or rebuild the QR, or create an alternative resource.",
81
- "If the WorkBuddy action fails, send the original handoff.url and handoff.mobile_url, report that it did not auto-open, and stop without creating another payment resource.",
82
- "handoff.mobile_url is the phone-friendly Checkout URL; when the current client cannot open links in place (for example a mobile mini program), send it and tell the human to copy it into the phone browser where it can jump into Alipay or WeChat Pay. It is only returned when the handoff carries the complete token pair; when absent, handoff.url remains the entry.",
83
- "Do not claim a handoff was shown until the official entry supported by this Host is genuinely visible. A link-only Host does not require a QR.",
69
+ "Agent Type is stable identity; Host is presentation and may be explicitly overridden.",
70
+ "A local QR path is not visible until a desktop Agent attaches or renders that file on the human-facing surface; WorkBuddy never receives a local QR path.",
71
+ "For workbuddy with plain-chat, execute handoff.agent_action exactly once; it calls present_files with handoff.url as the only files element and opens the rendered Card Link in the right-side browser.",
72
+ "For zcode with plain-chat, open handoff.url in the built-in browser. Do not only paste text, download or rebuild a QR, or invent a private browser-tool payload; use the same clickable URL only as fallback.",
73
+ "If the WorkBuddy action fails, send the original handoff.url, report that it did not auto-open, and stop without creating another payment resource.",
74
+ "Do not claim the handoff was shown until both a usable payment image or QR and the Checkout URL are visible.",
84
75
  "IM Hosts that require a target must receive --target before Checkout creation. OpenClaw has no default Host; Kimi Code uses terminal.",
85
- "OpenClaw Telegram uses flat url/value buttons for deployed-version compatibility. A grant_confirmed callback carries only the Checkout ID, never a display token, and never proves payment or an active grant.",
86
- "Business flow is the same across hosts. Vault grants apply only to protected purchased-content access, not every railway step."
76
+ "OpenClaw Telegram uses flat url/value buttons for deployed-version compatibility. A grant_confirmed callback carries only the Checkout ID, never a display token, and never proves payment or an active grant."
87
77
  ],
88
78
  "forbidden": [
89
79
  "Do not expose display tokens separately from the tokenized Checkout handoff.",
90
80
  "Do not print base64 images, mirror lists, renderer debug state, or provider QR URLs.",
91
81
  "Do not claim a desktop attachment exists when only a filesystem path was printed.",
92
- "For Checkout Card Link, do not use present_files for a local file, QR PNG, downloaded copy or rebuilt URL. Auth login is separate: use its actual handoff capabilities and returned local QR when supported; never rebuild it."
82
+ "Do not use present_files for a local file, QR PNG, downloaded copy, or rebuilt URL in WorkBuddy."
93
83
  ],
94
84
  "next_docs": [
95
85
  {
@@ -109,7 +99,6 @@
109
99
  "desktop",
110
100
  "workbuddy",
111
101
  "zcode",
112
- "doubao work",
113
102
  "kimi code",
114
103
  "openclaw",
115
104
  "telegram"
@@ -7,7 +7,7 @@
7
7
  "purpose": "Finish the original order outcome first, then persist safe process context and any explicit human rating or comment without exposing commands or internal identifiers.",
8
8
  "when_to_use": [
9
9
  "The human asks to rate a service, leave feedback, report a blocker, or says how many stars the experience deserves.",
10
- "A paid result has actually been delivered and the CLI instruction offers an optional safe Agent postmortem.",
10
+ "A paid result has actually been delivered and the CLI instruction requires a safe Agent postmortem.",
11
11
  "A paid service failed and its order, delivery, and refund path have already been explained or recovered."
12
12
  ],
13
13
  "intent_routing": {
@@ -27,11 +27,10 @@
27
27
  "agent_rules": [
28
28
  "A rating is optional. Normalize an explicit 1-5 rating to an integer; sentiment never implies a score. Preserve an explicit human comment without inventing one.",
29
29
  "Run every command yourself. Speak to the human only about the service, their rating, whether feedback was recorded, and any original order rights.",
30
- "Optionally submit one baseline Agent postmortem after presenting the outcome; it never blocks delivery. Do not pressure the human for a score; an empty repeat is a no-op, while a later explicit rating or comment updates the same feedback.",
30
+ "Submit one baseline Agent postmortem after the outcome. Do not pressure the human for a score; an empty repeat is a no-op, while a later explicit rating or comment updates the same feedback.",
31
31
  "Use only the human's own words plus safe order context. Never upload the conversation, prompt, diagnostics, contact details, tokens, internal identities, provider responses, or purchased payload.",
32
32
  "A successful feedback submission does not promise a reply, resolution, refund, or order change.",
33
- "If submission outcome is unknown, stop and explain that recording could not be confirmed; never retry automatically.",
34
- "Feedback follows a real outcome within the user’s authorization; never submit private raw logs, credentials, tokens or traveler identity."
33
+ "If submission outcome is unknown, stop and explain that recording could not be confirmed; never retry automatically."
35
34
  ],
36
35
  "human_language": {
37
36
  "success": "Your feedback has been recorded. Thank you.",
@@ -1,6 +1,6 @@
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. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
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
4
 
5
5
  `--agent-type` 表示哪类运行时在运行 CLI,用于 Agent 实例归属和定制 instruction。`--host` 表示输出展示在哪里;`--target` 只是在某些 Host 中指定 chat/channel/open ID。三者不可混用,窗口、任务和对话也不是身份。
6
6
 
@@ -16,7 +16,6 @@
16
16
  | `claude-code-cli` | `terminal` | 在用户可见终端输出二维码和官方链接,不声称已在桌面对话展示。 |
17
17
  | `workbuddy` | `plain-chat` | 返回完整渲染的 HTML Card Link 和可原样执行的 `present_files` action;立即打开 Card Link,不返回或检查本地图片路径。 |
18
18
  | `zcode` | `plain-chat` | 返回完整渲染的官方 URL;立即用 ZCode 内置浏览器打开,不只粘贴文字链接,也不返回或重建二维码图片。 |
19
- | `doubao-work` | `plain-chat` | 同时返回手机直达收银台链接和官方二维码图片链接;在豆包工作对话中明确标注两者,说明金额后停止等待。 |
20
19
  | `kimi-code` | `terminal` | 使用标准 CLI 引导,在用户可见终端渲染二维码和付款链接。 |
21
20
  | `openclaw` | 无;必须显式传入 | `--host telegram` 使用 OpenClaw 原生 `message` action;其他入口返回标准 HTTPS 二维码和付款链接。 |
22
21
 
@@ -35,7 +34,6 @@
35
34
  - OpenClaw 的 IM Host 必须提供 `--target`。缺失时在任何 Checkout 创建前返回 `target_required`。
36
35
  - `kimi-code` 是 CLI 型 Agent,复用 `terminal` Host 和现有 CLI 展示,不增加 Kimi 专属交易协议。
37
36
  - `zcode` 使用 `plain-chat` Host 和官方 URL-only handoff。Agent 必须自行在 ZCode 内置浏览器打开 URL;只有内置浏览器确实不可用时才向用户展示同一个可点击链接。
38
- - `doubao-work` 使用 `plain-chat` Host。它虽运行在云电脑中,仍走 Local Device Authority;不得改走 MCP 或创建第二套身份。Checkout 和 Vault 授权必须同时展示 `handoff.url` 与 `handoff.qr_image_url`。
39
37
  - session 失效时 CLI 只续期并重试原请求一次;再次失败立即返回。revoked v2 Device 不自动换身份。
40
38
  - 同一 Device 首次登记新的 Agent Type 时,CLI 只使用本地已登记且 Backend 仍接受的既有 Agent Instance 完成签名登记;被撤销的 Instance 会被跳过且不会恢复。若没有任何既有 Instance 可用,CLI 必须停止,不得重新登记 Device、旋转私钥或借用其他 Backend。
41
39
 
@@ -81,7 +79,6 @@ URL 内 credential 不得被提取、单独输出、记录或重建。
81
79
  | `claude-code-cli / terminal` | `url`;非 JSON 输出另外渲染终端二维码 |
82
80
  | `workbuddy / plain-chat` | `url, agent_action`(`present_files(files=[url])`,打开完整渲染的 HTML Card Link) |
83
81
  | `zcode / plain-chat` | `url`(立即用 ZCode 内置浏览器打开;不返回图片或平台私有 action) |
84
- | `doubao-work / plain-chat` | `url, qr_image_url`(`url` 是本机直接打开的首选入口;`qr_image_url` 是保存或由另一台设备扫码的备用入口) |
85
82
  | `kimi-code / terminal` | `url`;非 JSON 输出另外渲染终端二维码 |
86
83
  | `openclaw / telegram` | `url, qr_image_url, agent_action` |
87
84
  | `openclaw / other` | `url, qr_image_url` |
@@ -90,8 +87,6 @@ WorkBuddy instruction 必须要求 Agent 原样执行一次 `handoff.agent_actio
90
87
 
91
88
  ZCode instruction 必须明确要求 Agent 立即用内置浏览器打开 `handoff.url`,确认已发起打开后说明金额并停止。不得只把 URL 当作文字粘贴给用户,也不得下载、解析或重建二维码。只有内置浏览器明确不可用时,才把同一个 `handoff.url` 作为可点击链接展示。CLI 不猜测或输出 ZCode 私有工具调用 JSON。
92
89
 
93
- Doubao Work instruction 必须要求 Agent 在当前对话中展示两个有标签的官方入口:优先展示“手机直接打开收银台”对应的 `handoff.url`,再展示“二维码图片(保存或用另一台设备扫码)”对应的 `handoff.qr_image_url`。说明金额后停止等待;不得解析 URL 中的 credential、下载或重建二维码、调用 `pay`,也不得创建替代 Checkout。
94
-
95
90
  OpenClaw Telegram 的 `handoff.agent_action` 是可原样执行的原生 `message` tool action。`presentation` 只包含标准 `blocks.buttons`:`📱 手机点这儿支付` 使用扁平 `url`,`📋 已授权给我读` 使用扁平 `value=itp:grant_confirmed:<checkout_id>`;二维码单独使用 action 的 `media`。CLI `instruction` 必须要求 Agent 原样执行该 action,不得改写 Presentation、换用其他消息工具或声称普通文本回复等同于已发送按钮。收到授权 callback 后立即执行 `next.command` 查询同一 Checkout,再只跟随后端返回的同一 Execution grant 流程;callback 只携带 Checkout ID,不携带 display token,也不证明付款或 grant 已生效。OpenClaw `target` 使用原生 chat target(如 `5559456744` 或 `-1001234567890:topic:42`),不添加 `telegram:` 前缀。
96
91
 
97
92
  ### Purchased-content authorization
@@ -99,7 +94,7 @@ OpenClaw Telegram 的 `handoff.agent_action` 是可原样执行的原生 `messag
99
94
  `vault access` 使用相同字段集合,但不包含金额、Checkout ID、付款状态或付款
100
95
  查询命令。桌面 handoff 的 Markdown 标题和链接必须明确为“授权查看已购
101
96
  内容”;Terminal 显示授权二维码;WorkBuddy 用 `present_files` 打开完整
102
- `handoff.url`;ZCode 用内置浏览器打开完整 `handoff.url`;Doubao Work 同时展示授权链接和官方二维码图片链接;OpenClaw 使用返回的图片/原生 action。
97
+ `handoff.url`;ZCode 用内置浏览器打开完整 `handoff.url`;OpenClaw 使用返回的图片/原生 action。
103
98
 
104
99
  授权 handoff 展示后 `next=null`。用户明确表示已完成时,Agent只重新执行
105
100
  产生授权要求的原始 `vault list`、`orders` 或 `vault read`,不得再次执行
@@ -1,6 +1,6 @@
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. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -169,7 +169,6 @@ itpay buy \
169
169
  | `claude-code-cli` | `terminal` | `url` | 在用户可见终端展示;不能声称桌面对话已收到图片。 |
170
170
  | `workbuddy` | `plain-chat` | `url,agent_action` | 原样执行一次 `present_files(files=[url])`,在右侧打开完整渲染的 HTML Card Link,然后停止。 |
171
171
  | `zcode` | `plain-chat` | `url` | 立即用 ZCode 内置浏览器打开 URL;只有浏览器不可用时才展示同一个可点击链接。 |
172
- | `doubao-work` | `plain-chat` | `url,qr_image_url` | 展示“手机直接打开收银台”和“二维码图片(保存或用另一台设备扫码)”两个有标签的官方入口,说明金额后停止。 |
173
172
  | `kimi-code` | `terminal` | `url` | 使用标准 CLI 非 JSON 终端二维码和链接。 |
174
173
  | `openclaw` | 必须显式 | Telegram 返回 `url,qr_image_url,agent_action`;其他入口返回 `url,qr_image_url` | Telegram 执行原生 `message` action;其他入口直接展示图片和链接。 |
175
174
 
@@ -1,10 +1,6 @@
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. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
4
-
5
- ## 服务报价的批准边界
6
-
7
- 服务支持的 Quote/Cart/Checkout 共用服务端范围校验。缺少有效价格批准时返回完整 `approve_purchase` 模板,默认 `user_approved:false`;Agent 只在真实会话已同意当前主体、内容、价格或预算和条款时提交 true。选择候选或完成席别 review 不代替价格批准。同条件有效批准复用,已有 Checkout/未知付款先恢复原单,不补事后批准或创建替代订单。
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.
8
4
 
9
5
  ## 范围与意义
10
6