@itpay/cli 0.2.16 → 2.0.0-rc.1

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 (69) hide show
  1. package/README.md +148 -447
  2. package/bin/itp +1 -150
  3. package/dist/src/client/backend.js +154 -0
  4. package/dist/src/client/http.js +76 -0
  5. package/dist/src/client/types.js +4 -0
  6. package/dist/src/commands/buy.js +351 -0
  7. package/dist/src/commands/cart.js +264 -0
  8. package/dist/src/commands/catalog.js +26 -0
  9. package/dist/src/commands/checkout.js +106 -0
  10. package/dist/src/commands/docs.js +61 -0
  11. package/dist/src/commands/guidance.js +422 -0
  12. package/dist/src/commands/install.js +95 -0
  13. package/dist/src/commands/order.js +78 -0
  14. package/dist/src/commands/orders.js +22 -0
  15. package/dist/src/commands/pay.js +26 -0
  16. package/dist/src/commands/readyz.js +8 -0
  17. package/dist/src/commands/refund.js +20 -0
  18. package/dist/src/commands/services.js +317 -0
  19. package/dist/src/main.js +606 -0
  20. package/dist/src/render/feishu.js +201 -0
  21. package/dist/src/render/ide.js +321 -0
  22. package/dist/src/render/index.js +57 -0
  23. package/dist/src/render/interaction.js +49 -0
  24. package/dist/src/render/markdown.js +83 -0
  25. package/dist/src/render/output.js +42 -0
  26. package/dist/src/render/plain_chat.js +60 -0
  27. package/dist/src/render/plan.js +31 -0
  28. package/dist/src/render/qr.js +32 -0
  29. package/dist/src/render/sink.js +6 -0
  30. package/dist/src/render/status.js +37 -0
  31. package/dist/src/render/telegram.js +172 -0
  32. package/dist/src/render/terminal.js +148 -0
  33. package/dist/src/render/terminal_image.js +19 -0
  34. package/dist/src/state/cart_session.js +151 -0
  35. package/dist/src/state/client_context.js +73 -0
  36. package/dist/src/state/config.js +82 -0
  37. package/dist/src/state/device_authority.js +217 -0
  38. package/dist/src/state/operation_journal.js +80 -0
  39. package/docs/agent/buyer/cart-checkout.json +56 -94
  40. package/docs/agent/buyer/catalog-list.json +47 -0
  41. package/docs/agent/buyer/install-and-setup.json +82 -0
  42. package/docs/agent/buyer/orders-refunds.json +76 -0
  43. package/docs/agent/buyer/payment-flow.json +77 -0
  44. package/docs/agent/buyer/quickstart.json +143 -75
  45. package/docs/agent/buyer/render-hosts.json +79 -0
  46. package/package.json +32 -13
  47. package/skills/itpay-buyer/SKILL.md +107 -238
  48. package/docs/agent/buyer/account-portal.json +0 -81
  49. package/docs/agent/buyer/catalog-search.json +0 -106
  50. package/docs/agent/buyer/human-claim-ui.json +0 -77
  51. package/docs/agent/buyer/payment-qr.json +0 -97
  52. package/docs/agent/buyer/payment-wait.json +0 -84
  53. package/docs/agent/buyer/product-recommendation.json +0 -80
  54. package/docs/agent/buyer/qr-refresh.json +0 -67
  55. package/docs/agent/buyer/recovery.json +0 -85
  56. package/docs/agent/buyer/safety-policy.json +0 -70
  57. package/docs/agent/buyer/secure-delivery.json +0 -90
  58. package/docs/agent/buyer/vault-agent-read.json +0 -95
  59. package/install.ps1 +0 -65
  60. package/install.sh +0 -66
  61. package/lib/account-status.js +0 -157
  62. package/lib/buyer.js +0 -2332
  63. package/lib/client-context.js +0 -126
  64. package/lib/docs.js +0 -200
  65. package/lib/env.js +0 -723
  66. package/lib/http.js +0 -151
  67. package/lib/ops.js +0 -135
  68. package/lib/render-human.js +0 -718
  69. package/lib/runtime.js +0 -1456
