@itpay/cli 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +15 -7
  2. package/dist/src/commands/docs.js +1 -0
  3. package/dist/src/commands/guidance.js +8 -12
  4. package/dist/src/commands/install.js +2 -2
  5. package/dist/src/commands/readyz.js +7 -3
  6. package/dist/src/commands/skill.js +10 -10
  7. package/dist/src/main.js +22 -18
  8. package/dist/src/state/config.js +41 -6
  9. package/docs/agent/buyer/cart-checkout.json +16 -3
  10. package/docs/agent/buyer/catalog-list.json +1 -0
  11. package/docs/agent/buyer/identity-and-sessions.json +34 -13
  12. package/docs/agent/buyer/install-and-setup.json +25 -8
  13. package/docs/agent/buyer/orders-refunds.json +13 -2
  14. package/docs/agent/buyer/payment-flow.json +17 -3
  15. package/docs/agent/buyer/quickstart.json +49 -13
  16. package/docs/agent/buyer/render-hosts.json +14 -2
  17. package/docs/cli-reference/agent-types.md +2 -0
  18. package/docs/cli-reference/commands/buy.md +2 -0
  19. package/docs/cli-reference/commands/cart/add.md +2 -0
  20. package/docs/cli-reference/commands/cart/clear.md +2 -0
  21. package/docs/cli-reference/commands/cart/index.md +2 -0
  22. package/docs/cli-reference/commands/cart/next.md +2 -0
  23. package/docs/cli-reference/commands/cart/remove.md +3 -1
  24. package/docs/cli-reference/commands/cart/show.md +2 -0
  25. package/docs/cli-reference/commands/catalog/index.md +2 -0
  26. package/docs/cli-reference/commands/catalog/list.md +2 -0
  27. package/docs/cli-reference/commands/checkout.md +2 -0
  28. package/docs/cli-reference/commands/device.md +3 -1
  29. package/docs/cli-reference/commands/docs/index.md +2 -0
  30. package/docs/cli-reference/commands/docs/list.md +2 -0
  31. package/docs/cli-reference/commands/docs/search.md +2 -0
  32. package/docs/cli-reference/commands/docs/show.md +2 -0
  33. package/docs/cli-reference/commands/install.md +4 -2
  34. package/docs/cli-reference/commands/next.md +2 -0
  35. package/docs/cli-reference/commands/order.md +2 -0
  36. package/docs/cli-reference/commands/orders.md +2 -0
  37. package/docs/cli-reference/commands/pay.md +2 -0
  38. package/docs/cli-reference/commands/readyz.md +40 -11
  39. package/docs/cli-reference/commands/refund/cancel.md +2 -0
  40. package/docs/cli-reference/commands/refund/create.md +2 -0
  41. package/docs/cli-reference/commands/refund/get.md +2 -0
  42. package/docs/cli-reference/commands/refund/index.md +2 -0
  43. package/docs/cli-reference/commands/refund/list.md +2 -0
  44. package/docs/cli-reference/commands/refund/watch.md +2 -0
  45. package/docs/cli-reference/commands/services/action.md +2 -0
  46. package/docs/cli-reference/commands/services/checkout.md +2 -0
  47. package/docs/cli-reference/commands/services/events.md +2 -0
  48. package/docs/cli-reference/commands/services/get.md +2 -0
  49. package/docs/cli-reference/commands/services/index.md +2 -0
  50. package/docs/cli-reference/commands/services/invoke.md +2 -0
  51. package/docs/cli-reference/commands/services/list.md +2 -0
  52. package/docs/cli-reference/commands/services/next.md +2 -0
  53. package/docs/cli-reference/commands/services/quote.md +2 -0
  54. package/docs/cli-reference/commands/services/read-result.md +2 -0
  55. package/docs/cli-reference/commands/services/start.md +2 -0
  56. package/docs/cli-reference/commands/skill.md +5 -3
  57. package/docs/cli-reference/conventions.md +2 -0
  58. package/docs/cli-reference/index.md +3 -1
  59. package/docs/skill-bundle-rollout/01-mcp-authentication.md +256 -0
  60. package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +282 -0
  61. package/docs/skill-bundle-rollout/03-platform-publishing.md +270 -0
  62. package/docs/skill-bundle-rollout/README.md +98 -0
  63. package/package.json +6 -3
  64. package/skills/{itpay-buyer → itpay}/SKILL.md +39 -17
@@ -1,29 +1,38 @@
1
1
  ---
2
- name: itpay-buyer
2
+ name: itpay
3
3
  description: >
4
- Use the ItPay CLI when a human asks an Agent to discover services, use a
5
- capability, buy a result, show a Checkout, recover an interrupted flow,
6
- read a human-granted result, or manage a refund.
4
+ Use the single ItPay entry point when a human asks an Agent to buy or sell
5
+ through ItPay. Buyer workflows cover service discovery, purchase, Checkout,
6
+ delivery, recovery, and refunds. Seller workflows are not yet implemented.
7
7
  ---
8
8
 
9
- # ItPay Buyer
9
+ # ItPay
10
10
 
11
11
  Use the CLI as the only ItPay control surface. Never recreate API calls or hardcode a service-specific sequence.
12
12
 
13
- ## Envelope Rule
13
+ ## One Entry Point, Two Action Domains
14
+
15
+ - `itpay` is the only CLI entry point, and `$itpay` is the only user-facing Skill invocation. Never create or route users to a separate Buyer or Seller entry point.
16
+ - `buy` and `sell` are the two top-level ItPay action domains.
17
+ - Buyer workflows are available now. Seller workflows will use this same `itpay` entry point, but are not implemented in the current release.
18
+ - Do not invent Seller commands, onboarding, listings, or successful Seller state before that workflow ships.
14
19
 
