@yeaft/webchat-agent 0.1.333 → 0.1.334
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/role-output.js +7 -0
- package/crew/role-query.js +1 -1
- package/crew/routing.js +6 -1
- package/package.json +1 -1
package/crew/role-output.js
CHANGED
|
@@ -124,6 +124,13 @@ export async function processRoleOutput(session, roleName, roleQuery, roleState)
|
|
|
124
124
|
|
|
125
125
|
// 解析路由
|
|
126
126
|
const routes = parseRoutes(roleState.accumulatedText);
|
|
127
|
+
// Fallback: 如果 route summary 仍为空占位符,用 accumulatedText 末尾 500 字符
|
|
128
|
+
for (const route of routes) {
|
|
129
|
+
if (route.summary === '[该角色未提供消息摘要]' && roleState.accumulatedText) {
|
|
130
|
+
const tail = roleState.accumulatedText.slice(-500).trim();
|
|
131
|
+
if (tail) route.summary = `[auto-extracted]\n${tail}`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
127
134
|
|
|
128
135
|
// 决策者 turn 完成:检测 TASKS block 中新完成的任务
|
|
129
136
|
const roleConfig = session.roles.get(roleName);
|
package/crew/role-query.js
CHANGED
package/crew/routing.js
CHANGED
|
@@ -39,9 +39,14 @@ export function parseRoutes(text) {
|
|
|
39
39
|
const taskMatch = block.match(/^task:\s*(.+)/im);
|
|
40
40
|
const taskTitleMatch = block.match(/^taskTitle:\s*(.+)/im);
|
|
41
41
|
|
|
42
|
+
let summary = summaryMatch ? summaryMatch[1].trim() : '';
|
|
43
|
+
if (!summary) {
|
|
44
|
+
summary = '[该角色未提供消息摘要]';
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
routes.push({
|
|
43
48
|
to: toClean,
|
|
44
|
-
summary
|
|
49
|
+
summary,
|
|
45
50
|
taskId: taskMatch ? taskMatch[1].trim() : null,
|
|
46
51
|
taskTitle: taskTitleMatch ? taskTitleMatch[1].trim() : null
|
|
47
52
|
});
|