@itpay/cli 2.1.19 → 2.1.29
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 +2 -2
- package/dist/src/commands/buy.js +3 -3
- package/dist/src/commands/cart.js +15 -15
- package/dist/src/commands/catalog.js +10 -7
- package/dist/src/commands/checkout.js +8 -11
- package/dist/src/commands/docs.js +3 -14
- package/dist/src/commands/guidance.js +41 -25
- package/dist/src/commands/install.js +2 -2
- package/dist/src/commands/order.js +4 -3
- package/dist/src/commands/orders.js +4 -9
- package/dist/src/commands/pay.js +1 -1
- package/dist/src/commands/rail_catalog.js +160 -11
- package/dist/src/commands/refund.js +5 -5
- package/dist/src/commands/services.js +658 -361
- package/dist/src/commands/skill.js +1 -1
- package/dist/src/commands/vault.js +27 -20
- package/dist/src/main.js +39 -24
- package/dist/src/render/markdown.js +0 -3
- package/dist/src/state/account_auth.js +9 -5
- package/dist/src/state/cart_session.js +4 -1
- package/dist/src/state/config.js +1 -1
- package/dist/src/state/task_journal.js +2 -0
- package/docs/agent/buyer/cart-checkout.json +5 -4
- package/docs/agent/buyer/catalog-list.json +24 -6
- package/docs/agent/buyer/identity-and-sessions.json +16 -15
- package/docs/agent/buyer/install-and-setup.json +5 -4
- package/docs/agent/buyer/orders-refunds.json +11 -5
- package/docs/agent/buyer/payment-flow.json +3 -3
- package/docs/agent/buyer/purchased-content.json +18 -4
- package/docs/agent/buyer/quickstart.json +22 -14
- package/docs/agent/buyer/rail-booking.json +125 -171
- package/docs/agent/buyer/rail-fast-checkout.json +21 -44
- package/docs/agent/buyer/render-hosts.json +9 -6
- package/docs/agent/buyer/service-feedback.json +2 -1
- package/docs/cli-reference/agent-types.md +1 -1
- package/docs/cli-reference/commands/auth.md +2 -0
- package/docs/cli-reference/commands/buy.md +1 -1
- package/docs/cli-reference/commands/cart/add.md +1 -1
- package/docs/cli-reference/commands/cart/clear.md +1 -1
- package/docs/cli-reference/commands/cart/index.md +1 -1
- package/docs/cli-reference/commands/cart/next.md +1 -1
- package/docs/cli-reference/commands/cart/remove.md +1 -1
- package/docs/cli-reference/commands/cart/show.md +1 -1
- package/docs/cli-reference/commands/catalog/index.md +1 -1
- package/docs/cli-reference/commands/catalog/list.md +1 -1
- package/docs/cli-reference/commands/checkout.md +1 -1
- package/docs/cli-reference/commands/device.md +8 -7
- package/docs/cli-reference/commands/docs/index.md +1 -1
- package/docs/cli-reference/commands/docs/list.md +1 -1
- package/docs/cli-reference/commands/docs/search.md +1 -1
- package/docs/cli-reference/commands/docs/show.md +1 -1
- package/docs/cli-reference/commands/install.md +2 -2
- package/docs/cli-reference/commands/next.md +1 -1
- package/docs/cli-reference/commands/order.md +1 -1
- package/docs/cli-reference/commands/pay.md +1 -1
- package/docs/cli-reference/commands/readyz.md +1 -1
- package/docs/cli-reference/commands/refund/cancel.md +1 -1
- package/docs/cli-reference/commands/refund/create.md +1 -1
- package/docs/cli-reference/commands/refund/get.md +2 -2
- package/docs/cli-reference/commands/refund/index.md +1 -1
- package/docs/cli-reference/commands/refund/list.md +1 -1
- package/docs/cli-reference/commands/refund/watch.md +1 -1
- package/docs/cli-reference/commands/services/action.md +3 -3
- package/docs/cli-reference/commands/services/checkout.md +1 -1
- package/docs/cli-reference/commands/services/events.md +1 -1
- package/docs/cli-reference/commands/services/get.md +1 -1
- package/docs/cli-reference/commands/services/index.md +1 -1
- package/docs/cli-reference/commands/services/invoke.md +5 -13
- package/docs/cli-reference/commands/services/list.md +1 -1
- package/docs/cli-reference/commands/services/next.md +12 -10
- package/docs/cli-reference/commands/services/page.md +9 -7
- package/docs/cli-reference/commands/services/quote.md +1 -1
- package/docs/cli-reference/commands/services/read-result.md +16 -9
- package/docs/cli-reference/commands/services/run.md +4 -2
- package/docs/cli-reference/commands/services/start.md +1 -1
- package/docs/cli-reference/conventions.md +2 -2
- package/package.json +7 -5
- package/skills/itpay/SKILL.md +77 -238
- package/docs/reviews/agent-ux-handoff-2026-09-23/IMPLEMENTATION-EVIDENCE.md +0 -174
- package/docs/skill-bundle-rollout/01-mcp-authentication.md +0 -134
- package/docs/skill-bundle-rollout/02-platform-bundle-repositories.md +0 -210
- package/docs/skill-bundle-rollout/03-platform-publishing.md +0 -161
- package/docs/skill-bundle-rollout/04-first-wave-platforms.md +0 -70
- package/docs/skill-bundle-rollout/05-sync-operations.md +0 -62
- package/docs/skill-bundle-rollout/README.md +0 -151
- /package/bin/{itp → itp.mjs} +0 -0
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
# `itpay services invoke`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
7
7
|
调用当前 phase 允许的非付费 Agent-visible capability。输入先按 capability schema 校验,校验失败不得迁移 execution 或记录 Provider 已调用。
|
|
8
8
|
|
|
9
9
|
**上游:** `services start/next` 明确返回 invoke。
|
|
10
|
-
**下游:** 候选结果、人工 action 或付费 Quote
|
|
10
|
+
**下游:** 候选结果、人工 action 或付费 Quote。此页的候选人工选择示例适用于相应的非铁路服务;铁路按 `rail-booking` 的已保存结果和委托选择合同。Provider 错误先按实际错误码和当前 execution 状态恢复,不猜新输入或自动新建。
|
|
11
11
|
|
|
12
12
|
## 语法与参数
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
itpay services invoke <service_execution_id> --capability <capability_id>
|
|
16
|
-
[--input <key=value> ...] [--json]
|
|
16
|
+
[--input <key=value> ... | --input-json <file>] [--json]
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
`--input` 可重复;必填 key 来自 `input_schema.required`,值按 schema 类型解析。Agent
|
|
19
|
+
`--input` 可重复;必填 key 来自 `input_schema.required`,值按 schema 类型解析。Agent 不猜字段名。嵌套对象使用已有 JSON 文件读取方式 `--input-json <file>`;文件必须是完整对象,与 `--input` 二选一,冲突或解析失败不会调用供应商。
|
|
20
20
|
|
|
21
21
|
## 有结果输出
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
`result.catalog` 带搜索覆盖范围、模型来源和推荐引用;`recommended=true` 的方案排在首位。
|
|
25
|
-
本地 Agent 应先解释首推及不同取舍,用户不满意时可继续查看同一次返回的完整列表。
|
|
26
|
-
智能规划返回 `verified_phone_required` 时,先完成 ItPay 网页手机号验证,不在 CLI 收集手机号、身份证或姓名。
|
|
27
|
-
该错误发生在供应商调用和额度预占之前。
|
|
28
|
-
本地验证环境中 CLI 会返回 `verification_url`,用户在该网页验证手机号并确认连接 Agent。
|
|
29
|
-
完成后重试同一条 invoke;不在终端输入或回传手机验证码。
|
|
23
|
+
以下是非铁路候选服务的示例。铁路使用 `services run` 和 `services read-result` 返回的范围、完整紧凑目录与当前动作;不要把这里的 `select_candidate` 人工动作套用到已授权委托的铁路选择。
|
|
30
24
|
|
|
31
25
|
```json
|
|
32
26
|
{
|
|
@@ -161,5 +155,3 @@ Provider 已收到请求时,Backend 返回同一 Execution 的权威调用和
|
|
|
161
155
|
## Agent Type / Host
|
|
162
156
|
|
|
163
157
|
所有正式支持的 Local Agent Type 的 safe result 一致。instruction 可以适配对话表述,但不得隐藏 quota、价格或 schema 错误。
|
|
164
|
-
|
|
165
|
-
本地模拟购票阶段:用户选定候选后才提交选择,并使用 `services quote --capability book_ticket` 获取实时票款加每张 2 元服务费的锁定报价。精确查询需在报价输入中指定候选里可售的 `seat_type`;智能方案沿用所选席别。`pricing_method=rail_fare_plus_fee` 不代表总价 2 元。乘客资料仅在 Checkout 网页填写。本地出票结果明确标记 `simulation=true`,不表示真实出票。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `itpay services list`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `itpay services next`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
@@ -16,18 +16,19 @@ Backend 会根据当前 capability 选择 `current_delivery`;完整 `delivery_
|
|
|
16
16
|
## 语法与参数
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
itpay services next <service_execution_id> [--json]
|
|
19
|
+
itpay services next <service_execution_id> [--timeout <seconds>] [--since-snapshot <snapshot_id>] [--json]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
| 参数 | 必填 | 说明 |
|
|
23
23
|
| --- | --- | --- |
|
|
24
24
|
| `service_execution_id` | 是 | `services start` 或后续命令返回的 execution ID。 |
|
|
25
|
+
| `--timeout <seconds>` | 否 | 同一执行上的有界只读等待,0–120 秒,默认 0;查询等待中的推荐命令使用 120。已有业务结果、真实用户动作或终态会提前返回。 |
|
|
25
26
|
| `--since-snapshot <snapshot_id>` | 否 | rail.progressive.v2 增量读:传上次看到的 `snapshot_id`,未变化时只回扩展状态与 `result_not_updated`,不重复下发 journey 负载;永远不触发供应商调用。 |
|
|
26
27
|
| `--json` | 否 | 输出稳定 JSON 信封;未指定时输出相同事实的简洁文本。 |
|
|
27
28
|
|
|
28
29
|
需要有效 Agent Device session。命令不接受 Buyer token、capability 或服务输入。
|
|
29
30
|
|
|
30
|
-
##
|
|
31
|
+
## 非铁路服务的候选选择
|
|
31
32
|
|
|
32
33
|
免费或付费候选已经产生、Arazzo workflow 允许继续选择时,恢复输出必须包含当前 Result Set 的安全候选:
|
|
33
34
|
|
|
@@ -49,9 +50,9 @@ itpay services next <service_execution_id> [--json]
|
|
|
49
50
|
}
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
该列表来自 Backend 的 `current_result_items`,CLI 不缓存或合并其他 Execution
|
|
53
|
+
该列表来自 Backend 的 `current_result_items`,CLI 不缓存或合并其他 Execution 的候选。铁路 Exact 的正常返回改走 `read-result` 已保存车次行及逐行 `detail.command`;Smart 的委托选票用 `select_delegated`(actor-type agent),只有用户亲自选定才用 `select_user_chosen`(actor-type human)。
|
|
53
54
|
|
|
54
|
-
## Agent-visible 结果
|
|
55
|
+
## 非铁路服务的 Agent-visible 结果
|
|
55
56
|
|
|
56
57
|
```json
|
|
57
58
|
{
|
|
@@ -196,7 +197,7 @@ itpay services next <service_execution_id> [--json]
|
|
|
196
197
|
}
|
|
197
198
|
```
|
|
198
199
|
|
|
199
|
-
`succeeded` 退款改为“交付永久关闭”,并返回 `next: null`。取消、拒绝或确定未产生资金影响的失败退款不再阻塞,但旧 grant
|
|
200
|
+
`succeeded` 退款改为“交付永久关闭”,并返回 `next: null`。取消、拒绝或确定未产生资金影响的失败退款不再阻塞,但旧 grant 不会复活;是否需要新的交付授权由当前 owner 状态与返回动作决定。
|
|
200
201
|
|
|
201
202
|
## 额度暂停(试用/限流)
|
|
202
203
|
|
|
@@ -248,7 +249,7 @@ itpay services run itpay-rail-booking --input-json booking.json --json
|
|
|
248
249
|
# booking.json: {"passengers": 1, "selection": {"token": "<selection_token>", "seat_type": "O"}}
|
|
249
250
|
```
|
|
250
251
|
|
|
251
|
-
`booking_offer`
|
|
252
|
+
`booking_offer` 只是受条件约束的可选承接:查询完成本身已满足查询目标,不自动购买。过期 token 不会因重读保存结果而恢复;按当前 owner 错误与用户原请求取得新的实时选择证据,不手工拼装 `legs` 绕过失效凭据。
|
|
252
253
|
|
|
253
254
|
## 订票确认(booking review)
|
|
254
255
|
|
|
@@ -267,7 +268,8 @@ itpay services run itpay-rail-booking --input-json booking.json --json
|
|
|
267
268
|
"required_fields": ["draft_revision", "passengers", "seat_type", "seat_preferences", "party_preference", "fallback", "notice_version", "accept_non_guaranteed"]
|
|
268
269
|
},
|
|
269
270
|
"instruction": "向用户展示行程与可选席别/座位偏好词表,并明确告知:座位偏好仅为请求、不保证分配。收集后经 --input-json 提交完整 JSON;draft_revision 以服务端当前值为准。",
|
|
270
|
-
"next":
|
|
271
|
+
"next": null,
|
|
272
|
+
"interaction": { "input_template": { "command": "itpay services action <id> --action workflow:confirm_booking --actor-type human --status approved --input-json <file> --json", "executable": false } },
|
|
271
273
|
"recovery": [{ "command": "itpay services next <id> --json", "reason": "重新读取当前 draft_revision 后重试" }]
|
|
272
274
|
}
|
|
273
275
|
```
|
|
@@ -299,5 +301,5 @@ itpay services get <service_execution_id> --json
|
|
|
299
301
|
|
|
300
302
|
- `running`/`queued`:稍后按 `next.command` 增量轮询同一执行;不要重新发起查询。
|
|
301
303
|
- `paused`:首批结果已就绪、扩展暂停等待用户意图;`expand_search` 是唯一会再消耗供应商配额的动作。
|
|
302
|
-
- `complete
|
|
303
|
-
- 选票走 `select_journey`
|
|
304
|
+
- `complete`:扩展收敛;比较任务已满足就展示推荐并停止,购买委托则按明确规则选择。
|
|
305
|
+
- 选票走 `select_journey` 动作:卡片的 `select_delegated` 供已授权委托的 Agent 选择,`select_user_chosen` 仅用于用户亲自选定;乘车人身份信息永远只在受保护 Checkout 页面填写。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `itpay services page`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**上游:** `services run`、`services next` 返回的分页提示(`catalog_page.next_offset`)。
|
|
10
10
|
**下游:** 继续翻下一页,或在用户明确选择后用 `booking_offer` 承接购票。
|
|
11
11
|
|
|
12
|
-
本命令不接受 Buyer token、capability
|
|
12
|
+
本命令不接受 Buyer token、capability 或服务输入;CLI 可把已有保存车次投影成便于比较的业务行和购买模板,不增加供应商事实。Agent 不向用户暴露 `safe_payload`、Execution 或内部 ID。
|
|
13
13
|
|
|
14
14
|
## 语法与参数
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ rail.progressive.v2 中 `<result_item_id>` 也可以是规划快照 ID(`rps_
|
|
|
24
24
|
| `service_execution_id` | 是 | 产生该结果集的 Execution ID。 |
|
|
25
25
|
| `result_item_id` | 是 | `services next` 或分页响应中的 `service_capability_result_item_id`。 |
|
|
26
26
|
| `--offset` | 否 | 从零开始的候选偏移;默认 `0`,必须是非负整数。 |
|
|
27
|
-
| `--limit` | 否 | 页大小,`1` 到 `20` 的整数;默认 `
|
|
27
|
+
| `--limit` | 否 | 页大小,`1` 到 `20` 的整数;默认 `20`。 |
|
|
28
28
|
| `--json` | 否 | 输出稳定 JSON 信封;未指定时输出本页候选标题的简洁文本。 |
|
|
29
29
|
|
|
30
30
|
需要有效 Agent Device session。
|
|
@@ -40,20 +40,22 @@ rail.progressive.v2 中 `<result_item_id>` 也可以是规划快照 ID(`rps_
|
|
|
40
40
|
"service_execution_id": "<id>",
|
|
41
41
|
"service_capability_result_item_id": "<item_id>",
|
|
42
42
|
"offset": 0,
|
|
43
|
-
"limit":
|
|
43
|
+
"limit": 20,
|
|
44
44
|
"total": 63,
|
|
45
|
-
"count":
|
|
46
|
-
"next_offset":
|
|
45
|
+
"count": 20,
|
|
46
|
+
"next_offset": 20,
|
|
47
47
|
"page": { "catalog_page": { "...": "..." }, "candidates": [ { "title": "<title>" } ] }
|
|
48
48
|
},
|
|
49
49
|
"instruction": "读取的是已保存结果的同版本分页,不重新查询、不消耗额度。用普通语言向用户说明本页候选;铁路应付与地面估算费用分开表述;不要提及 safe_payload、Execution 或内部 ID。",
|
|
50
|
-
"next": { "command": "itpay services page <id> <item_id> --offset
|
|
50
|
+
"next": { "command": "itpay services page <id> <item_id> --offset 20 --json", "reason": "读取同版本结果的下一页" },
|
|
51
51
|
"recovery": []
|
|
52
52
|
}
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
`next_offset` 为 `null` 时 `next` 为 `null`;`offset > 0` 时 `recovery` 提供回到第一页的命令。页内候选可携带 `booking_offer`,承接方式与 `services next` 结果一致。
|
|
56
56
|
|
|
57
|
+
铁路 Exact 对已保存的单条车次使用 `--offset <result_offset> --limit 1 --json`,返回 `exact_train_detail`、当前席别代码与名称、库存/报价事实和 `booking_template`。模板中的 `selection.token` 来自服务端,`seat_type` 只能选当前返回的可购代码;人数按用户需求填写。查询价格不等于锁价。
|
|
58
|
+
|
|
57
59
|
## 异常处理
|
|
58
60
|
|
|
59
61
|
`--offset` 非负整数、`--limit` 必须在 `1`–`20` 内,否则在发起请求前返回 `offset_invalid` / `limit_invalid` 信封,不消耗服务端分页。execution 或 result item 不存在、不属于当前设备/账号时返回错误信封,并仅建议:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `itpay services quote`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
# `itpay services read-result`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
同一命令读取三种已保存结果:铁路 Exact 车次按页读取为紧凑业务行、铁路 Smart 快照分页紧凑车次目录,或持有效 grant 读取 Vault 保护内容。铁路读取免费、只读且不重新调用供应商。
|
|
8
8
|
|
|
9
|
-
**上游:** `services next` 返回 `vault_artifact
|
|
10
|
-
**下游:**
|
|
9
|
+
**上游:** 铁路查询的已保存结果入口,或 `services next` 返回 `vault_artifact` 且用户已在订单页面授权。
|
|
10
|
+
**下游:** 铁路紧凑行中使用逐行 `detail.command` 读取购买条件;Vault 仅在 grant scope 和 TTL 内使用返回字段。
|
|
11
11
|
|
|
12
12
|
## 语法与参数
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
itpay services read-result <service_execution_id> [--json]
|
|
15
|
+
itpay services read-result <service_execution_id> [--snapshot <snapshot_id>] [--journey <journey_id>] [--offset <offset>] [--limit <limit>] [--all] [--json]
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
| 参数 | 必填 | 说明 |
|
|
19
19
|
| --- | --- | --- |
|
|
20
|
-
| `service_execution_id` | 是 | Vault 交付对应的 execution ID。 |
|
|
21
|
-
| `--journey <journey_id>` | 否 | rail.progressive.v2 规划明细:读取指定 journey
|
|
22
|
-
| `--snapshot <snapshot_id>` | 否 |
|
|
20
|
+
| `service_execution_id` | 是 | 铁路查询或 Vault 交付对应的 execution ID。 |
|
|
21
|
+
| `--journey <journey_id>` | 否 | rail.progressive.v2 规划明细:读取指定 journey 的分段与席别选项;票计划按页返回。免费、属主校验、不触发供应商调用。 |
|
|
22
|
+
| `--snapshot <snapshot_id>` | 否 | 单独使用时读取该 Smart 已提交快照的紧凑线路页;与 `--journey` 配合时读取该线路详情页。 |
|
|
23
|
+
| `--offset <offset>` | 否 | Exact / Smart 保存结果从零开始的页偏移;不改变快照或重新查询。 |
|
|
24
|
+
| `--limit <limit>` | 否 | 保存结果当前页条数,1–20;Exact默认20条,Smart默认3条完整线路或3个票计划;必要时按最终输出字节缩小整行页。 |
|
|
25
|
+
| `--all` | 否 | 显式兼容读取 Exact / Smart 保存目录全量;输出可能很大,常规读取应沿当前页的 next.command。 |
|
|
23
26
|
| `--json` | 否 | 输出稳定 JSON 信封;未指定时输出相同事实的简洁文本。 |
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
Exact 执行按 offset/limit 读取已保存车次,返回 total、offset、count 和同一 read-result 的续页入口;不会把前100条冒充完整范围。Smart 使用 `--snapshot` 读取固定快照的默认小页,或用 `--journey` 读一条线路的票计划页;按返回的 next.command 续读同快照。这些读取不走 Vault grant。其他服务不带选择器时保持原授权路径。
|
|
29
|
+
|
|
30
|
+
Smart 保存目录按本次主推荐、其他合格线路、不可用或资格未知的诊断线路排列;`total` 仍是全部已保存时刻组合数,`qualification_counts` 分别说明当前合格、不合格、未知数。诊断线路保留车次、时刻和 `qualification_reasons`,其 `detail.command` 用于查看事实与原因,不表示可以购买。只有 `qualification_status=eligible` 且逐段票方案完整时,才给当前购买入口。历史快照缺资格字段按未知展示。`--all` 仍读取全部事实,不会重新查询铁路。
|
|
31
|
+
|
|
32
|
+
进度中的“保存组合”是具体车次与时刻组合数,不是不同站序数;“合格线路”按组合去重,profile 是同一组合下可推荐的席别及接驳选项数。模型实际调用和看到的合格组合以快照 coverage 为准;未穷尽范围不能称全网最优。推荐说明只披露当前方案实际涉及的地面交通、无座、跨日和分段票限制。
|
|
26
33
|
|
|
27
34
|
CLI 使用已登记设备的签名 session,不接受 Checkout token、Buyer token、`agent_device_id` 参数或开发者凭证。
|
|
28
35
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
运行 Catalog 中已发布的通用 Buyer workflow。CLI 只提交服务声明要求的输入,并复用现有 Service Execution、Checkout、交付和退款命令;它不解释或执行 Seller 提供的任意命令文本。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
没有提供输入且未指定现有 execution 时,本命令创建一次 Execution,返回已发布的 JSON input schema,并要求 Agent 继续同一 Execution。已有 Execution 必须通过 `--execution` 恢复,不能创建替代 Execution。
|
|
8
8
|
|
|
9
9
|
## 语法与参数
|
|
10
10
|
|
|
@@ -48,6 +48,8 @@ itpay services run <service_id>
|
|
|
48
48
|
|
|
49
49
|
Agent 必须展示 schema 所需信息并等待用户提供真实输入;不得猜值,也不得为补输入创建新 Execution。
|
|
50
50
|
|
|
51
|
+
铁路 Smart 新版 schema 使用 `endpoints.origin` / `endpoints.destination`,每端独立填写区域 `area`、具体地点 `place` 或准确车站 `station` 与原文 `text`;类型未确定可省略 `kind`。区域、地点和车站的九种组合共用这一输入。以当前执行返回的 `input_schema` 为准:旧 v4 执行仍使用旧字段;新版不可混填旧 `origin` / `destination`、坐标或锁站布尔值。地点/日期实质变更发起关联新查询,沿已保存结果返回的 `new_query_template` 填写真实变化;偏好、人数和期限在相同端点/日期下使用已有 `refine_preferences` 动作。
|
|
52
|
+
|
|
51
53
|
## 执行与付款
|
|
52
54
|
|
|
53
55
|
提供输入后,CLI 使用稳定 idempotency key 向同一 Execution 提交一次。`queued` 或 `running` 只轮询该 Execution。进入付款步骤时,CLI 调用现有 `services checkout`,返回其标准 `human_checkout_required` 输出和 Host handoff;不会实现第二套付款逻辑。
|
|
@@ -93,7 +95,7 @@ itpay services run <service_id> --execution <execution_id> --json
|
|
|
93
95
|
}
|
|
94
96
|
```
|
|
95
97
|
|
|
96
|
-
`query_quota`
|
|
98
|
+
`query_quota` 如实报告各查询服务自己的 `used`、`limit`、`remaining`。是否暂停只以本次服务端 `admission` 为准;已有结果先正常交付,不把另一服务的额度当作本次授权。
|
|
97
99
|
|
|
98
100
|
登录绑定完成后,再次运行同一条 `services run <service> --execution <id> --json`(不带输入文件):服务端重新读取当前设备绑定身份,被暂停的 Execution 从额度节点继续,不重放已成功的供应商调用,不要求重新输入。`failed`、`recovery_required` 或已完成付款的 Execution 不能以这种方式恢复。
|
|
99
101
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `itpay services start`
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 范围与意义
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Output And Error Contract
|
|
2
2
|
|
|
3
|
-
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation.
|
|
3
|
+
> **Product boundary:** `itpay` is the single public CLI entry point, and `$itpay` is its user-facing Skill invocation. The same entry point supports Buyer workflows and the existing `itpay sell` Seller workflow.
|
|
4
4
|
|
|
5
5
|
## 目标
|
|
6
6
|
|
|
@@ -78,7 +78,7 @@ next: <one command>
|
|
|
78
78
|
- 用户口头说“已付款”不是支付事实;仅服务端 `verified` 状态有效。
|
|
79
79
|
- `agent_device_session_required` 只触发一次 session 续期和同请求重试;第二次失败必须返回,不得循环或换身份。
|
|
80
80
|
- `device_state_unwritable` 表示当前运行环境不能可靠持久化 `~/.itpay-v3`;保持同一 Agent Type 与 CLI/Node launcher,恢复 Host 写权限后重试原命令,不得手工造 lock、删除身份或换运行时碰运气。
|
|
81
|
-
- WorkBuddy
|
|
81
|
+
- WorkBuddy 需通过宿主的正常权限机制允许 CLI 持久化 `~/.itpay-v3`。若被拦截,报告受阻操作和宿主原因;不切换 Node、删除 identity 或猜测性处理活跃 lock。
|
|
82
82
|
- `provider_input_rejected` 只表示 Provider 明确声明输入无效;`provider_contract_mismatch` 表示响应无法按已发布契约解释,绝不能归咎于用户输入。两者都必须停止且没有自动 recovery。
|
|
83
83
|
- `backend_contract_incompatible` 只有在 Backend 返回合法 `minimum_cli_version` 时才能提供升级 recovery。npm 分发返回精确的 `npm install -g @itpay/cli@<version>`;平台 bundle 返回该平台的 Skill/plugin 更新动作。不得使用 `latest`、解析 message 猜版本或继续任何业务命令;升级后必须先用 `itpay --version` 核对完全一致,再重新运行 `readyz`。
|
|
84
84
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itpay/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.29",
|
|
4
4
|
"description": "The ItPay CLI for services, orders, and human-authorized purchased content.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"itp": "bin/itp",
|
|
8
|
-
"itpay": "bin/itp",
|
|
9
|
-
"itpay_cli": "bin/itp"
|
|
7
|
+
"itp": "bin/itp.mjs",
|
|
8
|
+
"itpay": "bin/itp.mjs",
|
|
9
|
+
"itpay_cli": "bin/itp.mjs"
|
|
10
10
|
},
|
|
11
11
|
"main": "./dist/src/main.js",
|
|
12
12
|
"exports": {
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"bin/",
|
|
17
17
|
"dist/src/",
|
|
18
|
-
"docs/",
|
|
18
|
+
"docs/agent/buyer/",
|
|
19
|
+
"docs/cli-reference/",
|
|
20
|
+
"docs/sell.md",
|
|
19
21
|
"skills/",
|
|
20
22
|
"README.md",
|
|
21
23
|
"LICENSE",
|