@@ -2,122 +2,190 @@
2
2
  "schema_version": "itp.agent_doc.v1",
3
3
  "role": "buyer",
4
4
  "topic": "quickstart",
5
- "title": "ItPay Buyer Agent Quickstart",
6
- "purpose": "Teach a new external agent the minimal safe flow for buying through ItPay.",
5
+ "title": "ItPay V3 CLI Buyer Quickstart",
6
+ "purpose": "Teach an external agent the minimal safe path for using the current V3 itpay CLI package.",
7
7
  "when_to_use": [
8
- "The agent has just installed the ItPay CLI or loaded the buyer skill.",
9
- "The user wants the agent to search for a service, recommend an option, or buy through ItPay.",
10
- "The agent is unsure which ItPay buyer command should come first."
8
+ "The agent has just loaded the V3 npm package.",
9
+ "The user wants the agent to add a catalog item to the canonical server cart or create a checkout through the current V3 CLI.",
10
+ "The agent needs to know which commands exist right now."
11
11
  ],
12
12
  "required_state": {
13
13
  "needs": [
14
- "itp CLI available",
15
- "buyer delivery email before checkout"
14
+ "itpay CLI installed",
15
+ "prerelease API at https://test.itpay.ai, or an intentional ITPAY_BACKEND_URL override",
16
+ "catalog item id, variant id, and offer id from `itpay catalog list`",
17
+ "real agent runtime type supplied through --agent-type or ITPAY_AGENT_TYPE"
16
18
  ],
17
19
  "must_not_need": [
18
- "ops token",
20
+ "admin token",
19
21
  "claim token",
20
- "raw key",
21
22
  "provider raw payload"
22
23
  ]
23
24
  },
