@itpay/cli 2.1.48 → 2.1.49
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/README.md +1 -1
- package/dist/src/main.js +277 -161
- package/dist/src/state/config.js +2 -2
- package/docs/agent/buyer/cart-checkout.json +9 -50
- package/docs/agent/buyer/catalog-list.json +11 -50
- package/docs/agent/buyer/identity-and-sessions.json +9 -81
- package/docs/agent/buyer/install-and-setup.json +7 -47
- package/docs/agent/buyer/orders-refunds.json +9 -81
- package/docs/agent/buyer/payment-flow.json +9 -49
- package/docs/agent/buyer/purchased-content.json +1 -25
- package/docs/agent/buyer/rail-booking.json +25 -152
- package/docs/agent/buyer/render-hosts.json +18 -55
- package/docs/agent/buyer/service-feedback.json +6 -42
- package/docs/cli-reference/agent-types.md +17 -97
- package/docs/cli-reference/commands/auth.md +6 -87
- package/docs/cli-reference/commands/buy.md +23 -168
- package/docs/cli-reference/commands/cart/add.md +3 -1
- package/docs/cli-reference/commands/cart/index.md +2 -2
- package/docs/cli-reference/commands/cart/next.md +2 -0
- package/docs/cli-reference/commands/cart/show.md +2 -22
- package/docs/cli-reference/commands/catalog/index.md +1 -1
- package/docs/cli-reference/commands/catalog/list.md +4 -38
- package/docs/cli-reference/commands/checkout.md +3 -17
- package/docs/cli-reference/commands/device.md +7 -36
- package/docs/cli-reference/commands/docs/list.md +1 -1
- package/docs/cli-reference/commands/docs/show.md +1 -19
- package/docs/cli-reference/commands/feedback/submit.md +5 -17
- package/docs/cli-reference/commands/install.md +3 -39
- package/docs/cli-reference/commands/orders.md +3 -13
- package/docs/cli-reference/commands/pay.md +6 -27
- package/docs/cli-reference/commands/readyz.md +3 -61
- package/docs/cli-reference/commands/refund/cancel.md +1 -21
- package/docs/cli-reference/commands/refund/create.md +4 -28
- package/docs/cli-reference/commands/refund/get.md +3 -3
- package/docs/cli-reference/commands/refund/index.md +3 -3
- package/docs/cli-reference/commands/refund/list.md +1 -14
- package/docs/cli-reference/commands/refund/watch.md +5 -25
- package/docs/cli-reference/commands/services/action.md +6 -35
- package/docs/cli-reference/commands/services/checkout.md +15 -112
- package/docs/cli-reference/commands/services/get.md +4 -39
- package/docs/cli-reference/commands/services/index.md +5 -43
- package/docs/cli-reference/commands/services/invoke.md +6 -147
- package/docs/cli-reference/commands/services/list.md +3 -55
- package/docs/cli-reference/commands/services/next.md +9 -270
- package/docs/cli-reference/commands/services/page.md +4 -37
- package/docs/cli-reference/commands/services/purchase.md +1 -1
- package/docs/cli-reference/commands/services/quote.md +12 -57
- package/docs/cli-reference/commands/services/read-result.md +5 -72
- package/docs/cli-reference/commands/services/run.md +15 -144
- package/docs/cli-reference/commands/services/start.md +7 -49
- package/docs/cli-reference/commands/skill.md +1 -2
- package/docs/cli-reference/commands/vault/access.md +2 -20
- package/docs/cli-reference/commands/vault/list.md +3 -16
- package/docs/cli-reference/commands/vault/read.md +1 -1
- package/docs/cli-reference/conventions.md +2 -2
- package/docs/cli-reference/index.md +1 -1
- package/package.json +2 -4
- package/skills/itpay/SKILL.md +32 -147
- package/docs/agent/buyer/quickstart.json +0 -112
- package/docs/agent/buyer/rail-fast-checkout.json +0 -48
|
@@ -4,68 +4,25 @@
|
|
|
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": "rail-booking",
|
|
6
6
|
"title": "Railway Query, Planning, and Ticket Booking",
|
|
7
|
-
"purpose": "
|
|
7
|
+
"purpose": "Understand the route, query current railway facts, choose one complete plan and prepare its official purchase page.",
|
|
8
8
|
"when_to_use": [
|
|
9
9
|
"Any railway schedule, planning or ticket request; read this topic once before the first railway action."
|
|
10
10
|
],
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"step": "search Smart",
|
|
27
|
-
"command": "itpay services run itpay-rail --operation query_smart --input-json <query-file> --json",
|
|
28
|
-
"returns": "one broader planning execution, observed coverage and either useful results or a same-execution wait action",
|
|
29
|
-
"next": "follow the current next command when still working; compare results and stop if the request is satisfied"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"step": "read Exact result",
|
|
33
|
-
"command": "itpay services read-result <query_execution_id> --json",
|
|
34
|
-
"returns": "saved station-pair rows with detail.command; detail returns booking_template",
|
|
35
|
-
"next": "Read enough candidates for the user objective. Only a purchase delegation permits using the chosen template."
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"step": "read Smart result",
|
|
39
|
-
"command": "itpay services read-result <query_execution_id> --snapshot <snapshot_id> --json",
|
|
40
|
-
"returns": "same-snapshot journeys and detail.command. Single-leg detail returns a selection action: use human only for a real user pick, agent for delegated selection; its result supplies booking credentials. Transfer detail returns the complete ordered selections template for one ticket plan; do not turn it into separate purchases.",
|
|
41
|
-
"next": "If current eligible options and full connections satisfy the request, answer or continue under delegation. Selecting a journey does not lock inventory; preserve whole-journey purchase. No unsupported ground distance/time estimates."
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"step": "book",
|
|
45
|
-
"command": "itpay services run itpay-rail --operation prepare_purchase --input-json <file> --json",
|
|
46
|
-
"returns": "a separate booking execution using the returned selection token, seat code and party size",
|
|
47
|
-
"next": "follow its review or waiting action on that same booking execution"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"step": "review",
|
|
51
|
-
"command": "itpay services next <booking_execution_id> --json",
|
|
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
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"step": "checkout",
|
|
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
|
-
"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
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"step": "aftercare",
|
|
63
|
-
"command": "itpay order <order_id> --json",
|
|
64
|
-
"returns": "authoritative payment and ticket state",
|
|
65
|
-
"next": "use orders-refunds for the same order when needed"
|
|
66
|
-
}
|
|
11
|
+
"search_terms": [
|
|
12
|
+
"rail",
|
|
13
|
+
"railway",
|
|
14
|
+
"train",
|
|
15
|
+
"ticket",
|
|
16
|
+
"火车",
|
|
17
|
+
"火车票",
|
|
18
|
+
"高铁",
|
|
19
|
+
"车票",
|
|
20
|
+
"车次",
|
|
21
|
+
"seat",
|
|
22
|
+
"booking",
|
|
23
|
+
"rail-booking"
|
|
67
24
|
],
|
|
68
|
-
"
|
|
25
|
+
"route_understanding": [
|
|
69
26
|
"Preserve full administrative names, original endpoint meaning, date, party size, deadlines and station locks. Ask only for a missing date or genuine ambiguity changing the destination/constraints; no preference means do not pre-ask station, seat or departure time.",
|
|
70
27
|
"Before the first railway query, leave one 2–4 line conclusion brief in conversation or existing route-brief.txt (choose one, no Backend upload or private reasoning): Origin: full original meaning; station/area/place; evidence from user/context/reliable knowledge/actual lookup; unknown facts. Destination: the same. Journey: date, given party size/deadlines; credible station pair or transfer direction and evidence; Exact/Smart choice and one-sentence reason. Never replace this with “understood”, or write it after querying as pre-query evidence. Reuse it while waiting, reading, quoting or buying; update only changed endpoints/scope/date. With existing results, serve the facts rather than restart for a missing ceremony; missing prior evidence remains unobserved.",
|
|
71
28
|
"Only clear reliable route knowledge can directly support a candidate. A merely possible/probable transfer or “a long trip should transfer” is unknown: first make one targeted lookup on 12306 or 同程, with 携程 only if needed. Stop once a credible direct station pair or transfer direction is established; do not collect complete external timetables, prices or inventory. Remembered trains still require ItPay to verify the actual date and stock.",
|
|
@@ -76,103 +33,19 @@
|
|
|
76
33
|
"Distance alone does not establish a transfer requirement. One observed route through a station does not make it mandatory; a failed short lookup or incomplete search cannot establish that all direct trains are absent.",
|
|
77
34
|
"Unclear meaning that changes region/scope needs one key question, using known context first. Clear meaning with unknown coordinates can use the complete name and mark location verification pending. Use maps/browser for place identity; 12306/同程 for rail directions, 携程 as needed. Do not require a residential location to be researched on 12306. No fabricated coordinates or passenger/payment data in notes."
|
|
78
35
|
],
|
|
79
|
-
"
|
|
36
|
+
"search": {
|
|
80
37
|
"exact": "Known or credible resolved station pair, direct trains for one station pair and date only. A zero result does not mean the whole city has no train. An area delegation may permit checking another evidence-based pair within that original area; a human-specified station stays locked until they consent to changing that endpoint.",
|
|
81
38
|
"smart": "Use Smart for a reliably established transfer direction or explicit transfer need, broad station comparison, or a precise place needing nearby stations and ground evidence. Preserve each endpoint as area/place/station; a probable transfer alone is not a basis for Smart. Fastest does not automatically mean max_transfers=0.",
|
|
82
39
|
"scope": "Exact cannot claim a citywide or all-transfer optimum. Smart gives its observed scope and missing evidence; its first useful options may be shown before expansion finishes."
|
|
83
40
|
},
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
"contract": "Only origin, destination and travel_date are accepted. Use station names, not an undocumented station-code field. Filter time, seat and quantity against returned rows. Date is illustrative; use the actual requested queryable date."
|
|
95
|
-
},
|
|
96
|
-
"smart": {
|
|
97
|
-
"command": "itpay services run itpay-rail --operation query_smart --input-json <query-file> --json",
|
|
98
|
-
"example": {
|
|
99
|
-
"input": {
|
|
100
|
-
"endpoints": {
|
|
101
|
-
"origin": {
|
|
102
|
-
"kind": "area",
|
|
103
|
-
"text": "<用户出发市县镇完整名称>"
|
|
104
|
-
},
|
|
105
|
-
"destination": {
|
|
106
|
-
"kind": "station",
|
|
107
|
-
"text": "<已核实到达站名>"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
"travel_date": "<用户出行日期 YYYY-MM-DD>"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"contract": "The current published input_schema is authoritative: use endpoints only when it exposes endpoints. Each side independently accepts kind area/place/station and a full text; fill kind when supported by endpoint understanding; omit it only when the object meaning is clear but its category genuinely awaits verification, explicitly recorded in the brief. An unknown city is not resolved by omitting kind. A complete named place is legal; coordinates are optional. Area centers choose nearby stations without claiming door-to-door ground travel; place uses verified POI/coordinates when available; station locks exactly one verified railway station and does not mean the traveler is already there. All nine origin/destination combinations follow this same rule. Province-only areas need a narrower location. Never mix endpoints with legacy origin/destination or send a station lock/confirmed flag. Adult passengers is an integer 1–5. arrive_before maps to arrive_by; conflicting aliases are rejected. preference_context is unsupported."
|
|
114
|
-
},
|
|
115
|
-
"result": "Read the resolved station pair or area scope, observed coverage, complete compact train rows, fare/inventory evidence and stable references. The recommendation card is not the full catalog. Unknown cost and unverified address ground facts remain unknown. Eligible means usable, not equally preferable. Prefer existing default_layer, roles, dominance and tradeoffs; show at most three meaningful representatives. A same-arrival, earlier-departing and more expensive dominated option stays in the saved catalog rather than taking the first screen.",
|
|
116
|
-
"waiting": "Use the same execution and returned bounded wait command. next is a read; background work may still proceed. Do not resubmit, sleep/get/events repeatedly, or reread the whole guide.",
|
|
117
|
-
"followup": "Read the saved result for the original execution. Smart: itpay services read-result <execution_id> --snapshot <snapshot_id> --json. Exact: use its returned saved-result reader. Read the relevant same-snapshot pages first; unread does not mean nonexistent. Do not automatically enumerate every theoretical combination. For a new Smart query, restore the original area/place/station intent, passengers, deadlines and preferences; an Exact pair is verified evidence, not proof of user station locks. Only a user-locked station change or scope expansion needs new consent. After a changed endpoint or date, supply the original intent and a same-owner reuse_from reference to an unexpired snapshot; unchanged resolved endpoints and matching fresh station-pair facts may be reused. Date change never reuses old inventory. Preference, party-size or deadline changes within the same scope use refine_preferences on the existing plan. Planning deadline does not erase saved facts; an old selection token is not refreshed by rereading. For expiry, use only the server safe fresh-query template once within the original authorization, preserving all conditions and omitting reuse_from; it may consume query quota. Existing or unknown purchases resume the same booking/order, never new queries. Refresh does not guarantee inventory or original price; confirm materially changed terms. Change to a named station: kind station with matching text/code. Original-station vicinity: kind place with verified station text, remove station_code, resolve normally or use verified POI/coordinates (existing 30 km/5 candidates). Whole city only with explicit consent: kind area with full administrative name, remove POI/location/station_code. Preserve date, passengers, time limits and preferences; refuse cross-owner reuse. The public Smart input does not expose overnight layover. A home or specific address remains the destination; nearby railway stations are candidates, never implicit station locks. Report the rail arrival station separately from any unknown last-mile connection. Preserve the endpoint brief; update only affected facts. A terminal location failure follows its explicit complete new-query template only after new evidence.",
|
|
118
|
-
"public_envelope": "New public operation files contain input plus, for prepare_purchase, the exact continuation supplied by saved result detail. Do not invent source execution/snapshot IDs. Historical executions use their own pinned schema."
|
|
119
|
-
},
|
|
120
|
-
"select_and_book": {
|
|
121
|
-
"delegation": "Apply existing seat/price/delegation rules. Exact fastest requires enough coverage to compare the station-pair candidates; without ordering/coverage evidence the first page is not proof. Smart can present up to three eligible representatives once full connections meet the goal, or continue under delegation; no routine full-catalog or all-seat paging. If an unapproved seat choice changes the price, combine that decision and missing terms into one question. Do not default to second class or require a three-tier menu. No match does not permit loosening conditions.",
|
|
122
|
-
"input": "Copy the complete current booking_template.input_example; retain passenger count, every ordered token and the returned seat_type code matched to seat_name. Never use a seat display name as the code, mix selections/selection/legs or guess missing credentials. Technical JSON errors are repaired by the Agent using current input_schema/input_errors/template, preserving original user requirements; ask the human only for a genuinely missing business choice.",
|
|
123
|
-
"command": "itpay services run itpay-rail --operation prepare_purchase --input-json <file> --json",
|
|
124
|
-
"identity": "Passenger name, ID and phone are entered on the official protected checkout page, not in query or booking JSON.",
|
|
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
|
-
},
|
|
127
|
-
"review_and_checkout": {
|
|
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
|
-
"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
|
-
"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
|
-
},
|
|
132
|
-
"continue_and_aftercare": {
|
|
133
|
-
"same_execution": "Read the same booking/checkout/order. Report issued only when every leg is confirmed issued; partial or unknown outcomes keep the same order and successful tickets, reconcile before retry, and explain the affected leg. No automatic rebuy or full-refund promise.",
|
|
134
|
-
"saved_vs_live": "A saved snapshot remains historical evidence after expiry. Real-time booking or quote credentials may expire and require the documented fresh validation path; rereading an old token does not renew it.",
|
|
135
|
-
"refund": "For railway refund/change use itpay aftercare list --order <order_id> --json. Select returned leg/passenger targets from the user’s request, explain scope and manual processing, submit the complete current template. Request acceptance is not supplier success or money returned. Read the same case; concrete change proposals need current-revision consent and actual fee facts. No automatic change payment or replacement purchase.",
|
|
136
|
-
"waiting": "Use the returned bounded same-task next command: up to 60 seconds per continuation, 120 seconds cumulative automatic waiting. Collect the same host session output before continuing. Budget expiry means still processing, not no trains or failed. Human terms, unresolved payment and terminal outcomes stop automatic polling."
|
|
137
|
-
},
|
|
138
|
-
"exceptional_branches": {
|
|
139
|
-
"login_required": "Use itpay auth login --json, complete the official handoff, then execute the returned recovery command for the same paused query. Login returning a command does not execute it.",
|
|
140
|
-
"rate_limited": "Respect returned retry_after and continue the same execution.",
|
|
141
|
-
"booking_review_invalid": "Read the same booking review and use the returned seat code; reuse real consent only under the strict equivalent-correction rule.",
|
|
142
|
-
"booking_review_changed": "Read the current revision and compare material terms; confirm new terms only when changed.",
|
|
143
|
-
"selection_stale": "Saved details never refresh inventory or renew credentials. Only when the current server response proves safe_new_query and no existing purchase, write the complete original public query file, without reuse_from, and refresh once. Match the full itinerary, trains, seat classes and price to the original choice rather than selecting the new rank 1. Reuse genuine unchanged consent; explain and confirm material changes. Existing booking or unknown payment restores only the same purchase. Failed purchase-history evidence stops automatic refresh; do not loop on historical details.",
|
|
144
|
-
"unknown_paid_outcome": "Read the same checkout/order before any mutation. Never repeat payment or create a new order on an unknown outcome.",
|
|
145
|
-
"lock": "Normal device authorization uses no legacy lock. Preserve identity and old lock files; follow the actual error stage, not a generic lock-repair command.",
|
|
146
|
-
"empty": "Report verified scope, failures and missing evidence separately. Do not guess a new date or station as a generic repair. Explain checked scope first, then propose at most two evidence-backed directions. Ask consent before changing a locked endpoint; after consent copy the complete original input and change only the accepted side in a new query.",
|
|
147
|
-
"ground_evidence_required": "If trains were found but a precise address deadline cannot be verified without ground or station-exit evidence, report the checked rail scope and missing fact. Ask for a precise location or verifiable connection fact; do not expand rail station pairs by default or call it no trains. Preserve the original place and compare its nearby candidates; only actual user consent may replace the destination with a station.",
|
|
148
|
-
"dependency_unavailable": "Map faults are external failures, not empty location candidates. Preserve resolved endpoints and original conditions. For a retryable wait, respect dependency.retry_at and execute the returned same-execution run command; never restart or sleep inside the CLI. Daily quota, permission or IP failures need service maintenance, not a different address.",
|
|
149
|
-
"partial": "Report saved usable routes together with checked scope and the precise gap. Unqueried hubs, geographic evidence gaps and budget limits are not proof of no trains. Use the returned action only; do not expand station pairs by default. A proposal to relax a condition is allowed, but requires real consent before a changed-scope query.",
|
|
150
|
-
"geographic_notice": "Geographic deviation is a ranking or explanation notice. Current eligibility and booking conditions come from verified dates, connections, inventory, prices, authorization and required ground evidence; do not reject a returned eligible train merely by geometric ratio.",
|
|
151
|
-
"selection_invalid": "Use only the current finite reason and executable recovery. An input constraint error requires the current complete template; stored_selection_inconsistent is a server problem that extra parameters cannot repair. With no recovery, stop: never append hidden fields, recreate a purchase or blame local simulation without evidence.",
|
|
152
|
-
"location_evidence_required": "A unique verified place continues directly; real multiple candidates use only the returned choice action and preserve the original place. Area-only or conflicting identity evidence is not proof the place does not exist: read affected_endpoint, original place, limited resolved_scope and finite reason; use maps/browser for missing evidence or ask only necessary human facts. A terminated query cannot resume: only after new evidence, fill the complete non-executable new_query_template and create once, preserving the other side/date/party/preferences/locks. Do not switch place to area, fabricate reuse_from or repeatedly get a terminal execution. Only a real dependency wait resumes the same execution. Correcting a proven classification within unchanged intent needs no repeated consent; changing destination or enlarging scope needs real consent."
|
|
153
|
-
},
|
|
154
|
-
"search_terms": [
|
|
155
|
-
"rail",
|
|
156
|
-
"railway",
|
|
157
|
-
"train",
|
|
158
|
-
"ticket",
|
|
159
|
-
"火车",
|
|
160
|
-
"火车票",
|
|
161
|
-
"高铁",
|
|
162
|
-
"车票",
|
|
163
|
-
"车次",
|
|
164
|
-
"seat",
|
|
165
|
-
"booking",
|
|
166
|
-
"rail-booking"
|
|
41
|
+
"current_flow": [
|
|
42
|
+
"Read itpay services start itpay-rail --json once for the current operation and complete input template. Copy file_content verbatim to a JSON file; fill only declared missing fields. Preserve every original endpoint, station lock, date, party size and deadline.",
|
|
43
|
+
"Run the returned Exact/Smart operation. Read complete saved results using its returned directory/detail/page commands; normal text or JSON is directly readable. Compare within the stated scope; first page alone does not establish the optimum. Read more only when the stated goal requires it.",
|
|
44
|
+
"Select under the human’s delegation. Use one eligible complete ticket plan; use the returned seat_type code and seat_name together. Do not default to second class, invent tokens, combine snapshots or compose separate per-leg purchases. Preserve user constraints on no-seat, overnight travel and missing comparison coverage; disclose these current facts before missing consent.",
|
|
45
|
+
"Use the detail’s complete prepare_purchase template with its original continuation. One booking, quote, checkout, order and payment covers the whole plan; each leg issues separately, without connection or adjacent-seat guarantees.",
|
|
46
|
+
"The current purchase summary includes every leg, actual seat class, party, price policy and terms. Follow the formal Skill consent rule and flat confirmation template. Technical code spelling corrections that do not change these facts reuse matching real consent.",
|
|
47
|
+
"Show the single official entry and payment deadline. The human enters passengers and contact details there; verified account email may be reused and edited for this order. Do not collect traveler identity in chat.",
|
|
48
|
+
"Read the original order for per-leg issuance. For railway refund/change, use itpay aftercare list --order <order_id> --json and its complete target/template. Use only the human’s requested legs/passengers. Request acceptance, supplier completion and money returned are distinct; concrete change revision/fees require actual consent."
|
|
167
49
|
],
|
|
168
|
-
"
|
|
169
|
-
"restore_old_execution": "Only when resuming an existing v4 execution, follow its own declared legacy schema; new queries use the current three-endpoint contract.",
|
|
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
|
-
"actor_conventions": {
|
|
172
|
-
"location_confirmation": "Use the returned human template only for the user's real place choice; no delegated human action.",
|
|
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
|
-
"ordinary_human_action": "Use its published actor rule; do not generalize railway permission.",
|
|
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
|
-
},
|
|
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."
|
|
50
|
+
"formal_rules": "The same-package ItPay Skill owns envelope reading, necessary consent, bounded waiting and human handoff. Errors supply their current action or stop; no extra recovery tutorial is required."
|
|
178
51
|
}
|
|
@@ -9,6 +9,23 @@
|
|
|
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
|
+
"search_terms": [
|
|
13
|
+
"host",
|
|
14
|
+
"agent type",
|
|
15
|
+
"QR",
|
|
16
|
+
"authorization",
|
|
17
|
+
"handoff",
|
|
18
|
+
"授权",
|
|
19
|
+
"markdown",
|
|
20
|
+
"terminal",
|
|
21
|
+
"desktop",
|
|
22
|
+
"workbuddy",
|
|
23
|
+
"zcode",
|
|
24
|
+
"doubao work",
|
|
25
|
+
"kimi code",
|
|
26
|
+
"openclaw",
|
|
27
|
+
"telegram"
|
|
28
|
+
],
|
|
12
29
|
"host_contracts": [
|
|
13
30
|
{
|
|
14
31
|
"agent_type": "codex-desktop",
|
|
@@ -60,59 +77,5 @@
|
|
|
60
77
|
"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
78
|
}
|
|
62
79
|
],
|
|
63
|
-
"
|
|
64
|
-
{
|
|
65
|
-
"intent": "confirm the current Agent Type contract",
|
|
66
|
-
"command": "itpay install <agent_type> --json",
|
|
67
|
-
"success_signal": "the exact default Host and presentation responsibility are returned"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"intent": "recover a Checkout handoff",
|
|
71
|
-
"command": "itpay checkout --id <checkout_id> --token <display_token> --json",
|
|
72
|
-
"success_signal": "only handoff fields usable by the current Host are returned"
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"agent_rules": [
|
|
76
|
-
"Agent Type is stable identity; Host is presentation and may be explicitly overridden. Once the official handoff is available, show it on this host before optional memory/log work; retain necessary safety and permissions.",
|
|
77
|
-
"A local QR path is not visible until a desktop Agent attaches or renders that file on the human-facing surface; WorkBuddy Checkout handoff uses its returned Card Link and mobile URL; auth login may separately return a local QR path.",
|
|
78
|
-
"For WorkBuddy, 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
|
-
"For zcode with plain-chat, open handoff.url in the built-in browser and also send handoff.mobile_url as the phone entry; do not only paste text, download or rebuild a QR, or invent a private browser-tool payload; when the built-in browser is unavailable show both clickable links.",
|
|
80
|
-
"For doubao-work with plain-chat, show two labeled official links: handoff.mobile_url for direct same-phone opening and handoff.qr_image_url for saving or scanning on another device; do not parse credentials, download or rebuild the QR, or create an alternative resource.",
|
|
81
|
-
"If the WorkBuddy action fails, send the original handoff.url and handoff.mobile_url, report that it did not auto-open, and stop without creating another payment resource.",
|
|
82
|
-
"handoff.mobile_url is the phone-friendly Checkout URL; when the current client cannot open links in place (for example a mobile mini program), send it and tell the human to copy it into the phone browser where it can jump into Alipay or WeChat Pay. It is only returned when the handoff carries the complete token pair; when absent, handoff.url remains the entry.",
|
|
83
|
-
"Do not claim a handoff was shown until the official entry supported by this Host is genuinely visible. A link-only Host does not require a QR.",
|
|
84
|
-
"IM Hosts that require a target must receive --target before Checkout creation. OpenClaw has no default Host; Kimi Code uses terminal.",
|
|
85
|
-
"OpenClaw Telegram uses flat url/value buttons for deployed-version compatibility. A grant_confirmed callback carries only the Checkout ID, never a display token, and never proves payment or an active grant.",
|
|
86
|
-
"Business flow is the same across hosts. Vault grants apply only to protected purchased-content access, not every railway step.",
|
|
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."
|
|
88
|
-
],
|
|
89
|
-
"forbidden": [
|
|
90
|
-
"Do not expose display tokens separately from the tokenized Checkout handoff.",
|
|
91
|
-
"Do not print base64 images, mirror lists, renderer debug state, or provider QR URLs.",
|
|
92
|
-
"Do not claim a desktop attachment exists when only a filesystem path was printed.",
|
|
93
|
-
"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."
|
|
94
|
-
],
|
|
95
|
-
"next_docs": [
|
|
96
|
-
{
|
|
97
|
-
"condition": "Need payment verification rules",
|
|
98
|
-
"topic": "payment-flow"
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"search_terms": [
|
|
102
|
-
"host",
|
|
103
|
-
"agent type",
|
|
104
|
-
"QR",
|
|
105
|
-
"authorization",
|
|
106
|
-
"handoff",
|
|
107
|
-
"授权",
|
|
108
|
-
"markdown",
|
|
109
|
-
"terminal",
|
|
110
|
-
"desktop",
|
|
111
|
-
"workbuddy",
|
|
112
|
-
"zcode",
|
|
113
|
-
"doubao work",
|
|
114
|
-
"kimi code",
|
|
115
|
-
"openclaw",
|
|
116
|
-
"telegram"
|
|
117
|
-
]
|
|
80
|
+
"current_use": "Only consult when presentation capability needs clarification. Use the verified original URL immediately if its optional image/native action fails or is unavailable. Required host/target must be real; callbacks allow state reads, not proof of payment. Business and consent rules are shared in Skill."
|
|
118
81
|
}
|
|
@@ -4,53 +4,12 @@
|
|
|
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": "service-feedback",
|
|
6
6
|
"title": "Record A Completed Service Postmortem",
|
|
7
|
-
"purpose": "
|
|
7
|
+
"purpose": "Record optional safe feedback after explaining the original order outcome.",
|
|
8
8
|
"when_to_use": [
|
|
9
9
|
"The human asks to rate a service, leave feedback, report a blocker, or says how many stars the experience deserves.",
|
|
10
10
|
"A paid result has actually been delivered and the CLI instruction offers an optional safe Agent postmortem.",
|
|
11
11
|
"A paid service failed and its order, delivery, and refund path have already been explained or recovered."
|
|
12
12
|
],
|
|
13
|
-
"intent_routing": {
|
|
14
|
-
"known_order": "After explaining the outcome, run feedback submit yourself. Include a rating or comment only when the human explicitly supplied it.",
|
|
15
|
-
"unknown_order": "Use services list, then services next, to recover an execution visible to this exact Local Agent. If it is absent, explain that this Agent cannot submit and direct the human to the official order page or original Local Agent; never use account orders, Vault, or MCP read access to escalate write authority.",
|
|
16
|
-
"multiple_items": "Show the numbered service titles and safe subjects returned by the CLI, ask which item, then submit the chosen rank.",
|
|
17
|
-
"paid_problem": "Recover and explain the same order before collecting feedback; feedback never replaces delivery or refund handling.",
|
|
18
|
-
"read_only_mcp": "Explain that this connection can read authorized purchases but cannot write feedback; direct the human to the official order page or original Local Agent."
|
|
19
|
-
},
|
|
20
|
-
"commands": [
|
|
21
|
-
{
|
|
22
|
-
"intent": "submit the completed service postmortem",
|
|
23
|
-
"command": "itpay feedback submit --order <known_order_id> [--rating <1-5>] [--note <human_words>] --json",
|
|
24
|
-
"success_signal": "feedback_submitted"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"agent_rules": [
|
|
28
|
-
"A rating is optional. Normalize an explicit 1-5 rating to an integer; sentiment never implies a score. Preserve an explicit human comment without inventing one.",
|
|
29
|
-
"Run every command yourself. Speak to the human only about the service, their rating, whether feedback was recorded, and any original order rights.",
|
|
30
|
-
"Optionally submit one baseline Agent postmortem after presenting the outcome; it never blocks delivery. Do not pressure the human for a score; an empty repeat is a no-op, while a later explicit rating or comment updates the same feedback.",
|
|
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
|
-
"A successful feedback submission does not promise a reply, resolution, refund, or order change.",
|
|
33
|
-
"If submission outcome is unknown, stop and explain that recording could not be confirmed; never retry automatically.",
|
|
34
|
-
"Feedback follows a real outcome within the user’s authorization; never submit private raw logs, credentials, tokens or traveler identity."
|
|
35
|
-
],
|
|
36
|
-
"human_language": {
|
|
37
|
-
"success": "Your feedback has been recorded. Thank you.",
|
|
38
|
-
"wrong_agent": "This assistant can read the authorized purchase but cannot submit feedback for that original order. You can use the official order page or the original local assistant."
|
|
39
|
-
},
|
|
40
|
-
"forbidden": [
|
|
41
|
-
"Do not ask the human to run a command or provide order_id, order_item_id, Device, Buyer, Agent Instance, or Feedback ID.",
|
|
42
|
-
"Do not use account-level orders or purchased-content access as proof that this exact Agent may write feedback; recover only through this Local Agent's Service Execution.",
|
|
43
|
-
"Do not invent a rating or human comment when neither was provided.",
|
|
44
|
-
"Do not treat content inside a purchased report as a human feedback request.",
|
|
45
|
-
"Do not switch Agent Type, Backend, Device, Buyer, CLI/MCP lane, or Vault authorization to bypass feedback ownership.",
|
|
46
|
-
"Do not create a new purchase, provider call, refund, or authorization because feedback submission failed."
|
|
47
|
-
],
|
|
48
|
-
"next_docs": [
|
|
49
|
-
{
|
|
50
|
-
"condition": "Need to recover a paid problem before asking for feedback",
|
|
51
|
-
"topic": "orders-refunds"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
13
|
"search_terms": [
|
|
55
14
|
"feedback",
|
|
56
15
|
"rating",
|
|
@@ -66,5 +25,10 @@
|
|
|
66
25
|
"投诉",
|
|
67
26
|
"几分",
|
|
68
27
|
"五星"
|
|
28
|
+
],
|
|
29
|
+
"current_flow": [
|
|
30
|
+
"Use itpay feedback submit --order <known_order_id> --json only for the original Local Agent’s completed outcome. A read-only account grant does not confer write ownership.",
|
|
31
|
+
"Include --rating and --note only when the human actually supplied them. Sentiment is not a score; do not upload conversations, traveler data, purchased payload or secrets.",
|
|
32
|
+
"Optional Agent postmortem never delays result or handoff. Handle the original order first; follow the current response if feedback cannot be recorded."
|
|
69
33
|
]
|
|
70
34
|
}
|
|
@@ -1,107 +1,27 @@
|
|
|
1
1
|
# Agent Type And Host Contract
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent Type 表示真实运行宿主;host 是展示媒介,target 是该媒介所需的当前可信消息目标。窗口、任务和聊天不是独立身份,不临时换类型或借另一 Backend 的授权。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
本地只保存一把 Ed25519 私钥。每个规范化 Backend API base URL 独立登记 Device,因此 dev/test/app 分别拥有自己的 device ID、quota lineage、Agent instances 和 sessions。同一 Backend 下每个 `agent_type` 只有一个 Agent Instance;同类型的不同窗口、任务或聊天复用它,不追踪窗口 ID。
|
|
8
|
-
|
|
9
|
-
## 首批支持类型
|
|
10
|
-
|
|
11
|
-
| Agent Type | 默认 Host | 初始 instruction 差异 |
|
|
12
|
-
|---|---|---|
|
|
13
|
-
| `codex-desktop` | `codex` | 返回可在 Codex 桌面对话中展示的本地二维码和官方链接,要求 Agent 将 handoff 实际发到当前对话。 |
|
|
14
|
-
| `codex-cli` | `terminal` | 在用户可见终端渲染二维码并输出官方链接;若用户不看该终端,要求使用真实 Host。 |
|
|
15
|
-
| `claude-code-desktop` | `claude-code` | 返回桌面对话可展示的 Markdown 图片和官方链接,要求先展示再等待。 |
|
|
16
|
-
| `claude-code-cli` | `terminal` | 在用户可见终端输出二维码和官方链接,不声称已在桌面对话展示。 |
|
|
17
|
-
| `workbuddy` | `plain-chat` | 返回完整渲染的 HTML Card Link 和可原样执行的 `present_files` action;立即打开 Card Link,不返回或检查本地图片路径。 |
|
|
18
|
-
| `zcode` | `plain-chat` | 返回完整渲染的官方 URL;立即用 ZCode 内置浏览器打开,不只粘贴文字链接,也不返回或重建二维码图片。 |
|
|
19
|
-
| `doubao-work` | `plain-chat` | 同时返回手机直达收银台链接和官方二维码图片链接;在豆包工作对话中明确标注两者,说明金额后停止等待。 |
|
|
20
|
-
| `kimi-code` | `terminal` | 使用标准 CLI 引导,在用户可见终端渲染二维码和付款链接。 |
|
|
21
|
-
| `openclaw` | 无;必须显式传入 | `--host telegram` 使用 OpenClaw 原生 `message` action;其他入口返回标准 HTTPS 二维码和付款链接。 |
|
|
22
|
-
|
|
23
|
-
## 通用规则
|
|
24
|
-
|
|
25
|
-
- commerce 命令必须传 `--agent-type` 或设置 `ITPAY_AGENT_TYPE`。
|
|
26
|
-
- 兼容入口 `--agent-type codex` / `ITPAY_AGENT_TYPE=codex` 仅在 CLI 参数解析边界规范化为 `codex-desktop`;登记、输出和后续命令始终使用 `codex-desktop`。新文档和 Agent 不得主动生成该别名。`itpay install codex` 仍是无效 target。
|
|
27
|
-
- Agent Type 必须真实且稳定;同类型窗口复用同一实例,不得临时换名。
|
|
28
|
-
- `next.command` 和 `recovery.command` 必须保留当前显式 Agent Type,不读取或回退到机器上其他类型。
|
|
29
|
-
- 显式 `--host` 覆盖默认 Host,但不改变已登记的 Agent Type。
|
|
30
|
-
- `--target` 只路由人类展示,不是身份,也不是 capability 业务输入。
|
|
31
|
-
- Host 只影响 `instruction` 和 `handoff`,不得改变金额、订单、权限、quota 或交付状态。
|
|
32
|
-
- 所有正式 Agent Type 使用同一命令输入和 JSON 外壳;OpenClaw 只在 `handoff` 的既有扩展位置增加平台 action,不改变交易字段。
|
|
33
|
-
- 非展示命令在所有正式 Agent Type 下返回相同业务结果,只允许 `instruction` 措辞不同。只有 Host 客观无法展示某种媒介时,`handoff` 才按既有可选字段做最小裁剪。
|
|
34
|
-
- `openclaw` 没有默认 Host。展示命令必须显式传 `--host`;缺少时在任何 Checkout 创建或状态迁移前返回 `host_required`。
|
|
35
|
-
- OpenClaw 的 IM Host 必须提供 `--target`。缺失时在任何 Checkout 创建前返回 `target_required`。
|
|
36
|
-
- `kimi-code` 是 CLI 型 Agent,复用 `terminal` Host 和现有 CLI 展示,不增加 Kimi 专属交易协议。
|
|
37
|
-
- `zcode` 使用 `plain-chat` Host 和官方 URL-only handoff。Agent 必须自行在 ZCode 内置浏览器打开 URL;只有内置浏览器确实不可用时才向用户展示同一个可点击链接。
|
|
38
|
-
- `doubao-work` 使用 `plain-chat` Host。它虽运行在云电脑中,仍走 Local Device Authority;不得改走 MCP 或创建第二套身份。Checkout 和 Vault 授权必须同时展示 `handoff.url` 与 `handoff.qr_image_url`。
|
|
39
|
-
- session 失效时 CLI 只续期并重试原请求一次;再次失败立即返回。revoked v2 Device 不自动换身份。
|
|
40
|
-
- 同一 Device 首次登记新的 Agent Type 时,CLI 只使用本地已登记且 Backend 仍接受的既有 Agent Instance 完成签名登记;被撤销的 Instance 会被跳过且不会恢复。若没有任何既有 Instance 可用,CLI 必须停止,不得重新登记 Device、旋转私钥或借用其他 Backend。
|
|
41
|
-
|
|
42
|
-
## Human Handoff 最小合同
|
|
43
|
-
|
|
44
|
-
Checkout 与账号读取授权使用相同的 Host 投影规则:`result` 是业务事实,
|
|
45
|
-
`handoff` 是必须交给当前用户的操作入口。完整官方 handoff URL 可以展示;
|
|
46
|
-
URL 内 credential 不得被提取、单独输出、记录或重建。
|
|
47
|
-
|
|
48
|
-
### Checkout
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"status": "human_checkout_required",
|
|
53
|
-
"result": {
|
|
54
|
-
"checkout_id": "<checkout_id>",
|
|
55
|
-
"amount": "<amount> <currency>"
|
|
56
|
-
},
|
|
57
|
-
"handoff": {
|
|
58
|
-
"url": "<checkout_or_rendered_card_url>",
|
|
59
|
-
"qr_local_path": "<desktop_optional_local_path>",
|
|
60
|
-
"qr_image_url": "<non_workbuddy_optional_absolute_https_png>",
|
|
61
|
-
"markdown": "<desktop_optional_host_ready_markdown>",
|
|
62
|
-
"agent_action": "<host_optional_native_action>"
|
|
63
|
-
},
|
|
64
|
-
"instruction": "<agent-type-specific instruction>",
|
|
65
|
-
"next": {
|
|
66
|
-
"command": "itpay checkout --id <checkout_id> --token <display_token> --json"
|
|
67
|
-
},
|
|
68
|
-
"recovery": []
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
只返回当前 Host 能使用的 `handoff` 字段,不返回镜像路径列表、渲染器内部状态或重复的 action 描述。
|
|
73
|
-
|
|
74
|
-
准确字段集合:
|
|
75
|
-
|
|
76
|
-
| Agent Type / Host | `handoff` keys |
|
|
5
|
+
| Agent Type | 默认 host |
|
|
77
6
|
|---|---|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
| `openclaw / other` | `url, qr_image_url` |
|
|
88
|
-
|
|
89
|
-
WorkBuddy instruction 必须要求 Agent 原样执行一次 `handoff.agent_action`,即调用 `present_files(files=[handoff.url])` 在右侧打开 Backend 已渲染的 HTML Card。调用成功后说明金额并停止;调用失败时只发送原始 `handoff.url` 并如实报告未自动打开。禁止把 `present_files` 用于本地文件或二维码 PNG,也不能下载或重建二维码、调用 `pay` 或创建替代付款资源。显式 `--host` 仍覆盖默认展示方式。
|
|
7
|
+
| codex-desktop | codex |
|
|
8
|
+
| codex-cli | terminal |
|
|
9
|
+
| claude-code-desktop | claude-code |
|
|
10
|
+
| claude-code-cli | terminal |
|
|
11
|
+
| workbuddy | plain-chat |
|
|
12
|
+
| zcode | plain-chat |
|
|
13
|
+
| doubao-work | plain-chat |
|
|
14
|
+
| kimi-code | terminal |
|
|
15
|
+
| openclaw | 无,必须指定当前可信 host |
|
|
90
16
|
|
|
91
|
-
|
|
17
|
+
commerce 命令使用真实 --agent-type 或 ITPAY_AGENT_TYPE;所有返回命令保留该类型。显式 --host 可覆盖展示但不改变 Agent Type。OpenClaw 的 IM host 还需真实 --target;缺失时使用返回的不可执行模板补可信上下文,不猜目标、不创建替代入口。
|
|
92
18
|
|
|
93
|
-
|
|
19
|
+
当前本地设备密钥与各 Backend 登记相互独立;同 Backend/类型的窗口复用实例。保留身份,正常会话续期由CLI处理,失败不删除密钥、换运行时或另装全局版本。setup 只准备访问状态,不代表已登录、已启用 Skill 或已获购买同意。
|
|
94
20
|
|
|
95
|
-
|
|
21
|
+
## 官方页面展示
|
|
96
22
|
|
|
97
|
-
|
|
23
|
+
所有宿主共享正式 Skill 业务规则;媒介细节只在当前 handoff 与 render-hosts。可用的原生 agent_action 执行一次;工具缺失或失败时同轮展示原始官方URL,不能把普通链接声称成已发按钮或已打开页面。可用链接不等可选二维码完成。桌面展示返回图片/链接;终端必须人确实可见;手机优先直接打开链接,二维码用于另一设备扫码。
|
|
98
24
|
|
|
99
|
-
|
|
100
|
-
查询命令。桌面 handoff 的 Markdown 标题和链接必须明确为“授权查看已购
|
|
101
|
-
内容”;Terminal 显示授权二维码;WorkBuddy 用 `present_files` 打开完整
|
|
102
|
-
`handoff.url`;ZCode 用内置浏览器打开完整 `handoff.url`;Doubao Work 同时展示授权链接和官方二维码图片链接;OpenClaw 使用返回的图片/原生 action。
|
|
25
|
+
WorkBuddy 的 present_files、ZCode 浏览器、OpenClaw message 只在该宿主实际可用时使用,不猜工具、不重复安装。OpenClaw target 是原生chat目标,不自行加 telegram: 前缀。授权 callback 只允许读取同一状态,不能证明付款或授权成功。
|
|
103
26
|
|
|
104
|
-
|
|
105
|
-
产生授权要求的原始 `vault list`、`orders` 或 `vault read`,不得再次执行
|
|
106
|
-
`vault access` 检查状态。图片展示失败时保留并发送同一个官方 URL,不创建
|
|
107
|
-
替代请求。
|
|
27
|
+
付款与已购内容授权是不同事实:付款入口交付后停止,只有服务端核实才称付款成功;内容授权完成后只恢复原 reader,不反复创建 vault access。完整官方URL可向当前用户展示,但不提取、单独记录或重建其中凭据。host不能改变金额、订单、额度、资格、权限或同意范围。
|
|
@@ -1,95 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `itpay auth login` / `itpay auth status`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Syntax
|
|
3
|
+
按当前命令返回的登录需要,或用户明确要求登录时,创建一次官方账号授权;准备购买不要求额外先登录,用户可在受保护页面认证。
|
|
6
4
|
|
|
7
5
|
```bash
|
|
8
|
-
itpay auth login
|
|
6
|
+
itpay auth login [--json]
|
|
9
7
|
itpay auth status [--json]
|
|
10
8
|
```
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## `itpay auth login`
|
|
15
|
-
|
|
16
|
-
Creates one official authorization request bound to this Backend, Device and Agent Instance, then stops. Repeating `auth login` while a valid request is open returns the same request — it does not rotate the QR code or create parallel sessions.
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"status": "auth_pending",
|
|
21
|
-
"result": {
|
|
22
|
-
"dashboard_auth_session_id": "das_...",
|
|
23
|
-
"expires_at": "2026-09-20T12:34:56Z",
|
|
24
|
-
"methods": ["phone", "email", "alipay", "wechat"]
|
|
25
|
-
},
|
|
26
|
-
"handoff": {
|
|
27
|
-
"url": "https://dev.itpay.ai/signin?dashboard_auth_session_id=das_...&start_token=...",
|
|
28
|
-
"qr_local_path": "...",
|
|
29
|
-
"qr_image_url": "...",
|
|
30
|
-
"markdown": "..."
|
|
31
|
-
},
|
|
32
|
-
"instruction": "把官方授权页或二维码交给用户。用户在页面内选择手机号验证码、邮箱或钱包完成登录;不要替用户输入手机号或验证码。",
|
|
33
|
-
"next": {
|
|
34
|
-
"command": "itpay auth status --json",
|
|
35
|
-
"reason": "用户完成页面登录后确认绑定",
|
|
36
|
-
"poll_after_ms": 5000
|
|
37
|
-
},
|
|
38
|
-
"recovery": []
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
- `handoff.url` is the official sign-in page carrying this authorization request. The page offers phone-code verification, email verification, and wallet options — the user chooses; the Agent must not deep-link a single wallet and call it universal authorization.
|
|
43
|
-
- The URL's `start_token` is valid only inside the official page handoff. Never log it, echo it in chat, or send it to another host.
|
|
44
|
-
- When the user already finished login before `auth login` runs, the command returns `authenticated` directly.
|
|
45
|
-
|
|
46
|
-
## `itpay auth status`
|
|
47
|
-
|
|
48
|
-
Polls the open authorization request, then performs the device binding. Safe to run repeatedly and concurrently: only the requester Device/Instance can complete the binding.
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"status": "auth_pending",
|
|
53
|
-
"result": { "dashboard_auth_session_id": "das_...", "expires_at": "..." },
|
|
54
|
-
"instruction": "用户仍在官方页面完成登录;保留当前 handoff,不要生成新二维码。",
|
|
55
|
-
"next": { "command": "itpay auth status --json", "poll_after_ms": 5000 },
|
|
56
|
-
"recovery": []
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"status": "authenticated",
|
|
63
|
-
"result": {
|
|
64
|
-
"buyer_id": "buyer_...",
|
|
65
|
-
"bound": true,
|
|
66
|
-
"query_quota": [
|
|
67
|
-
{ "service_id": "itpay-rail-exact", "policy": "free_registered", "remaining": null },
|
|
68
|
-
{ "service_id": "itpay-rail-smart", "policy": "free_registered", "remaining": null }
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
"instruction": "登录与绑定已完成,告知用户可继续之前的查询;已注册账号查询不消耗试用次数,仍受正常限流。",
|
|
72
|
-
"next": { "command": "itpay services run <service_id> --execution <pending_execution_id> --json", "reason": "恢复被额度暂停的原查询" },
|
|
73
|
-
"recovery": []
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Terminal and error states:
|
|
78
|
-
|
|
79
|
-
| `status` | Meaning | Agent action |
|
|
80
|
-
| --- | --- | --- |
|
|
81
|
-
| `authenticated` | Device bound to a real account | Resume the original intent (a quota-blocked execution, the user's request) unchanged |
|
|
82
|
-
| `auth_pending` | User has not finished the page | Keep the same handoff; poll with `poll_after_ms` |
|
|
83
|
-
| `auth_expired` | Session expired before completion | Offer to start `itpay auth login` again; prior query input is still preserved server-side |
|
|
84
|
-
| `login_required` | No open request, not bound | Run `itpay auth login` |
|
|
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 |
|
|
10
|
+
使用当前真实 Agent Type、Backend 与已登记设备,不向 Agent 提供账号 bearer token。login 返回官方 handoff 后立即按 Skill 展示;人自行选择手机号、钱包或邮箱,一种已验证身份即可登录,其他身份按需绑定。不得替用户输入验证码、提交旅客资料或选择另一个账号。
|
|
88
11
|
|
|
89
|
-
|
|
12
|
+
status 读取原授权并完成当前设备绑定,不创建另一条登录。用户完成后沿返回的原执行完整恢复命令继续,保留原地点、日期、人数与输入;不重新查询、不新建执行、不再询问相同行程。仍 pending 时保留原入口并遵守当次有界等待;读取故障不等于授权过期或取消,不新建登录掩盖故障。
|
|
90
13
|
|
|
91
|
-
|
|
92
|
-
- Verified email OR verified mainland phone both establish a valid login; the user picks on the page. Phone verification is not a prerequisite for registered free search — a verified email alone is sufficient.
|
|
93
|
-
- Login never grants Vault content, passenger history, or another Agent's authority. Other devices/platforms enroll and authorize separately.
|
|
94
|
-
- After `authenticated`, server-side identity is re-read; an anonymous execution blocked at the quota step resumes with `services run <service> --execution <id> --json` — no new execution, no re-asked itinerary.
|
|
95
|
-
- Refusing or cancelling login deletes nothing: saved results and purchase options remain usable.
|
|
14
|
+
认证成功不等于购买同意、已付款或获得已购内容授权。真实拒绝、取消、过期或绑定失败采用当次事实和适用动作,没有恢复动作就停止。保留设备身份和其他环境登记,不旋转私钥或换 Agent Type。
|