@kriston-ai/kst-im-cli 0.0.12 → 0.0.14
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 +15 -0
- package/dist/index.js +79 -79
- package/package.json +1 -1
- package/skills/kst-im-cli/SKILL.md +16 -1
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ description: 快商通 IM CLI — 渠道账号/网页站点列表、渠道与网
|
|
|
7
7
|
|
|
8
8
|
## 版本要求
|
|
9
9
|
|
|
10
|
-
使用 `kst-im-cli` 前必须确认版本不低于 `0.0.
|
|
10
|
+
使用 `kst-im-cli` 前必须确认版本不低于 `0.0.14`;低于该版本时,先升级 CLI 后再执行任何业务命令。
|
|
11
11
|
|
|
12
12
|
## Quick Reference
|
|
13
13
|
|
|
@@ -30,6 +30,7 @@ description: 快商通 IM CLI — 渠道账号/网页站点列表、渠道与网
|
|
|
30
30
|
| `history schema` | 输出历史记录字段说明 |
|
|
31
31
|
| `history web --start <time> --end <time> [--site-ids <ids>]` | 查询网页站点历史会话 |
|
|
32
32
|
| `history channel --start <time> --end <time> [--account-ids <ids>]` | 查询渠道账号历史会话 |
|
|
33
|
+
| `history context --rec-id <id> --source web\|channel` | 查询对话上下文(优先临时表,无数据查历史表) |
|
|
33
34
|
|
|
34
35
|
所有命令支持 `-f/--format json|table|pretty`,默认 `json`;agent 模式始终用默认值。
|
|
35
36
|
|
|
@@ -43,6 +44,10 @@ description: 快商通 IM CLI — 渠道账号/网页站点列表、渠道与网
|
|
|
43
44
|
|
|
44
45
|
agent 查询历史记录前必须先调用 `history schema` 理解字段含义;不要依赖 schema 未声明的旧接口字段。
|
|
45
46
|
|
|
47
|
+
当用户询问 Agent “下一句怎么聊”并提供 `recId` 与渠道来源时,使用 `history context --rec-id <id> --source web|channel`。如果用户还提供了当前身份描述,将上下文与身份描述一起用于生成 1 至 3 句回复;不要让 CLI 生成话术。
|
|
48
|
+
|
|
49
|
+
`history context` 优先查询当前临时表:网页来源为 `online.TD_DIALOGRECORD`,渠道来源为 `ks_wechat_td.wx_dialogrecord`;临时表无数据时,网页校验 `ONLINEHD.OC_HDVISITORINFO` 后读取历史消息,渠道读取 `ks_wechat_hd.wx_dialogrecordhis`。仅保留 `recType=1,2,5` 的访客、客服和机器人记录,不支持 SDK。返回空 `records` 表示临时表和历史表都未查到符合条件的记录。
|
|
50
|
+
|
|
46
51
|
---
|
|
47
52
|
|
|
48
53
|
## 意图路由(优先遵守)
|
|
@@ -297,6 +302,16 @@ kst-im-cli history channel \
|
|
|
297
302
|
- `visitorInfo.accountInfo`
|
|
298
303
|
- `dialogInfo.dialogTag`
|
|
299
304
|
|
|
305
|
+
### history context
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
kst-im-cli history context \
|
|
309
|
+
--rec-id <recId> \
|
|
310
|
+
--source web|channel
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
`--rec-id` 必须是正整数;`--source` 必须为 `web` 或 `channel`。输出中的 `.data.records[]` 包含 `content`、`sender`、`recType` 和 `addTime` 等上下文字段,记录按时间正序排列。
|
|
314
|
+
|
|
300
315
|
### history 查询约束
|
|
301
316
|
|
|
302
317
|
- `--start` 和 `--end` 必须同时指定。
|