feat: 添加 Windows Terminal swarm 后端及 swarm 增强

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
unraid
2026-04-22 22:38:09 +08:00
parent c4775fff58
commit 59f8675fa3
17 changed files with 1298 additions and 86 deletions

View File

@@ -339,3 +339,35 @@ export function killInProcessTeammate(
return killed
}
/**
* Kills an in-process teammate by logical agent ID.
* Used by team-level UI/actions where the stable identifier is
* "name@team", not the AppState task id.
*/
export function killInProcessTeammateByAgentId(
agentIdToKill: string,
setAppState: SetAppStateFn,
): boolean {
let taskIdToKill: string | undefined
setAppState((prev: AppState) => {
for (const [taskId, task] of Object.entries(prev.tasks)) {
if (
task.type === 'in_process_teammate' &&
task.identity.agentId === agentIdToKill &&
task.status === 'running'
) {
taskIdToKill = taskId
break
}
}
return prev
})
if (!taskIdToKill) {
return false
}
return killInProcessTeammate(taskIdToKill, setAppState)
}