@itpay/cli 2.1.19 → 2.1.29

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 (86) hide show
  1. package/README.md +2 -2
  2. package/dist/src/commands/buy.js +3 -3
  3. package/dist/src/commands/cart.js +15 -15
  4. package/dist/src/commands/catalog.js +10 -7
  5. package/dist/src/commands/checkout.js +8 -11
  6. package/dist/src/commands/docs.js +3 -14
  7. package/dist/src/commands/guidance.js +41 -25
  8. package/dist/src/commands/install.js +2 -2
  9. package/dist/src/commands/order.js +4 -3
  10. package/dist/src/commands/orders.js +4 -9
  11. package/dist/src/commands/pay.js +1 -1
  12. package/dist/src/commands/rail_catalog.js +160 -11
  13. package/dist/src/commands/refund.js +5 -5
  14. package/dist/src/commands/services.js +658 -361
  15. package/dist/src/commands/skill.js +1 -1
  16. package/dist/src/commands/vault.js +27 -20
  17. package/dist/src/main.js +39 -24
  18. package/dist/src/render/markdown.js +0 -3
  19. package/dist/src/state/account_auth.js +9 -5
  20. package/dist/src/state/cart_session.js +4 -1
  21. package/dist/src/state/config.js +1 -1
  22. package/dist/src/state/task_journal.js +2 -0
  23. package/docs/agent/buyer/cart-checkout.json +5 -4
  24. package/docs/agent/buyer/catalog-list.json +24 -6
  25. package/docs/agent/buyer/identity-and-sessions.json +16 -15
  26. package/docs/agent/buyer/install-and-setup.json +5 -4
  27. package/docs/agent/buyer/orders-refunds.json +11 -5
  28. package/docs/agent/buyer/payment-flow.json +3 -3
  29. package/docs/agent/buyer/purchased-content.json +18 -4
  30. package/docs/agent/buyer/quickstart.json +22 -14
  31. package/docs/agent/buyer/rail-booking.json +125 -171
  32. package/docs/agent/buyer/rail-fast-checkout.json +21 -44
  33. package/docs/agent/buyer/render-hosts.json +9 -6
  34. package/docs/agent/buyer/service-feedback.json +2 -1
  35. package/docs/cli-reference/agent-types.md +1 -1
  36. package/docs/cli-reference/commands/auth.md +2 -0
  37. package/docs/cli-reference/commands/buy.md +1 -1
  38. package/docs/cli-reference/commands/cart/add.md +1 -1
  39. package/docs/cli-reference/commands/cart/clear.md +1 -1
  40. package/docs/cli-reference/commands/cart/index.md +1 -1
  41. package/docs/cli-reference/commands/cart/next.md +1 -1
  42. package/docs/cli-reference/commands/cart/remove.md +1 -1
  43. package/docs/cli-reference/commands/cart/show.md +1 -1
  44. package/docs/cli-reference/commands/catalog/index.md +1 -1
  45. package/docs/cli-reference/commands/catalog/list.md +1 -1
  46. package/docs/cli-reference/commands/checkout.md +1 -1
  47. package/docs/cli-reference/commands/device.md +8 -7
  48. package/docs/cli-reference/commands/docs/index.md +1 -1
  49. package/docs/cli-reference/commands/docs/list.md +1 -1
  50. package/docs/cli-reference/commands/docs/search.md +1 -1
  51. package/docs/cli-reference/commands/docs/show.md +1 -1
  52. package/docs/cli-reference/commands/install.md +2 -2
  53. package/docs/cli-reference/commands/next.md +1 -1
  54. package/docs/cli-reference/commands/order.md +1 -1
  55. package/docs/cli-reference/commands/pay.md +1 -1
  56. package/docs/cli-reference/commands/readyz.md +1 -1
  57. package/docs/cli-reference/commands/refund/cancel.md +1 -1
  58. package/docs/cli-reference/commands/refund/create.md +1 -1
  59. package/docs/cli-reference/commands/refund/get.md +2 -2
  60. package/docs/cli-reference/commands/refund/index.md +1 -1
  61. package/docs/cli-reference/commands/refund/list.md +1 -1
  62. package/docs/cli-reference/commands/refund/watch.md +1 -1
  63. package/docs/cli-reference/commands/services/action.md +3 -3
  64. package/docs/cli-reference/commands/services/checkout.md +1 -1
  65. package/docs/cli-reference/commands/services/events.md +1 -1
  66. package/docs/cli-reference/commands/services/get.md +1 -1
  67. package/docs/cli-reference/commands/services/index.md +1 -1
  68. package/docs/cli-reference/commands/services/invoke.md +5 -13
  69. package/docs/cli-reference/commands/services/list.md +1 -1
  70. package/docs/cli-reference/commands/services/next.md +12 -10
  71. package/docs/cli-reference/commands/services/page.md +9 -7
  72. package/docs/cli-reference/commands/services/quote.md +1 -1
  73. package/docs/cli-reference/commands/services/read-result.md +16 -9
  74. package/docs/cli-reference/commands/services/run.md +4 -2
  75. package/docs/cli-reference/commands/services/start.md +1 -1
  76. package/docs/cli-reference/conventions.md +2 -2
  77. package/package.json +7 -5
  78. package/skills/itpay/SKILL.md +77 -238
  79. package/docs/reviews/agent-ux-handoff-2026-09-23/IMPLEMENTATION-EVIDENCE.md +0 -174
  80. package/docs/skill-bundle-rollout/01-mcp-authentication.md +0 -134
  81. package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +0 -210
  82. package/docs/skill-bundle-rollout/03-platform-publishing.md +0 -161
  83. package/docs/skill-bundle-rollout/04-first-wave-platforms.md +0 -70
  84. package/docs/skill-bundle-rollout/05-sync-operations.md +0 -62
  85. package/docs/skill-bundle-rollout/README.md +0 -151
  86. /package/bin/{itp → itp.mjs} +0 -0
