mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 22:05:50 +00:00
feat: 添加 Windows Terminal swarm 后端及 swarm 增强
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user