@bty/customer-service-cli 0.5.4 → 0.5.5
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/CHANGELOG.md +5 -0
- package/dist/bin.js +18 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.5 (2026-06-07)
|
|
4
|
+
|
|
5
|
+
- 修复 `debug ask --messages` 重放多轮对话时,历史消息时间戳晚于当前时间导致本次 Agent 回复插入历史消息中间、review 页面消息乱序的问题。
|
|
6
|
+
- 发送前将整段历史消息的时间戳统一平移,使最晚消息对齐当前时间;保留消息原有相对顺序与时间间隔,且不修改调用方传入的原始消息对象。
|
|
7
|
+
|
|
3
8
|
## 0.5.4 (2026-06-03)
|
|
4
9
|
|
|
5
10
|
- `ops-agent` 新增 `conversations` 子命令:`ops-agent conversations [--agent-id <id>] [--customer-id <id>] [--page N] [--page-size N]`,对接 `GET /v1/ops-agent/conversations`,按当前 workspace 查询客服助手会话列表,返回 `workspace_id`、`customer_id`、`title`、`agent_id`、`created_at`、`updated_at`。
|
package/dist/bin.js
CHANGED
|
@@ -1628,6 +1628,23 @@ function registerDashboardCommand(program2) {
|
|
|
1628
1628
|
|
|
1629
1629
|
// src/client/debug-api.ts
|
|
1630
1630
|
var DEFAULT_FLOW_WORKSPACE_ID = "531c14d1ece047cbaec22914e1f1364d";
|
|
1631
|
+
function toTimestampSeconds(value) {
|
|
1632
|
+
const timestamp = typeof value === "string" && Number.isNaN(Number(value)) ? Math.floor(new Date(value).getTime() / 1e3) : Math.floor(Number(value));
|
|
1633
|
+
if (!Number.isFinite(timestamp)) return null;
|
|
1634
|
+
return timestamp > 9999999999 ? Math.floor(timestamp / 1e3) : timestamp;
|
|
1635
|
+
}
|
|
1636
|
+
function rebaseMsgListTimestamps(msgList) {
|
|
1637
|
+
const timestamps = msgList.map(
|
|
1638
|
+
(message) => typeof message === "object" && message !== null ? toTimestampSeconds(message.timestamp) : null
|
|
1639
|
+
).filter((timestamp) => timestamp !== null);
|
|
1640
|
+
if (timestamps.length === 0) return msgList;
|
|
1641
|
+
const offset = Math.floor(Date.now() / 1e3) - Math.max(...timestamps);
|
|
1642
|
+
return msgList.map((message) => {
|
|
1643
|
+
if (typeof message !== "object" || message === null) return message;
|
|
1644
|
+
const timestamp = toTimestampSeconds(message.timestamp);
|
|
1645
|
+
return timestamp === null ? message : { ...message, timestamp: timestamp + offset };
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1631
1648
|
async function createDebugConversation(opts) {
|
|
1632
1649
|
const request = createRequest();
|
|
1633
1650
|
return request(getCustomerServiceUrl(), "/v1/chat/conversation", {
|
|
@@ -1642,7 +1659,7 @@ async function createDebugConversation(opts) {
|
|
|
1642
1659
|
async function sendAgentMessage(opts) {
|
|
1643
1660
|
let msgList;
|
|
1644
1661
|
if (opts.msgList) {
|
|
1645
|
-
msgList = opts.msgList;
|
|
1662
|
+
msgList = rebaseMsgListTimestamps(opts.msgList);
|
|
1646
1663
|
} else {
|
|
1647
1664
|
if (opts.text == null) {
|
|
1648
1665
|
throw new Error("sendAgentMessage: either msgList or text must be provided");
|