@@ -3,66 +3,43 @@
3
3
  "role": "buyer_agent",
4
4
  "product_scope": "itpay_rail",
5
5
  "topic": "rail-fast-checkout",
6
- "title": "Rail Fast Checkout — One Human Question, Owners Do The Rest",
7
- "purpose": "After the buyer has picked a train/seat (prepare_checkout delegation), carry one valid selection through booking review, protected checkout and issuance tracking with a single consolidated human interaction — using only existing commands and owner-issued handles.",
6
+ "title": "Rail Fast Checkout — Delegated Purchase Supplement",
7
+ "purpose": "Short delegated-purchase supplement to rail-booking; host presentation differences only.",
8
8
  "when_to_use": [
9
- "The buyer explicitly picked a train/seat or delegated selection under rules, and you hold a bookable option with booking_offer.selection_token from itpay-rail-exact or itpay-rail-smart.",
10
- "Do NOT use for a plain schedule query (compare goal) — present one preferred option plus up to two alternatives and wait instead."
9
+ "The buyer delegated railway selection and a current bookable result is available. Read rail-booking first."
11
10
  ],
12
11
  "steps": [
13
12
  {
14
- "step": "create_booking_input",
15
- "command": "printf '%s' '{\"passengers\":1,\"selection\":{\"token\":\"<token>\"}}' > /tmp/itpay-booking-input.json",
13
+ "step": "read_full_flow",
14
+ "command": "Use the rail-booking guide already read for this request",
16
15
  "notes": [
17
- "Fill <token> with the current result's booking_offer.selection_token; add selection.seat_type when the buyer picked a class. Create the file yourself under /tmp — the buyer never sees a path.",
18
- "Never reconstruct legs JSON when a token is available; the owner derives authoritative legs and re-quotes live."
16
+ "Use the current query result and booking_template; this topic does not replace the railway guide."
19
17
  ]
20
18
  },
21
19
  {
22
- "step": "start_booking",
23
- "command": "itpay services run itpay-rail-booking --input-json /tmp/itpay-booking-input.json --json",
24
- "then": "Use the booking run response directly; call its next only if it is still waiting for progress.",
25
- "expected_status": "booking_review_required"
26
- },
27
- {
28
- "step": "one_consolidated_review",
29
- "read": "human_action.context.review carries legs, seat_options, draft_revision and notice_version.",
30
- "ask_human_once": "Show the itinerary, seat options and the seat-preference disclaimer in one message; collect passengers count, seat_type, one seat preference per passenger slot, party_preference, and agreement to the notice_version terms.",
31
- "web_review": "If the review projection carries an official web entry (handoff.url in the envelope), prefer it: open it for the buyer and wait there; the chat fallback remains valid if the page is unavailable.",
32
- "submit": "itpay services action <execution_id> --action workflow:confirm_booking --actor-type human --status approved --input-json /tmp/itpay-review.json --json",
33
- "notes": [
34
- "draft_revision must equal the current server value; booking_review_changed means re-read services next and resubmit, never bump locally.",
35
- "accept_non_guaranteed is true only when the buyer actually agreed; never fabricate a human approval.",
36
- "On booking_review_invalid, re-read this booking. A seat-code spelling correction may reuse the buyer's explicit approval only if train, actual seat class, passenger count, price, and terms are unchanged; confirm material changes or missing approval.",
37
- "Passenger names, ID numbers and phones are NOT in this input — they belong to the protected checkout page."
38
- ]
39
- },
40
- {
41
- "step": "checkout_handoff",
42
- "read": "The current booking response may already contain handoff.url (the protected checkout page).",
43
- "command": "Only if the current handoff was not presented, use the exact checkout command returned by the CLI.",
20
+ "step": "continue_delegated_booking",
21
+ "command": "Use the current result’s booking_template and returned next action",
44
22
  "notes": [
45
- "Show or open the checkout exactly once; pass --viewer mobile when the buyer is on a phone.",
46
- "The buyer completes identity and payment on that page (Path B — no forced separate login). Payment handoff is not payment success; wallet return is not confirmation."
23
+ "Select under the buyer’s unchanged rules. Required human terms still require real consent. Continue the same booking execution."
47
24
  ]
48
25
  },
49
26
  {
50
- "step": "track_issuance",
51
- "command": "itpay services next <execution_id> --json",
52
- "then": "itpay orders show <order_id> --json",
53
- "expected_status": ["paid_pending_issuance", "issued"],
27
+ "step": "present_host_handoff",
28
+ "command": "Use the current Host handoff",
54
29
  "notes": [
55
- "Issuance is asynchronous — paid does not mean ticketed. Keep reading the SAME execution; never create a replacement.",
56
- "On issued, report the order state; if seat details are still syncing, advise checking 12306 instead of re-querying."
30
+ "Show only the supported official entry. Read itpay order <order_id> --json after payment for authoritative status; issuing is not issued."
57
31
  ]
58
32
  }
59
33
  ],