24
25
  "commands": [
25
26
  {
26
- "intent": "verify whether this agent/device already has a server-valid buyer session",
27
- "command": "itp status --refresh --host <client> --json",
28
- "success_signal": "response.status is idle when authenticated, or response.next.command tells the agent how to start human auth; if response.recoverable_context.found is true, compare it with the current user intent before continuing or ignoring it"
27
+ "intent": "check backend readiness",
28
+ "command": "itpay readyz",
29
+ "success_signal": "the production backend reports ready and accepts this CLI contract"
29
30
  },
30
31
  {
31
- "intent": "list the available agent docs topics",
32
- "command": "itp docs list --role buyer --json",
33
- "success_signal": "response.topics contains catalog-search, cart-checkout, payment-wait, secure-delivery"
32
+ "intent": "browse available services",
33
+ "command": "itpay --agent-type <agent_type> catalog list --json",
34
+ "success_signal": "catalog items with variants and prices are displayed"
34
35
  },
35
36
  {
36
- "intent": "search the public catalog for the current user request",
37
- "command": "itp buyer catalog search --query \"<user request>\" --host <client> --json",
38
- "success_signal": "response.products contains public services and purchase options; response.catalog_guidance tells the agent how to compare and when to ask the human"
37
+ "intent": "start a catalog service without hardcoding its workflow",
38
+ "command": "itpay --agent-type <agent_type> services start <service_id>",
39
+ "success_signal": "a service_execution_id and server-derived next actions are displayed"
39
40
  },
40
41
  {
41
- "intent": "search standardized API services with category/facet filters when intent is clear",
42
- "command": "itp buyer catalog search --query \"企业工商信息 查询\" --category business_data_api --provider itpay_enterprise_data --service-type ai_api --host <client> --json",
43
- "success_signal": "response.products are narrowed by category/facet before recommendation"
42
+ "intent": "recover the next step from remembered server handles",
43
+ "command": "itpay next --json",
44
+ "success_signal": "JSON includes next_actions derived from server cart, service execution, or checkout handles"
44
45
  },
45
46
  {
46
- "intent": "buy a selected variant with the high-level cart-first flow",
47
- "command": "itp buy <variant_id> --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --host <client> --json",
48
- "success_signal": "response.status becomes waiting_human_auth or payment_handoff_required; if agent_action is present, execute it before any normal reply or payment status check"
47
+ "intent": "add one line to the canonical server cart",
48
+ "command": "itpay cart add --item <catalog_item_id> --variant <catalog_variant_id> --offer <offer_id> --quantity 1 --host <client> --json",
49
+ "success_signal": "JSON includes cart_id, cart_item_id, service_execution_id when the line is service-backed, and top-level next_actions"
50
+ },
51
+ {
52
+ "intent": "read the next cart or service-backed action",
53
+ "command": "itpay cart next --json",
54
+ "success_signal": "JSON includes next_actions such as services invoke, services action, services checkout, or buy"
55
+ },
56
+ {
57
+ "intent": "show the current canonical server cart",
58
+ "command": "itpay cart show",
59
+ "success_signal": "the CLI prints persisted server cart items and service refs when present"
60
+ },
61
+ {
62
+ "intent": "remove a pre-checkout line if the human changes their mind",
63
+ "command": "itpay cart remove --line <cart_item_id>",
64
+ "success_signal": "the server cart is updated; quote-locked or checkout-bound lines return a conflict"
65
+ },
66
+ {
67
+ "intent": "invoke an agent-visible service capability after a service-backed cart or service start",
68
+ "command": "itpay services invoke <service_execution_id> --capability <capability_id> --input key=value",
69
+ "success_signal": "JSON with redacted execution status, safe result items, and next_actions"
70
+ },
71
+ {
72
+ "intent": "submit a human/agent service action when required by the service contract",
73
+ "command": "itpay services action <service_execution_id> --action <action_type> --result-item <result_item_id>",
74
+ "success_signal": "JSON with redacted execution status, accepted action, and next_actions"
75
+ },
76
+ {
77
+ "intent": "read the next Service Execution action",
78
+ "command": "itpay services next <service_execution_id> --json",
79
+ "success_signal": "JSON includes next_actions derived from the Service Execution read model and capabilities"
80
+ },
81
+ {
82
+ "intent": "create checkout from a confirmed service execution and render human handoff",
83
+ "command": "itpay services checkout <service_execution_id> --capability <paid_capability_id> --email <email> --json",
84
+ "success_signal": "quote lock is bound to the server cart item when present; JSON includes checkout_id, display_token, checkout_url, qr_png_url, and brand_qr_local_path"
85
+ },
86
+ {
87
+ "intent": "recover a lost or expired service checkout handoff",
88
+ "command": "itpay services checkout <service_execution_id> --resume --json",
89
+ "success_signal": "the same checkout_id is returned with a fresh short-lived display token and QR path"
90
+ },
91
+ {
92
+ "intent": "create checkout from a server cart that is ready for checkout",
93
+ "command": "itpay buy --cart <cart_id> --host terminal --contact-email <email>",
94
+ "success_signal": "checkout QR/URL rendered for the host"
95
+ },
96
+ {
97
+ "intent": "inspect checkout state",
98
+ "command": "itpay checkout --id <checkout_id> --token <display_token>",
99
+ "success_signal": "checkout presentation with status, items, payment intents"
100
+ },
101
+ {
102
+ "intent": "read an order",
103
+ "command": "itpay order <order_id>",
104
+ "success_signal": "order details with items and delivery artifacts"
105
+ },
106
+ {
107
+ "intent": "read a protected result after the human grants temporary access",
108
+ "command": "itpay --agent-type <agent_type> services read-result <service_execution_id>",
109
+ "success_signal": "the payload for this service execution is returned while its human grant is active"
110
+ },
111
+ {
112
+ "intent": "list account orders (needs ITPAY_BEARER_TOKEN)",
113
+ "command": "itpay orders --limit 20",
114
+ "success_signal": "list of orders"
115
+ },
116
+ {
117
+ "intent": "show install instructions",
118
+ "command": "itpay install [claude-code|codex|terminal|telegram|feishu]",
119
+ "success_signal": "step-by-step instructions for the target host"
120
+ },
121
+ {
122
+ "intent": "browse agent documentation",
123
+ "command": "itpay docs list",
124
+ "success_signal": "list of available doc topics"
49
125
  }
50
126
  ],
