@yeaft/webchat-agent 0.0.173 → 0.0.174
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.js +9 -4
- package/index.js +1 -1
- package/package.json +1 -1
package/crew.js
CHANGED
|
@@ -313,7 +313,8 @@ async function saveSessionMeta(session) {
|
|
|
313
313
|
status: session.status,
|
|
314
314
|
roles: Array.from(session.roles.values()).map(r => ({
|
|
315
315
|
name: r.name, displayName: r.displayName, icon: r.icon,
|
|
316
|
-
description: r.description, isDecisionMaker: r.isDecisionMaker || false
|
|
316
|
+
description: r.description, isDecisionMaker: r.isDecisionMaker || false,
|
|
317
|
+
groupIndex: r.groupIndex, roleType: r.roleType, model: r.model
|
|
317
318
|
})),
|
|
318
319
|
decisionMaker: session.decisionMaker,
|
|
319
320
|
maxRounds: session.maxRounds,
|
|
@@ -326,7 +327,8 @@ async function saveSessionMeta(session) {
|
|
|
326
327
|
costUsd: session.costUsd,
|
|
327
328
|
totalInputTokens: session.totalInputTokens,
|
|
328
329
|
totalOutputTokens: session.totalOutputTokens,
|
|
329
|
-
features: Array.from(session.features.values())
|
|
330
|
+
features: Array.from(session.features.values()),
|
|
331
|
+
groupNames: session.groupNames || {}
|
|
330
332
|
};
|
|
331
333
|
await fs.writeFile(join(session.sharedDir, 'session.json'), JSON.stringify(meta, null, 2));
|
|
332
334
|
// 保存 UI 消息历史(用于恢复时重放)
|
|
@@ -494,7 +496,8 @@ export async function resumeCrewSession(msg) {
|
|
|
494
496
|
sharedKnowledge: session.sharedKnowledge || '',
|
|
495
497
|
roles: roles.map(r => ({
|
|
496
498
|
name: r.name, displayName: r.displayName, icon: r.icon,
|
|
497
|
-
description: r.description, isDecisionMaker: r.isDecisionMaker || false
|
|
499
|
+
description: r.description, isDecisionMaker: r.isDecisionMaker || false,
|
|
500
|
+
groupIndex: r.groupIndex, roleType: r.roleType, model: r.model
|
|
498
501
|
})),
|
|
499
502
|
decisionMaker: session.decisionMaker,
|
|
500
503
|
maxRounds: session.maxRounds,
|
|
@@ -546,6 +549,7 @@ export async function resumeCrewSession(msg) {
|
|
|
546
549
|
waitingHumanContext: null,
|
|
547
550
|
pendingRoutes: [],
|
|
548
551
|
features: new Map((meta.features || []).map(f => [f.taskId, f])),
|
|
552
|
+
groupNames: meta.groupNames || {},
|
|
549
553
|
userId: userId || meta.userId,
|
|
550
554
|
username: username || meta.username,
|
|
551
555
|
agentId: meta.agentId || ctx.CONFIG?.agentName || null,
|
|
@@ -567,7 +571,8 @@ export async function resumeCrewSession(msg) {
|
|
|
567
571
|
sharedKnowledge: session.sharedKnowledge || '',
|
|
568
572
|
roles: roles.map(r => ({
|
|
569
573
|
name: r.name, displayName: r.displayName, icon: r.icon,
|
|
570
|
-
description: r.description, isDecisionMaker: r.isDecisionMaker || false
|
|
574
|
+
description: r.description, isDecisionMaker: r.isDecisionMaker || false,
|
|
575
|
+
groupIndex: r.groupIndex, roleType: r.roleType, model: r.model
|
|
571
576
|
})),
|
|
572
577
|
decisionMaker,
|
|
573
578
|
maxRounds: session.maxRounds,
|
package/index.js
CHANGED
|
@@ -59,7 +59,7 @@ const fileConfig = loadConfig();
|
|
|
59
59
|
const CONFIG = {
|
|
60
60
|
serverUrl: process.env.SERVER_URL || fileConfig.serverUrl,
|
|
61
61
|
agentName: process.env.AGENT_NAME || fileConfig.agentName,
|
|
62
|
-
workDir: process.env.WORK_DIR || fileConfig.workDir,
|
|
62
|
+
workDir: process.env.WORK_DIR || fileConfig.workDir || process.cwd(),
|
|
63
63
|
reconnectInterval: fileConfig.reconnectInterval,
|
|
64
64
|
agentSecret: process.env.AGENT_SECRET || fileConfig.agentSecret,
|
|
65
65
|
// MCP 白名单:只允许这些 MCP 服务器的工具,其余自动禁用
|