@itpay/cli 2.1.41 → 2.1.44
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 +12 -5
- package/assets/sell-preview/index.html +6 -0
- package/assets/sell-preview/preview.js +9 -0
- package/bin/darwin-amd64/itpay-sell +0 -0
- package/bin/darwin-arm64/itpay-sell +0 -0
- package/bin/linux-amd64/itpay-sell +0 -0
- package/bin/linux-arm64/itpay-sell +0 -0
- package/bin/windows-amd64/itpay-sell.exe +0 -0
- package/dist/src/client/backend.js +38 -2
- package/dist/src/client/http.js +2 -0
- package/dist/src/commands/aftercare.js +12 -0
- package/dist/src/commands/buy.js +17 -58
- package/dist/src/commands/cart.js +17 -15
- package/dist/src/commands/catalog.js +39 -14
- package/dist/src/commands/checkout.js +146 -5
- package/dist/src/commands/checkout_handoff.js +11 -61
- package/dist/src/commands/docs.js +7 -18
- package/dist/src/commands/guidance.js +1 -134
- package/dist/src/commands/install.js +6 -3
- package/dist/src/commands/order.js +34 -3
- package/dist/src/commands/orders.js +4 -9
- package/dist/src/commands/pay.js +1 -1
- package/dist/src/commands/presentation.js +153 -0
- package/dist/src/commands/rail_catalog.js +1 -0
- package/dist/src/commands/readyz.js +1 -1
- package/dist/src/commands/refund.js +13 -57
- package/dist/src/commands/services/actions.js +133 -0
- package/dist/src/commands/services/commerce.js +197 -0
- package/dist/src/commands/services/lifecycle.js +418 -0
- package/dist/src/commands/services/results.js +130 -0
- package/dist/src/commands/services.js +14 -1068
- package/dist/src/commands/skill.js +8 -5
- package/dist/src/commands/vault.js +27 -20
- package/dist/src/commands/vault_handoff.js +18 -0
- package/dist/src/main.js +332 -46
- package/dist/src/render/browser.js +65 -0
- package/dist/src/render/checkout_handoff.js +101 -0
- package/dist/src/render/checkout_plan.js +47 -0
- package/dist/src/render/markdown.js +0 -3
- package/dist/src/render/qr.js +1 -1
- package/dist/src/sell/commands.js +80 -0
- package/dist/src/sell/contract.js +86 -0
- package/dist/src/sell/local.js +260 -0
- package/dist/src/sell/mcp.js +49 -0
- package/dist/src/sell/preview.js +70 -0
- package/dist/src/sell/sync.js +145 -0
- package/dist/src/services/adapter.js +1 -0
- package/dist/src/services/presentation.js +198 -0
- package/dist/src/services/rail/actions.js +51 -0
- package/dist/src/services/rail/adapter.js +36 -0
- package/dist/src/services/rail/aftercare.js +45 -0
- package/dist/src/services/rail/catalog.js +261 -0
- package/dist/src/services/rail/checkout.js +19 -0
- package/dist/src/services/rail/fulfillment.js +76 -0
- package/dist/src/services/rail/guide.js +110 -0
- package/dist/src/services/rail/invocation.js +54 -0
- package/dist/src/services/rail/page.js +76 -0
- package/dist/src/services/rail/pagination.js +6 -0
- package/dist/src/services/rail/query.js +71 -0
- package/dist/src/services/rail/readers.js +107 -0
- package/dist/src/services/rail/reading.js +125 -0
- package/dist/src/services/rail/recovery.js +51 -0
- package/dist/src/services/rail/results.js +378 -0
- package/dist/src/services/rail/review.js +268 -0
- package/dist/src/services/rail/saved.js +49 -0
- package/dist/src/services/rail/wait.js +11 -0
- package/dist/src/services/registry.js +31 -0
- package/dist/src/services/schema.js +21 -0
- package/dist/src/services/shared/envelope.js +184 -0
- package/dist/src/services/shared/input.js +39 -0
- package/dist/src/services/shared/pagination.js +28 -0
- package/dist/src/services/shared/platform.js +365 -0
- package/dist/src/services/shared/refund.js +40 -0
- package/dist/src/services/shared/workflow.js +28 -0
- package/dist/src/state/account_auth.js +354 -0
- package/dist/src/state/cart_session.js +4 -1
- package/dist/src/state/client_context.js +72 -0
- package/dist/src/state/config.js +44 -14
- package/dist/src/state/device_authority.js +402 -72
- package/dist/src/state/task_journal.js +90 -0
- package/docs/agent/buyer/cart-checkout.json +8 -6
- package/docs/agent/buyer/catalog-list.json +29 -9
- package/docs/agent/buyer/identity-and-sessions.json +26 -9
- package/docs/agent/buyer/install-and-setup.json +17 -15
- package/docs/agent/buyer/orders-refunds.json +25 -9
- package/docs/agent/buyer/payment-flow.json +6 -4
- package/docs/agent/buyer/purchased-content.json +18 -4
- package/docs/agent/buyer/quickstart.json +26 -17
- package/docs/agent/buyer/rail-booking.json +176 -0
- package/docs/agent/buyer/rail-fast-checkout.json +48 -0
- package/docs/agent/buyer/render-hosts.json +23 -12
- package/docs/agent/buyer/service-feedback.json +4 -3
- package/docs/cli-reference/agent-types.md +7 -2
- package/docs/cli-reference/commands/aftercare.md +15 -0
- package/docs/cli-reference/commands/auth.md +96 -0
- package/docs/cli-reference/commands/buy.md +2 -1
- package/docs/cli-reference/commands/cart/add.md +5 -1
- package/docs/cli-reference/commands/cart/clear.md +1 -1
- package/docs/cli-reference/commands/cart/index.md +1 -1
- package/docs/cli-reference/commands/cart/next.md +5 -1
- package/docs/cli-reference/commands/cart/remove.md +1 -1
- package/docs/cli-reference/commands/cart/show.md +1 -1
- package/docs/cli-reference/commands/catalog/index.md +1 -1
- package/docs/cli-reference/commands/catalog/list.md +2 -2
- package/docs/cli-reference/commands/checkout.md +12 -2
- package/docs/cli-reference/commands/device.md +18 -11
- package/docs/cli-reference/commands/docs/index.md +1 -1
- package/docs/cli-reference/commands/docs/list.md +1 -1
- package/docs/cli-reference/commands/docs/search.md +1 -1
- package/docs/cli-reference/commands/docs/show.md +1 -1
- package/docs/cli-reference/commands/install.md +8 -6
- package/docs/cli-reference/commands/next.md +1 -1
- package/docs/cli-reference/commands/order.md +1 -1
- package/docs/cli-reference/commands/pay.md +1 -1
- package/docs/cli-reference/commands/readyz.md +11 -11
- package/docs/cli-reference/commands/refund/cancel.md +1 -1
- package/docs/cli-reference/commands/refund/create.md +1 -1
- package/docs/cli-reference/commands/refund/get.md +2 -2
- package/docs/cli-reference/commands/refund/index.md +1 -1
- package/docs/cli-reference/commands/refund/list.md +1 -1
- package/docs/cli-reference/commands/refund/watch.md +1 -1
- package/docs/cli-reference/commands/sell.md +1364 -0
- package/docs/cli-reference/commands/services/action.md +24 -3
- package/docs/cli-reference/commands/services/checkout.md +17 -2
- package/docs/cli-reference/commands/services/events.md +1 -1
- package/docs/cli-reference/commands/services/get.md +4 -2
- package/docs/cli-reference/commands/services/index.md +4 -3
- package/docs/cli-reference/commands/services/invoke.md +6 -4
- package/docs/cli-reference/commands/services/list.md +1 -1
- package/docs/cli-reference/commands/services/next.md +78 -12
- package/docs/cli-reference/commands/services/page.md +71 -0
- package/docs/cli-reference/commands/services/quote.md +4 -4
- package/docs/cli-reference/commands/services/read-result.md +17 -6
- package/docs/cli-reference/commands/services/run.md +152 -0
- package/docs/cli-reference/commands/services/start.md +5 -3
- package/docs/cli-reference/commands/vault/access.md +5 -1
- package/docs/cli-reference/conventions.md +4 -6
- package/docs/cli-reference/index.md +10 -1
- package/docs/sell.md +84 -0
- package/package.json +20 -12
- package/skills/itpay/SKILL.md +112 -102
- package/docs/skill-bundle-rollout/01-mcp-authentication.md +0 -134
- package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +0 -210
- package/docs/skill-bundle-rollout/03-platform-publishing.md +0 -161
- package/docs/skill-bundle-rollout/04-first-wave-platforms.md +0 -69
- package/docs/skill-bundle-rollout/05-sync-operations.md +0 -62
- package/docs/skill-bundle-rollout/README.md +0 -151
- /package/bin/{itp → itp.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
-
"product_scope": "itpay is the single public CLI entry point
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
|
|
5
5
|
"topic": "quickstart",
|
|
6
6
|
"title": "Route One Human Intent Through ItPay",
|
|
7
7
|
"purpose": "Choose the correct first action from the human's words and continue through one authoritative CLI envelope at a time.",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"required_state": {
|
|
13
13
|
"needs": [
|
|
14
14
|
"the real supported Agent Type",
|
|
15
|
-
"one
|
|
15
|
+
"one allowed Backend: production https://app.itpay.ai by default; explicit https://sandbox.itpay.ai or https://dev.itpay.ai for the corresponding test environment"
|
|
16
16
|
],
|
|
17
17
|
"must_not_need": [
|
|
18
18
|
"Admin access",
|
|
@@ -21,29 +21,32 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"intent_routing": {
|
|
24
|
-
"new_service": "
|
|
24
|
+
"new_service": "For other new services, use itpay catalog list --json and the selected input contract.",
|
|
25
25
|
"previous_content": "Use vault list, optionally with the subject as --query.",
|
|
26
26
|
"purchase_history": "Use orders.",
|
|
27
27
|
"refund_or_paid_problem": "Resume the known Order or Refund before creating anything new.",
|
|
28
|
-
"service_feedback": "Finish the original order outcome first, then submit one safe Agent postmortem; include a rating or comment only when the human explicitly gives it.",
|
|
29
|
-
"ambiguous": "Ask whether the human wants an earlier purchase or a new query before calling ItPay."
|
|
28
|
+
"service_feedback": "Finish the original order outcome first, then optionally submit one safe Agent postmortem; include a rating or comment only when the human explicitly gives it.",
|
|
29
|
+
"ambiguous": "Ask whether the human wants an earlier purchase or a new query before calling ItPay.",
|
|
30
|
+
"railway": "Known railway intent: itpay docs show rail-booking. Read once, then follow its Exact/Smart route."
|
|
30
31
|
},
|
|
31
|
-
"commands": [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
"commands": [
|
|
33
|
+
{
|
|
34
|
+
"intent": "continue the selected flow",
|
|
35
|
+
"command": "<execute the exact next.command returned by the previous CLI envelope>",
|
|
36
|
+
"success_signal": "the next envelope reports one current state and at most one preferred action"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
36
39
|
"agent_rules": [
|
|
37
40
|
"Use the CLI as the control surface; infer the human's intent before the first command and never hardcode a service workflow.",
|
|
38
41
|
"Treat result as current facts, instruction as how to use those facts, next as the preferred executable action, and recovery as exceptional paths.",
|
|
39
|
-
"Run one state-changing command at a time. Treat next.command as the preferred continuation: execute it unchanged
|
|
42
|
+
"Run one state-changing command at a time. Treat next.command as the preferred continuation: execute it unchanged only when its required values are already present; fill a non-executable input_template separately only when the current result has not already satisfied the user's goal.",
|
|
40
43
|
"Keep the same explicit Agent Type through next and recovery commands; same-type windows reuse one Backend Agent Instance.",
|
|
41
|
-
"When testing
|
|
42
|
-
"Use --target only for a Host presentation destination.
|
|
43
|
-
"
|
|
44
|
-
"Ask the user for required email or contact values and explain their purpose; never invent them.",
|
|
44
|
+
"When testing sandbox, execute every returned command unchanged so its ITPAY_BACKEND_URL=https://sandbox.itpay.ai prefix is preserved.",
|
|
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
|
+
"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.",
|
|
45
47
|
"Explain useful service facts in ordinary language; never ask the human to run commands or learn internal IDs.",
|
|
46
|
-
"Normal payment uses the returned ItPay Checkout handoff."
|
|
48
|
+
"Normal payment uses the returned ItPay Checkout handoff.",
|
|
49
|
+
"A railway query execution and its separate booking execution may serve one purchase intent; keep both references."
|
|
47
50
|
],
|
|
48
51
|
"forbidden": [
|
|
49
52
|
"Do not invent catalog, variant, offer, capability, result item, order or refund IDs.",
|
|
@@ -51,6 +54,10 @@
|
|
|
51
54
|
"Do not bypass a grant, refund lock, ownership error or compatibility gate."
|
|
52
55
|
],
|
|
53
56
|
"next_docs": [
|
|
57
|
+
{
|
|
58
|
+
"condition": "Known railway request",
|
|
59
|
+
"topic": "rail-booking"
|
|
60
|
+
},
|
|
54
61
|
{
|
|
55
62
|
"condition": "Need service catalog language",
|
|
56
63
|
"topic": "catalog-list"
|
|
@@ -99,5 +106,7 @@
|
|
|
99
106
|
"rating",
|
|
100
107
|
"target",
|
|
101
108
|
"input"
|
|
102
|
-
]
|
|
109
|
+
],
|
|
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": "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."
|
|
103
112
|
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "itp.agent_doc.v1",
|
|
3
|
+
"role": "buyer",
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point, and $itpay is its user-facing Skill invocation. Under that one product entry point, the two top-level commerce actions are buy and sell: Buyer workflows are available now; Seller workflows use the same entry point via itpay sell.",
|
|
5
|
+
"topic": "rail-booking",
|
|
6
|
+
"title": "Railway Query, Planning, and Ticket Booking",
|
|
7
|
+
"purpose": "One railway route from understanding the request to saved results, booking, protected checkout, order status and refunds.",
|
|
8
|
+
"when_to_use": [
|
|
9
|
+
"Any railway schedule, planning or ticket request; read this topic once before the first railway action."
|
|
10
|
+
],
|
|
11
|
+
"goal_and_overview": {
|
|
12
|
+
"route": "Understand endpoints and constraints → 2–4 line route brief → Exact or Smart → read enough saved results for the goal → select under delegation → missing real consent only → official payment entry; show and stop.",
|
|
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
|
+
"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
|
+
"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": "Choosing a candidate or confirming seat/whole-journey terms is not approving price. Read the current scoped approve_purchase template after quote; record true only for genuine matching exact-price or capped-budget approval, or an explicitly authorized official-page confirmation. Reuse matching approval; never fabricate it."
|
|
17
|
+
},
|
|
18
|
+
"flow_at_a_glance": [
|
|
19
|
+
{
|
|
20
|
+
"step": "search Exact",
|
|
21
|
+
"command": "itpay services run itpay-rail --operation query_exact --input-json <query-file> --json",
|
|
22
|
+
"returns": "one station-pair query execution, resolved scope and either useful results or a same-execution wait action",
|
|
23
|
+
"next": "follow the current next command when still working; compare results and stop if the request is satisfied"
|
|
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": "current review revision, material terms and a non-executable confirm_booking input_template",
|
|
53
|
+
"next": "submit the returned actor-type agent template only after genuine consent; reuse an unchanged explicit consent for code-only correction"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"step": "checkout",
|
|
57
|
+
"command": "use the returned next or handoff for the same booking execution",
|
|
58
|
+
"returns": "an official protected payment entry",
|
|
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
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"understand_before_search": [
|
|
69
|
+
"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
|
+
"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
|
+
"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.",
|
|
72
|
+
"12306 https://kyfw.12306.cn/ is the official date/station/train reference; claim a date verified only after reading that date result. 同程 https://www.ly.com/mergeTrain/huochepiao helps identify station pairs and transfer directions. 携程 https://trains.ctrip.com/ is an optional supplement for transfer routes. Knowledge, search snippets and historical timetables do not prove current operation, inventory, price or purchase credentials.",
|
|
73
|
+
"If login, captcha or network blocks the short lookup, stop without repeated troubleshooting or browser installation and state the facts still unknown. Clear double-station endpoints can use Exact to verify direct trains; do not choose Smart merely because a transfer seems probable. A known transfer requirement or supported multi-station/place comparison can use Smart; genuinely unclear place meaning needs human clarification.",
|
|
74
|
+
"Date verification is required; the ItPay query for the actual date can perform it. A 12306 visit is not a mandatory extra call for every order. Valid Smart journeys and credentials do not require routine Exact rechecks of each leg.",
|
|
75
|
+
"Each side independently means area, place or station, giving all nine combinations. An area is not a same-name station; a specific station stays locked until the human consents to changing it. Smart also supports two locked stations when transfers are needed.",
|
|
76
|
+
"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
|
+
"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
|
+
],
|
|
79
|
+
"choose_search": {
|
|
80
|
+
"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
|
+
"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
|
+
"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
|
+
},
|
|
84
|
+
"input_and_expected_result": {
|
|
85
|
+
"exact": {
|
|
86
|
+
"command": "itpay services run itpay-rail --operation query_exact --input-json <query-file> --json",
|
|
87
|
+
"example": {
|
|
88
|
+
"input": {
|
|
89
|
+
"origin": "<已核实出发站>",
|
|
90
|
+
"destination": "<已核实到达站>",
|
|
91
|
+
"travel_date": "<用户出行日期 YYYY-MM-DD>"
|
|
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": "Copy the returned complete interaction.input_template.input, current revision and notice. For a whole journey, each ordered leg has its own seat_type and an object preference per passenger; default auto, never null/string arrays. Use known choices and confirm only missing genuine terms consent or material changes. Set accept_non_guaranteed=true only after real consent; delegation or choosing a train alone is not terms consent. The false default is protection, not a broken template; if consent is missing, ask the returned review.consent_question once. Seat/berth placement requests differ from the whole-journey separate-issuance and partial-outcome terms; use the current notice.",
|
|
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
|
+
},
|
|
137
|
+
"exceptional_branches": {
|
|
138
|
+
"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.",
|
|
139
|
+
"rate_limited": "Respect returned retry_after and continue the same execution.",
|
|
140
|
+
"booking_review_invalid": "Read the same booking review and use the returned seat code; reuse real consent only under the strict equivalent-correction rule.",
|
|
141
|
+
"booking_review_changed": "Read the current revision and compare material terms; confirm new terms only when changed.",
|
|
142
|
+
"selection_stale": "Saved result stays readable, but follow the current owner action for new live inventory and quote evidence; do not assume reread refreshes the token.",
|
|
143
|
+
"unknown_paid_outcome": "Read the same checkout/order before any mutation. Never repeat payment or create a new order on an unknown outcome.",
|
|
144
|
+
"lock": "Use the CLI returned device repair-lock recovery only for a lock proven stale; preserve active owners and identity.",
|
|
145
|
+
"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.",
|
|
146
|
+
"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.",
|
|
147
|
+
"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.",
|
|
148
|
+
"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.",
|
|
149
|
+
"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.",
|
|
150
|
+
"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.",
|
|
151
|
+
"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."
|
|
152
|
+
},
|
|
153
|
+
"search_terms": [
|
|
154
|
+
"rail",
|
|
155
|
+
"railway",
|
|
156
|
+
"train",
|
|
157
|
+
"ticket",
|
|
158
|
+
"火车",
|
|
159
|
+
"火车票",
|
|
160
|
+
"高铁",
|
|
161
|
+
"车票",
|
|
162
|
+
"车次",
|
|
163
|
+
"seat",
|
|
164
|
+
"booking",
|
|
165
|
+
"rail-booking"
|
|
166
|
+
],
|
|
167
|
+
"reading_and_writing": "Use the formal Skill Follow one envelope rules for direct text/file reading, truncation and small JSON input; no parsing scripts.",
|
|
168
|
+
"restore_old_execution": "Only when resuming an existing v4 execution, follow its own declared legacy schema; new queries use the current three-endpoint contract.",
|
|
169
|
+
"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.",
|
|
170
|
+
"actor_conventions": {
|
|
171
|
+
"location_confirmation": "Use the returned human template only for the user's real place choice; no delegated human action.",
|
|
172
|
+
"journey_terms": "workflow:confirm_booking and booking_review_invalid recovery accept agent-reported genuine consent; default false, never infer from purchase delegation.",
|
|
173
|
+
"ordinary_human_action": "Use its published actor rule; do not generalize railway permission.",
|
|
174
|
+
"price_approval": "approve_purchase uses actor-type agent with the unchanged server-scoped approval template and genuine matching approval; candidate choice is not price approval."
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "itp.agent_doc.v1",
|
|
3
|
+
"role": "buyer_agent",
|
|
4
|
+
"product_scope": "itpay_rail",
|
|
5
|
+
"topic": "rail-fast-checkout",
|
|
6
|
+
"title": "Rail Fast Checkout — Delegated Purchase Supplement",
|
|
7
|
+
"purpose": "Short delegated-purchase supplement to rail-booking; host presentation differences only.",
|
|
8
|
+
"when_to_use": [
|
|
9
|
+
"The buyer delegated railway selection and a current bookable result is available. Read rail-booking first."
|
|
10
|
+
],
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"step": "read_full_flow",
|
|
14
|
+
"command": "Use the rail-booking guide already read for this request",
|
|
15
|
+
"notes": [
|
|
16
|
+
"Use the current query result and booking_template; this topic does not replace the railway guide.",
|
|
17
|
+
"Before first querying, follow the single endpoint-understanding brief in rail-booking (meaning/category/evidence/unknowns and Exact/Smart choice). Use reliable route knowledge or one short lookup if merely probable. With current results, continue from their facts; do not restart to backfill a brief."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"step": "continue_delegated_booking",
|
|
22
|
+
"command": "Use the current result’s booking_template and returned next action",
|
|
23
|
+
"notes": [
|
|
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; raw legs are single-leg compatibility only, multi-leg purchases require the complete selections template; one whole quote and official payment entry, separate issuance. Use the returned full review JSON; only missing real agreement requires asking."
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"step": "present_host_handoff",
|
|
30
|
+
"command": "Use the current Host handoff",
|
|
31
|
+
"notes": [
|
|
32
|
+
"Show only the supported official entry. Read itpay order <order_id> --json after payment for authoritative status; issuing is not issued."
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"never": [
|
|
37
|
+
"Never invent consent, identity or a seat code.",
|
|
38
|
+
"Never duplicate a purchase or repeat an unknown-outcome payment.",
|
|
39
|
+
"Never show an internal command to the human.",
|
|
40
|
+
"When a failure has no applicable next, interaction, recovery or complete new-query template, stop; never guess undeclared fields, duplicate a booking, split a journey into separate payments or claim an unverified cause."
|
|
41
|
+
],
|
|
42
|
+
"search_terms": [
|
|
43
|
+
"fast checkout",
|
|
44
|
+
"快速下单",
|
|
45
|
+
"一键购票",
|
|
46
|
+
"rail checkout recipe"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "itp.agent_doc.v1",
|
|
3
3
|
"role": "buyer",
|
|
4
|
-
"product_scope": "itpay is the single public CLI entry point
|
|
4
|
+
"product_scope": "itpay is the single public CLI entry point for Buyer services and the existing itpay sell Seller workflow; $itpay is its user-facing Skill invocation.",
|
|
5
5
|
"topic": "render-hosts",
|
|
6
6
|
"title": "Agent Type And Human Handoff Rendering",
|
|
7
7
|
"purpose": "Use only the handoff fields returned for the current Agent Type and make Checkout or read authorization genuinely visible on that surface.",
|
|
@@ -33,12 +33,17 @@
|
|
|
33
33
|
{
|
|
34
34
|
"agent_type": "workbuddy",
|
|
35
35
|
"default_host": "plain-chat",
|
|
36
|
-
"responsibility": "execute handoff.agent_action exactly once to open the fully rendered handoff.url with present_files; show the amount and stop"
|
|
36
|
+
"responsibility": "execute handoff.agent_action exactly once to open the fully rendered handoff.url with present_files, then send handoff.mobile_url as a clickable link that jumps straight into Alipay or WeChat Pay on a phone; show the amount and stop"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"agent_type": "zcode",
|
|
40
40
|
"default_host": "plain-chat",
|
|
41
|
-
"responsibility": "open handoff.url immediately in the ZCode built-in browser
|
|
41
|
+
"responsibility": "open handoff.url immediately in the ZCode built-in browser, also send handoff.mobile_url as the phone-friendly entry, then stop; when the built-in browser is unavailable show both clickable links"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"agent_type": "doubao-work",
|
|
45
|
+
"default_host": "plain-chat",
|
|
46
|
+
"responsibility": "show handoff.mobile_url as the preferred same-phone checkout or authorization link and handoff.qr_image_url as the labeled save-or-scan fallback; state the amount for Checkout and stop"
|
|
42
47
|
},
|
|
43
48
|
{
|
|
44
49
|
"agent_type": "kimi-code",
|
|
@@ -49,7 +54,9 @@
|
|
|
49
54
|
"agent_type": "openclaw",
|
|
50
55
|
"default_host": null,
|
|
51
56
|
"host_required": true,
|
|
52
|
-
"native_hosts": [
|
|
57
|
+
"native_hosts": [
|
|
58
|
+
"telegram"
|
|
59
|
+
],
|
|
53
60
|
"responsibility": "pass the native OpenClaw entry target explicitly; for Telegram execute handoff.agent_action unchanged, then treat itp:grant_confirmed callbacks only as permission to query the same Checkout and follow Backend grant state; otherwise show the returned HTTPS QR image and Checkout URL"
|
|
54
61
|
}
|
|
55
62
|
],
|
|
@@ -66,20 +73,23 @@
|
|
|
66
73
|
}
|
|
67
74
|
],
|
|
68
75
|
"agent_rules": [
|
|
69
|
-
"Agent Type is stable identity; Host is presentation and may be explicitly overridden.",
|
|
70
|
-
"A local QR path is not visible until a desktop Agent attaches or renders that file on the human-facing surface; WorkBuddy
|
|
71
|
-
"For workbuddy with plain-chat, execute handoff.agent_action exactly once; it calls present_files with handoff.url as the only files element and opens the rendered Card Link in the right-side browser.",
|
|
72
|
-
"For zcode with plain-chat, open handoff.url in the built-in browser.
|
|
73
|
-
"
|
|
74
|
-
"
|
|
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 with plain-chat, execute handoff.agent_action exactly once; it calls present_files with handoff.url as the only files element and opens the rendered Card Link in the right-side browser, then send handoff.mobile_url so phone users can tap straight into Alipay or WeChat Pay.",
|
|
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.",
|
|
75
84
|
"IM Hosts that require a target must receive --target before Checkout creation. OpenClaw has no default Host; Kimi Code uses terminal.",
|
|
76
|
-
"OpenClaw Telegram uses flat url/value buttons for deployed-version compatibility. A grant_confirmed callback carries only the Checkout ID, never a display token, and never proves payment or an active grant."
|
|
85
|
+
"OpenClaw Telegram uses flat url/value buttons for deployed-version compatibility. A grant_confirmed callback carries only the Checkout ID, never a display token, and never proves payment or an active grant.",
|
|
86
|
+
"Business flow is the same across hosts. Vault grants apply only to protected purchased-content access, not every railway step."
|
|
77
87
|
],
|
|
78
88
|
"forbidden": [
|
|
79
89
|
"Do not expose display tokens separately from the tokenized Checkout handoff.",
|
|
80
90
|
"Do not print base64 images, mirror lists, renderer debug state, or provider QR URLs.",
|
|
81
91
|
"Do not claim a desktop attachment exists when only a filesystem path was printed.",
|
|
82
|
-
"
|
|
92
|
+
"For Checkout Card Link, do not use present_files for a local file, QR PNG, downloaded copy or rebuilt URL. Auth login is separate: use its actual handoff capabilities and returned local QR when supported; never rebuild it."
|
|
83
93
|
],
|
|
84
94
|
"next_docs": [
|
|
85
95
|
{
|
|
@@ -99,6 +109,7 @@
|
|
|
99
109
|
"desktop",
|
|
100
110
|
"workbuddy",
|
|
101
111
|
"zcode",
|
|
112
|
+
"doubao work",
|
|
102
113
|
"kimi code",
|
|
103
114
|
"openclaw",
|
|
104
115
|
"telegram"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"purpose": "Finish the original order outcome first, then persist safe process context and any explicit human rating or comment without exposing commands or internal identifiers.",
|
|
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
|
-
"A paid result has actually been delivered and the CLI instruction
|
|
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
13
|
"intent_routing": {
|
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
"agent_rules": [
|
|
28
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
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
|
-
"
|
|
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
31
|
"Use only the human's own words plus safe order context. Never upload the conversation, prompt, diagnostics, contact details, tokens, internal identities, provider responses, or purchased payload.",
|
|
32
32
|
"A successful feedback submission does not promise a reply, resolution, refund, or order change.",
|
|
33
|
-
"If submission outcome is unknown, stop and explain that recording could not be confirmed; never retry automatically."
|
|
33
|
+
"If submission outcome is unknown, stop and explain that recording could not be confirmed; never retry automatically.",
|
|
34
|
+
"Feedback follows a real outcome within the user’s authorization; never submit private raw logs, credentials, tokens or traveler identity."
|
|
34
35
|
],
|
|
35
36
|
"human_language": {
|
|
36
37
|
"success": "Your feedback has been recorded. Thank you.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Type And Host Contract
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
`--agent-type` 表示哪类运行时在运行 CLI,用于 Agent 实例归属和定制 instruction。`--host` 表示输出展示在哪里;`--target` 只是在某些 Host 中指定 chat/channel/open ID。三者不可混用,窗口、任务和对话也不是身份。
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
| `claude-code-cli` | `terminal` | 在用户可见终端输出二维码和官方链接,不声称已在桌面对话展示。 |
|
|
17
17
|
| `workbuddy` | `plain-chat` | 返回完整渲染的 HTML Card Link 和可原样执行的 `present_files` action;立即打开 Card Link,不返回或检查本地图片路径。 |
|
|
18
18
|
| `zcode` | `plain-chat` | 返回完整渲染的官方 URL;立即用 ZCode 内置浏览器打开,不只粘贴文字链接,也不返回或重建二维码图片。 |
|
|
19
|
+
| `doubao-work` | `plain-chat` | 同时返回手机直达收银台链接和官方二维码图片链接;在豆包工作对话中明确标注两者,说明金额后停止等待。 |
|
|
19
20
|
| `kimi-code` | `terminal` | 使用标准 CLI 引导,在用户可见终端渲染二维码和付款链接。 |
|
|
20
21
|
| `openclaw` | 无;必须显式传入 | `--host telegram` 使用 OpenClaw 原生 `message` action;其他入口返回标准 HTTPS 二维码和付款链接。 |
|
|
21
22
|
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
- OpenClaw 的 IM Host 必须提供 `--target`。缺失时在任何 Checkout 创建前返回 `target_required`。
|
|
35
36
|
- `kimi-code` 是 CLI 型 Agent,复用 `terminal` Host 和现有 CLI 展示,不增加 Kimi 专属交易协议。
|
|
36
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`。
|
|
37
39
|
- session 失效时 CLI 只续期并重试原请求一次;再次失败立即返回。revoked v2 Device 不自动换身份。
|
|
38
40
|
- 同一 Device 首次登记新的 Agent Type 时,CLI 只使用本地已登记且 Backend 仍接受的既有 Agent Instance 完成签名登记;被撤销的 Instance 会被跳过且不会恢复。若没有任何既有 Instance 可用,CLI 必须停止,不得重新登记 Device、旋转私钥或借用其他 Backend。
|
|
39
41
|
|
|
@@ -79,6 +81,7 @@ URL 内 credential 不得被提取、单独输出、记录或重建。
|
|
|
79
81
|
| `claude-code-cli / terminal` | `url`;非 JSON 输出另外渲染终端二维码 |
|
|
80
82
|
| `workbuddy / plain-chat` | `url, agent_action`(`present_files(files=[url])`,打开完整渲染的 HTML Card Link) |
|
|
81
83
|
| `zcode / plain-chat` | `url`(立即用 ZCode 内置浏览器打开;不返回图片或平台私有 action) |
|
|
84
|
+
| `doubao-work / plain-chat` | `url, qr_image_url`(`url` 是本机直接打开的首选入口;`qr_image_url` 是保存或由另一台设备扫码的备用入口) |
|
|
82
85
|
| `kimi-code / terminal` | `url`;非 JSON 输出另外渲染终端二维码 |
|
|
83
86
|
| `openclaw / telegram` | `url, qr_image_url, agent_action` |
|
|
84
87
|
| `openclaw / other` | `url, qr_image_url` |
|
|
@@ -87,6 +90,8 @@ WorkBuddy instruction 必须要求 Agent 原样执行一次 `handoff.agent_actio
|
|
|
87
90
|
|
|
88
91
|
ZCode instruction 必须明确要求 Agent 立即用内置浏览器打开 `handoff.url`,确认已发起打开后说明金额并停止。不得只把 URL 当作文字粘贴给用户,也不得下载、解析或重建二维码。只有内置浏览器明确不可用时,才把同一个 `handoff.url` 作为可点击链接展示。CLI 不猜测或输出 ZCode 私有工具调用 JSON。
|
|
89
92
|
|
|
93
|
+
Doubao Work instruction 必须要求 Agent 在当前对话中展示两个有标签的官方入口:优先展示“手机直接打开收银台”对应的 `handoff.url`,再展示“二维码图片(保存或用另一台设备扫码)”对应的 `handoff.qr_image_url`。说明金额后停止等待;不得解析 URL 中的 credential、下载或重建二维码、调用 `pay`,也不得创建替代 Checkout。
|
|
94
|
+
|
|
90
95
|
OpenClaw Telegram 的 `handoff.agent_action` 是可原样执行的原生 `message` tool action。`presentation` 只包含标准 `blocks.buttons`:`📱 手机点这儿支付` 使用扁平 `url`,`📋 已授权给我读` 使用扁平 `value=itp:grant_confirmed:<checkout_id>`;二维码单独使用 action 的 `media`。CLI `instruction` 必须要求 Agent 原样执行该 action,不得改写 Presentation、换用其他消息工具或声称普通文本回复等同于已发送按钮。收到授权 callback 后立即执行 `next.command` 查询同一 Checkout,再只跟随后端返回的同一 Execution grant 流程;callback 只携带 Checkout ID,不携带 display token,也不证明付款或 grant 已生效。OpenClaw `target` 使用原生 chat target(如 `5559456744` 或 `-1001234567890:topic:42`),不添加 `telegram:` 前缀。
|
|
91
96
|
|
|
92
97
|
### Purchased-content authorization
|
|
@@ -94,7 +99,7 @@ OpenClaw Telegram 的 `handoff.agent_action` 是可原样执行的原生 `messag
|
|
|
94
99
|
`vault access` 使用相同字段集合,但不包含金额、Checkout ID、付款状态或付款
|
|
95
100
|
查询命令。桌面 handoff 的 Markdown 标题和链接必须明确为“授权查看已购
|
|
96
101
|
内容”;Terminal 显示授权二维码;WorkBuddy 用 `present_files` 打开完整
|
|
97
|
-
`handoff.url`;ZCode 用内置浏览器打开完整 `handoff.url`;OpenClaw 使用返回的图片/原生 action。
|
|
102
|
+
`handoff.url`;ZCode 用内置浏览器打开完整 `handoff.url`;Doubao Work 同时展示授权链接和官方二维码图片链接;OpenClaw 使用返回的图片/原生 action。
|
|
98
103
|
|
|
99
104
|
授权 handoff 展示后 `next=null`。用户明确表示已完成时,Agent只重新执行
|
|
100
105
|
产生授权要求的原始 `vault list`、`orders` 或 `vault read`,不得再次执行
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# `itpay aftercare`
|
|
2
|
+
|
|
3
|
+
Railway manual refund/change intake; ordinary service refunds retain `itpay refund`.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
itpay aftercare list --order <order_id> --json
|
|
7
|
+
itpay aftercare create --order <order_id> --input-json <file> --json
|
|
8
|
+
itpay aftercare get <case_id> --json
|
|
9
|
+
itpay aftercare respond <case_id> --input-json <file> --json
|
|
10
|
+
itpay aftercare cancel <case_id> --input-json <file> --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`list` returns the complete current JSON templates, original safe journey and available ticket targets. Indices start at zero. Use user-selected targets; do not guess supplier IDs or money. Only real scope consent sets `user_confirmed_scope=true`.
|
|
14
|
+
|
|
15
|
+
`get` shows original immutable request, history, supplier facts and separate money state. Pending/manual intake does not authorize financial execution. A current change proposal must be explicitly accepted using its returned revision; the original purchase consent is insufficient. Fees are coordinated manually, with no automatic payment link. Cancellation cannot undo supplier or money operations already started. Platform content locks remain; safe remaining-ticket status is a separate authorized read.
|