feat(panel): add Native Swarm mode compatibility and distinct worker telemetry

- Guard conversation_parents against forked Swarm Workers (subagentSpec or trajectoryType != 22) and selectively decode CORTEX_STEP_TYPE_SYSTEM_MESSAGE (step_type = 101) for child trajectories only
- Parse swarm, post_message, read_board, and swarm_wait tool calls, split zero-human-turn worker trajectories on initial brief / @mention / cron wakeup boundaries, and downgrade swarm_wait parked workers from RUNNING to IDLE ('waiting') while surfacing killed workers ('killed')
- Scan brain/<id>/.system_generated/swarm/members.json with mtime+size memoization, sort workers chronologically, assign independent swarm_worker ordinals (蜂k / Wk) separate from standard subagents (子k / Sk) and side questions (问k / Qk), and preserve 100% of worker token/USD billing
- Render Swarm counts, titles, scrollable sorted live worker lists, and one-shot auto-focus when navigating host routes to /c/<worker-uuid>, backed by E2E and binary SQLite tests
This commit is contained in:
fish
2026-11-19 09:36:05 +09:00
parent 352d6bdfef
commit 2c211f67cc
19 changed files with 3077 additions and 246 deletions
+27
View File
@@ -17,6 +17,8 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'header.lockedSession': '已锁定会话 ({id})',
'header.lockedMeta': '已锁定',
'header.convMetaWithSubs': '主{main} · {subs}子 (共{total}步)',
'header.convMetaWithSwarm': '主{main} · {swarm}蜂 (共{total}步)',
'header.convMetaWithSwarmAndSubs': '主{main} · {swarm}蜂 · {subs}子 (共{total}步)',
'header.convMetaSteps': '{count}步',
'header.hasUpdate': '有新版本',
'header.upgradeToVer': '升级 v{ver}',
@@ -55,6 +57,11 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'fmt.subAgent': '子代理',
'fmt.subBadge': '子{index}',
'fmt.subBadgeShort': '子',
'fmt.swarmAgent': '蜂群',
'fmt.swarmBadge': '蜂{index}',
'fmt.swarmBadgeShort': '蜂',
'fmt.swarmMonitorHint': '巡检',
'fmt.swarmNarratorHint': '旁白',
'fmt.sideQuestion': '旁路提问',
'fmt.sideBadge': '旁{index}',
'fmt.sideBadgeShort': '旁',
@@ -68,6 +75,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'capsule.multiZero': '0 运行中',
'capsule.multiRunning': '{count} 运行中',
'capsule.multiRunningWithSubs': '{count} 运行 · {subs} 子',
'capsule.multiRunningWithSwarm': '{count} 运行 · {subs} 蜂',
'capsule.tpsRunning': '生成中',
'capsule.tpsIdle': '待命',
'capsule.quotaLeft': '余 {pct}%',
@@ -88,6 +96,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'multi.empty': '当前暂无在线运行的会话',
'multi.allIdle': '全部待命',
'multi.metaWithSubs': '{main} 主会话 · {subs} 子代理运行中',
'multi.metaWithSwarm': '{main} 主会话 · {subs} 蜂群运行中',
'multi.metaMainOnly': '{main} 个会话运行中',
'multi.hereTag': '本窗',
'multi.inspectSessionTitle': '点击在监控面板中检视会话:{title}',
@@ -184,10 +193,16 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.thinking': '推理中',
'live.generating': '生成中',
'live.running': '运行中',
'live.waiting': '待命中',
'live.killed': '已终止',
'live.done': '已完成',
'live.doneWithSteps': '已完成 ({steps} 步)',
'live.waitingWithSteps': '待命中 ({steps} 步)',
'live.killedWithSteps': '已终止 ({steps} 步)',
'live.subToggleRunning': '子代理 {run}/{total} {arrow}',
'live.subToggleIdle': '子代理 ({total}) {arrow}',
'live.swarmToggleRunning': '蜂群 {run}/{total} {arrow}',
'live.swarmToggleIdle': '蜂群 ({total}) {arrow}',
'live.subCollapseTitle': '点击收起子代理列表',
'live.subExpandTitle': '点击展开查看子代理缩略状态',
@@ -558,6 +573,15 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.act.invoke_subagent': '调用子代理',
'live.act.send_message': '通信子代理',
'live.act.manage_subagents': '管理子代理',
'live.act.swarm_add': '派生工蜂',
'live.act.swarm_title': '命名蜂群',
'live.act.swarm_kill': '终止工蜂',
'live.act.swarm_model': '切换工蜂模型',
'live.act.swarm_channel': '蜂群频道',
'live.act.swarm_status': '巡检蜂群',
'live.act.post_message': '发布看板',
'live.act.read_board': '读取看板',
'live.act.swarm_wait': '看板待命',
'live.act.manage_task': '后台任务',
'live.act.schedule': '定时任务',
'live.act.ask_question': '等待用户选择',
@@ -568,6 +592,9 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
'live.act.compacting': '上下文压缩',
'live.act.responding': '正在输出回复',
'live.act.waiting_subagent': '等待子代理',
'live.act.waiting_swarm': '等待工蜂',
'live.act.swarm_waiting': '待命中',
'live.act.swarm_killed': '已终止',
'live.act.starting': '启动中',
'live.act.done': '已完成',
'live.act.awaitingApproval': '等待确认 · {label}',