51
127
  "agent_rules": [
52
- "Use --json for every ItPay command.",
53
- "Every non-doc ItPay command must include the current client context: --host codex, --host claude-code, --host terminal, --host plain-chat, or for OpenClaw/Telegram use --host telegram --target <inbound_meta.chat_id>. --host is the human-visible client/surface, not where the shell command runs; in Codex desktop chat use --host codex even when calling itp through shell.",
54
- "Do not rely on the CLI to guess Telegram, Discord, WhatsApp, Codex, or Claude Code. If ItPay returns client_context_required or client_target_required, rerun the same command with the required --host/--target fields before continuing.",
55
- "For Telegram group chat or @mention flows, pass the group/private chat target from OpenClaw inbound metadata, for example --target telegram:-1001234567890. ItPay only echoes the target into agent_action; OpenClaw owns group allowlist/mention policy.",
56
- "Use `itp status --refresh --host <client> --json` before account, order, refund, or repeat-purchase decisions. Plain local memory is not identity.",
57
- "If `status --refresh` returns `recoverable_context.found=true`, do not blindly resume or blindly ignore it. Decide whether the old task is related to the current user intent; continue related tasks, ignore clearly unrelated tasks, and ask the human when unsure.",
58
- "If the catalog is unclear, read catalog-search docs and use buyer shelf manifest/snapshot as the shopping-list view before guessing keywords.",
59
- "Search and explain purchase options before buying unless the user already named a purchase option ID.",
60
- "Add the selected UCP Variant.id to cart; do not bypass cart for CORE-028 flows.",
61
- "When explaining prices, remember ItPay JSON money fields use minor units. For CNY, amount=10 means CNY 0.10. Prefer display_amount when present.",
62
- "Before checkout, make sure a buyer delivery email is available. If no email is known from the current buyer context, ask the human for it before creating checkout.",
63
- "Do not invent, guess, or use a placeholder email. Secure delivery and account/order access depend on the buyer email.",
64
- "For first purchase, show auth_qr as the ItPay first-purchase entry: the human first approves provider login/registration/profile sharing, then ItPay should continue the same checkout to payment.",
65
- "After showing auth_qr, keep running/resuming the same checkout unless the human explicitly asks you to pause. Do not stop merely because a QR was displayed.",
66
- "When a buyer command returns buyer_session.status=buyer_session_saved, the CLI has stored the buyer account session for this agent device. You may continue with checkout/payment or `buyer vault` commands without asking the human for a token.",
67
- "Vault grants are only for reading approved delivered artifacts. They are not buyer session credentials and do not authorize refunds or account/order management.",
68
- "Use high-level itp buy when possible. In Codex/Claude Code app clients, the default payment flow is one round: send response.agent_action.markdown to the current chat, then immediately run response.after_visible_action.command once if the QR/link is visible.",
69
- "If response.agent_action is present, it is the mandatory execution path for the current client. Execute it before any normal prose reply: command/argv for Telegram or terminal, markdown for Codex/Claude Code app clients.",
70
- "In OpenClaw Telegram, response.agent_action is already the exact openclaw message send command. It includes target, QR media, exact message, and native button presentation.",
71
- "If response.agent_action cannot be executed or made visible to the human, stop and tell the human what capability is missing. Do not fall back to handwritten prose.",
72
- "response.agent_instruction is natural-language reinforcement for the agent; it does not replace response.agent_action.",
73
- "If response.status is payment_handoff_required, do not run payment wait before the QR/link is visible. If response.next.type is send_to_human_then_wait_once_if_visible, send agent_action first, then run after_visible_action.command once. Stop only when visibility is uncertain.",
74
- "Show the returned payment QR exactly as provided before starting payment wait.",
75
- "Payment truth comes only from payment_intent.verified.",
76
- "Secure delivery goes to the human first; report redacted delivery status only.",
77
- "For OpenClaw Telegram, root agent_action is the execution path. Do not use handwritten prose when agent_action is present."
128
+ "Every human-facing command should include the correct --host value.",
129
+ "For Telegram, Feishu, and Lark, provide --target or the CLI will reject.",
130
+ "Use --json for machine-readable output in agent flows.",
131
+ "Supply the real agent runtime type on commerce commands; the CLI persists one signed device identity and registered agent instances under ~/.itpay-v3/device.",
132
+ "Prefer top-level next_actions over hardcoded service-specific command sequences.",
133
+ "Use itpay next or itpay cart next to recover after interruption; these commands read server handles and do not treat local cart files as business truth.",
134
+ "For service-backed catalog items, read service_execution_id from `itpay cart add --json` before invoking service capabilities.",
135
+ "Do not use --pay or itpay pay for the normal buyer flow; first show the ItPay checkout QR/URL so the human enters the checkout page.",
136
+ "If buy emits an interaction request for missing contact fields, collect values and rerun with --contact-email/--contact-phone.",
137
+ "Do not assume checkout implies payment succeeded; it only creates a handoff.",
138
+ "Payment success is confirmed by backend checkout/order state, not by QR display or buyer claim.",
139
+ "A human grant applies only to its service execution and expires after 15 minutes; do not claim access to other orders or executions.",
140
+ "Use `itpay catalog list` to browse available services before buying.",
141
+ "Use `itpay docs show <topic>` to get detailed instructions on a specific topic.",
142
+ "Server cart, quota, execution, quote, checkout, and delivery facts persist in backend Postgres. ~/.itpay-v3/cart.json only caches last ids and explicit local drafts."
78
143
  ],