60
34
  "never": [
61
- "Never build legs JSON from visible result fields while a selection_token exists.",
62
- "Never run a second services run for the same selection — repeat submission restores the same execution.",
63
- "Never ask for passenger identity, verification codes, or payment details in chat.",
64
- "Never claim payment equals issuance, or a displayed handoff equals human approval.",
65
- "Never invent command flags, action types, revisions or tokens; copy server-issued handles verbatim."
35
+ "Never invent consent, identity or a seat code.",
36
+ "Never duplicate a purchase or repeat an unknown-outcome payment.",
37
+ "Never show an internal command to the human."
66
38
  ],
67
- "search_terms": ["fast checkout", "快速下单", "一键购票", "rail checkout recipe"]
39
+ "search_terms": [
40
+ "fast checkout",
41
+ "快速下单",
42
+ "一键购票",
43
+ "rail checkout recipe"
44
+ ]
68
45
  }
@@ -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, 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
+ "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.",
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.",
@@ -54,7 +54,9 @@
54
54
  "agent_type": "openclaw",
55
55
  "default_host": null,
56
56
  "host_required": true,
57
- "native_hosts": ["telegram"],
57
+ "native_hosts": [
58
+ "telegram"
59
+ ],
58
60
  "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"
59
61
  }
60
62
  ],
@@ -72,21 +74,22 @@
72
74
  ],
