refactor(agent): consolidate agent system into unified AgentManager with provider-based architecture

Replace separate ACP and agent-types modules with unified AgentManager using provider pattern. Migrate Claude and Codex implementations to provider-specific clients. Streamline session-agent integration, remove old ACP notification types, and introduce agent timeline events. Delete obsolete documentation and test files. Add AgentRegistry for persistence and agent-stream-based communication pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-11-15 02:06:09 +01:00
co-authored by Claude
parent 90b0094aae
commit 8cf808b14d
55 changed files with 2770 additions and 7042 deletions
@@ -285,6 +285,23 @@ export class AgentManager {
this.emitState(agent);
}
async cancelAgentRun(agentId: string): Promise<boolean> {
const agent = this.requireAgent(agentId);
if (!agent.pendingRun || typeof agent.pendingRun.return !== "function") {
return false;
}
try {
await agent.pendingRun.return(undefined as unknown as AgentStreamEvent);
return true;
} catch (error) {
console.error(
`[AgentManager] Failed to cancel run for agent ${agentId}:`,
error
);
throw error;
}
}
getPendingPermissions(agentId: string): AgentPermissionRequest[] {
const agent = this.requireAgent(agentId);
return Array.from(agent.pendingPermissions.values());