79
144
  "forbidden": [
80
- "Do not call ops commands from the buyer path.",
81
- "Do not call worker run-once, provider query recovery, or fixture evidence routes.",
82
- "Do not ask the user to paste raw keys, claim links, claim tokens, provider payloads, or secrets.",
83
- "Do not rewrite, shorten, re-encode, or invent QR URLs.",
84
- "Do not treat user text like 'I paid' as payment proof."
145
+ "Do not invent variant ids, offer ids, or catalog ids.",
146
+ "Do not invent admin, account-management, or grant-creation commands; the human grants access in the web UI and the CLI only reads an active grant.",
147
+ "Do not ask users to paste secrets into chat."
85
148
  ],
86
149
  "next_docs": [
87
150
  {
88
- "condition": "Need to discover or compare services",
89
- "topic": "catalog-search",
90
- "command": "itp docs show catalog-search --role buyer --json"
151
+ "condition": "Need to understand cart-first checkout in detail",
152
+ "topic": "cart-checkout",
153
+ "file": "docs/agent/buyer/cart-checkout.json"
91
154
  },
92
155
  {
93
- "condition": "User asks which option to choose",
94
- "topic": "product-recommendation",
95
- "command": "itp docs show product-recommendation --role buyer --json"
156
+ "condition": "Need to browse available services",
157
+ "topic": "catalog-list",
158
+ "file": "docs/agent/buyer/catalog-list.json"
96
159
  },
97
160
  {
98
- "condition": "A variant is selected and the agent needs to create cart/checkout",
99
- "topic": "cart-checkout",
100
- "command": "itp docs show cart-checkout --role buyer --json"
161
+ "condition": "Need the checkout-to-payment handoff and verification rules",
162
+ "topic": "payment-flow",
163
+ "file": "docs/agent/buyer/payment-flow.json"
101
164
  },
102
165
  {
103
- "condition": "The agent is unsure what is forbidden",
104
- "topic": "safety-policy",
105
- "command": "itp docs show safety-policy --role buyer --json"
166
+ "condition": "Need to understand host rendering and interaction",
167
+ "topic": "render-hosts",
168
+ "file": "docs/agent/buyer/render-hosts.json"
106
169
  },
107
170
  {
108
- "condition": "The user asks to view their ItPay account or previous orders",
109
- "topic": "account-portal",
110
- "command": "itp docs show account-portal --role buyer --json"
171
+ "condition": "Need to inspect orders or create refunds",
172
+ "topic": "orders-refunds",
173
+ "file": "docs/agent/buyer/orders-refunds.json"
174
+ },
175
+ {
176
+ "condition": "Need to install or configure for a specific host",
177
+ "topic": "install-and-setup",
178
+ "file": "docs/agent/buyer/install-and-setup.json"
111
179
  }
112
180
  ],