73
75
  "agent_rules": [
74
76
  "Agent Type is stable identity; Host is presentation and may be explicitly overridden.",
75
- "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.",
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.",
76
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.",
77
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.",
78
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.",
79
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.",
80
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.",
81
- "Do not claim the handoff was shown until both a usable payment image or QR and the Checkout URL are visible.",
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.",
82
84
  "IM Hosts that require a target must receive --target before Checkout creation. OpenClaw has no default Host; Kimi Code uses terminal.",
83
- "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."
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."
84
87
  ],
85
88
  "forbidden": [
86
89
  "Do not expose display tokens separately from the tokenized Checkout handoff.",
87
90
  "Do not print base64 images, mirror lists, renderer debug state, or provider QR URLs.",
88
91
  "Do not claim a desktop attachment exists when only a filesystem path was printed.",
89
- "Do not use present_files for a local file, QR PNG, downloaded copy, or rebuilt URL in WorkBuddy."
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."
90
93
  ],
91
94
  "next_docs": [
92
95
  {
@@ -30,7 +30,8 @@
30
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."
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."
34
35
  ],
35
36
  "human_language": {
36
37
  "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. 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.
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
4
 
5
5
  `--agent-type` 表示哪类运行时在运行 CLI,用于 Agent 实例归属和定制 instruction。`--host` 表示输出展示在哪里;`--target` 只是在某些 Host 中指定 chat/channel/open ID。三者不可混用,窗口、任务和对话也不是身份。
6
6
 
@@ -83,6 +83,8 @@ Terminal and error states:
83
83
  | `auth_expired` | Session expired before completion | Offer to start `itpay auth login` again; prior query input is still preserved server-side |
84
84
  | `login_required` | No open request, not bound | Run `itpay auth login` |
85
85
  | `auth_cancelled` / `auth_denied` | User declined or closed the page | Respect the refusal; do not silently re-open; the pending query stays resumable |
86
+ | `auth_session_missing` | Saved authorization session no longer exists (404/410) | `auth status` stays read-only; an explicit `auth login` may create one new official session |
87
+ | `auth_status_unknown` | Transport or temporary server failure while reading status | Keep the same saved session and reread later; do not open a second login |
86
88
 
87
89
  ## Rules
88
90
 
@@ -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. 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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +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. 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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 命令范围
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 命令范围
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,10 +1,12 @@
1
1
  # `itpay device` / `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.
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
4
 
5
5
  ## 范围
6
6
 
7
- `itpay device` 只显示该命令组的帮助并退出,不访问 Backend、不读取或修改身份。当前子命令是 `recover`(运营确认 Backend 重置后删除本地登记)和 `reset-key`(服务端拒绝当前私钥登记时放弃本地密钥)。
7
+ `itpay device` 只显示该命令组的帮助并退出,不访问 Backend、不读取或修改身份。当前子命令是 `repair-lock`(检查并修复已退出进程留下的本地锁)、`recover`(运营确认 Backend 重置后删除本地登记)和 `reset-key`(服务端拒绝当前私钥登记时放弃本地密钥)。
8
+
9
+ `itpay device repair-lock --json` 只检查本地锁,保留 Device identity;活跃锁返回 `device_lock_active`,过期锁修复后返回 `device_lock_recovered`,无锁返回 `device_lock_absent`。
8
10
 
9
11
  仅在运营明确确认当前 Backend 的 Device 登记数据库已重建或清空后,删除本地该 Backend 的 v2 registration:
10
12
 
@@ -19,20 +21,19 @@ Instance。CLI 只在原子更新 Device state 时使用短期本地锁;释放
19
21
  通过 rename 完成,不依赖 Host 删除文件,因此 WorkBuddy 等 sandbox 的
20
22
  safe-delete/trash shim 不应阻断正常命令。该锁不在 Backend,不会让另一台电脑或
21
23
  另一个 Buyer 等待。遇到本地锁错误时不得删除 `~/.itpay-v3/device`、切换 Agent
22
- Type 或执行 `device recover`;应保留身份并重试原命令一次,持续失败时报告
23
- `device_state_unwritable` 或 lock timeout。
24
+ Type 或执行 `device recover`;锁忙用 `itpay device repair-lock --json` 检查,只回收已退出进程的锁。写盘权限错误按返回事实恢复宿主允许的持久写入权限后重试原命令,保持原身份。
24
25
 
25
26
  缺少确认参数返回 `backend_reset_confirmation_required`。普通 session 失效由 CLI 自动续期;revoked、quota、权限或未知 Backend 故障不得使用本命令。所有 Agent Type 使用相同输入和输出合同。
26
27
 
27
28
  ## `itpay device reset-key`
28
29
 
29
- 仅在服务端拒绝以当前私钥完成设备登记时使用(登记阶段持续返回 `internal_error`,或返回 `agent_device_key_rotated` / `agent_device_key_conflict`)。这是本地操作,不访问 Backend:
30
+ 仅在确认当前密钥不可恢复,且服务端返回 `agent_device_key_rotated` / `agent_device_key_conflict` 时使用;`internal_error` 是服务端故障,不能据此重置身份。必须指定真实 Agent Type 并取得明确确认。这是本地操作,不访问 Backend:
30
31
 
31
32
  ```bash
32
- itpay device reset-key --confirm-key-reset --json
33
+ itpay --agent-type <agent_type> device reset-key --confirm-key-reset --json
33
34
  ```
34
35
 
35
- 命令删除本地 Ed25519 私钥并清空所有 Backend 的本地登记记录;下一次需要设备身份的命令会以全新密钥重新登记为新设备。服务端旧设备记录保留为孤儿,不会被删除或复用;原设备的额度谱系不迁移。先尝试普通重试——Backend 会把已验证私钥的重复登记幂等挂回原设备,只有在该修复不可用或私钥已被服务端轮换/冲突时才需要本命令。
36
+ 命令删除本地 Ed25519 私钥并清空所有 Backend 的本地登记记录;下一次需要设备身份的命令会以全新密钥重新登记为新设备。服务端旧设备记录保留为孤儿,不会被删除或复用;原设备的额度谱系不迁移。正常续期与登记由 CLI 既有逻辑处理;仅在用户或运营明确决定放弃旧身份后才可执行换钥,旧执行访问不会迁移。锁超时使用 repair-lock,不重复登记或换钥。
36
37
 
37
38
  缺少确认参数返回 `key_reset_confirmation_required`;本地文件操作失败返回 `device_key_reset_failed`。本命令不得删除 Cart、operation journal 或 `~/.itpay-v3` 的其他内容。
38
39
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 命令范围
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -121,7 +121,7 @@ OpenClaw 额外明确没有默认入口:
121
121
  | `codex-cli` | `terminal` | 只在用户可见终端展示付款交接。 |
122
122
  | `claude-code-desktop` | `claude-code` | 桌面对话必须实际展示二维码和付款链接。 |
123
123
  | `claude-code-cli` | `terminal` | 只在用户可见终端展示付款交接。 |
124
- | `workbuddy` | `plain-chat` | 会持久化 `~/.itpay-v3` 的 Bash 调用先设 Shell 工具参数 `dangerouslyDisableSandbox=true`;拒绝权限时停止。Checkout 原样执行返回的 `present_files` action,打开渲染后的 Card Link。 |
124
+ | `workbuddy` | `plain-chat` | 为 `~/.itpay-v3` 申请正常持久化权限;拒绝时报告受阻操作。Checkout 原样执行返回的 `present_files` action,打开渲染后的 Card Link。 |
125
125
  | `zcode` | `plain-chat` | Checkout 或授权返回后立即用 ZCode 内置浏览器打开 `handoff.url`;只有浏览器不可用时才展示同一个可点击链接。 |
126
126
  | `doubao-work` | `plain-chat` | Checkout 或授权时同时展示 `handoff.url` 和 `handoff.qr_image_url` 两个有标签的官方入口;优先让手机直接打开链接,二维码供保存或另一台设备扫码。 |
127
127
  | `kimi-code` | `terminal` | 使用标准 CLI 流程和终端展示,不增加 Kimi 专属命令。 |
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -48,7 +48,7 @@ itpay refund get <refund_request_id> [--json]
48
48
  ## 终态
49
49
 
50
50
  - `succeeded`:先告诉用户退款已由 ItPay 确认成功,交付永久关闭,`next=null`。
51
- - `cancelled/rejected`:说明退款没有执行,交付资格可恢复,但旧 grant 不复活,需要用户重新授权,`next=null`。
51
+ - `cancelled/rejected`:说明退款没有执行,交付资格依当前订单和 owner 状态判断;旧 grant 不复活,按返回动作决定是否需要新的授权,`next=null` 时不自行创建。
52
52
  - `failed + known_no_effect`:说明退款请求确认未发送;Agent 不重试,由平台管理员决定是否重新执行,`next=null`。
53
53
  - `failed + retryable`:说明渠道明确返回可重试失败但 Agent 不会自行重试;等待平台管理员处理,`next=null`。
54
54
  - `failed + outcome_unknown`:说明渠道结果未知、交付继续锁定且必须先对账;禁止重试或重复申请,`next=null`。
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 命令范围
6
6
 
@@ -1,6 +1,6 @@
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.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
1
1
  # `itpay refund watch`
2
2
 
3
- > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
1
1
  # `itpay services action`
2
2
 
3
- > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -36,7 +36,7 @@ itpay services action <service_execution_id> --action <action_type>
36
36
  | `workflow:expand_search` | 有界新增查询 | 仅在扩展暂停(`expansion_status=paused`)时可用;必须带服务端下发的 `action_request_id`(`pa_…`)与 `expected_query_revision`,一轮一柄、用完作废。 |
37
37
  | `workflow:refine_preferences` | 无(本地重排) | 用 `--input-json` 提交偏好补丁,对已保存证据重排序。 |
38
38
  | `workflow:stop_search` | 无 | 停止未发送的扩展任务;不影响已开始或已完成的出票。 |
39
- | `select_journey` | 无 | 记录用户选定:`--input journey_id=<rj_…>`;仅记录选择、不改排名,后续购买仍走既有报价与受保护 Checkout。 |
39
+ | `select_journey` | 无 | 用户亲自选定用 `--actor-type human`;用户已明确委托按规则代选用 `--actor-type agent --input selection_mode=delegated`。两者都带服务端返回的 `journey_id`,仅记录选择,后续购买仍走既有报价与受保护 Checkout。 |
40
40
 
41
41
  同一 `action_request_id` 相同内容重放返回原受理结果;相同 ID 不同内容会被判冲突。过期 `expected_query_revision` 的新动作被拒绝。
42
42
 
@@ -68,4 +68,4 @@ rank 不存在、属于旧结果集或其他 Execution、action 不允许、stat
68
68
 
69
69
  ## Agent Type / Host
70
70
 
71
- 所有正式支持的 Local Agent Type 行为相同。需要人确认时 instruction 必须明确“先询问用户”,不能因 Desktop Host 自动代替用户选择。
71
+ 所有正式支持的 Local Agent Type 行为相同。真实条款同意仍需人确认;在用户已明确委托选择且规则未变时,Agent 可执行返回的委托选择动作,不得冒充 human。
@@ -1,6 +1,6 @@
1
1
  # `itpay services checkout`
2
2
 
3
- > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
1
1
  # `itpay services events`
2
2
 
3
- > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -1,6 +1,6 @@
1
1
  # `itpay services get`
2
2
 
3
- > **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are `buy` and `sell`: Buyer workflows are available now; Seller workflows will use the same entry point and are not implemented yet.
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
4
 
5
5
  ## 范围与意义
6
6
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  ## 核心不变量
13
13
 
14
- - 一个 Execution 表示一个独立服务意图;多个意图分别执行、分别交付,但各自的 Quote 可以进入同一 Cart。
14
+ - Execution 的边界由服务合同决定;铁路查询和购票使用不同 Execution,已有执行的等待与恢复保持原 ID。其他独立服务分别执行,其 Quote 可进入同一 Cart。
15
15
  - 任何 capability 输入都必须在状态写入、锁价、订单创建和 Provider 调用前通过 schema 校验。
16
16
  - `invoke` 只运行当前阶段允许且不需付款的 Agent-visible capability。
17
17
  - 依赖候选的付费 capability 必须继续来源 Execution;`action --candidate` 不能跨 Execution 搬运候选。