@itpay/cli 0.1.0
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/LICENSE +21 -0
- package/README.md +617 -0
- package/bin/itp +4311 -0
- package/docs/agent/buyer/account-portal.json +65 -0
- package/docs/agent/buyer/cart-checkout.json +130 -0
- package/docs/agent/buyer/catalog-search.json +71 -0
- package/docs/agent/buyer/human-claim-ui.json +59 -0
- package/docs/agent/buyer/payment-qr.json +66 -0
- package/docs/agent/buyer/payment-wait.json +54 -0
- package/docs/agent/buyer/product-recommendation.json +79 -0
- package/docs/agent/buyer/qr-refresh.json +52 -0
- package/docs/agent/buyer/quickstart.json +86 -0
- package/docs/agent/buyer/recovery.json +63 -0
- package/docs/agent/buyer/safety-policy.json +56 -0
- package/docs/agent/buyer/secure-delivery.json +70 -0
- package/docs/agent/buyer/vault-agent-read.json +69 -0
- package/e2e-local.sh +134 -0
- package/install.ps1 +53 -0
- package/install.sh +53 -0
- package/package.json +45 -0
- package/skills/itpay-buyer/SKILL.md +203 -0
- package/skills/voltagent/SKILL.md +603 -0
- package/smoke.sh +426 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "itp.agent_doc.v1",
|
|
3
|
+
"role": "buyer",
|
|
4
|
+
"topic": "account-portal",
|
|
5
|
+
"title": "Human Account Portal",
|
|
6
|
+
"purpose": "Teach the agent how to help a human open the ItPay account/order portal without reading protected content.",
|
|
7
|
+
"when_to_use": [
|
|
8
|
+
"The human asks to see their ItPay account or previous orders.",
|
|
9
|
+
"The original claim email link expired or was already used.",
|
|
10
|
+
"The agent needs to explain that human UI and agent status share the same redacted order state."
|
|
11
|
+
],
|
|
12
|
+
"required_state": {
|
|
13
|
+
"needs": ["authenticated buyer account session"],
|
|
14
|
+
"must_not_need": ["claim token", "raw content", "portal page contents"]
|
|
15
|
+
},
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"intent": "create a one-time human account portal link",
|
|
19
|
+
"command": "itp account login-link --json",
|
|
20
|
+
"success_signal": "response.status == account_portal_login_link_created and response.portal_login_link.one_time == true"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"intent": "same command under buyer namespace",
|
|
24
|
+
"command": "itp buyer account login-link --json",
|
|
25
|
+
"success_signal": "response.login_url is present"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"intent": "agent-side state check without opening the human portal",
|
|
29
|
+
"command": "itp buyer checkout status <checkout_id> --json",
|
|
30
|
+
"success_signal": "response contains redacted order/delivery state only"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"agent_rules": [
|
|
34
|
+
"Give the one-time account portal link to the human buyer.",
|
|
35
|
+
"Do not open the account portal link yourself.",
|
|
36
|
+
"The human portal and agent APIs read the same redacted order/vault state.",
|
|
37
|
+
"If the human chooses one-key agent authorization after Passkey reveal, use `itp buyer vault grants list ...` to discover the active grant; do not ask the human to copy the grant id.",
|
|
38
|
+
"If the human reports an order status, verify it through buyer status/order commands instead of scraping the portal.",
|
|
39
|
+
"Protected artifact reveal still requires a later Passkey/WebAuthn human reveal flow."
|
|
40
|
+
],
|
|
41
|
+
"forbidden": [
|
|
42
|
+
"Do not fetch, screenshot, scrape, cache, or summarize the account portal page.",
|
|
43
|
+
"Do not ask the human to paste portal contents, claim links, keys, or raw results into chat.",
|
|
44
|
+
"Do not claim the portal link is a raw content reveal link.",
|
|
45
|
+
"Do not reuse a portal link after it has been opened."
|
|
46
|
+
],
|
|
47
|
+
"next_docs": [
|
|
48
|
+
{
|
|
49
|
+
"condition": "The user asks where a delivered item is",
|
|
50
|
+
"topic": "secure-delivery",
|
|
51
|
+
"command": "itp docs show secure-delivery --role buyer --json"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"condition": "The human approved agent access to selected fields",
|
|
55
|
+
"topic": "vault-agent-read",
|
|
56
|
+
"command": "itp docs show vault-agent-read --role buyer --json"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"condition": "The user asks why the agent cannot open the portal",
|
|
60
|
+
"topic": "safety-policy",
|
|
61
|
+
"command": "itp docs show safety-policy --role buyer --json"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"search_terms": ["account portal", "orders", "login link", "one time link", "portal", "账号", "订单", "登录链接", "一次性链接"]
|
|
65
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "itp.agent_doc.v1",
|
|
3
|
+
"role": "buyer",
|
|
4
|
+
"topic": "cart-checkout",
|
|
5
|
+
"title": "Cart-First Checkout",
|
|
6
|
+
"purpose": "Teach the agent to use the UCP cart handoff, including CORE-033 multi-item carts, instead of bypassing cart.",
|
|
7
|
+
"when_to_use": [
|
|
8
|
+
"The user selected one or more public catalog variants.",
|
|
9
|
+
"The agent needs an estimate before checkout.",
|
|
10
|
+
"The agent needs to create a checkout from cart_id.",
|
|
11
|
+
"A first-time wild agent may receive auth_qr as a first-purchase auth-to-payment entry before payment is verified."
|
|
12
|
+
],
|
|
13
|
+
"required_state": {
|
|
14
|
+
"needs": [
|
|
15
|
+
"catalog_variant_id or catalog_variant_ids",
|
|
16
|
+
"buyer email for secure delivery",
|
|
17
|
+
"product-specific required input fields before cart creation"
|
|
18
|
+
],
|
|
19
|
+
"optional": [
|
|
20
|
+
"buyer phone"
|
|
21
|
+
],
|
|
22
|
+
"must_not_need": [
|
|
23
|
+
"catalog version",
|
|
24
|
+
"expected amount",
|
|
25
|
+
"ops token"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"commands": [
|
|
29
|
+
{
|
|
30
|
+
"intent": "create a cart estimate for the selected UCP Variant.id",
|
|
31
|
+
"command": "itp buyer cart create --variant <variant_id> --json",
|
|
32
|
+
"success_signal": "response.cart.cart_id is present and agent_next_actions includes create_checkout_from_cart"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"intent": "create a multi-item cart estimate for selected UCP Variant.id values",
|
|
36
|
+
"command": "itp buyer cart create --variants <variant_id_1>,<variant_id_2> --quantities 1,2 --json",
|
|
37
|
+
"success_signal": "response.cart.line_items contains every selected variant and response.cart.amount is the estimated total"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"intent": "create an enterprise fuzzy search cart with required query input",
|
|
41
|
+
"command": "itp buyer cart create --variant var_itpay_enterprise_fuzzy_search_cny01 --input company_name=京东 --json",
|
|
42
|
+
"success_signal": "response.cart.cart_id is present; the raw provider result is not visible to the agent"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"intent": "create an enterprise precise lookup cart with exact registered name or credit code",
|
|
46
|
+
"command": "itp buyer cart create --variant var_itpay_enterprise_precise_lookup_cny05 --input company_name_or_credit_no=北京京东世纪贸易有限公司 --json",
|
|
47
|
+
"success_signal": "response.cart.cart_id is present; payment can proceed only after the exact query input is locked into the cart line"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"intent": "view the current cart state without relying on model memory",
|
|
51
|
+
"command": "itp buyer cart show <cart_id> --json",
|
|
52
|
+
"success_signal": "response.cart.line_items and response.cart.totals reflect the server-side cart"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"intent": "add one more selected UCP Variant.id to an existing cart before checkout",
|
|
56
|
+
"command": "itp buyer cart add <cart_id> --variant <variant_id> --quantity 1 --json",
|
|
57
|
+
"success_signal": "response.cart.cart_id is unchanged and response.cart.line_items includes the new line"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"intent": "remove one line from an existing cart before checkout",
|
|
61
|
+
"command": "itp buyer cart remove <cart_id> --line <cart_line_item_id> --json",
|
|
62
|
+
"success_signal": "response.cart.cart_id is unchanged and response.cart.line_items no longer contains that line id"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"intent": "create checkout from cart_id",
|
|
66
|
+
"command": "itp buyer checkout create --cart <cart_id> --email <buyer_email> --phone <buyer_phone> --json",
|
|
67
|
+
"success_signal": "response.checkout.checkout_id is present; if response.checkout.next_required_action is auth_qr, show response.checkout.human_action and poll/resume until payment_intent_id appears"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"intent": "do both steps through the high-level command",
|
|
71
|
+
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --json",
|
|
72
|
+
"success_signal": "response.status is waiting_human_auth, waiting_user_payment, payment_verified, or delivery_claimable"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"agent_rules": [
|
|
76
|
+
"CORE-033 supports multiple cart lines and bounded positive quantities when all items belong to the same supported settlement/provider group.",
|
|
77
|
+
"Before cart creation, inspect product metadata input_schema_json and collect every required input field. Do not wait until after payment to ask for required query inputs.",
|
|
78
|
+
"Enterprise fuzzy search requires input.company_name. This can be a keyword, brand, short name, or partial company name supplied by the user, such as 京东.",
|
|
79
|
+
"Enterprise precise lookup requires input.company_name_or_credit_no. This must be a complete China mainland registered company name or unified social credit code. If the user only provides a brand/short name, resolve the exact name first or use fuzzy search before precise lookup.",
|
|
80
|
+
"Use --input key=value for service-specific inputs. For multiple lines, prefer separate cart add commands when each line needs different input.",
|
|
81
|
+
"Before checkout create, confirm buyer email is available for secure delivery. If it is missing, ask the human for the email before checkout; do not guess or use a placeholder.",
|
|
82
|
+
"Use cart_id as the checkout handoff.",
|
|
83
|
+
"Use buyer cart show whenever you need current cart contents. Do not rely on chat memory for cart state.",
|
|
84
|
+
"Use buyer cart add/remove before checkout when the user changes their mind. After checkout is created, treat the cart as locked.",
|
|
85
|
+
"Do not override cart line_items during checkout.",
|
|
86
|
+
"If the user asks for several compatible products, add them to one cart and create one checkout. Do not split into separate checkouts unless ItPay rejects the cart or says split checkout is required.",
|
|
87
|
+
"If the same cart is retried, expect the same checkout unless contact/client reference changes.",
|
|
88
|
+
"The backend revalidates catalog, price, and delivery requirements.",
|
|
89
|
+
"For first purchase, auth_qr means the ItPay first-purchase entry: provider login/registration/profile consent first, then ItPay should continue the same checkout to payment.",
|
|
90
|
+
"After presenting auth_qr, run buyer checkout resume and keep it active/waiting. Do not stop at QR display unless the human explicitly asks you to pause.",
|
|
91
|
+
"Do not tell the user auth_qr is a completed payment or payment proof.",
|
|
92
|
+
"For first purchase, show the ItPay auth entry as one human orchestration entry; after provider OAuth callback the same checkout exposes payment.",
|
|
93
|
+
"After showing auth_qr, poll checkout or run buyer checkout resume until identity_status becomes identity_resolved and payment_intent_id appears.",
|
|
94
|
+
"When auth completes, CLI should claim and store the buyer session so a repeat purchase by the same agent/device can skip auth."
|
|
95
|
+
],
|
|
96
|
+
"forbidden": [
|
|
97
|
+
"Do not call legacy checkout directly for CORE-028 external-agent tests.",
|
|
98
|
+
"Do not pass a different variant in checkout after cart is created.",
|
|
99
|
+
"Do not create a second cart/checkout after a retryable timeout unless the user asks to abandon the previous one.",
|
|
100
|
+
"Do not buy enterprise precise lookup with only a vague brand/short name unless you have resolved the exact registered company name.",
|
|
101
|
+
"Do not claim enterprise API raw results are visible to the agent; they are delivered to the human Vault/claim UI."
|
|
102
|
+
],
|
|
103
|
+
"next_docs": [
|
|
104
|
+
{
|
|
105
|
+
"condition": "Checkout returns auth_qr",
|
|
106
|
+
"topic": "payment-qr",
|
|
107
|
+
"command": "itp docs show payment-qr --role buyer --json"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"condition": "Checkout has payment_intent_id and payment QR is needed",
|
|
111
|
+
"topic": "payment-qr",
|
|
112
|
+
"command": "itp docs show payment-qr --role buyer --json"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"condition": "Cart or checkout command fails",
|
|
116
|
+
"topic": "recovery",
|
|
117
|
+
"command": "itp docs show recovery --role buyer --json"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"search_terms": [
|
|
121
|
+
"cart",
|
|
122
|
+
"checkout",
|
|
123
|
+
"cart_id",
|
|
124
|
+
"line_items",
|
|
125
|
+
"quantity",
|
|
126
|
+
"购物车",
|
|
127
|
+
"下单",
|
|
128
|
+
"结账"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "itp.agent_doc.v1",
|
|
3
|
+
"role": "buyer",
|
|
4
|
+
"topic": "catalog-search",
|
|
5
|
+
"title": "Catalog Search For Buyer Agents",
|
|
6
|
+
"purpose": "Help the agent find public ItPay services without login and without expensive repeated full searches.",
|
|
7
|
+
"when_to_use": [
|
|
8
|
+
"The user describes a need but has not chosen a service.",
|
|
9
|
+
"The agent needs product and variant details before recommendation.",
|
|
10
|
+
"The agent needs to search standardized API products such as ItPay enterprise data APIs."
|
|
11
|
+
],
|
|
12
|
+
"required_state": {
|
|
13
|
+
"needs": ["search query or service intent"],
|
|
14
|
+
"must_not_need": ["buyer login", "payment intent", "ops token"]
|
|
15
|
+
},
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"intent": "search public catalog by natural language query",
|
|
19
|
+
"command": "itp buyer catalog search --query \"企业工商信息 查询\" --json",
|
|
20
|
+
"success_signal": "response.products contains variants with id, title, price, metadata"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"intent": "search API services by stable category and safe facets",
|
|
24
|
+
"command": "itp buyer catalog search --query \"企业工商信息 查询\" --category business_data_api --provider itpay_enterprise_data --service-type ai_api --delivery-mode managed_capability --use-case company_lookup --input-facet company_name --json",
|
|
25
|
+
"success_signal": "response.products only contains products matching the requested category/facets"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"intent": "search fuzzy company lookup when the user only provides a partial company name",
|
|
29
|
+
"command": "itp buyer catalog search --query \"企业 模糊 查询 公司简称\" --category business_data_api --provider itpay_enterprise_data --service-type ai_api --use-case company_disambiguation --input-facet company_name --json",
|
|
30
|
+
"success_signal": "response.products includes the fuzzy enterprise search product before precise lookup"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"intent": "get exact product details for a selected variant",
|
|
34
|
+
"command": "itp buyer catalog get --variant <variant_id> --json",
|
|
35
|
+
"success_signal": "response.selection.catalog_variant_id matches the selected variant"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"intent": "discover low-cost shelf sync endpoints for repeated reads",
|
|
39
|
+
"command": "itp buyer shelf manifest --json",
|
|
40
|
+
"success_signal": "response.snapshot_version and response.snapshot_url are present"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"agent_rules": [
|
|
44
|
+
"Full search is allowed for explicit user search, not as a polling loop.",
|
|
45
|
+
"For repeated discovery, prefer shelf manifest/snapshot/delta.",
|
|
46
|
+
"For API services, map user intent to category/facet filters before relying on keyword ranking.",
|
|
47
|
+
"Use stable categories: business_data_api, business_verification_api, identity_verification_api, phone_verification_api, risk_compliance_api, location_weather_api, finance_data_api.",
|
|
48
|
+
"Use safe facets such as --use-case, --input-facet, --output-facet, --sensitivity-level, --delivery-mode, and --provider.",
|
|
49
|
+
"Use product and variant metadata to explain options in user language.",
|
|
50
|
+
"For products with requires_human_input=true, do not ask for identity numbers or phone numbers in chat; rely on ItPay human authorization/input.",
|
|
51
|
+
"Do not create checkout until the user intent maps to one selected variant or the user confirms a cart."
|
|
52
|
+
],
|
|
53
|
+
"forbidden": [
|
|
54
|
+
"Do not require login for discovery.",
|
|
55
|
+
"Do not invent catalog items or variant IDs.",
|
|
56
|
+
"Do not assume search result order means the user has approved purchase."
|
|
57
|
+
],
|
|
58
|
+
"next_docs": [
|
|
59
|
+
{
|
|
60
|
+
"condition": "Need to recommend among variants",
|
|
61
|
+
"topic": "product-recommendation",
|
|
62
|
+
"command": "itp docs show product-recommendation --role buyer --json"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"condition": "The user has chosen a variant",
|
|
66
|
+
"topic": "cart-checkout",
|
|
67
|
+
"command": "itp docs show cart-checkout --role buyer --json"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"search_terms": ["catalog", "search", "shelf", "product", "variant", "api", "enterprise_data", "category", "facet", "business_data_api", "企业查询", "工商信息", "企业工商数据精准查询", "企业工商数据模糊查询", "搜索", "商品"]
|
|
71
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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": ["delivery status or human email"],
|
|
14
|
+
"must_not_need": ["claim token in agent context", "raw content in CLI output"]
|
|
15
|
+
},
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"intent": "show agent-safe delivery status only",
|
|
19
|
+
"command": "itp buyer deliveries list --checkout <checkout_id> --json",
|
|
20
|
+
"success_signal": "response.secrets.raw_content_included == false"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"intent": "check whether the human has granted this agent a scoped view",
|
|
24
|
+
"command": "itp buyer vault grants list --checkout <checkout_id> --json",
|
|
25
|
+
"success_signal": "count > 0 means the human approved agent-readable access for this exact agent device"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"agent_rules": [
|
|
29
|
+
"The human claim page is for the human buyer, not the agent.",
|
|
30
|
+
"The claim link is short-lived and single-use.",
|
|
31
|
+
"The agent may explain that ItPay intentionally separates agent operations from raw secret access.",
|
|
32
|
+
"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.",
|
|
33
|
+
"After the human grants access, the agent should discover the grant with `itp buyer vault grants list ...`; do not ask the human to paste the grant id.",
|
|
34
|
+
"If the human later wants the agent to install or use something, wait for an explicit human-granted install/capability flow."
|
|
35
|
+
],
|
|
36
|
+
"forbidden": [
|
|
37
|
+
"Do not ask the human to paste the claim link or key into chat.",
|
|
38
|
+
"Do not fetch the claim page with CLI, curl, browser automation, or an agent tool.",
|
|
39
|
+
"Do not store raw content in local run files."
|
|
40
|
+
],
|
|
41
|
+
"next_docs": [
|
|
42
|
+
{
|
|
43
|
+
"condition": "The human wants to view their account or other orders later",
|
|
44
|
+
"topic": "account-portal",
|
|
45
|
+
"command": "itp docs show account-portal --role buyer --json"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"condition": "The human approved agent-readable fields",
|
|
49
|
+
"topic": "vault-agent-read",
|
|
50
|
+
"command": "itp docs show vault-agent-read --role buyer --json"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"condition": "The user asks why this boundary exists",
|
|
54
|
+
"topic": "safety-policy",
|
|
55
|
+
"command": "itp docs show safety-policy --role buyer --json"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"search_terms": ["claim ui", "claim page", "human", "single use", "reveal", "领取页", "人类", "查看密钥"]
|
|
59
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 Alipay sandbox."
|
|
12
|
+
],
|
|
13
|
+
"required_state": {
|
|
14
|
+
"needs": ["payment_intent_id", "human_action", "qr_png_url/preferred_qr_url or local_qr_path"],
|
|
15
|
+
"must_not_need": ["raw provider QR", "provider sign", "ops token"]
|
|
16
|
+
},
|
|
17
|
+
"commands": [
|
|
18
|
+
{
|
|
19
|
+
"intent": "create payment intent through the high-level buy flow",
|
|
20
|
+
"command": "itp buy <variant_id> --sandbox --email <buyer_email> --phone <buyer_phone> --display agent --json",
|
|
21
|
+
"success_signal": "response.payment_intent.human_action.local_qr_path or response.payment_intent.human_action.qr_png_url is present"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"intent": "recover a scanner order-not-found display problem",
|
|
25
|
+
"command": "itp buyer payment refresh-qr <payment_intent_id> --reason order-not-found --display agent --json",
|
|
26
|
+
"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"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"agent_rules": [
|
|
30
|
+
"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.",
|
|
31
|
+
"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.",
|
|
32
|
+
"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.",
|
|
33
|
+
"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.",
|
|
34
|
+
"Do not describe auth_qr as payment success or payment proof. Only payment_intent.verified proves payment.",
|
|
35
|
+
"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.",
|
|
36
|
+
"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.",
|
|
37
|
+
"Use qr_image_url/SVG only as a fallback when PNG/local rendering is unavailable.",
|
|
38
|
+
"For mobile users, present mobile_wallet_url as a clickable payment button when present.",
|
|
39
|
+
"payment_entry_url is the stable ItPay status/payment page. qr_png_url/local_qr_path is usually the better desktop scanner artifact.",
|
|
40
|
+
"In Alipay sandbox, 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.",
|
|
41
|
+
"Opening the payment page must not be treated as paid.",
|
|
42
|
+
"After showing QR, immediately wait for payment verification."
|
|
43
|
+
],
|
|
44
|
+
"forbidden": [
|
|
45
|
+
"Do not encode payment_entry_url into a new QR yourself when qr_png_url/local_qr_path is available.",
|
|
46
|
+
"Do not encode mobile_wallet_url into a new QR yourself.",
|
|
47
|
+
"Do not request or display raw provider QR payloads.",
|
|
48
|
+
"Do not bypass the ItPay auth orchestration page by making oauth_start_url the primary user-facing link.",
|
|
49
|
+
"Do not rewrite, shorten, summarize, or translate QR URLs.",
|
|
50
|
+
"Do not expose raw provider QR payload in chat.",
|
|
51
|
+
"Do not treat QR display as payment success."
|
|
52
|
+
],
|
|
53
|
+
"next_docs": [
|
|
54
|
+
{
|
|
55
|
+
"condition": "QR is visible to the human",
|
|
56
|
+
"topic": "payment-wait",
|
|
57
|
+
"command": "itp docs show payment-wait --role buyer --json"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"condition": "Alipay sandbox says order not found after waiting on the same QR/page",
|
|
61
|
+
"topic": "qr-refresh",
|
|
62
|
+
"command": "itp docs show qr-refresh --role buyer --json"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"search_terms": ["qr", "payment qr", "alipay", "scan", "order not found", "二维码", "扫码", "付款码"]
|
|
66
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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": ["payment_intent_id"],
|
|
14
|
+
"optional": ["cursor"],
|
|
15
|
+
"must_not_need": ["ops token", "provider query permission", "human text proof"]
|
|
16
|
+
},
|
|
17
|
+
"commands": [
|
|
18
|
+
{
|
|
19
|
+
"intent": "wait for payment verified event",
|
|
20
|
+
"command": "itp buyer payment wait <payment_intent_id> --json",
|
|
21
|
+
"success_signal": "response.payment_event.event_type == payment_intent.verified"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"intent": "resume checkout after verified event",
|
|
25
|
+
"command": "itp buyer checkout status <checkout_id> --json",
|
|
26
|
+
"success_signal": "response.delivery.status or response.checkout.status is returned"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"agent_rules": [
|
|
30
|
+
"wait.timeout is a heartbeat, not a payment failure.",
|
|
31
|
+
"Continue waiting with the same payment_intent_id unless the command reaches its overall timeout or the user cancels.",
|
|
32
|
+
"Payment success is payment_intent.verified only.",
|
|
33
|
+
"After verified, poll checkout or delivery status."
|
|
34
|
+
],
|
|
35
|
+
"forbidden": [
|
|
36
|
+
"Do not accept 'I paid' as proof.",
|
|
37
|
+
"Do not run provider query recovery from buyer flow.",
|
|
38
|
+
"Do not create a duplicate checkout merely because one wait cycle timed out.",
|
|
39
|
+
"Do not call worker run-once."
|
|
40
|
+
],
|
|
41
|
+
"next_docs": [
|
|
42
|
+
{
|
|
43
|
+
"condition": "payment_intent.verified received",
|
|
44
|
+
"topic": "secure-delivery",
|
|
45
|
+
"command": "itp docs show secure-delivery --role buyer --json"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"condition": "wait timeout or interrupted agent run",
|
|
49
|
+
"topic": "recovery",
|
|
50
|
+
"command": "itp docs show recovery --role buyer --json"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"search_terms": ["wait", "long poll", "timeout", "still waiting", "paid", "payment", "等待", "付款", "付款成功", "没返回", "一直等", "超时"]
|
|
54
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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> --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
|
+
"For API products, explain what the API checks or returns, quota unit, sensitivity level, required human input, and whether Passkey/WebAuthn reveal is required.",
|
|
32
|
+
"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.",
|
|
33
|
+
"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.",
|
|
34
|
+
"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.",
|
|
35
|
+
"For enterprise precise lookup, examples of acceptable input are 北京京东世纪贸易有限公司 or a unified social credit code; examples of insufficient input are 京东, 那个京东商城, 大众知道那个京东.",
|
|
36
|
+
"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.",
|
|
37
|
+
"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.",
|
|
38
|
+
"Tell the user the service is a sandbox test service when applicable.",
|
|
39
|
+
"Ask for confirmation before buying if the user's intent is ambiguous."
|
|
40
|
+
],
|
|
41
|
+
"forbidden": [
|
|
42
|
+
"Do not promise real game delivery for a sandbox service.",
|
|
43
|
+
"Do not hide the price.",
|
|
44
|
+
"Do not choose a more expensive variant without a clear user signal."
|
|
45
|
+
],
|
|
46
|
+
"next_docs": [
|
|
47
|
+
{
|
|
48
|
+
"condition": "User confirmed the variant",
|
|
49
|
+
"topic": "cart-checkout",
|
|
50
|
+
"command": "itp docs show cart-checkout --role buyer --json"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"condition": "Need to search again",
|
|
54
|
+
"topic": "catalog-search",
|
|
55
|
+
"command": "itp docs show catalog-search --role buyer --json"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"condition": "Need to know how to pass required API product input into cart",
|
|
59
|
+
"topic": "cart-checkout",
|
|
60
|
+
"command": "itp docs show cart-checkout --role buyer --json"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"search_terms": [
|
|
64
|
+
"recommend",
|
|
65
|
+
"compare",
|
|
66
|
+
"which one",
|
|
67
|
+
"variant",
|
|
68
|
+
"option",
|
|
69
|
+
"api",
|
|
70
|
+
"sensitivity",
|
|
71
|
+
"quota",
|
|
72
|
+
"passkey",
|
|
73
|
+
"推荐",
|
|
74
|
+
"怎么选",
|
|
75
|
+
"区别",
|
|
76
|
+
"敏感等级",
|
|
77
|
+
"查询次数"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 Alipay sandbox 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": ["payment_intent_id"],
|
|
14
|
+
"must_not_need": ["ops token", "provider query", "new checkout"]
|
|
15
|
+
},
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"intent": "ask ItPay for same-intent display recovery",
|
|
19
|
+
"command": "itp buyer payment refresh-qr <payment_intent_id> --reason order-not-found --json",
|
|
20
|
+
"success_signal": "response.payment_intent.qr_png_url or response.payment_intent.qr_image_url is present"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"intent": "continue waiting after refresh",
|
|
24
|
+
"command": "itp buyer payment wait <payment_intent_id> --json",
|
|
25
|
+
"success_signal": "payment_event.event_type == payment_intent.verified"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"agent_rules": [
|
|
29
|
+
"QR refresh is display recovery only. ItPay may return the same QR again when the current provider QR is still valid.",
|
|
30
|
+
"Use the same payment_intent_id.",
|
|
31
|
+
"For Alipay sandbox 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.",
|
|
32
|
+
"After refresh, continue waiting through the normal wait contract."
|
|
33
|
+
],
|
|
34
|
+
"forbidden": [
|
|
35
|
+
"Do not treat refresh as paid.",
|
|
36
|
+
"Do not query Alipay from buyer flow.",
|
|
37
|
+
"Do not create a new checkout unless the user explicitly abandons the old one."
|
|
38
|
+
],
|
|
39
|
+
"next_docs": [
|
|
40
|
+
{
|
|
41
|
+
"condition": "refreshed QR is visible",
|
|
42
|
+
"topic": "payment-wait",
|
|
43
|
+
"command": "itp docs show payment-wait --role buyer --json"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"condition": "refresh fails",
|
|
47
|
+
"topic": "recovery",
|
|
48
|
+
"command": "itp docs show recovery --role buyer --json"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"search_terms": ["refresh", "order not found", "expired qr", "qr unavailable", "刷新", "订单不存在"]
|
|
52
|
+
}
|