113
181
  "search_terms": [
114
- "start",
115
182
  "quickstart",
116
- "first time",
183
+ "start",
117
184
  "buyer flow",
118
- "how to use itpay",
185
+ "v3 cli",
186
+ "how to use",
187
+ "怎么用",
119
188
  "开始",
120
- "第一次",
121
- "怎么用"
189
+ "快速开始"
122
190
  ]
123
191
  }
@@ -0,0 +1,79 @@
1
+ {
2
+ "schema_version": "itp.agent_doc.v1",
3
+ "role": "buyer",
4
+ "topic": "render-hosts",
5
+ "title": "Host Rendering And Interaction Requests",
6
+ "purpose": "Teach the agent how the current V3 CLI renders checkout handoff and missing-data interaction prompts for each host.",
7
+ "when_to_use": [
8
+ "The agent needs to choose the right --host value.",
9
+ "The agent needs to explain what the user will see in terminal, Trae/Codex, Telegram, or Feishu/Lark.",
10
+ "The flow emits an interaction request instead of immediate checkout."
11
+ ],
12
+ "required_state": {
13
+ "needs": [
14
+ "correct host selection"
15
+ ],
16
+ "optional": [
17
+ "target for Telegram / Feishu / Lark"
18
+ ]
19
+ },
20
+ "commands": [
21
+ {
22
+ "intent": "render checkout for terminal",
23
+ "command": "itpay buy --host terminal --item <catalog_item_id> --variant <catalog_variant_id> --offer <offer_id>",
24
+ "success_signal": "terminal summary, links, Branded QR local path + mirrors, and an ATTACH block with status=downloaded are printed"
25
+ },
26
+ {
27
+ "intent": "render checkout or interaction request for Trae / Codex style chat",
28
+ "command": "itpay buy --host trae --item <catalog_item_id> --variant <catalog_variant_id> --offer <offer_id> --require-contact email,phone",
29
+ "success_signal": "markdown with one inline data: image, an [ATTACH] IDE image reference block, and a structured itpay_input_request block is printed"
30
+ },
31
+ {
32
+ "intent": "render chat-native buttons for Telegram",
33
+ "command": "itpay buy --host telegram --target <chat_id> --item <catalog_item_id> --variant <catalog_variant_id> --offer <offer_id>",
34
+ "success_signal": "openclaw_message and presentation payload plus presentation.ide_image_attach (status, local_path, mirrors, must_render_reason) are printed"
35
+ },
36
+ {
37
+ "intent": "render interactive card output for Feishu or Lark",
38
+ "command": "itpay buy --host feishu --target <open_id_or_chat_id> --item <catalog_item_id> --variant <catalog_variant_id> --offer <offer_id>",
39
+ "success_signal": "interactive card JSON plus message.ide_image_attach (status, local_path, mirrors, must_render_reason) is printed"
40
+ }
41
+ ],
42
+ "agent_rules": [
43
+ "Use --host terminal only when the human is directly watching a terminal.",
44
+ "Use --host trae in Trae chat; it normalizes to the codex-style markdown renderer.",
45
+ "Telegram, Feishu, and Lark require --target.",
46
+ "Current V3 CLI can emit structured interaction requests, but Trae itself does not show a native popup unless a host adapter consumes that block.",
47
+ "Terminal can render images as ASCII when an image URL is available.",
48
+ "Telegram and Feishu/Lark can emit selector or input metadata for host-native adapters.",
49
+ "If an interaction request is emitted, collect the requested values and rerun the relevant command with those values rather than inventing them.",
50
+ "After buy/checkout/order output, the IDE image attach contract must be honoured: read the file at brand_qr_local_path (or any of brand_qr_mirrors) with the IDE's Read tool so the human sees the QR in the chat window. Do not declare success unless brand_qr_status is \"downloaded\" and the image is visible."
51
+ ],
52
+ "forbidden": [
53
+ "Do not claim Trae currently has a built-in native popup if only markdown is printed.",
54
+ "Do not handwrite Telegram buttons when the CLI already returns a native presentation payload.",
55
+ "Do not drop required --target fields for IM hosts."
56
+ ],
57
+ "next_docs": [
58
+ {
59
+ "condition": "Need the overall start sequence",
60
+ "topic": "quickstart",
61
+ "file": "docs/agent/buyer/quickstart.json"
62
+ },
63
+ {
64
+ "condition": "Need cart-first handoff details",
65
+ "topic": "cart-checkout",
66
+ "file": "docs/agent/buyer/cart-checkout.json"
67
+ }
68
+ ],
69
+ "search_terms": [
70
+ "render",
71
+ "host",
72
+ "telegram",
73
+ "trae",
74
+ "codex",
75
+ "interaction request",
76
+ "selector",
77
+ "输入框"
78
+ ]
79
+ }
package/package.json CHANGED
@@ -1,44 +1,63 @@
1
1
  {
2
2
  "name": "@itpay/cli",
3
- "version": "0.2.16",
4
- "description": "ItPay CLI, buyer skill, and agent-readable docs for agent-native commerce.",
3
+ "version": "2.0.0-rc.1",
4
+ "description": "ItPay CLI for V3 checkout, payment, order, refund, and agent-facing render flows.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "itp": "bin/itp",
8
8
  "itpay": "bin/itp",
9
9
  "itpay_cli": "bin/itp"
10
10
  },
