@bty/customer-service-cli 0.1.19 → 0.1.20

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 CHANGED
@@ -225,7 +225,7 @@ cs-cli product update-sku --agent <id> --sku "颜色分类:粉红" --update '{"
225
225
 
226
226
  | 命令 | 说明 |
227
227
  | -------------------------------------------------------------------------------- | -------- |
228
- | `conversation list --agent <id> [--user <用户名>] [--start <日期>] [--end <日期>]` | 搜索会话 |
228
+ | `conversation list [--agent <id>] [--equipment-id <设备ID>] [--user <用户名>] [--start <日期>] [--end <日期>]` | 搜索会话 |
229
229
  | `conversation records <conversation_id> [--page-size N] [--direction prev|next]` | 获取会话聊天记录 |
230
230
  | `conversation context-search --query <文本> [--start <时间>] [--end <时间>]` | 通过上下文内容模糊搜索对话记录(返回匹配消息详情,时间范围最多 3 天) |
231
231
 
package/dist/bin.js CHANGED
@@ -1456,7 +1456,11 @@ function truncateBeforeRecord(records, targetRecordId) {
1456
1456
  return records.slice(0, targetIdx);
1457
1457
  }
1458
1458
  function recordsToMsgList(records) {
1459
- return records.map((r) => {
1459
+ const nowSec = Math.floor(Date.now() / 1e3);
1460
+ const originalTimestamps = records.map((r) => Math.floor(new Date(r.created_at).getTime() / 1e3));
1461
+ const maxOriginal = Math.max(...originalTimestamps);
1462
+ const offset = nowSec - maxOriginal;
1463
+ return records.map((r, i) => {
1460
1464
  const context = r.context ?? {};
1461
1465
  const text = context.text ?? "";
1462
1466
  const imageUrl = context.image_url;
@@ -1468,7 +1472,7 @@ function recordsToMsgList(records) {
1468
1472
  if (imageUrl) {
1469
1473
  content.image_url = imageUrl;
1470
1474
  }
1471
- const timestamp = Math.floor(new Date(r.created_at).getTime() / 1e3);
1475
+ const timestamp = originalTimestamps[i] + offset;
1472
1476
  return {
1473
1477
  match_id: r.record_id ?? `match_${timestamp}_${Math.floor(Math.random() * 100)}`,
1474
1478
  content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bty/customer-service-cli",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "AI Customer Service CLI - Agent friendly",
5
5
  "type": "module",
6
6
  "main": "./dist/bin.js",