15
- - Keep one honest Agent Type, CLI/Node launcher, and Host permission context. Supported types: `codex-desktop`, `codex-cli`, `claude-code-desktop`, `claude-code-cli`, `workbuddy`.
16
- - WorkBuddy: before any ItPay Bash command that persists `~/.itpay-v3`, set the Shell tool parameter `dangerouslyDisableSandbox` to `true`. If the human denies that permission, the command did not run: stop and report it. Never switch Node, delete identity, edit locks, or change Agent Type.
20
+ ## Critical Rules
21
+
22
+ - The CLI defaults to production `https://app.itpay.ai`. Only an explicit test may use the exact prefix `ITPAY_BACKEND_URL=https://dev.itpay.ai`; never use another Backend. While testing dev, execute every returned command unchanged so that prefix is preserved.
23
+ - Keep one honest Agent Type, one CLI/Node launcher, and one Host-approved permission context for the whole flow. Supported types: `codex-desktop`, `codex-cli`, `claude-code-desktop`, `claude-code-cli`, `workbuddy`.
24
+ - WorkBuddy: before any ItPay Bash command that persists `~/.itpay-v3`, set the Shell tool parameter `dangerouslyDisableSandbox` to `true`. If the human denies that permission, the command did not run: stop and report it.
17
25
  - Windows, tasks, chats, processes, and model sessions are not new Agents. Never rotate Agent Type or identity to reset quota.
18
- - Read `status` and `result` as facts, follow `instruction`, and execute at most the applicable `next.command`; use `recovery` only when it cannot continue.
19
- - `next.command` is not unconditional. If the result satisfies the user's goal, present useful facts and stop; never dump the whole envelope.
26
+ - Treat `next.command` as the preferred continuation, not an unconditional command. If the current result already satisfies the user's stated goal, present it and stop.
27
+ - Keep internal parsing, retries, sandbox diagnosis, and command translation out of the user response; report useful progress, results, and real human decisions only.
28
+ - If Device state is not writable, stop. Do not switch Node, manually create lock files, delete identity, or rotate Agent Type.
20
29
 
21
30
  ## Bootstrap
22
31
 
23
32
  ```bash
24
33
  npm install -g @itpay/cli
25
34
  itpay readyz --json
26
- itpay skill show itpay-buyer --json
35
+ itpay skill show itpay --json
27
36
  itpay install --json
28
37
  itpay install <agent_type> --json
29
38
  itpay --agent-type <agent_type> readyz --json
@@ -35,11 +44,24 @@ If `backend_contract_incompatible` returns `result.required_cli_version`, stop e
35
44
 
36
45
  ## Identity And Sessions
37
46
 
38
- - One local Ed25519 private key represents this installation. Never expose, copy, delete, or rotate it during normal recovery.
39
- - `dev`, `test`, and `app` have separate Device registrations under the same key. Each registration has one Agent Instance per `agent_type`; same-type windows reuse it.
40
- - Keep the returned `--agent-type` on every commerce command, or use one stable `ITPAY_AGENT_TYPE`. `--host` is presentation and `--target` is routing; neither is identity or business input.
41
- - The CLI may renew a rejected/expired session and retry once. If it still fails or Device state is not writable, stop; do not loop, switch Node, edit locks, inspect credentials, or change identity.
42
- - Use `device recover --confirm-backend-reset` only after an operator confirms that Backend was reset. It preserves the key and other Backend registrations.
47
+ - One local Ed25519 private key represents this ItPay installation. Never expose, copy, or rotate it to recover quota.
48
+ - The CLI uses one local signing key with separate official Backend registrations. Each registration has one Agent Instance per `agent_type`; different windows and chats of the same type reuse it.
49
+ - Every commerce command must keep the explicit `--agent-type` returned in `next` and `recovery`, or use one stable `ITPAY_AGENT_TYPE`. Never fall back to another type previously used on the machine.
50
+ - The CLI renews an expired or rejected device session and retries the same request exactly once. If that retry still fails, stop and report it; do not loop, create a new identity, or switch Agent Type.
51
+ - A revoked v2 device is not replaced automatically. It requires an explicit operator recovery path.
52
+ - If an operator confirms that the current official Backend registration database was reset, use the complete returned `device recover --confirm-backend-reset` command. This preserves the private key and other Backend registration; never use it for ordinary session expiry or revocation.
53
+ - `--host` selects presentation. `--target` is only the destination chat/channel/open ID required by some Hosts. Neither is business input or identity.
54
+
55
+ ## Envelope Rule
56
+
57
+ For every JSON response:
58
+
59
+ 1. Read `status` and `result` as current facts.
60
+ 2. Follow `instruction` when explaining or presenting those facts.
61
+ 3. Execute at most the one `next.command`, filling only explicit placeholders or required user data.
62
+ 4. Use `recovery` only when the normal next step cannot continue.
63
+
64
+ Do not print the whole envelope to the user. Return the useful result, a short explanation, and the next human action when needed.
43
65
 
44
66
  ## Golden Flow
45
67
 
@@ -110,7 +132,7 @@ Reuse the same Execution and Checkout. Never start another Execution, create ano
110
132
  itpay docs list --json
111
133
  itpay docs search <term> --json
112
134
  itpay docs show <topic> --json
113
- itpay skill show itpay-buyer --json
135
+ itpay skill show itpay --json
114
136
  ```
115
137
 
116
138
  Normative command contracts are packaged under `docs/cli-reference`.