@itpay/cli 2.1.47 → 2.1.48
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.
- package/dist/src/main.js +8920 -8808
- package/dist/src/state/config.js +2 -2
- package/docs/agent/buyer/cart-checkout.json +8 -8
- package/docs/agent/buyer/catalog-list.json +2 -4
- package/docs/agent/buyer/payment-flow.json +5 -6
- package/docs/agent/buyer/quickstart.json +3 -3
- package/docs/agent/buyer/rail-booking.json +8 -8
- package/docs/agent/buyer/rail-fast-checkout.json +1 -1
- package/docs/agent/buyer/render-hosts.json +6 -5
- package/docs/cli-reference/commands/services/checkout.md +2 -2
- package/docs/cli-reference/commands/services/index.md +4 -3
- package/docs/cli-reference/commands/services/invoke.md +1 -1
- package/docs/cli-reference/commands/services/next.md +1 -1
- package/docs/cli-reference/commands/services/purchase.md +21 -0
- package/docs/cli-reference/commands/services/run.md +1 -1
- package/docs/cli-reference/index.md +1 -0
- package/package.json +3 -2
- package/skills/itpay/SKILL.md +21 -4
package/dist/src/state/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const CLI_VERSION = "2.1.
|
|
2
|
-
const API_CONTRACT_REVISION = "sha256:
|
|
1
|
+
const CLI_VERSION = "2.1.48";
|
|
2
|
+
const API_CONTRACT_REVISION = "sha256:e61bd9998bddfaeee498d2306854f29a4e50c50a372acc26746b6c251c1b70f6";
|
|
3
3
|
export {
|
|
4
4
|
API_CONTRACT_REVISION,
|
|
5
5
|
CLI_VERSION
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
"role": "buyer",
|
|
4
4
|
"product_scope": "itpay is the single public Buyer CLI entry point, and $itpay is its user-facing Skill invocation. It covers services, railway planning and booking, orders, authorized purchased content and refunds.",
|
|
5
5
|
"topic": "cart-checkout",
|
|
6
|
-
"title": "
|
|
7
|
-
"purpose": "Use
|
|
6
|
+
"title": "Advanced Multi-Service Cart And Historical Checkout Recovery",
|
|
7
|
+
"purpose": "Use only for an explicitly requested multi-service cart or a historical pinned flow. Normal selected services use the Skill purchase route.",
|
|
8
8
|
"when_to_use": [
|
|
9
|
-
"
|
|
10
|
-
"An
|
|
9
|
+
"The human explicitly requests combining several services in one Cart.",
|
|
10
|
+
"An existing Cart or historical Checkout needs recovery."
|
|
11
11
|
],
|
|
12
12
|
"commands": [
|
|
13
13
|
{
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"success_signal": "service-backed lines route to services next; ordinary lines route to buy"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"intent": "
|
|
24
|
+
"intent": "prepare an ordinary official Checkout; no payment request",
|
|
25
25
|
"command": "itpay --agent-type <agent_type> buy --cart <cart_id> --json",
|
|
26
26
|
"success_signal": "status is human_checkout_required and handoff contains only fields usable by the current Host"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"intent": "
|
|
29
|
+
"intent": "historical pinned service Checkout compatibility",
|
|
30
30
|
"command": "itpay --agent-type <agent_type> services checkout <service_execution_id> --capability <capability_id> [--input key=value] [--email <email>] --json",
|
|
31
31
|
"success_signal": "one Checkout handoff is returned; rerun with --resume after output or token loss"
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"Railway query and booking use distinct Service Executions for one purchase journey. Start another execution for an independent intent.",
|
|
38
38
|
"Only non-rail capabilities explicitly requiring delivery email may ask its purpose and value. Railway notification contact belongs to the protected checkout page with verified account email reuse; the Agent must not guess or collect it in chat.",
|
|
39
39
|
"A lost Checkout response is retried with the same Cart and persisted idempotency operation.",
|
|
40
|
-
"A
|
|
40
|
+
"A normal selected service follows services purchase on its original execution. Do not introduce Cart as an extra tutorial or recovery fallback."
|
|
41
41
|
],
|
|
42
42
|
"forbidden": [
|
|
43
43
|
"Do not call ordinary buy for a service-backed Cart line.",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"resume",
|
|
62
62
|
"contact"
|
|
63
63
|
],
|
|
64
|
-
"purchase_consent": "
|
|
64
|
+
"purchase_consent": "Advanced and historical quote/cart flows retain the current quote-bound approve_purchase template and genuine matching consent. Do not bypass its exact quote or expiry. Normal new services use the Skill purchase preparation rule instead."
|
|
65
65
|
}
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"condition": "Non-rail Buyer selected a service and wants to purchase",
|
|
59
|
-
"topic": "
|
|
60
|
-
"file": "docs/agent/buyer/cart-checkout.json"
|
|
59
|
+
"topic": "quickstart"
|
|
61
60
|
}
|
|
62
61
|
],
|
|
63
62
|
"search_terms": [
|
|
@@ -69,6 +68,5 @@
|
|
|
69
68
|
"what to buy",
|
|
70
69
|
"有哪些",
|
|
71
70
|
"服务列表"
|
|
72
|
-
]
|
|
73
|
-
"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."
|
|
71
|
+
]
|
|
74
72
|
}
|
|
@@ -6,13 +6,13 @@
|
|
|
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.",
|
|
8
8
|
"when_to_use": [
|
|
9
|
-
"buy or services checkout returned
|
|
9
|
+
"services purchase, buy or historical services checkout returned an official human handoff.",
|
|
10
10
|
"The agent restarted or lost the Checkout output before payment was confirmed."
|
|
11
11
|
],
|
|
12
12
|
"commands": [
|
|
13
13
|
{
|
|
14
14
|
"intent": "present the Checkout handoff",
|
|
15
|
-
"command": "<
|
|
15
|
+
"command": "<show the already-returned official handoff on the current Host>",
|
|
16
16
|
"success_signal": "the returned official URL and/or QR supported by the actual Host is visible to the human"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"intent": "recover a service Checkout handoff",
|
|
25
|
-
"command": "itpay services
|
|
25
|
+
"command": "itpay services purchase <service_execution_id> --resume --json",
|
|
26
26
|
"success_signal": "the same unpaid Checkout is reused with a fresh short-lived handoff"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"agent_rules": [
|
|
30
|
-
"Normal
|
|
30
|
+
"Normal preparation generates an official filling/payment page; it does not call payment or charge. The human completes actual payment on that page.",
|
|
31
31
|
"Use only handoff fields returned for the current Host and make them actually visible to the human.",
|
|
32
32
|
"Obtain only missing required agreement or material price/term changes. Reuse a valid explicit confirmation for unchanged terms; never invent it.",
|
|
33
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.",
|
|
@@ -66,6 +66,5 @@
|
|
|
66
66
|
"付款后",
|
|
67
67
|
"不要重复付款",
|
|
68
68
|
"支付确认"
|
|
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."
|
|
69
|
+
]
|
|
71
70
|
}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
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
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.",
|
|
47
47
|
"Explain useful service facts in ordinary language; never ask the human to run commands or learn internal IDs.",
|
|
48
|
-
"Normal
|
|
48
|
+
"Normal selected service purchase uses its complete services purchase confirmation template, then the returned official handoff; no manual quote/cart/buy chain.",
|
|
49
49
|
"A railway query execution and its separate booking execution may serve one purchase intent; keep both references."
|
|
50
50
|
],
|
|
51
51
|
"forbidden": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"topic": "purchased-content"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
"condition": "
|
|
70
|
+
"condition": "Explicit multi-service Cart or historical Cart recovery",
|
|
71
71
|
"topic": "cart-checkout"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"input"
|
|
109
109
|
],
|
|
110
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": "
|
|
111
|
+
"purchase_consent": "Follow the same-package Skill purchase preparation rule: current complete review → reuse matching real consent or ask only what is missing → write flat file_content → services purchase → show the official entry. This step does not request payment."
|
|
112
112
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"query_vs_booking": "Exact/Smart returns a query execution and saved evidence. Booking creates a separate execution from a server-issued selection; it is not a repeated search.",
|
|
14
14
|
"comparison": "If the human only asked to compare, answer within the searched scope and stop without a buy-or-not question. Reuse already-read unchanged Skill/docs in this context; do not repeat install/readyz/docs at each step. A clear purchase delegation permits selection under their rules, subject to required human terms.",
|
|
15
15
|
"public_entry": "One public service itpay-rail declares query_exact, query_smart and prepare_purchase. Query, booking, Checkout and order remain separate identities. Legacy IDs are only for recovering their pinned historical executions.",
|
|
16
|
-
"price_approval": "
|
|
16
|
+
"price_approval": "Use the complete purchase review and price policy under the formal Skill consent rule; one confirmation covers the actual itinerary, party, price policy and terms. Selection alone is not consent. The coordinator compares the real supplier quote; changed material conditions cannot reuse narrower approval."
|
|
17
17
|
},
|
|
18
18
|
"flow_at_a_glance": [
|
|
19
19
|
{
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
{
|
|
50
50
|
"step": "review",
|
|
51
51
|
"command": "itpay services next <booking_execution_id> --json",
|
|
52
|
-
"returns": "
|
|
53
|
-
"next": "
|
|
52
|
+
"returns": "complete purchase summary, current server reference and flat purchase confirmation file",
|
|
53
|
+
"next": "reuse genuine matching consent, ask only missing conditions, then execute the returned services purchase input template"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"step": "checkout",
|
|
57
|
-
"command": "
|
|
58
|
-
"returns": "
|
|
57
|
+
"command": "itpay services purchase <booking_execution_id> --input-json <purchase-confirmation.json> --json",
|
|
58
|
+
"returns": "one original official page, or original progress with a bounded purchase --resume action; no payment requested",
|
|
59
59
|
"next": "show the official entry using the current host immediately before optional memory/log writing, then stop; retain necessary safety/permissions, do not infer paid or issued"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"whole_journey": "Use the returned complete ticket plan booking_template: ordered selections (2–3 legs) from one owner/snapshot/revision/plan, or selection for one leg. One booking, one refreshed whole quote, one checkout, one order and one payment; each leg issues separately without connection or joint-seat guarantees. Raw legs are single-leg compatibility only; never hand-compose multi-leg legs when complete selections are missing or expired. Do not combine different plans or choose per-leg payment by default. Historical details without a whole-journey template do not prove whole-journey support."
|
|
126
126
|
},
|
|
127
127
|
"review_and_checkout": {
|
|
128
|
-
"review": "
|
|
128
|
+
"review": "Read every ordered leg, seat class, party size, whole-journey terms and current price policy in the purchase summary. Copy the complete flat file_content, preserving server review_ref/request_key. Use the formal Skill rule to reuse genuine unchanged consent or ask only missing conditions. The coordinator applies the original railway review template and checks the real supplier quote; do not separately assemble confirm_booking, approve_purchase, cart or buy.",
|
|
129
129
|
"equivalent_correction": "If only seat code spelling changes while train, actual seat class, party, price and terms are identical, reuse an existing explicit human approval. Material draft changes or missing approval require human confirmation. Reuse accepted original endpoints, no-seat, overnight and incomplete-coverage facts when unchanged; never silently substitute the destination.",
|
|
130
130
|
"checkout": "Present the complete itinerary, total and single official handoff: one payment, separate issuance. The human enters one passenger set on that page; verified account notification email is reused there and can be changed for this order. Do not ask or guess traveler identity/email in chat. Use the returned checkout payment deadline, not an estimated duration. Handoff is not payment, and payment is not all legs issued."
|
|
131
131
|
},
|
|
@@ -170,9 +170,9 @@
|
|
|
170
170
|
"saved_followup": "Use returned refine_preferences with expected_query_revision for arrival/departure times, passengers, seat preference or priority; rerank uses existing facts. Only endpoints/date/new scope require a new query. Profiles compare within one journey, not the whole catalog. Fares and service fees are whole-journey totals for the stated people; observed available is not proof of ample inventory. Page limit is 1-20; follow next_offset exactly, never infer full-catalog optimality from the visible page. Byte-limited pages may contain fewer rows than limit. Area station candidates are not guaranteed nearest; transfer wait/minimum are facts, not a low-risk guarantee.",
|
|
171
171
|
"actor_conventions": {
|
|
172
172
|
"location_confirmation": "Use the returned human template only for the user's real place choice; no delegated human action.",
|
|
173
|
-
"journey_terms": "workflow:confirm_booking
|
|
173
|
+
"journey_terms": "Normal preparation uses the purchase confirmation file and real user_answer. Historical workflow:confirm_booking recovery retains its original agent-reported genuine consent rule; default false.",
|
|
174
174
|
"ordinary_human_action": "Use its published actor rule; do not generalize railway permission.",
|
|
175
|
-
"price_approval": "approve_purchase
|
|
175
|
+
"price_approval": "Historical approve_purchase keeps its exact server-scoped quote binding and actor-type agent; it is not the new default route."
|
|
176
176
|
},
|
|
177
177
|
"consent_template_semantics": "Template false means approval is not recorded, not that the human must answer again. When user_answer_required is absent, check explicit chat or recorded consent for the current scope, party, price and terms; reuse it unchanged, ask only for missing consent or material differences, and never invent approval."
|
|
178
178
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"command": "Use the current result’s booking_template and returned next action",
|
|
23
23
|
"notes": [
|
|
24
24
|
"Select under the buyer’s unchanged rules. Required human terms still require real consent. Continue the same booking execution.",
|
|
25
|
-
"Copy the complete plan template into one booking
|
|
25
|
+
"Copy the complete ordered plan template into one booking. Its complete purchase review leads to one services purchase confirmation and official entry; reuse genuine unchanged consent. Separate leg issuance remains, not separate payments."
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
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.",
|
|
8
8
|
"when_to_use": [
|
|
9
|
-
"
|
|
9
|
+
"services purchase or an existing Checkout/authorization reader returned a human handoff.",
|
|
10
10
|
"The human cannot see a Checkout or authorization QR image or link."
|
|
11
11
|
],
|
|
12
12
|
"host_contracts": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
{
|
|
34
34
|
"agent_type": "workbuddy",
|
|
35
35
|
"default_host": "plain-chat",
|
|
36
|
-
"responsibility": "
|
|
36
|
+
"responsibility": "If present_files is already available, execute the returned agent_action once; otherwise show the original official URL in this turn. Show mobile_url when present and the amount, then stop."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"agent_type": "zcode",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"native_hosts": [
|
|
58
58
|
"telegram"
|
|
59
59
|
],
|
|
60
|
-
"responsibility": "
|
|
60
|
+
"responsibility": "Preserve the trusted native Host/target. Use the returned message action only if its tool is available now; otherwise show the official URL in this turn. Callbacks only permit reading the same state, never prove payment."
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"commands": [
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"agent_rules": [
|
|
76
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
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
|
|
78
|
+
"For WorkBuddy, use present_files once only if already available; otherwise show the original handoff.url immediately. Send mobile_url when present. Do not research or install a tool before delivering the entry.",
|
|
79
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
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
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.",
|
|
@@ -83,7 +83,8 @@
|
|
|
83
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.",
|
|
84
84
|
"IM Hosts that require a target must receive --target before Checkout creation. OpenClaw has no default Host; Kimi Code uses terminal.",
|
|
85
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."
|
|
86
|
+
"Business flow is the same across hosts. Vault grants apply only to protected purchased-content access, not every railway step.",
|
|
87
|
+
"Image preparation has a short budget. A failed or slow image does not invalidate an already verified, currently payable official URL; show that URL in the same turn, without creating another Checkout."
|
|
87
88
|
],
|
|
88
89
|
"forbidden": [
|
|
89
90
|
"Do not expose display tokens separately from the tokenized Checkout handoff.",
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
服务支持的 Quote/Cart/Checkout 共用服务端范围校验。缺少有效价格批准时返回完整 `approve_purchase` 模板,默认 `user_approved:false`;Agent 只在真实会话已同意当前主体、内容、价格或预算和条款时提交 true。选择候选或完成席别 review 不代替价格批准。同条件有效批准复用,已有 Checkout/未知付款先恢复原单,不补事后批准或创建替代订单。
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 历史合同兼容与高级入口
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
普通新服务使用 `services purchase` 完整确认与官方入口。此命令保留历史合同和高级兼容,为单个 Service Execution 创建或恢复 Checkout,并按 Host 向人交接付款入口。它是 `services quote -> cart add --quote -> buy --cart` 的单项快捷方式,必须复用相同的 Quote、Cart 和 Checkout Use Case。
|
|
12
12
|
|
|
13
13
|
未注册/未登录用户不要求先执行 `itpay auth login`(Path B):官方 checkout 页内完成必要的钱包认证、创建或复用账号并取得页面权限;人在页面上确认旅客、通知联系方式和最终报价后付款。支付确认沿用既有设备绑定机制,不再独立绑定。checkout 内完成账号认证不等于账号已通过手机号验证;钱包显示名、账号手机号与乘车人身份互相独立。
|
|
14
14
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
- 任何 capability 输入都必须在状态写入、锁价、订单创建和 Provider 调用前通过 schema 校验。
|
|
16
16
|
- `invoke` 只运行当前阶段允许且不需付款的 Agent-visible capability。
|
|
17
17
|
- 依赖候选的付费 capability 必须继续来源 Execution;`action --candidate` 不能跨 Execution 搬运候选。
|
|
18
|
-
- `services
|
|
19
|
-
- `services
|
|
18
|
+
- 普通已选服务使用 `services purchase` 读取完整确认、提交真实同意并交付官方页面;此操作不请求支付。
|
|
19
|
+
- `services quote`、`cart add --quote`、`buy --cart` 保留为用户明确要求多服务组合的高级路径;旧 `services checkout` 保留已有执行兼容。
|
|
20
20
|
- `agent_visible_result` 从 `services next` 读取;`vault_artifact` 只有人授权后才能 `read-result`。
|
|
21
21
|
|
|
22
22
|
## 子命令
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- [`invoke`](invoke.md)
|
|
27
27
|
- [`action`](action.md)
|
|
28
28
|
- [`quote`](quote.md)
|
|
29
|
+
- [`purchase`](purchase.md)
|
|
29
30
|
- [`checkout`](checkout.md)
|
|
30
31
|
- [`list`](list.md)
|
|
31
32
|
- [`get`](get.md)
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
itpay services --help
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
输出当前子命令:运行已发布服务使用 `run`,查询推进使用 `next`,选定后的完整购买确认使用 `purchase`,深度诊断才使用 `get/events`。未知子命令返回参数错误和本 help,不创建 Execution。
|
|
45
46
|
|
|
46
47
|
## Agent Type / Host
|
|
47
48
|
|
|
@@ -61,7 +61,7 @@ Provider 已收到请求但没有匹配项时,该 invocation 成功完成、
|
|
|
61
61
|
|
|
62
62
|
## 额度耗尽
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
额度耗尽且需要购买时,支持通用购买的 Execution 返回 `services purchase` 完整确认;未支持的新合同不能猜测授权,已有执行保留原兼容恢复。`services quote -> cart add --quote -> buy --cart` 只用于用户明确要求把多个独立 Execution 合并付款的高级流程。
|
|
65
65
|
|
|
66
66
|
```json
|
|
67
67
|
{
|
|
@@ -250,7 +250,7 @@ itpay services next <service_execution_id> [--timeout <seconds>] [--since-snapsh
|
|
|
250
250
|
|
|
251
251
|
- 每段保留相连行程、对应席别、每位乘客偏好;不要恢复固定单腿 scalar 模板。
|
|
252
252
|
- `booking_review_changed` 重新读取当前服务端 revision,不自行递增、不重放旧 revision。
|
|
253
|
-
-
|
|
253
|
+
- 候选选择不等于真实同意。正常流程使用返回的 `services purchase` 完整模板,服务端核对准备同意与实际 quote 后才生成原有价格批准;旧执行的 approve_purchase 模板仅按原范围兼容恢复。
|
|
254
254
|
- 未付且允许修改时修订同一 booking 重新报价;支付已在途/完成、结果未知或退款锁定时按原单读取,不新建替代购买。
|
|
255
255
|
- 乘客身份、电话、邮箱修改只在保护页完成,不在聊天或 workflow 输入收集。
|
|
256
256
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# `itpay services purchase`
|
|
2
|
+
|
|
3
|
+
## 当前执行的官方页面准备
|
|
4
|
+
|
|
5
|
+
选定服务后读取完整购买摘要;仅补缺失的真实同意。CLI沿原业务确认、供应商报价与服务端范围校验准备一个官方填写与付款页面。本步骤不请求支付、不扣款,不代表出票或交付。
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
itpay services purchase <service_execution_id> --json
|
|
9
|
+
itpay services purchase <service_execution_id> --input-json <purchase-confirmation.json> --json
|
|
10
|
+
itpay services purchase <service_execution_id> --resume --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
输入文件原样使用当前模板的完整 `file_content`,不包外层 `input`。保留 `review_ref`、`request_key`,填写真实 `user_answer`;真实同意覆盖对象、人数、价格策略和条款时才设 `user_approved:true`。已有明确同意未变就复用;未知价格不能默认选择官方页面确认。
|
|
14
|
+
|
|
15
|
+
价格策略为当前服务器模板的 exact(amount_minor)、capped(maximum_minor),或用户明确允许的 confirm_on_official_page;均带 currency。不得添加 quote_id 或自己拼业务字段。本地格式错误返回未发送,不当作未知写入。
|
|
16
|
+
|
|
17
|
+
`--timeout` 默认60秒,范围大于0且不超过120秒;服务器保存原确认的累计120秒自动等待预算,恢复不重置。running交回真实阶段和原执行的恢复动作;不重查、不换单。`--host`、`--target`按实际宿主填写;`--locale`控制展示语言。
|
|
18
|
+
|
|
19
|
+
成功返回已核验官方URL、当前期限和 effects:payment_requested=false、charged=false。图片不可用不阻塞同轮链接交付。人完成官方页面操作后再读取原 Checkout/Order;不能用二维码或人的付款陈述替代后端支付事实。
|
|
20
|
+
|
|
21
|
+
旧合同未声明此能力时保留原执行,使用其公开的历史恢复路径;不能绕过兼容检查、创建替代单或改身份。
|
|
@@ -136,7 +136,7 @@ itpay services run itpay-rail --operation query_exact --input-json query.json --
|
|
|
136
136
|
|
|
137
137
|
旧 `itpay-rail-exact/smart/booking` ID 仅用于已有执行和历史模板的兼容恢复;新公共模板与旧凭据共用原购买去重。存在或未知购买先恢复,过期库存不等于能新建购买。
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
候选选择不等于价格和条款同意。正常流程读取返回的 `services purchase` 完整确认;已有真实、匹配价格/上限/条款/主体的同意可复用,缺失或实质变化才补确认。服务端核对实际报价并衔接原有批准;旧执行的 approve_purchase 模板保留原范围保护。付款与出票事实仍由后端及官方页确认。
|
|
140
140
|
|
|
141
141
|
## 终态和异常
|
|
142
142
|
|
|
@@ -85,6 +85,7 @@ Commander 自动提供的 `itpay help [command]` 与 `itpay <group> help [subcom
|
|
|
85
85
|
- [`itpay services start`](commands/services/start.md)
|
|
86
86
|
- [`itpay services invoke`](commands/services/invoke.md)
|
|
87
87
|
- [`itpay services action`](commands/services/action.md)
|
|
88
|
+
- [`itpay services purchase`](commands/services/purchase.md)
|
|
88
89
|
- [`itpay services quote`](commands/services/quote.md)
|
|
89
90
|
- [`itpay services checkout`](commands/services/checkout.md)
|
|
90
91
|
- [`itpay services list`](commands/services/list.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itpay/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.48",
|
|
4
4
|
"description": "The ItPay CLI for services, orders, and human-authorized purchased content.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"docs/cli-reference/commands/services/list.md",
|
|
73
73
|
"docs/cli-reference/commands/services/next.md",
|
|
74
74
|
"docs/cli-reference/commands/services/page.md",
|
|
75
|
+
"docs/cli-reference/commands/services/purchase.md",
|
|
75
76
|
"docs/cli-reference/commands/services/quote.md",
|
|
76
77
|
"docs/cli-reference/commands/services/read-result.md",
|
|
77
78
|
"docs/cli-reference/commands/services/run.md",
|
|
@@ -141,5 +142,5 @@
|
|
|
141
142
|
"url": "git+https://github.com/itpay-ai/cli.git"
|
|
142
143
|
},
|
|
143
144
|
"itpayBundleFormat": "buyer-esm-v1",
|
|
144
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "5165ffbbcac542b4348996deebcad10280e3e88c"
|
|
145
146
|
}
|
package/skills/itpay/SKILL.md
CHANGED
|
@@ -98,10 +98,27 @@ Apply the human's existing choices and approvals within their scope. Ask only
|
|
|
98
98
|
for missing choices, permissions or materially changed terms. Service-specific
|
|
99
99
|
rules determine when delegated selection is allowed. Never invent human
|
|
100
100
|
consent, identity data, payment, ticket issuance or refund success. An Agent
|
|
101
|
-
may select under the human's delegation, but must not record itself as a human.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
may select under the human's delegation, but must not record itself as a human.
|
|
102
|
+
Candidate selection is not price or material-terms approval.
|
|
103
|
+
|
|
104
|
+
For a normal selected service, read its complete purchase review. Write the
|
|
105
|
+
returned flat confirmation file, preserving its server reference and request key.
|
|
106
|
+
Use existing genuine consent covering the object, quantity, price policy and
|
|
107
|
+
terms; ask once only for missing consent or material changes. Run the returned
|
|
108
|
+
`services purchase --input-json` command to prepare one official page. The CLI
|
|
109
|
+
coordinates the original business confirmation, real quote and Checkout; do not
|
|
110
|
+
manually assemble quote → approve → cart → buy. Unknown price never implies
|
|
111
|
+
permission to confirm later on the official page. Exact price, capped budget or
|
|
112
|
+
that page-confirmation policy must reflect the human's explicit authorization.
|
|
113
|
+
A running response resumes the same purchase with its persisted waiting budget;
|
|
114
|
+
never restart the query or create another purchase. Page preparation does not
|
|
115
|
+
request payment or prove payment, issuance or delivery.
|
|
116
|
+
|
|
117
|
+
Cart/buy remain advanced paths for an explicitly requested multi-service cart or
|
|
118
|
+
an older pinned contract that supplies those actions. Their original quote-bound
|
|
119
|
+
approval protection remains. Ordinary human_action nodes retain their published
|
|
120
|
+
actor rule; purchase preparation does not permit arbitrary Agent signatures.
|
|
121
|
+
Location choice still requires the real choice and its returned actor template.
|
|
105
122
|
|
|
106
123
|
## Show the human
|
|
107
124
|
|