@itpay/cli 0.2.16 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -447
- package/bin/itp +1 -150
- package/dist/src/client/backend.js +154 -0
- package/dist/src/client/http.js +76 -0
- package/dist/src/client/types.js +4 -0
- package/dist/src/commands/buy.js +351 -0
- package/dist/src/commands/cart.js +264 -0
- package/dist/src/commands/catalog.js +26 -0
- package/dist/src/commands/checkout.js +106 -0
- package/dist/src/commands/docs.js +61 -0
- package/dist/src/commands/guidance.js +422 -0
- package/dist/src/commands/install.js +95 -0
- package/dist/src/commands/order.js +78 -0
- package/dist/src/commands/orders.js +22 -0
- package/dist/src/commands/pay.js +26 -0
- package/dist/src/commands/readyz.js +8 -0
- package/dist/src/commands/refund.js +20 -0
- package/dist/src/commands/services.js +317 -0
- package/dist/src/main.js +606 -0
- package/dist/src/render/feishu.js +201 -0
- package/dist/src/render/ide.js +321 -0
- package/dist/src/render/index.js +57 -0
- package/dist/src/render/interaction.js +49 -0
- package/dist/src/render/markdown.js +83 -0
- package/dist/src/render/output.js +42 -0
- package/dist/src/render/plain_chat.js +60 -0
- package/dist/src/render/plan.js +31 -0
- package/dist/src/render/qr.js +32 -0
- package/dist/src/render/sink.js +6 -0
- package/dist/src/render/status.js +37 -0
- package/dist/src/render/telegram.js +172 -0
- package/dist/src/render/terminal.js +148 -0
- package/dist/src/render/terminal_image.js +19 -0
- package/dist/src/state/cart_session.js +151 -0
- package/dist/src/state/client_context.js +73 -0
- package/dist/src/state/config.js +82 -0
- package/dist/src/state/device_authority.js +217 -0
- package/dist/src/state/operation_journal.js +80 -0
- package/docs/agent/buyer/cart-checkout.json +56 -94
- package/docs/agent/buyer/catalog-list.json +47 -0
- package/docs/agent/buyer/install-and-setup.json +82 -0
- package/docs/agent/buyer/orders-refunds.json +76 -0
- package/docs/agent/buyer/payment-flow.json +77 -0
- package/docs/agent/buyer/quickstart.json +143 -75
- package/docs/agent/buyer/render-hosts.json +79 -0
- package/package.json +32 -13
- package/skills/itpay-buyer/SKILL.md +107 -238
- package/docs/agent/buyer/account-portal.json +0 -81
- package/docs/agent/buyer/catalog-search.json +0 -106
- package/docs/agent/buyer/human-claim-ui.json +0 -77
- package/docs/agent/buyer/payment-qr.json +0 -97
- package/docs/agent/buyer/payment-wait.json +0 -84
- package/docs/agent/buyer/product-recommendation.json +0 -80
- package/docs/agent/buyer/qr-refresh.json +0 -67
- package/docs/agent/buyer/recovery.json +0 -85
- package/docs/agent/buyer/safety-policy.json +0 -70
- package/docs/agent/buyer/secure-delivery.json +0 -90
- package/docs/agent/buyer/vault-agent-read.json +0 -95
- package/install.ps1 +0 -65
- package/install.sh +0 -66
- package/lib/account-status.js +0 -157
- package/lib/buyer.js +0 -2332
- package/lib/client-context.js +0 -126
- package/lib/docs.js +0 -200
- package/lib/env.js +0 -723
- package/lib/http.js +0 -151
- package/lib/ops.js +0 -135
- package/lib/render-human.js +0 -718
- package/lib/runtime.js +0 -1456
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "human-claim-ui",
|
|
5
|
-
"title": "Human Claim UI",
|
|
6
|
-
"purpose": "Explain the human-only claim page boundary to an agent.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"The human received a secure delivery email.",
|
|
9
|
-
"The user asks why the agent cannot see the key.",
|
|
10
|
-
"The delivery status says claim_link_sent or check_email."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"delivery status or human email"
|
|
15
|
-
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
-
"claim token in agent context",
|
|
18
|
-
"raw content in CLI output"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"commands": [
|
|
22
|
-
{
|
|
23
|
-
"intent": "show agent-safe delivery status only",
|
|
24
|
-
"command": "itp buyer deliveries list --checkout <checkout_id> --host <client> --json",
|
|
25
|
-
"success_signal": "response.secrets.raw_content_included == false"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"intent": "check whether the human has granted this agent a scoped view",
|
|
29
|
-
"command": "itp buyer vault grants list --checkout <checkout_id> --host <client> --json",
|
|
30
|
-
"success_signal": "count > 0 means the human approved agent-readable access for this exact agent device"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"agent_rules": [
|
|
34
|
-
"The human claim page is for the human buyer, not the agent.",
|
|
35
|
-
"The claim link is short-lived and single-use.",
|
|
36
|
-
"The agent may explain that ItPay intentionally separates agent operations from raw secret access.",
|
|
37
|
-
"If the human wants the agent to analyze or use the delivered result, ask them to click 'Give to Agent / 一键给 Agent' in the ItPay page and confirm with Passkey.",
|
|
38
|
-
"Use clear user guidance: open the ItPay email or order/claim page, find 'Give to Agent / 一键给 Agent', select the fields the agent may read, then confirm with Passkey/WebAuthn.",
|
|
39
|
-
"Tell the user they do not need to copy claim links, tokens, portal text, grant ids, or raw results into chat. The agent will discover the grant with CLI after approval.",
|
|
40
|
-
"After the human grants access, the agent should discover the grant with `itp buyer vault grants list --checkout <checkout_id> --host <client> --json`; do not ask the human to paste the grant id. The CLI restores the buyer agent session from the checkout auth handoff when possible.",
|
|
41
|
-
"If `buyer vault grants list` returns buyer_session.status=buyer_session_saved, the agent should proceed with the returned grant list; the saved session is intentionally not printed.",
|
|
42
|
-
"If the human later wants the agent to install or use something, wait for an explicit human-granted install/capability flow."
|
|
43
|
-
],
|
|
44
|
-
"forbidden": [
|
|
45
|
-
"Do not ask the human to paste the claim link or key into chat.",
|
|
46
|
-
"Do not fetch the claim page with CLI, curl, browser automation, or an agent tool.",
|
|
47
|
-
"Do not ask the human for auth session IDs, display tokens, buyer session tokens, or portal tokens.",
|
|
48
|
-
"Do not store raw content in local run files."
|
|
49
|
-
],
|
|
50
|
-
"next_docs": [
|
|
51
|
-
{
|
|
52
|
-
"condition": "The human wants to view their account or other orders later",
|
|
53
|
-
"topic": "account-portal",
|
|
54
|
-
"command": "itp docs show account-portal --role buyer --json"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"condition": "The human approved agent-readable fields",
|
|
58
|
-
"topic": "vault-agent-read",
|
|
59
|
-
"command": "itp docs show vault-agent-read --role buyer --json"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"condition": "The user asks why this boundary exists",
|
|
63
|
-
"topic": "safety-policy",
|
|
64
|
-
"command": "itp docs show safety-policy --role buyer --json"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"search_terms": [
|
|
68
|
-
"claim ui",
|
|
69
|
-
"claim page",
|
|
70
|
-
"human",
|
|
71
|
-
"single use",
|
|
72
|
-
"reveal",
|
|
73
|
-
"领取页",
|
|
74
|
-
"人类",
|
|
75
|
-
"查看密钥"
|
|
76
|
-
]
|
|
77
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "payment-qr",
|
|
5
|
-
"title": "Payment QR Display",
|
|
6
|
-
"purpose": "Teach the agent how to present ItPay-hosted human QR images without corrupting or replacing them.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"Checkout returns human_action.kind=auth_qr for the first-purchase auth-to-payment entry.",
|
|
9
|
-
"PaymentIntent has been created.",
|
|
10
|
-
"The CLI returned human_action.kind=payment_qr, qr_png_url, preferred_qr_url, or qr_image_url.",
|
|
11
|
-
"The human needs to scan with the payment provider."
|
|
12
|
-
],
|
|
13
|
-
"required_state": {
|
|
14
|
-
"needs": [
|
|
15
|
-
"payment_intent_id",
|
|
16
|
-
"human_action",
|
|
17
|
-
"qr_png_url/preferred_qr_url or local_qr_path"
|
|
18
|
-
],
|
|
19
|
-
"must_not_need": [
|
|
20
|
-
"raw provider QR",
|
|
21
|
-
"provider sign",
|
|
22
|
-
"ops token"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"commands": [
|
|
26
|
-
{
|
|
27
|
-
"intent": "create payment intent through the high-level buy flow",
|
|
28
|
-
"command": "itp buy <variant_id> --email <buyer_email> --phone <buyer_phone> --display agent --no-wait-payment --host <client> --json",
|
|
29
|
-
"success_signal": "response.status is payment_handoff_required; for OpenClaw Telegram, execute response.agent_action.command or response.agent_action.argv before any normal reply or status check"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"intent": "recover a scanner order-not-found display problem",
|
|
33
|
-
"command": "itp buyer payment refresh-qr <payment_intent_id> --reason order-not-found --display agent --host <client> --json",
|
|
34
|
-
"success_signal": "response.payment_intent.human_action.local_qr_path or response.payment_intent.qr_png_url is present and status is still waiting_user_payment or verified"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"agent_rules": [
|
|
38
|
-
"Every non-doc ItPay command must include current client context. Use --host codex/claude-code/terminal/plain-chat, or for OpenClaw Telegram use --host telegram --target <inbound_meta.chat_id>. --host is the human-visible client/surface, not where the shell command runs; in Codex desktop chat use --host codex even when calling itp through shell.",
|
|
39
|
-
"If ItPay returns client_context_required or client_target_required, rerun the same command with the requested --host/--target before doing anything else.",
|
|
40
|
-
"If human_action.kind is auth_qr, present the ItPay first-purchase entry URL/QR and explain it starts account login/registration/profile authorization and should continue to payment for the same checkout after approval.",
|
|
41
|
-
"For auth_qr, the ItPay auth entry is the primary handoff. oauth_start_url is fallback/debug and should not replace the ItPay orchestration page.",
|
|
42
|
-
"For auth_qr, do not call payment-intent creation directly or create a new checkout; poll checkout or run buyer checkout resume until payment_intent_id appears.",
|
|
43
|
-
"Payment QR display requires both a valid/saved buyer session and payment_intent_id. If payment_intent_id appears before buyer_session is saved, run buyer checkout resume/status instead of showing payment QR.",
|
|
44
|
-
"Do not stop after showing auth_qr unless the human explicitly asks you to pause. Keep waiting/resuming the same checkout so the post-auth payment handoff can continue.",
|
|
45
|
-
"Do not describe auth_qr as payment success or payment proof. Only payment_intent.verified proves payment.",
|
|
46
|
-
"If response.agent_action is present, it is the mandatory execution path. Execute it before any normal prose reply or next ItPay command: command/argv for Telegram or terminal, markdown for Codex/Claude Code app clients.",
|
|
47
|
-
"In OpenClaw Telegram, response.agent_action is already the exact openclaw message send command. Do not rebuild it, do not summarize it, and do not rewrite it into a custom table.",
|
|
48
|
-
"If response.agent_action cannot be executed or made visible to the human, stop and tell the human what capability is missing. Do not fall back to handmade prose.",
|
|
49
|
-
"response.agent_instruction is natural-language reinforcement for the agent; it does not replace response.agent_action.",
|
|
50
|
-
"Telegram native buttons require openclaw message send --presentation; presentation.blocks[].type=\"buttons\" uses native text/url/callback_data. Do not simulate buttons in normal prose.",
|
|
51
|
-
"If agent_instruction links/buttons include URLs, include the real URL. Do not only show the link label.",
|
|
52
|
-
"In Codex or Claude Code app clients, send response.agent_action.markdown first. Once it is visible in the current chat, immediately run response.after_visible_action.command once; do not start a hidden wait before the human-visible message is sent.",
|
|
53
|
-
"For Telegram-style message clients, send photo media first, include links, and expose native buttons for refresh/status when the adapter supports them.",
|
|
54
|
-
"For plain chat clients, show response.agent_instruction.message/links and stop unless the human asks you to check status or returns with a payment question.",
|
|
55
|
-
"When response.status is payment_handoff_required, response.next describes the current client handoff. For Codex/Claude Code, send the markdown and then run after_visible_action once if visible; for plain chat, stop for the human.",
|
|
56
|
-
"MUST show local_qr_path first when present. Many agent clients do not reliably render remote QR images; local_qr_path is the most reliable desktop/chat display artifact.",
|
|
57
|
-
"If local_qr_path is not present, show qr_png_url or preferred_qr_url as the primary scannable QR. This is an ItPay-hosted human QR image; it may render the native provider payment code for scanner reliability, but the agent must not request or decode the raw provider payload.",
|
|
58
|
-
"Use qr_image_url/SVG only as a fallback when PNG/local rendering is unavailable.",
|
|
59
|
-
"For mobile users, present mobile_wallet_url as a clickable payment button when present.",
|
|
60
|
-
"payment_entry_url is the stable ItPay status/payment page. qr_png_url/local_qr_path is usually the better desktop scanner artifact.",
|
|
61
|
-
"The provider can briefly show order not found even after precreate succeeded. Tell the human to wait 30-60 seconds and retry the same QR/page. Do not create a new checkout, do not create a new payment intent, and do not repeatedly refresh unless the ItPay page or CLI explicitly asks for recovery.",
|
|
62
|
-
"Opening the payment page must not be treated as paid.",
|
|
63
|
-
"Do not run payment wait before the QR/link has been sent to the human. If response.after_visible_action.command exists and you can confirm the handoff is visible, run it once by default; if unsure, stop and wait for the human.",
|
|
64
|
-
"If response.after_visible_action was not run, or after the human says they paid/clicks a platform status button later, run response.after_human_response.check_payment_command for the same payment_intent_id."
|
|
65
|
-
],
|
|
66
|
-
"forbidden": [
|
|
67
|
-
"Do not encode payment_entry_url into a new QR yourself when qr_png_url/local_qr_path is available.",
|
|
68
|
-
"Do not encode mobile_wallet_url into a new QR yourself.",
|
|
69
|
-
"Do not request or display raw provider QR payloads.",
|
|
70
|
-
"Do not bypass the ItPay auth orchestration page by making oauth_start_url the primary user-facing link.",
|
|
71
|
-
"Do not rewrite, shorten, summarize, or translate QR URLs.",
|
|
72
|
-
"Do not expose raw provider QR payload in chat.",
|
|
73
|
-
"Do not treat QR display as payment success."
|
|
74
|
-
],
|
|
75
|
-
"next_docs": [
|
|
76
|
-
{
|
|
77
|
-
"condition": "QR is visible to the human",
|
|
78
|
-
"topic": "payment-wait",
|
|
79
|
-
"command": "itp docs show payment-wait --role buyer --json"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"condition": "the payment provider says order not found after waiting on the same QR/page",
|
|
83
|
-
"topic": "qr-refresh",
|
|
84
|
-
"command": "itp docs show qr-refresh --role buyer --json"
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
"search_terms": [
|
|
88
|
-
"qr",
|
|
89
|
-
"payment qr",
|
|
90
|
-
"alipay",
|
|
91
|
-
"scan",
|
|
92
|
-
"order not found",
|
|
93
|
-
"二维码",
|
|
94
|
-
"扫码",
|
|
95
|
-
"付款码"
|
|
96
|
-
]
|
|
97
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "payment-wait",
|
|
5
|
-
"title": "Payment Wait Contract",
|
|
6
|
-
"purpose": "Teach the agent to wait for human payment through the ItPay event wait contract instead of sleeping or guessing.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"The human is scanning or paying.",
|
|
9
|
-
"PaymentIntent status is waiting_user_payment.",
|
|
10
|
-
"The CLI returned agent_wait metadata."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"payment_intent_id"
|
|
15
|
-
],
|
|
16
|
-
"optional": [
|
|
17
|
-
"cursor"
|
|
18
|
-
],
|
|
19
|
-
"must_not_need": [
|
|
20
|
-
"ops token",
|
|
21
|
-
"provider query permission",
|
|
22
|
-
"human text proof"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"commands": [
|
|
26
|
-
{
|
|
27
|
-
"intent": "wait for payment verified event",
|
|
28
|
-
"command": "itp buyer payment wait <payment_intent_id> --timeout 1 --host <client> --json",
|
|
29
|
-
"success_signal": "response.payment_event.event_type is payment_intent.verified or wait.timeout"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"intent": "resume checkout after verified event",
|
|
33
|
-
"command": "itp buyer checkout status <checkout_id> --host <client> --json",
|
|
34
|
-
"success_signal": "response.delivery.status or response.checkout.status is returned"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"agent_rules": [
|
|
38
|
-
"Every payment wait/status command must include the same client context as the handoff command. For OpenClaw Telegram, keep --host telegram --target <same chat_id>.",
|
|
39
|
-
"If payment wait returns payment_handoff_required with response.agent_action, execute it before any later status check: command/argv for Telegram or terminal, markdown for Codex/Claude Code app clients. If only response.agent_instruction is present, follow it exactly before any later status check.",
|
|
40
|
-
"Start payment status checks only after the QR image/link has already been sent to the human. In Codex/Claude Code app clients, after_visible_action.command is the default one-round status check once the handoff is visible.",
|
|
41
|
-
"If you run payment wait without a short timeout while payment is still pending, CLI returns payment_handoff_required and the human handoff instruction instead of long-polling.",
|
|
42
|
-
"Payment wait/status check is a recovery loop around the same payment_intent_id, not a one-shot command.",
|
|
43
|
-
"wait.timeout is a heartbeat, not a payment failure.",
|
|
44
|
-
"In Codex or Claude Code app clients, after showing QR and confirming it is visible, run after_visible_action.command once. If it times out, explain that the same QR/link remains valid and pause for the human or continue only if they ask.",
|
|
45
|
-
"Continue checking the same payment_intent_id unless the user explicitly cancels or asks you to pause.",
|
|
46
|
-
"If the network drops, the process is interrupted, or there is no response, rerun payment wait with the same payment_intent_id or run checkout status/resume with the same checkout_id.",
|
|
47
|
-
"If status is unclear, tell the human it is unclear and continue querying the same payment_intent_id/checkout_id. Do not create a new checkout.",
|
|
48
|
-
"Payment success is payment_intent.verified only.",
|
|
49
|
-
"Human text such as 'I paid' is not proof; continue waiting until payment_intent.verified.",
|
|
50
|
-
"After verified, poll checkout or delivery status."
|
|
51
|
-
],
|
|
52
|
-
"forbidden": [
|
|
53
|
-
"Do not accept 'I paid' as proof.",
|
|
54
|
-
"Do not run provider query recovery from buyer flow.",
|
|
55
|
-
"Do not create a duplicate checkout merely because one wait cycle timed out.",
|
|
56
|
-
"Do not call worker run-once."
|
|
57
|
-
],
|
|
58
|
-
"next_docs": [
|
|
59
|
-
{
|
|
60
|
-
"condition": "payment_intent.verified received",
|
|
61
|
-
"topic": "secure-delivery",
|
|
62
|
-
"command": "itp docs show secure-delivery --role buyer --json"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"condition": "wait timeout or interrupted agent run",
|
|
66
|
-
"topic": "recovery",
|
|
67
|
-
"command": "itp docs show recovery --role buyer --json"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"search_terms": [
|
|
71
|
-
"wait",
|
|
72
|
-
"long poll",
|
|
73
|
-
"timeout",
|
|
74
|
-
"still waiting",
|
|
75
|
-
"paid",
|
|
76
|
-
"payment",
|
|
77
|
-
"等待",
|
|
78
|
-
"付款",
|
|
79
|
-
"付款成功",
|
|
80
|
-
"没返回",
|
|
81
|
-
"一直等",
|
|
82
|
-
"超时"
|
|
83
|
-
]
|
|
84
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "product-recommendation",
|
|
5
|
-
"title": "Product Recommendation Rules",
|
|
6
|
-
"purpose": "Help the agent explain public product variants before checkout without overclaiming fulfillment or payment status.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"The user asks what to buy.",
|
|
9
|
-
"Catalog search returned multiple variants.",
|
|
10
|
-
"The user's request is fuzzy, such as company lookup, identity verification, phone verification, low budget, premium skin, or ten draw."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"catalog product or search result"
|
|
15
|
-
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
-
"buyer profile values",
|
|
18
|
-
"payment status",
|
|
19
|
-
"raw delivery content"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"commands": [
|
|
23
|
-
{
|
|
24
|
-
"intent": "refresh exact product detail before recommendation",
|
|
25
|
-
"command": "itp buyer catalog get --variant <variant_id> --host <client> --json",
|
|
26
|
-
"success_signal": "response.product.variants includes current price and availability"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"agent_rules": [
|
|
30
|
-
"Map user intent to the variant description and price.",
|
|
31
|
-
"Catalog JSON money fields use minor units. For CNY, amount=10 means CNY 0.10 and amount=50 means CNY 0.50. Use display_amount when present, or divide by 100 before explaining price to the user.",
|
|
32
|
-
"For API products, explain what the API checks or returns, quota unit, sensitivity level, required human input, and whether Passkey/WebAuthn reveal is required.",
|
|
33
|
-
"If metadata says agent_may_view_raw_result=false, tell the user secure delivery/reveal is human-first and do not request the raw result.",
|
|
34
|
-
"For enterprise fuzzy search, tell the user the required input is a company keyword/short name/brand. The user can say something broad like 京东; the service is designed to return candidates.",
|
|
35
|
-
"For enterprise precise lookup, warn that the input must be the exact registered company name or unified social credit code. If the user is vague, use fuzzy search or other knowledge/search to lock the correct entity before checkout.",
|
|
36
|
-
"For enterprise precise lookup, examples of acceptable input are 北京京东世纪贸易有限公司 or a unified social credit code; examples of insufficient input are 京东, 那个京东商城, 大众知道那个京东.",
|
|
37
|
-
"For regulated_identity or personal_sensitive products, do not collect identity numbers or phone numbers in chat; direct the flow through ItPay human authorization/input.",
|
|
38
|
-
"For the CORE-028 PUBG sandbox pack: 20 CNY is low-cost couple skin, 40 CNY is premium skin, 288 CNY is ten-draw supply pack.",
|
|
39
|
-
"Tell the user the service is a sandbox test service when applicable.",
|
|
40
|
-
"Ask for confirmation before buying if the user's intent is ambiguous."
|
|
41
|
-
],
|
|
42
|
-
"forbidden": [
|
|
43
|
-
"Do not promise real game delivery for a sandbox service.",
|
|
44
|
-
"Do not hide the price.",
|
|
45
|
-
"Do not choose a more expensive variant without a clear user signal."
|
|
46
|
-
],
|
|
47
|
-
"next_docs": [
|
|
48
|
-
{
|
|
49
|
-
"condition": "User confirmed the variant",
|
|
50
|
-
"topic": "cart-checkout",
|
|
51
|
-
"command": "itp docs show cart-checkout --role buyer --json"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"condition": "Need to search again",
|
|
55
|
-
"topic": "catalog-search",
|
|
56
|
-
"command": "itp docs show catalog-search --role buyer --json"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"condition": "Need to know how to pass required API product input into cart",
|
|
60
|
-
"topic": "cart-checkout",
|
|
61
|
-
"command": "itp docs show cart-checkout --role buyer --json"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"search_terms": [
|
|
65
|
-
"recommend",
|
|
66
|
-
"compare",
|
|
67
|
-
"which one",
|
|
68
|
-
"variant",
|
|
69
|
-
"option",
|
|
70
|
-
"api",
|
|
71
|
-
"sensitivity",
|
|
72
|
-
"quota",
|
|
73
|
-
"passkey",
|
|
74
|
-
"推荐",
|
|
75
|
-
"怎么选",
|
|
76
|
-
"区别",
|
|
77
|
-
"敏感等级",
|
|
78
|
-
"查询次数"
|
|
79
|
-
]
|
|
80
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "qr-refresh",
|
|
5
|
-
"title": "QR Refresh Recovery",
|
|
6
|
-
"purpose": "Teach the agent how to recover scanner problems without changing payment truth or creating a second order.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"The human reports the payment provider says order not found after waiting 30-60 seconds on the same QR/page.",
|
|
9
|
-
"The QR expired or the wallet cannot load it.",
|
|
10
|
-
"The payment intent is still not verified."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"payment_intent_id"
|
|
15
|
-
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
-
"ops token",
|
|
18
|
-
"provider query",
|
|
19
|
-
"new checkout"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"commands": [
|
|
23
|
-
{
|
|
24
|
-
"intent": "ask ItPay for same-intent display recovery",
|
|
25
|
-
"command": "itp buyer payment refresh-qr <payment_intent_id> --reason order-not-found --host <client> --json",
|
|
26
|
-
"success_signal": "response.payment_intent.qr_png_url or response.payment_intent.qr_image_url is present"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"intent": "continue waiting after refresh",
|
|
30
|
-
"command": "itp buyer payment wait <payment_intent_id> --timeout 1 --host <client> --json",
|
|
31
|
-
"success_signal": "payment_event.event_type == payment_intent.verified"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"agent_rules": [
|
|
35
|
-
"QR refresh is display recovery only. ItPay may return the same QR again when the current provider QR is still valid.",
|
|
36
|
-
"Use the same payment_intent_id.",
|
|
37
|
-
"If QR does not render, first use the returned local_qr_path, qr_png_url, or preferred_qr_url. Do not generate a new QR from guessed provider payload.",
|
|
38
|
-
"For provider order-not-found, first ask the human to wait and scan/open the same QR/page again; use refresh only after that wait has failed.",
|
|
39
|
-
"If refresh succeeds, show only the returned ItPay QR/display URL and continue waiting on the same payment_intent_id.",
|
|
40
|
-
"After refresh, continue waiting through the normal wait contract."
|
|
41
|
-
],
|
|
42
|
-
"forbidden": [
|
|
43
|
-
"Do not treat refresh as paid.",
|
|
44
|
-
"Do not query Alipay from buyer flow.",
|
|
45
|
-
"Do not create a new checkout unless the user explicitly abandons the old one."
|
|
46
|
-
],
|
|
47
|
-
"next_docs": [
|
|
48
|
-
{
|
|
49
|
-
"condition": "refreshed QR is visible",
|
|
50
|
-
"topic": "payment-wait",
|
|
51
|
-
"command": "itp docs show payment-wait --role buyer --json"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"condition": "refresh fails",
|
|
55
|
-
"topic": "recovery",
|
|
56
|
-
"command": "itp docs show recovery --role buyer --json"
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"search_terms": [
|
|
60
|
-
"refresh",
|
|
61
|
-
"order not found",
|
|
62
|
-
"expired qr",
|
|
63
|
-
"qr unavailable",
|
|
64
|
-
"刷新",
|
|
65
|
-
"订单不存在"
|
|
66
|
-
]
|
|
67
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "recovery",
|
|
5
|
-
"title": "Safe Recovery",
|
|
6
|
-
"purpose": "Teach the agent how to recover without duplicating orders or crossing into ops authority.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"A command timed out.",
|
|
9
|
-
"The agent lost local context.",
|
|
10
|
-
"The human reports QR scan trouble.",
|
|
11
|
-
"Checkout or delivery is pending."
|
|
12
|
-
],
|
|
13
|
-
"required_state": {
|
|
14
|
-
"needs": [
|
|
15
|
-
"last known checkout_id, payment_intent_id, or variant_id"
|
|
16
|
-
],
|
|
17
|
-
"must_not_need": [
|
|
18
|
-
"ops token",
|
|
19
|
-
"provider raw payload",
|
|
20
|
-
"claim token"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
"commands": [
|
|
24
|
-
{
|
|
25
|
-
"intent": "resume checkout state",
|
|
26
|
-
"command": "itp buyer checkout resume <checkout_id> --host <client> --json",
|
|
27
|
-
"success_signal": "response.status and agent_next_actions describe the safe next action"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"intent": "wait again on the same payment intent",
|
|
31
|
-
"command": "itp buyer payment wait <payment_intent_id> --timeout 1 --host <client> --json",
|
|
32
|
-
"success_signal": "response.payment_event.event_type is payment_intent.verified or still waiting"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"intent": "refresh display QR only",
|
|
36
|
-
"command": "itp buyer payment refresh-qr <payment_intent_id> --reason order-not-found --host <client> --json",
|
|
37
|
-
"success_signal": "response.payment_intent.qr_image_url is present"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"agent_rules": [
|
|
41
|
-
"Prefer resume over creating a new checkout.",
|
|
42
|
-
"A timeout does not prove failure.",
|
|
43
|
-
"Network failure, broken connection, no response, or interrupted agent run does not prove payment failure.",
|
|
44
|
-
"Use the same checkout_id/cart_id/payment_intent_id whenever possible.",
|
|
45
|
-
"For payment recovery, first retry payment wait or checkout status/resume with the same IDs. Escalate to QR refresh only for display/scanner problems.",
|
|
46
|
-
"If payment status is unknown, say it is unknown and keep checking the same payment/checkout; do not guess paid/unpaid.",
|
|
47
|
-
"Report safe error messages only."
|
|
48
|
-
],
|
|
49
|
-
"forbidden": [
|
|
50
|
-
"Do not call ops sandbox worker or provider query from buyer flow.",
|
|
51
|
-
"Do not create duplicate checkout after transient wait timeout.",
|
|
52
|
-
"Do not ask the user to paste secrets, claim links, or raw provider data."
|
|
53
|
-
],
|
|
54
|
-
"next_docs": [
|
|
55
|
-
{
|
|
56
|
-
"condition": "QR needs display refresh",
|
|
57
|
-
"topic": "qr-refresh",
|
|
58
|
-
"command": "itp docs show qr-refresh --role buyer --json"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"condition": "Payment still waiting",
|
|
62
|
-
"topic": "payment-wait",
|
|
63
|
-
"command": "itp docs show payment-wait --role buyer --json"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"condition": "Delivery is claimable",
|
|
67
|
-
"topic": "secure-delivery",
|
|
68
|
-
"command": "itp docs show secure-delivery --role buyer --json"
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"search_terms": [
|
|
72
|
-
"recover",
|
|
73
|
-
"resume",
|
|
74
|
-
"timeout",
|
|
75
|
-
"lost",
|
|
76
|
-
"retry",
|
|
77
|
-
"stuck",
|
|
78
|
-
"恢复",
|
|
79
|
-
"重试",
|
|
80
|
-
"卡住",
|
|
81
|
-
"没返回",
|
|
82
|
-
"断了",
|
|
83
|
-
"找不到"
|
|
84
|
-
]
|
|
85
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "safety-policy",
|
|
5
|
-
"title": "Buyer Agent Safety Policy",
|
|
6
|
-
"purpose": "Define the non-negotiable safety rules for ItPay buyer agents.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"The agent is unsure whether a command or data access is allowed.",
|
|
9
|
-
"The user asks the agent to reveal, fetch, or paste protected content.",
|
|
10
|
-
"The agent is deciding between buyer and ops commands."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"role=buyer"
|
|
15
|
-
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
-
"ops token",
|
|
18
|
-
"raw secret access"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"commands": [
|
|
22
|
-
{
|
|
23
|
-
"intent": "read this safety policy",
|
|
24
|
-
"command": "itp docs show safety-policy --role buyer --json",
|
|
25
|
-
"success_signal": "forbidden list is present"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"intent": "return to quickstart after safety check",
|
|
29
|
-
"command": "itp docs show quickstart --role buyer --json",
|
|
30
|
-
"success_signal": "quickstart topic is returned"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"agent_rules": [
|
|
34
|
-
"Buyer agent authority is public discovery, cart/checkout creation, QR presentation, payment wait, and redacted delivery status.",
|
|
35
|
-
"Payment success must be verified by ItPay, not by user text or local inference.",
|
|
36
|
-
"Secure delivery is human-first.",
|
|
37
|
-
"If a request requires raw secret access, explain that ItPay blocks agent access by design."
|
|
38
|
-
],
|
|
39
|
-
"forbidden": [
|
|
40
|
-
"No ops token in buyer flow.",
|
|
41
|
-
"No worker run-once in buyer flow.",
|
|
42
|
-
"No provider query recovery in buyer flow.",
|
|
43
|
-
"No fixture evidence route.",
|
|
44
|
-
"No raw key, redeem code, claim token, claim URL, storage ref, provider raw payload, buyer profile value, or session token in chat.",
|
|
45
|
-
"No QR URL rewriting.",
|
|
46
|
-
"No fake/mock/offline payment unless the user explicitly asks for offline simulation."
|
|
47
|
-
],
|
|
48
|
-
"next_docs": [
|
|
49
|
-
{
|
|
50
|
-
"condition": "Need the normal flow",
|
|
51
|
-
"topic": "quickstart",
|
|
52
|
-
"command": "itp docs show quickstart --role buyer --json"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"condition": "Need delivery boundary details",
|
|
56
|
-
"topic": "secure-delivery",
|
|
57
|
-
"command": "itp docs show secure-delivery --role buyer --json"
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
"search_terms": [
|
|
61
|
-
"policy",
|
|
62
|
-
"forbidden",
|
|
63
|
-
"security",
|
|
64
|
-
"secret",
|
|
65
|
-
"ops",
|
|
66
|
-
"安全",
|
|
67
|
-
"禁止",
|
|
68
|
-
"权限"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": "itp.agent_doc.v1",
|
|
3
|
-
"role": "buyer",
|
|
4
|
-
"topic": "secure-delivery",
|
|
5
|
-
"title": "Secure Delivery Status",
|
|
6
|
-
"purpose": "Teach the agent how to handle ItPay secure delivery without seeing protected content.",
|
|
7
|
-
"when_to_use": [
|
|
8
|
-
"Payment was verified.",
|
|
9
|
-
"Checkout status mentions delivery_claimable, check_email, or claim_link_sent.",
|
|
10
|
-
"The user asks where the purchased key/content is."
|
|
11
|
-
],
|
|
12
|
-
"required_state": {
|
|
13
|
-
"needs": [
|
|
14
|
-
"checkout_id"
|
|
15
|
-
],
|
|
16
|
-
"must_not_need": [
|
|
17
|
-
"claim token",
|
|
18
|
-
"claim link",
|
|
19
|
-
"raw key",
|
|
20
|
-
"storage ref"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
"commands": [
|
|
24
|
-
{
|
|
25
|
-
"intent": "check redacted delivery status",
|
|
26
|
-
"command": "itp buyer checkout status <checkout_id> --host <client> --json",
|
|
27
|
-
"success_signal": "delivery.sensitive_content_redacted == true"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"intent": "list agent-safe delivery state",
|
|
31
|
-
"command": "itp buyer deliveries list --checkout <checkout_id> --host <client> --json",
|
|
32
|
-
"success_signal": "response.deliveries contains no raw content or claim token"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"intent": "after the human says they granted agent access, discover the current agent's grants",
|
|
36
|
-
"command": "itp buyer vault grants list --checkout <checkout_id> --host <client> --json",
|
|
37
|
-
"success_signal": "response.agent_readable_grants contains only grants for this exact agent device"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"agent_rules": [
|
|
41
|
-
"Tell the human to check email or the ItPay human claim UI.",
|
|
42
|
-
"Agent-visible status may say delivery_claimable/check_email/claim_link_sent.",
|
|
43
|
-
"Raw protected content is human-first unless the human later shares it outside ItPay.",
|
|
44
|
-
"If the user wants analysis, comparison, installation help, or structured use of the delivered result, you may ask the human to use the ItPay page's 'Give to Agent / 一键给 Agent' Passkey flow.",
|
|
45
|
-
"When guiding the human, be concrete: open the delivery email or ItPay order page, click Give to Agent / 一键给 Agent, choose fields, and confirm with Passkey/WebAuthn.",
|
|
46
|
-
"If the human uses the portal's one-key agent authorization, discover the resulting grant with buyer vault commands; do not ask the human to paste content or grant IDs.",
|
|
47
|
-
"If no grant appears, explain that authorization may not be completed, may not have synced, may target a different checkout/order, or may have expired/revoked.",
|
|
48
|
-
"Do not ask the human to paste the key into chat."
|
|
49
|
-
],
|
|
50
|
-
"forbidden": [
|
|
51
|
-
"Do not call the secure claim URL as an agent API.",
|
|
52
|
-
"Do not request or print claim token, claim URL, raw key, redeem code, or storage ref.",
|
|
53
|
-
"Do not scrape the human claim UI.",
|
|
54
|
-
"Do not claim installation is complete unless a later human-granted install flow says so."
|
|
55
|
-
],
|
|
56
|
-
"next_docs": [
|
|
57
|
-
{
|
|
58
|
-
"condition": "Human asks what the claim page is",
|
|
59
|
-
"topic": "human-claim-ui",
|
|
60
|
-
"command": "itp docs show human-claim-ui --role buyer --json"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"condition": "Human asks to view account or order history",
|
|
64
|
-
"topic": "account-portal",
|
|
65
|
-
"command": "itp docs show account-portal --role buyer --json"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"condition": "Human says they approved agent access with Passkey",
|
|
69
|
-
"topic": "vault-agent-read",
|
|
70
|
-
"command": "itp docs show vault-agent-read --role buyer --json"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"condition": "Delivery is not ready yet",
|
|
74
|
-
"topic": "recovery",
|
|
75
|
-
"command": "itp docs show recovery --role buyer --json"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"search_terms": [
|
|
79
|
-
"delivery",
|
|
80
|
-
"claim",
|
|
81
|
-
"email",
|
|
82
|
-
"key",
|
|
83
|
-
"redeem",
|
|
84
|
-
"secure delivery",
|
|
85
|
-
"交付",
|
|
86
|
-
"邮件",
|
|
87
|
-
"领取",
|
|
88
|
-
"密钥"
|
|
89
|
-
]
|
|
90
|
-
}
|