@yeaft/webchat-agent 0.1.59 → 0.1.60
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/crew/routing.js +5 -1
- package/crew/ui-messages.js +7 -4
- package/package.json +1 -1
package/crew/routing.js
CHANGED
|
@@ -84,7 +84,11 @@ export async function executeRoute(session, fromRole, route) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// 发送路由消息(UI 显示)
|
|
87
|
-
sendCrewOutput(session, fromRole, 'route', null, {
|
|
87
|
+
sendCrewOutput(session, fromRole, 'route', null, {
|
|
88
|
+
routeTo: to, routeSummary: summary,
|
|
89
|
+
taskId: taskId || undefined,
|
|
90
|
+
taskTitle: taskTitle || undefined
|
|
91
|
+
});
|
|
88
92
|
|
|
89
93
|
// 路由到 human
|
|
90
94
|
if (to === 'human') {
|
package/crew/ui-messages.js
CHANGED
|
@@ -49,10 +49,13 @@ export function sendCrewOutput(session, roleName, outputType, rawMessage, extra
|
|
|
49
49
|
const roleIcon = role?.icon || '';
|
|
50
50
|
const displayName = role?.displayName || roleName;
|
|
51
51
|
|
|
52
|
-
// 从 roleState 获取当前 task
|
|
52
|
+
// 从 extra 或 roleState 获取当前 task 信息(extra 优先)
|
|
53
53
|
const roleState = session.roleStates.get(roleName);
|
|
54
|
-
const taskId = roleState?.currentTask?.taskId || null;
|
|
55
|
-
const taskTitle = roleState?.currentTask?.taskTitle || null;
|
|
54
|
+
const taskId = extra.taskId || roleState?.currentTask?.taskId || null;
|
|
55
|
+
const taskTitle = extra.taskTitle || roleState?.currentTask?.taskTitle || null;
|
|
56
|
+
|
|
57
|
+
// 清除 extra 中的 taskId/taskTitle 避免重复展开到 WebSocket 消息
|
|
58
|
+
const { taskId: _tid, taskTitle: _tt, ...extraRest } = extra;
|
|
56
59
|
|
|
57
60
|
sendCrewMessage({
|
|
58
61
|
type: 'crew_output',
|
|
@@ -64,7 +67,7 @@ export function sendCrewOutput(session, roleName, outputType, rawMessage, extra
|
|
|
64
67
|
data: rawMessage,
|
|
65
68
|
taskId,
|
|
66
69
|
taskTitle,
|
|
67
|
-
...
|
|
70
|
+
...extraRest
|
|
68
71
|
});
|
|
69
72
|
|
|
70
73
|
// ★ 累积 feature 到持久化列表
|