11
+ "main": "./dist/src/main.js",
12
+ "exports": {
13
+ ".": "./dist/src/main.js"
14
+ },
11
15
  "files": [
12
16
  "bin/",
13
- "lib/",
14
- "skills/",
17
+ "dist/src/",
15
18
  "docs/",
16
- "install.sh",
17
- "install.ps1",
19
+ "skills/",
18
20
  "README.md",
19
21
  "LICENSE"
20
22
  ],
21
23
  "publishConfig": {
22
24
  "access": "public"
23
25
  },
24
- "scripts": {
25
- "smoke": "sh ./smoke.sh",
26
- "check": "node --check ./bin/itp && sh ./smoke.sh"
27
- },
28
26
  "keywords": [
29
27
  "itpay",
30
28
  "agent",
31
29
  "cli",
32
30
  "claude-code",
33
31
  "codex",
34
- "openclaw"
32
+ "openclaw",
33
+ "trae"
35
34
  ],
36
35
  "license": "MIT",
37
36
  "engines": {
38
37
  "node": ">=18"
39
38
  },
40
39
  "dependencies": {
41
- "qrcode": "^1.5.4",
42
- "json5": "^2.2.3"
40
+ "commander": "^12.1.0",
41
+ "qrcode": "^1.5.4"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^22.7.5",
45
+ "@types/qrcode": "^1.5.5",
46
+ "tsx": "^4.19.2",
47
+ "typescript": "^5.6.3"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.json",
51
+ "dev": "tsx src/main.ts",
52
+ "start": "node dist/src/main.js",
53
+ "lint": "tsc -p tsconfig.json --noEmit",
54
+ "clean": "rm -rf dist",
55
+ "check": "npm run lint && npm test && npm run test:package",
56
+ "pack:dry-run": "npm run clean && npm run build && npm pack --dry-run --ignore-scripts",
57
+ "test:package": "npm run clean && npm run build && node scripts/package-smoke.mjs",
58
+ "prepack": "npm run clean && npm run build",
59
+ "prepublishOnly": "npm run check",
60
+ "test": "tsx --test tests/*.test.ts",
61
+ "typecheck": "tsc -p tsconfig.json --noEmit"
43
62
  }
44
63
  }