@itpay/cli 2.1.47 → 2.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/main.js +9497 -9269
- package/dist/src/state/config.js +2 -2
- package/docs/agent/buyer/cart-checkout.json +9 -50
- package/docs/agent/buyer/catalog-list.json +11 -52
- package/docs/agent/buyer/identity-and-sessions.json +9 -81
- package/docs/agent/buyer/install-and-setup.json +7 -47
- package/docs/agent/buyer/orders-refunds.json +9 -81
- package/docs/agent/buyer/payment-flow.json +9 -50
- package/docs/agent/buyer/purchased-content.json +1 -25
- package/docs/agent/buyer/rail-booking.json +25 -152
- package/docs/agent/buyer/render-hosts.json +21 -57
- package/docs/agent/buyer/service-feedback.json +6 -42
- package/docs/cli-reference/agent-types.md +17 -97
- package/docs/cli-reference/commands/auth.md +6 -87
- package/docs/cli-reference/commands/buy.md +23 -168
- package/docs/cli-reference/commands/cart/add.md +3 -1
- package/docs/cli-reference/commands/cart/index.md +2 -2
- package/docs/cli-reference/commands/cart/next.md +2 -0
- package/docs/cli-reference/commands/cart/show.md +2 -22
- package/docs/cli-reference/commands/catalog/index.md +1 -1
- package/docs/cli-reference/commands/catalog/list.md +4 -38
- package/docs/cli-reference/commands/checkout.md +3 -17
- package/docs/cli-reference/commands/device.md +7 -36
- package/docs/cli-reference/commands/docs/list.md +1 -1
- package/docs/cli-reference/commands/docs/show.md +1 -19
- package/docs/cli-reference/commands/feedback/submit.md +5 -17
- package/docs/cli-reference/commands/install.md +3 -39
- package/docs/cli-reference/commands/orders.md +3 -13
- package/docs/cli-reference/commands/pay.md +6 -27
- package/docs/cli-reference/commands/readyz.md +3 -61
- package/docs/cli-reference/commands/refund/cancel.md +1 -21
- package/docs/cli-reference/commands/refund/create.md +4 -28
- package/docs/cli-reference/commands/refund/get.md +3 -3
- package/docs/cli-reference/commands/refund/index.md +3 -3
- package/docs/cli-reference/commands/refund/list.md +1 -14
- package/docs/cli-reference/commands/refund/watch.md +5 -25
- package/docs/cli-reference/commands/services/action.md +6 -35
- package/docs/cli-reference/commands/services/checkout.md +15 -112
- package/docs/cli-reference/commands/services/get.md +4 -39
- package/docs/cli-reference/commands/services/index.md +5 -42
- package/docs/cli-reference/commands/services/invoke.md +6 -147
- package/docs/cli-reference/commands/services/list.md +3 -55
- package/docs/cli-reference/commands/services/next.md +9 -270
- package/docs/cli-reference/commands/services/page.md +4 -37
- package/docs/cli-reference/commands/services/purchase.md +21 -0
- package/docs/cli-reference/commands/services/quote.md +12 -57
- package/docs/cli-reference/commands/services/read-result.md +5 -72
- package/docs/cli-reference/commands/services/run.md +15 -144
- package/docs/cli-reference/commands/services/start.md +7 -49
- package/docs/cli-reference/commands/skill.md +1 -2
- package/docs/cli-reference/commands/vault/access.md +2 -20
- package/docs/cli-reference/commands/vault/list.md +3 -16
- package/docs/cli-reference/commands/vault/read.md +1 -1
- package/docs/cli-reference/conventions.md +2 -2
- package/docs/cli-reference/index.md +2 -1
- package/package.json +3 -4
- package/skills/itpay/SKILL.md +32 -130
- package/docs/agent/buyer/quickstart.json +0 -112
- package/docs/agent/buyer/rail-fast-checkout.json +0 -48
|
@@ -1,95 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `itpay auth login` / `itpay auth status`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Syntax
|
|
3
|
+
按当前命令返回的登录需要,或用户明确要求登录时,创建一次官方账号授权;准备购买不要求额外先登录,用户可在受保护页面认证。
|
|
6
4
|
|
|
7
5
|
```bash
|
|
8
|
-
itpay auth login
|
|
6
|
+
itpay auth login [--json]
|
|
9
7
|
itpay auth status [--json]
|
|
10
8
|
```
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## `itpay auth login`
|
|
15
|
-
|
|
16
|
-
Creates one official authorization request bound to this Backend, Device and Agent Instance, then stops. Repeating `auth login` while a valid request is open returns the same request — it does not rotate the QR code or create parallel sessions.
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"status": "auth_pending",
|
|
21
|
-
"result": {
|
|
22
|
-
"dashboard_auth_session_id": "das_...",
|
|
23
|
-
"expires_at": "2026-09-20T12:34:56Z",
|
|
24
|
-
"methods": ["phone", "email", "alipay", "wechat"]
|
|
25
|
-
},
|
|
26
|
-
"handoff": {
|
|
27
|
-
"url": "https://dev.itpay.ai/signin?dashboard_auth_session_id=das_...&start_token=...",
|
|
28
|
-
"qr_local_path": "...",
|
|
29
|
-
"qr_image_url": "...",
|
|
30
|
-
"markdown": "..."
|
|
31
|
-
},
|
|
32
|
-
"instruction": "把官方授权页或二维码交给用户。用户在页面内选择手机号验证码、邮箱或钱包完成登录;不要替用户输入手机号或验证码。",
|
|
33
|
-
"next": {
|
|
34
|
-
"command": "itpay auth status --json",
|
|
35
|
-
"reason": "用户完成页面登录后确认绑定",
|
|
36
|
-
"poll_after_ms": 5000
|
|
37
|
-
},
|
|
38
|
-
"recovery": []
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
- `handoff.url` is the official sign-in page carrying this authorization request. The page offers phone-code verification, email verification, and wallet options — the user chooses; the Agent must not deep-link a single wallet and call it universal authorization.
|
|
43
|
-
- The URL's `start_token` is valid only inside the official page handoff. Never log it, echo it in chat, or send it to another host.
|
|
44
|
-
- When the user already finished login before `auth login` runs, the command returns `authenticated` directly.
|
|
45
|
-
|
|
46
|
-
## `itpay auth status`
|
|
47
|
-
|
|
48
|
-
Polls the open authorization request, then performs the device binding. Safe to run repeatedly and concurrently: only the requester Device/Instance can complete the binding.
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"status": "auth_pending",
|
|
53
|
-
"result": { "dashboard_auth_session_id": "das_...", "expires_at": "..." },
|
|
54
|
-
"instruction": "用户仍在官方页面完成登录;保留当前 handoff,不要生成新二维码。",
|
|
55
|
-
"next": { "command": "itpay auth status --json", "poll_after_ms": 5000 },
|
|
56
|
-
"recovery": []
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"status": "authenticated",
|
|
63
|
-
"result": {
|
|
64
|
-
"buyer_id": "buyer_...",
|
|
65
|
-
"bound": true,
|
|
66
|
-
"query_quota": [
|
|
67
|
-
{ "service_id": "itpay-rail-exact", "policy": "free_registered", "remaining": null },
|
|
68
|
-
{ "service_id": "itpay-rail-smart", "policy": "free_registered", "remaining": null }
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
"instruction": "登录与绑定已完成,告知用户可继续之前的查询;已注册账号查询不消耗试用次数,仍受正常限流。",
|
|
72
|
-
"next": { "command": "itpay services run <service_id> --execution <pending_execution_id> --json", "reason": "恢复被额度暂停的原查询" },
|
|
73
|
-
"recovery": []
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Terminal and error states:
|
|
78
|
-
|
|
79
|
-
| `status` | Meaning | Agent action |
|
|
80
|
-
| --- | --- | --- |
|
|
81
|
-
| `authenticated` | Device bound to a real account | Resume the original intent (a quota-blocked execution, the user's request) unchanged |
|
|
82
|
-
| `auth_pending` | User has not finished the page | Keep the same handoff; poll with `poll_after_ms` |
|
|
83
|
-
| `auth_expired` | Session expired before completion | Offer to start `itpay auth login` again; prior query input is still preserved server-side |
|
|
84
|
-
| `login_required` | No open request, not bound | Run `itpay auth login` |
|
|
85
|
-
| `auth_cancelled` / `auth_denied` | User declined or closed the page | Respect the refusal; do not silently re-open; the pending query stays resumable |
|
|
86
|
-
| `auth_session_missing` | Saved authorization session no longer exists (404/410) | `auth status` stays read-only; an explicit `auth login` may create one new official session |
|
|
87
|
-
| `auth_status_unknown` | Transport or temporary server failure while reading status | Keep the same saved session and reread later; do not open a second login |
|
|
10
|
+
使用当前真实 Agent Type、Backend 与已登记设备,不向 Agent 提供账号 bearer token。login 返回官方 handoff 后立即按 Skill 展示;人自行选择手机号、钱包或邮箱,一种已验证身份即可登录,其他身份按需绑定。不得替用户输入验证码、提交旅客资料或选择另一个账号。
|
|
88
11
|
|
|
89
|
-
|
|
12
|
+
status 读取原授权并完成当前设备绑定,不创建另一条登录。用户完成后沿返回的原执行完整恢复命令继续,保留原地点、日期、人数与输入;不重新查询、不新建执行、不再询问相同行程。仍 pending 时保留原入口并遵守当次有界等待;读取故障不等于授权过期或取消,不新建登录掩盖故障。
|
|
90
13
|
|
|
91
|
-
|
|
92
|
-
- Verified email OR verified mainland phone both establish a valid login; the user picks on the page. Phone verification is not a prerequisite for registered free search — a verified email alone is sufficient.
|
|
93
|
-
- Login never grants Vault content, passenger history, or another Agent's authority. Other devices/platforms enroll and authorize separately.
|
|
94
|
-
- After `authenticated`, server-side identity is re-read; an anonymous execution blocked at the quota step resumes with `services run <service> --execution <id> --json` — no new execution, no re-asked itinerary.
|
|
95
|
-
- Refusing or cancelling login deletes nothing: saved results and purchase options remain usable.
|
|
14
|
+
认证成功不等于购买同意、已付款或获得已购内容授权。真实拒绝、取消、过期或绑定失败采用当次事实和适用动作,没有恢复动作就停止。保留设备身份和其他环境登记,不旋转私钥或换 Agent Type。
|
|
@@ -1,178 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# itpay buy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用于用户明确请求的普通多服务Cart购买。服务-backed行由当前cart next返回其服务动作;普通选择不绕过真实购买同意。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
为普通 Catalog 项目或已绑定 Service Quote 的 canonical Cart 创建一个 ItPay Checkout,并按当前 Agent Type 把付款入口交给用户。命令只创建或恢复 ItPay Checkout,不把“用户说已付款”当作付款成功。
|
|
8
|
-
|
|
9
|
-
未报价的 service-backed line 不可购买;命令停止并转向 `services next`。已通过 `cart add --quote` 锁定输入和价格的服务行可以合并结算,每个 Order Item 仍映射回独立 Execution、Capability 和交付路径。
|
|
10
|
-
|
|
11
|
-
**直接上游:**
|
|
12
|
-
|
|
13
|
-
- `cart add` 创建的 canonical Cart;
|
|
14
|
-
- `cart add --local` 创建的本地兼容草稿;
|
|
15
|
-
- Catalog 返回的一组完整 `item / variant / offer`;
|
|
16
|
-
- 已知的普通 canonical `cart_id`。
|
|
17
|
-
|
|
18
|
-
**直接下游:** `checkout` 查询同一 Checkout 的权威状态。付款确认后,再按其返回的 `next` 进入订单或服务履约。
|
|
19
|
-
|
|
20
|
-
## 语法
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
itpay buy [--json]
|
|
24
|
-
|
|
25
|
-
itpay buy --cart <cart_id> [--json]
|
|
26
|
-
|
|
27
|
-
itpay buy \
|
|
28
|
-
--item <catalog_item_id> \
|
|
29
|
-
--variant <catalog_variant_id> \
|
|
30
|
-
--offer <offer_id> \
|
|
31
|
-
[--quantity <positive_integer>] [--json]
|
|
5
|
+
```sh
|
|
6
|
+
itpay cart next --json
|
|
32
7
|
```
|
|
33
8
|
|
|
34
|
-
|
|
9
|
+
随后使用返回的完整buy命令及参数(--help为当前参考)。它准备或恢复原官方Checkout,不自动请求付款。展示与付款事实规则见正式Skill,独立Cart用途见cart-checkout。
|
|
10
|
+
|
|
11
|
+
## 当前参数
|
|
35
12
|
|
|
36
13
|
```text
|
|
14
|
+
--host <host> client host (terminal, telegram, feishu,
|
|
15
|
+
--target <target> chat id / channel id / open id for IM hosts
|
|
16
|
+
--item <catalog_item_id>
|
|
17
|
+
--variant <catalog_variant_id>
|
|
18
|
+
--offer <offer_id>
|
|
19
|
+
--cart <cart_id> existing canonical server cart id
|
|
20
|
+
--quantity <n> quantity (default: "1")
|
|
37
21
|
--ref <client_reference_id>
|
|
38
22
|
--contact-email <email>
|
|
39
23
|
--contact-phone <phone>
|
|
40
|
-
--require-contact <
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--locale <zh-CN|en
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--pay
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--timeout <positive_seconds>
|
|
50
|
-
--json
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 参数合同
|
|
54
|
-
|
|
55
|
-
| 参数 | 必填 | 规则 |
|
|
56
|
-
|---|---:|---|
|
|
57
|
-
| `--cart` | 条件必填 | 使用一个已存在的普通或全量已报价 canonical Cart。不能和 inline 三元组同时使用。 |
|
|
58
|
-
| `--item` | 条件必填 | Inline 购买时必须与 `--variant`、`--offer` 一起提供。只能使用 Catalog 返回值。 |
|
|
59
|
-
| `--variant` | 条件必填 | 同上。 |
|
|
60
|
-
| `--offer` | 条件必填 | 同上。 |
|
|
61
|
-
| `--quantity` | 否 | 正整数,默认 `1`;只用于 inline 项目。 |
|
|
62
|
-
| `--ref` | 否 | 调用方自己的业务引用;不承担幂等职责。 |
|
|
63
|
-
| `--contact-email` | 条件必填 | 普通 Cart 或兼容旧 Quote 缺少所需邮箱时使用,值必须来自用户;新版 Service Quote 会自动携带已确认邮箱。 |
|
|
64
|
-
| `--contact-phone` | 条件必填 | `--require-contact` 包含 `phone` 时必填,值必须来自用户。 |
|
|
65
|
-
| `--require-contact` | 否 | 只接受 `email`、`phone`;缺失时先询问用户,禁止 Agent 编造。 |
|
|
66
|
-
| `--host` | 条件必填 | 通常由 `--agent-type` 推导;`openclaw` 必须显式传当前入口。只改变 handoff 展示,不改变交易事实。 |
|
|
67
|
-
| `--target` | 条件必填 | 要求目标会话的 IM Host 必须提供;OpenClaw 从当前可信会话上下文传入。 |
|
|
68
|
-
| `--locale` | 否 | Payment Card 语言,默认 `zh-CN`;可使用 `en`。只改变 Card 文案,不改变交易事实。 |
|
|
69
|
-
| `--qr-format` | 否 | 非 JSON 的终端渲染选项。 |
|
|
70
|
-
| `--qr-file` | 否 | 非 JSON handoff 的明确二维码文件路径。 |
|
|
71
|
-
| `--pay` | 否 | 创建 Payment Intent 的集成/运维入口;普通 Agent 流程只展示 Checkout。 |
|
|
72
|
-
| `--method` | 否 | 只接受 `alipay` 或 `wechatpay`,默认 `alipay`;仅随 `--pay` 生效。 |
|
|
73
|
-
| `--no-wait` | 否 | 只能与 `--pay` 一起使用。 |
|
|
74
|
-
| `--timeout` | 否 | 等待付款事件的正整数秒数,默认 `120`。 |
|
|
75
|
-
| `--json` | 否 | 输出本文定义的紧凑机器合同,不输出字符二维码或图片二进制。 |
|
|
76
|
-
|
|
77
|
-
不传 `--cart` 或 inline 三元组时,命令使用本机保存的 active canonical Cart;若没有,则使用本地普通草稿创建 canonical Cart。两者都没有时返回 `cart_empty`。
|
|
78
|
-
|
|
79
|
-
## 标准 JSON 输出
|
|
80
|
-
|
|
81
|
-
### 等待用户付款
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"status": "human_checkout_required",
|
|
86
|
-
"result": {
|
|
87
|
-
"checkout_id": "<checkout_id>",
|
|
88
|
-
"payment": "pending",
|
|
89
|
-
"amount": "<amount> <currency>",
|
|
90
|
-
"item_count": 1
|
|
91
|
-
},
|
|
92
|
-
"handoff": {
|
|
93
|
-
"url": "<tokenized_checkout_url>",
|
|
94
|
-
"qr_local_path": "<desktop_optional_host_ready_file>",
|
|
95
|
-
"markdown": "<desktop_only_optional_markdown>",
|
|
96
|
-
"qr_image_url": "<chat_host_optional_absolute_https_png>",
|
|
97
|
-
"agent_action": "<openclaw_telegram_only_native_message_action>"
|
|
98
|
-
},
|
|
99
|
-
"instruction": "<current_host_instruction>",
|
|
100
|
-
"next": {
|
|
101
|
-
"command": "itpay checkout --id <checkout_id> --token <display_token> --json",
|
|
102
|
-
"reason": "稍后查询同一笔 Checkout 状态"
|
|
103
|
-
},
|
|
104
|
-
"recovery": []
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
`handoff` 只保留当前 Host 可以使用的字段。不得返回二维码 base64、镜像路径数组、renderer 状态或原始后端 DTO。`agent_action` 只允许出现在 `openclaw + telegram`。
|
|
109
|
-
|
|
110
|
-
**Instruction:** 必须使用下方 Agent Type 表定义的展示动作;展示完成或失败后停止。OpenClaw Telegram 必须原样执行 `handoff.agent_action`,不得改写 Presentation 或用普通回复冒充按钮已发送。收到 `itp:grant_confirmed:<checkout_id>` 表示用户声明已授权读取,应立即执行 `next.command` 查询同一 Checkout,再只跟随后端 grant 状态;该 callback 本身不证明付款或 grant active。
|
|
111
|
-
|
|
112
|
-
### `--pay` 已观察到付款事件
|
|
113
|
-
|
|
114
|
-
```json
|
|
115
|
-
{
|
|
116
|
-
"status": "payment_event_observed",
|
|
117
|
-
"result": {
|
|
118
|
-
"checkout_id": "<checkout_id>",
|
|
119
|
-
"payment": "verified",
|
|
120
|
-
"amount": "<amount> <currency>",
|
|
121
|
-
"item_count": 1,
|
|
122
|
-
"payment_intent_id": "<payment_intent_id>",
|
|
123
|
-
"payment_intent_status": "<provider_status>"
|
|
124
|
-
},
|
|
125
|
-
"instruction": "已观察到付款确认事件;读取同一 Checkout 的权威完成状态,不要再次付款。",
|
|
126
|
-
"next": {
|
|
127
|
-
"command": "itpay checkout --id <checkout_id> --token <display_token> --json",
|
|
128
|
-
"reason": "读取订单和履约句柄"
|
|
129
|
-
},
|
|
130
|
-
"recovery": []
|
|
131
|
-
}
|
|
24
|
+
--require-contact <fields> comma-separated required contact fields:
|
|
25
|
+
--qr-format <format> unicode|utf8|ansi|terminal
|
|
26
|
+
--qr-file <path> explicit QR file path
|
|
27
|
+
--locale <locale> payment card language: zh-CN|en (default:
|
|
28
|
+
--pay explicit controlled integration only; creates a payment intent
|
|
29
|
+
--method <alipay|wechatpay> payment method for --pay (default: "alipay")
|
|
30
|
+
--no-wait do not wait after an explicitly authorized --pay
|
|
31
|
+
--timeout <seconds> max seconds to wait for payment (default:
|
|
32
|
+
--json output JSON instead of terminal text
|
|
132
33
|
```
|
|
133
|
-
|
|
134
|
-
事件观察不是订单 DTO。Agent 必须执行 `next.command`,不能自行宣称履约完成。
|
|
135
|
-
|
|
136
|
-
## 幂等与中断恢复
|
|
137
|
-
|
|
138
|
-
- CLI 在本机 `operations.json.d/`(dev 使用独立目录)中为 `checkout.create:<cart_id>` 保存一条不可变、owner-only 的稳定幂等记录;不同操作不共享全局锁。
|
|
139
|
-
- HTTP 请求通过 `Idempotency-Key` 提交该键。
|
|
140
|
-
- Checkout 响应丢失时,重跑同一命令会复用已保存的 canonical Cart 和同一幂等键。
|
|
141
|
-
- 后端返回同一个待处理 Checkout,并轮换新的交接 token;不会创建第二笔订单。
|
|
142
|
-
- Service Quote Cart 的联系信息由 Quote Lock 汇总;正常流程无需在 `buy` 重复传邮箱,旧 Quote 可显式补充。
|
|
143
|
-
- Checkout 成功保存后,active Cart 句柄被清除,只保留 Checkout(以及可选 Service Execution)恢复句柄。
|
|
144
|
-
- 不确定命令执行到哪一步时,先运行 `itpay next --json`,不得重新拼一笔购买。
|
|
145
|
-
|
|
146
|
-
## 异常处理
|
|
147
|
-
|
|
148
|
-
| 错误码 | 含义 | Agent 处理 |
|
|
149
|
-
|---|---|---|
|
|
150
|
-
| `buy_source_invalid` | Inline 三元组不完整,或与 `--cart` 混用。 | 从 Catalog 重新读取完整 ID,或只保留 `--cart`。 |
|
|
151
|
-
| `cart_empty` | 没有本地草稿或 active canonical Cart。 | 执行 `catalog list`,不要猜 ID。 |
|
|
152
|
-
| `missing_contact` | 缺少调用方声明的 required contact。 | 向用户询问后重跑同一命令;禁止编造。 |
|
|
153
|
-
| `contact_field_invalid` | `--require-contact` 包含不支持字段。 | 只使用 `email`、`phone`。 |
|
|
154
|
-
| `payment_method_invalid` | 付款方式不是允许值。 | 使用 `alipay` 或 `wechatpay`。 |
|
|
155
|
-
| `buy_parameter_invalid` | quantity/timeout 非正整数,或 `--no-wait` 未配 `--pay`。 | 修正参数;本次不创建资源。 |
|
|
156
|
-
| `service_quote_required` | Cart 含尚未绑定 Quote 的 Service Execution。 | 原样执行返回的 `services next <id> --json`;不要绕过 Quote 输入校验。 |
|
|
157
|
-
| `idempotency_conflict` | 同一幂等操作被用于不同请求。 | 保留句柄并执行 `itpay next --json`,不要换键重建。 |
|
|
158
|
-
| `buy_failed` | 非传输层的未知命令错误。 | 先执行 `itpay next --json` 或 `cart next --json` 恢复现有资源。传输失败使用 conventions 中的稳定 `network_*` 错误码。 |
|
|
159
|
-
|
|
160
|
-
所有参数错误都必须在 HTTP 和本地 Cart 变更前被拒绝。服务 Cart 只有每条 service-backed line 都绑定有效 Quote 时才能创建 Checkout;付款后 Backend 按 Order Item 分别推进 Execution。
|
|
161
|
-
|
|
162
|
-
## Agent Type / Host
|
|
163
|
-
|
|
164
|
-
| Agent Type | 默认 Host | JSON handoff | Instruction |
|
|
165
|
-
|---|---|---|---|
|
|
166
|
-
| `codex-desktop` | `codex` | `url`、可用时 `qr_local_path` 和 `markdown` | 把 `handoff.markdown` 原样发到当前 Codex 对话,确认二维码和链接可见后等待。 |
|
|
167
|
-
| `codex-cli` | `terminal` | `url` | 非 JSON 模式在用户可见终端渲染二维码;始终保留付款链接。 |
|
|
168
|
-
| `claude-code-desktop` | `claude-code` | `url`、可用时 `qr_local_path` 和 `markdown` | 把 Markdown handoff 发到当前桌面对话,不能只输出本地路径。 |
|
|
169
|
-
| `claude-code-cli` | `terminal` | `url` | 在用户可见终端展示;不能声称桌面对话已收到图片。 |
|
|
170
|
-
| `workbuddy` | `plain-chat` | `url,agent_action` | 原样执行一次 `present_files(files=[url])`,在右侧打开完整渲染的 HTML Card Link,然后停止。 |
|
|
171
|
-
| `zcode` | `plain-chat` | `url` | 立即用 ZCode 内置浏览器打开 URL;只有浏览器不可用时才展示同一个可点击链接。 |
|
|
172
|
-
| `doubao-work` | `plain-chat` | `url,qr_image_url` | 展示“手机直接打开收银台”和“二维码图片(保存或用另一台设备扫码)”两个有标签的官方入口,说明金额后停止。 |
|
|
173
|
-
| `kimi-code` | `terminal` | `url` | 使用标准 CLI 非 JSON 终端二维码和链接。 |
|
|
174
|
-
| `openclaw` | 必须显式 | Telegram 返回 `url,qr_image_url,agent_action`;其他入口返回 `url,qr_image_url` | Telegram 执行原生 `message` action;其他入口直接展示图片和链接。 |
|
|
175
|
-
|
|
176
|
-
显式 `--host` 可以覆盖展示方式,但不会改变 Agent Type、设备身份、金额、权限或交易状态。
|
|
177
|
-
|
|
178
|
-
OpenClaw 缺少 `--host`,或 IM Host 缺少 `--target` 时,必须在创建 Cart/Checkout 前分别返回 `host_required` 或 `target_required`。
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The public package provides Buyer workflows; Seller authoring source is maintained separately.
|
|
4
4
|
|
|
5
|
+
本命令仅用于用户明确要求的独立多服务Cart,不能作为普通购买或错误恢复旁路。
|
|
6
|
+
|
|
5
7
|
## 服务报价的批准边界
|
|
6
8
|
|
|
7
9
|
服务支持的 Quote/Cart/Checkout 共用服务端范围校验。缺少有效价格批准时返回完整 `approve_purchase` 模板,默认 `user_approved:false`;Agent 只在真实会话已同意当前主体、内容、价格或预算和条款时提交 true。选择候选或完成席别 review 不代替价格批准。同条件有效批准复用,已有 Checkout/未知付款先恢复原单,不补事后批准或创建替代订单。
|
|
@@ -65,7 +67,7 @@ Catalog 模式下 `--item`、`--variant`、`--offer` 必须成组且来自同一
|
|
|
65
67
|
"offer_id": "<offer_id>",
|
|
66
68
|
"quantity": 1
|
|
67
69
|
},
|
|
68
|
-
"instruction": "
|
|
70
|
+
"instruction": "仅写入本地未验证草稿,未验证目录、价格或服务合同;不要把它当作 canonical Cart。",
|
|
69
71
|
"next": { "command": "itpay cart show --local", "reason": "检查本地草稿" },
|
|
70
72
|
"recovery": []
|
|
71
73
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 命令范围
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
仅在用户明确要求组合独立服务时管理 canonical server Cart。Catalog line 可以创建 Service Execution;已准备好的 Service Quote 则通过 `cart add --quote` 加入 Cart。Cart 聚合交易,但不合并 Execution、候选归属或交付。
|
|
8
8
|
|
|
9
9
|
**上游:** Catalog item、variant、offer 和服务输入。
|
|
10
10
|
**下游:** Service Execution、Quote 聚合或 `buy`。
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
- [`cart show`](show.md)
|
|
18
18
|
- [`cart clear`](clear.md)
|
|
19
19
|
|
|
20
|
-
`--local`
|
|
20
|
+
`--local` 只用于显式本地未验证草稿,不得用于 service-backed flow。直接运行 `itpay cart` 显示 help。
|
|
21
21
|
|
|
22
22
|
## 语法、输出与异常
|
|
23
23
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The public package provides Buyer workflows; Seller authoring source is maintained separately.
|
|
4
4
|
|
|
5
|
+
本命令仅用于用户明确要求的独立多服务Cart,不能作为普通购买或错误恢复旁路。
|
|
6
|
+
|
|
5
7
|
## 服务报价的批准边界
|
|
6
8
|
|
|
7
9
|
服务支持的 Quote/Cart/Checkout 共用服务端范围校验。缺少有效价格批准时返回完整 `approve_purchase` 模板,默认 `user_approved:false`;Agent 只在真实会话已同意当前主体、内容、价格或预算和条款时提交 true。选择候选或完成席别 review 不代替价格批准。同条件有效批准复用,已有 Checkout/未知付款先恢复原单,不补事后批准或创建替代订单。
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
itpay cart show [--json] [--local]
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
默认只读取本地保存的 canonical Cart 句柄并调用服务端。`--local`
|
|
18
|
+
默认只读取本地保存的 canonical Cart 句柄并调用服务端。`--local` 只查看显式本地未验证草稿,不发 HTTP,也不会把该草稿解释成 canonical Cart。
|
|
19
19
|
|
|
20
20
|
## 标准输出
|
|
21
21
|
|
|
@@ -36,27 +36,7 @@ itpay cart show [--json] [--local]
|
|
|
36
36
|
|
|
37
37
|
canonical 输出不得包含 Catalog variant/offer、line input、Service quote lock、完整 Service Execution 或重复 guidance。空 Cart 的 next 改为 `catalog list --json`。
|
|
38
38
|
|
|
39
|
-
显式 local draft
|
|
40
|
-
|
|
41
|
-
```json
|
|
42
|
-
{
|
|
43
|
-
"status": "shown_local",
|
|
44
|
-
"result": {
|
|
45
|
-
"currency": "CNY",
|
|
46
|
-
"items": [
|
|
47
|
-
{
|
|
48
|
-
"catalog_item_id": "<item_id>",
|
|
49
|
-
"catalog_variant_id": "<variant_id>",
|
|
50
|
-
"offer_id": "<offer_id>",
|
|
51
|
-
"quantity": 1
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
"instruction": "这是未验证的本地兼容草稿,只能用于明确的普通商品流程;不要把它当作 canonical Cart。",
|
|
56
|
-
"next": { "command": "itpay buy --json", "reason": "将普通本地草稿提交为 canonical Cart" },
|
|
57
|
-
"recovery": []
|
|
58
|
-
}
|
|
59
|
-
```
|
|
39
|
+
显式 local draft 只展示未验证草稿(shown_local/local_empty);不验证目录或价格,不能作为原购买恢复或授权替代。要继续独立Cart时只按当前返回的完整动作,不由示例生成新的购买命令。
|
|
60
40
|
|
|
61
41
|
## 异常处理
|
|
62
42
|
|
|
@@ -1,47 +1,13 @@
|
|
|
1
1
|
# `itpay catalog list`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## 范围与意义
|
|
6
|
-
|
|
7
|
-
列出当前 published Catalog。每个项目先说明用户真正购买的主服务,再说明免费或付费的辅助能力,避免把辅助消歧误称为最终服务。
|
|
8
|
-
|
|
9
|
-
**上游:** `readyz`。
|
|
10
|
-
**下游:** `services start <service_id>`。
|
|
11
|
-
|
|
12
|
-
## 语法与参数
|
|
3
|
+
读取已发布服务与公开操作,不运行服务、不创建资源。用户已有任务时沿原执行恢复,不重新发现一遍目录。
|
|
13
4
|
|
|
14
5
|
```bash
|
|
15
6
|
itpay catalog list [--json]
|
|
16
7
|
```
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```json
|
|
21
|
-
{
|
|
22
|
-
"status": "listed",
|
|
23
|
-
"result": {
|
|
24
|
-
"catalog_version": "<version>",
|
|
25
|
-
"services": [
|
|
26
|
-
{
|
|
27
|
-
"service_id": "<service_id>",
|
|
28
|
-
"title": "<product title>",
|
|
29
|
-
"description": "<what the user receives>",
|
|
30
|
-
"discovery": { "title": "<helper title>", "description": "<optional helper>", "free_quota": 3, "paid_price": "<optional price>" },
|
|
31
|
-
"primary_offer": { "title": "<offer title>", "description": "<deliverable>", "price": "<price>" }
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"instruction": "向用户解释主服务、辅助步骤和价格;得到用户意图后再启动对应 service_id。",
|
|
36
|
-
"next": { "command": "itpay --agent-type <agent_type> services start <service_id> --json", "reason": "启动用户选择的服务" },
|
|
37
|
-
"recovery": []
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## 异常处理
|
|
42
|
-
|
|
43
|
-
输出不得包含 snapshot、manifest 原文、Arazzo workflow 或 Provider secret。服务为空时返回 `catalog_empty`,要求稍后重试,不猜服务 ID。
|
|
9
|
+
返回 catalog_version 和服务摘要:公开 definition 包含服务名、用途、版本、entry、operation角色/价格及是否需要continuation。查询免费不等于票款免费;报价以当前确认材料为准。不存在定义时不猜operation或价格。
|
|
44
10
|
|
|
45
|
-
|
|
11
|
+
只有一项服务时 next 可提供该服务的完整入口,仍须匹配用户意图;多个服务时 next=null,由 Agent 根据原需求选当前 entry。不把带 service_id 或 agent_type 占位符的示意命令当成可执行next。空目录结束读取,不自动重试或猜ID。
|
|
46
12
|
|
|
47
|
-
|
|
13
|
+
输出不含manifest原文、供应商凭据或内部工作流。当前参数与实际错误来自help/运行返回;所有宿主目录事实一致。
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
读取并恢复一笔已存在 Checkout 的公开展示状态。它不创建新 Checkout,也不把“用户说已付款”当作付款成功。
|
|
8
8
|
|
|
9
|
-
**上游:** `buy`
|
|
9
|
+
**上游:** `services purchase`、明确独立Cart的 `buy` 或原 Checkout reader 返回的 `checkout_id` 与 display token。
|
|
10
10
|
**下游:** 继续授权/付款、读取关联 Service Execution,或结束等待。
|
|
11
11
|
|
|
12
12
|
## 语法与参数
|
|
@@ -74,20 +74,6 @@ token 缺失或不匹配时使用本机句柄恢复。只有请求的 Checkout
|
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## 宿主交付
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| Agent Type | Handoff |
|
|
82
|
-
|---|---|
|
|
83
|
-
| `codex-desktop` | `url, qr_local_path, markdown`;原样发送 Markdown。 |
|
|
84
|
-
| `codex-cli` | `url`;普通文本模式渲染终端二维码。 |
|
|
85
|
-
| `claude-code-desktop` | `url, qr_local_path, markdown`;原样发送 Markdown。 |
|
|
86
|
-
| `claude-code-cli` | `url`;普通文本模式渲染终端二维码。 |
|
|
87
|
-
| `workbuddy` | 返回 `url,agent_action`;原样执行一次 `present_files(files=[url])` 打开完整渲染的 HTML Card Link,不生成本地文件。 |
|
|
88
|
-
| `zcode` | 返回 `url`;立即用 ZCode 内置浏览器打开,不只粘贴文字链接,也不生成或重建二维码文件。 |
|
|
89
|
-
| `doubao-work` | 返回 `url,qr_image_url`;展示手机直达收银台链接和官方二维码图片链接,说明金额后停止。 |
|
|
90
|
-
| `kimi-code` | `url`;普通文本模式渲染标准终端二维码。 |
|
|
91
|
-
| `openclaw` | Telegram 为 `url,qr_image_url,agent_action`;instruction 强制原样执行 action。`📋 已授权给我读` callback 触发同一 Checkout 查询,再由 Backend 决定是否进入 grant 读取;其他显式 Host 为 `url,qr_image_url`。 |
|
|
92
|
-
|
|
93
|
-
完成、退款或失效状态下所有 Agent Type 都只返回同一状态和下一步,不渲染二维码。OpenClaw 的 `--target` 必须使用原生 chat target 并传入展示层,不能添加 `telegram:` 前缀或被 CLI 参数解析后丢弃。
|
|
79
|
+
采用正式 Skill 和当前 handoff 的宿主动作;原生工具不可用或可选图片失败时同轮展示原官方URL,不创建替代付款资源。callback与人的付款陈述都不证明支付;完成、退款或失效状态不再生成付款展示。
|
|
@@ -1,39 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# itpay device
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
保持当前设备身份和实际Agent Type。正常授权与会话续期由CLI处理;业务错误不能触发身份替换或缓存清理。安装准备见install-and-setup,当前账号登录见identity-and-sessions。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 当前操作
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## `itpay device recover`
|
|
12
|
-
|
|
13
|
-
Only after an operator confirms the selected Backend registration database was reset:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
itpay --agent-type <agent_type> device recover --confirm-backend-reset --json
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
This invalidates the selected Backend's caches, preserves the key, old identity and other Backend contexts, and returns a same-Backend/type `auth status` command. It does not contact the Backend itself or authorize business. Missing type or confirmation fails before mutation. Do not use it for expiry, revocation, quota or an unconfirmed failure.
|
|
20
|
-
|
|
21
|
-
Success status is `backend_cache_invalidated` or `backend_cache_absent`; `result.invalidated_agent_types` records the affected types. The next device check proves the original key to the selected Backend and reuses its authoritative Device/key/quota lineage. No token or private key appears in output.
|
|
22
|
-
|
|
23
|
-
## `itpay device repair-lock`
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
itpay device repair-lock --json
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Compatibility explanation only: status `device_legacy_lock_unmanaged`, lock_status `unmanaged`, identity preserved. No legacy file is read, moved or deleted. This does not claim a lock was repaired. Ordinary authorization needs no lock cleanup.
|
|
30
|
-
|
|
31
|
-
## `itpay device reset-key`
|
|
32
|
-
|
|
33
|
-
This version does not support automatic device key reset. The command name and existing type/confirmation guards remain recognized:
|
|
34
|
-
|
|
35
|
-
```sh
|
|
36
|
-
itpay --agent-type <agent_type> device reset-key --confirm-key-reset --json
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
It returns nonzero `device_key_reset_unavailable`, next=null, recovery=[]; the original identity is unchanged. Do not delete a key manually, install an older version to reset it, or present this command as a recovery action. Restoring safe explicit key replacement requires a separately reviewed implementation.
|
|
7
|
+
- status:读取当前设备状态。
|
|
8
|
+
- recover:仅运营已确认当前Backend登记库重置,且用户明确授权时,带--confirm-backend-reset处理该Backend缓存。保留设备身份及其他环境状态;不是普通失败恢复动作。
|
|
9
|
+
- repair-lock、reset-key:当前不可用,不能作为恢复动作;不改身份。reset-key保留--confirm-key-reset参数识别并返回明确错误。
|
|
10
|
+
- --agent-type、--json:使用实际宿主类型和结构化输出。全部参数以当前--help为准;未知结果停止,不删除身份。
|
|
@@ -45,25 +45,7 @@ itpay docs show <topic> [--json]
|
|
|
45
45
|
|
|
46
46
|
## 异常处理
|
|
47
47
|
|
|
48
|
-
topic
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"status": "error",
|
|
53
|
-
"error": {
|
|
54
|
-
"code": "doc_not_found",
|
|
55
|
-
"message": "doc topic not found: <topic>"
|
|
56
|
-
},
|
|
57
|
-
"instruction": "使用稳定 topic 名称;不要根据标题猜 topic。",
|
|
58
|
-
"next": null,
|
|
59
|
-
"recovery": [
|
|
60
|
-
{ "command": "itpay docs list --json", "reason": "列出全部 topic" },
|
|
61
|
-
{ "command": "itpay docs search <topic> --json", "reason": "按关键词重新搜索" }
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
文档文件损坏使用 `docs_unavailable`,与 `docs list` 相同。
|
|
48
|
+
topic 不存在按当前返回使用稳定topic名称;文档缺失/损坏使用真实错误停止,由原安装方式修复,不猜标题、编造命令或另装全局CLI。
|
|
67
49
|
|
|
68
50
|
## Agent Type / Host
|
|
69
51
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## 范围与意义
|
|
4
4
|
|
|
5
5
|
在当前 Local Agent 完成一笔已有 Order 后,记录一次最小、安全的服务复盘。用户评分
|
|
6
|
-
和原话均为可选;Agent
|
|
6
|
+
和原话均为可选;Agent 即使没有收到评分或评论,可以提交已知的安全服务结果上下文,复盘可选且不延迟交付。CLI
|
|
7
7
|
通过 Feedback 专用选项接口选择真实项目,再调用现有 Feedback Owner。用户不需要知道
|
|
8
8
|
Order ID、Order Item ID、Device 或 Agent Instance。
|
|
9
9
|
|
|
@@ -98,7 +98,7 @@ CLI 不读取或上传 Host 对话、WorkBuddy/ZCode sandbox 日志或其他本
|
|
|
98
98
|
未评分时成功结果省略 `rating`。同一 submitter 在用户后来补充评分或评论时会更新
|
|
99
99
|
现有记录并重新进入 `new`,不是创建第二条。
|
|
100
100
|
|
|
101
|
-
如果用户没有给出评分或评论,Agent
|
|
101
|
+
如果用户没有给出评分或评论,Agent 可选提交安全 Context;成功 instruction 改为“无需打扰
|
|
102
102
|
用户”,不得声称用户表达过意见。
|
|
103
103
|
|
|
104
104
|
## 多项目 JSON
|
|
@@ -119,21 +119,9 @@ CLI 不读取或上传 Host 对话、WorkBuddy/ZCode sandbox 日志或其他本
|
|
|
119
119
|
}
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
##
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
| --- | --- |
|
|
126
|
-
| `order_required` | 使用当前 exact Agent 的 `services list` 恢复原服务;找不到时指向官方订单页或原 Local Agent,不用账号订单/Vault 绕过。 |
|
|
127
|
-
| `feedback_rating_invalid` | 用户提供了评分但格式不是 1–5;不提交、不猜测。 |
|
|
128
|
-
| `feedback_note_too_long` | 请用户缩短;不截断、不提交。 |
|
|
129
|
-
| `feedback_unavailable` | 该 Order 当前没有可反馈项目;不猜 ID。 |
|
|
130
|
-
| `feedback_item_invalid` | 重新使用返回的项目 rank;不提交。 |
|
|
131
|
-
| `feedback_not_available_for_agent` | 当前 Agent 不能代该订单提交;指向官方订单页或原 Local Agent,不切身份绕过。 |
|
|
132
|
-
| `feedback_rejected` | 输入未被记录;只有用户修正明确输入后才重试。 |
|
|
133
|
-
| `feedback_submission_unknown` | 无法确认是否记录;停止自动重试,只有用户明确要求后才再次提交。 |
|
|
134
|
-
|
|
135
|
-
Feedback POST 不做自动 transport retry。虽然 Backend 使用 upsert,重放仍会更新记录
|
|
136
|
-
并追加事件,CLI 不能把它当成无副作用查询。
|
|
122
|
+
## 记录边界
|
|
123
|
+
|
|
124
|
+
按实际返回的项目、权限与输入要求处理;缺真实评分不猜,无法确认记录结果就停止自动重试。Feedback POST 不做自动 transport retry;后台upsert仍会追加事件,不能当只读查询。原账号级读取授权、MCP或其他Agent历史不赋予写权限;不换身份绕过。复盘可选,不打断结果/官方入口交付。
|
|
137
125
|
|
|
138
126
|
## Agent Type / Host
|
|
139
127
|
|