@optima-chat/optima-agent 0.4.21 → 0.4.22
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.
|
@@ -12,6 +12,7 @@ description: Order fulfillment and shipping management. Process orders, ship pac
|
|
|
12
12
|
当用户说:
|
|
13
13
|
- "查看待发货订单" → `commerce order list --status paid`
|
|
14
14
|
- "订单XX发货" → 先查订单详情,根据 shipping_mode_used 决定发货方式(见下方流程)
|
|
15
|
+
- "查询订单物流" / "运单标签好了吗" → `commerce order tracking --id XX`
|
|
15
16
|
- "取消订单XX" → `commerce order cancel --id XX --yes`
|
|
16
17
|
- "标记订单已送达" → `commerce order mark-delivered --id XX`
|
|
17
18
|
- "查询运费" → `commerce shipping calculate --country XX --weight YY`
|
|
@@ -84,9 +85,27 @@ commerce order ship --id <order-id> --easyship --courier-id <courier-id>
|
|
|
84
85
|
**返回结果包含**:
|
|
85
86
|
- `tracking_number`: 自动生成的运单号
|
|
86
87
|
- `tracking_url`: 快递跟踪链接
|
|
87
|
-
- `label_url`:
|
|
88
|
+
- `label_url`: 运单标签下载链接(可能为空)
|
|
89
|
+
- `label_state`: 标签状态
|
|
88
90
|
- `carrier`: 快递公司名称
|
|
89
91
|
|
|
92
|
+
**运单标签处理(重要)**:
|
|
93
|
+
|
|
94
|
+
运单标签是用户必须打印并贴在包裹上的快递单。Easyship 生成标签需要几秒到几分钟。
|
|
95
|
+
|
|
96
|
+
**发货后根据 label_state 处理**:
|
|
97
|
+
|
|
98
|
+
| label_state | 含义 | 处理方式 |
|
|
99
|
+
|-------------|------|----------|
|
|
100
|
+
| `generated` / `printed` | 标签已生成 | 提供 `label_url` 让用户下载打印 |
|
|
101
|
+
| `pending` / `generating` | 标签生成中 | 告知用户「标签正在生成,稍后可以让我帮你查询」 |
|
|
102
|
+
| `failed` / `technical_failed` | 生成失败 | 告知用户需要检查 EasyShip 后台或重新发货 |
|
|
103
|
+
|
|
104
|
+
**查询标签状态**:
|
|
105
|
+
```bash
|
|
106
|
+
commerce order tracking --id <order-id>
|
|
107
|
+
```
|
|
108
|
+
|
|
90
109
|
**查看可用快递**:
|
|
91
110
|
```bash
|
|
92
111
|
commerce easyship couriers
|
|
@@ -154,10 +173,20 @@ AskUserQuestion:
|
|
|
154
173
|
用户:[选择 Easyship 自动发货]
|
|
155
174
|
|
|
156
175
|
助手:[执行 Bash: commerce order ship --id order_abc --easyship]
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
[检查返回结果中的 label_state]
|
|
177
|
+
|
|
178
|
+
[情况A:label_state = "generated",有 label_url]
|
|
179
|
+
发货成功!运单号 ES123456789,快递公司 FedEx。
|
|
180
|
+
运单标签已生成,请下载打印后贴在包裹上:https://...
|
|
181
|
+
|
|
182
|
+
[情况B:label_state = "pending" 或 "generating"]
|
|
183
|
+
发货成功!运单号 ES123456789,快递公司 FedEx。
|
|
184
|
+
运单标签正在生成中,稍后可以让我帮你查询。
|
|
185
|
+
|
|
186
|
+
用户:查一下标签好了没
|
|
187
|
+
|
|
188
|
+
助手:[执行 Bash: commerce order tracking --id order_abc]
|
|
189
|
+
运单标签已生成,请下载打印后贴在包裹上:https://...
|
|
161
190
|
```
|
|
162
191
|
|
|
163
192
|
**场景2:固定运费订单**
|
|
@@ -254,6 +283,7 @@ commerce order ship --id order_789 --tracking DHL123458 --carrier DHL
|
|
|
254
283
|
- `commerce order list` - 查看订单列表
|
|
255
284
|
- `commerce order get` - 查看订单详情
|
|
256
285
|
- `commerce order ship` - 标记订单发货
|
|
286
|
+
- `commerce order tracking` - 查询物流跟踪和标签状态
|
|
257
287
|
- `commerce order cancel` - 取消订单
|
|
258
288
|
- `commerce order complete` - 完成订单
|
|
259
289
|
- `commerce order mark-delivered` - 标记已送达
|
package/package.json
CHANGED