# ACP Entry-Point Alignment TODO

This tracks the work to align the kiro-agent ACP entry-point with the existing IDE execution infrastructure.

## Phase 1: ACP Workspace Connection

- [x] Create `src/acp/acp-workspace-connection.ts` - IWorkspaceConnection implementation for ACP
- [x] Implement file operations using ACP client methods
- [x] Implement tool retrieval (placeholder until tool migration PR lands)

## Phase 2: ACP Event Adapter

- [x] Create `src/acp/acp-event-adapter.ts` - Maps AgentController events to ACP sessionUpdate calls
- [x] Handle tool call events (pending, in_progress, completed)
- [x] Handle agent message chunks
- [x] Handle execution lifecycle events

## Phase 3: Refactor KiroAgent to Use AgentController

- [x] Add AgentController to KiroAgent
- [x] Refactor `prompt()` to create ChatAgentDefinition and trigger via controller
- [x] Wire up ACP event adapter for session updates
- [x] Handle session lifecycle (newSession, loadSession, cancel)

## Phase 4: Simplify AgentSession

- [x] Remove `processPrompt()` reimplementation
- [x] Remove `executeTool()` and individual tool methods
- [x] Keep only session configuration and state

## Phase 5: Cleanup

- [x] Update exports in index.ts
- [x] Update tests
- [x] Remove `src/types/acp-tool-provider.ts` (replaced by workspace connection)

## Phase 6: Session Persistence

- [x] Integrate SessionPersistence for disk storage at `~/.kiro/sessions`
- [x] Persist sessions on newSession() and loadSession()
- [x] Append user messages during prompt()
- [x] Load sessions from disk on loadSession() if not in memory

## Phase 7: Platform Initialization

- [x] Create `src/acp/acp-auth.ts` - Auth provider reading from `~/.aws/sso/cache/kiro-auth-token.json`
- [x] Create `src/acp/acp-q-client-factory.ts` - QClientFactory for ACP using auth provider
- [x] Initialize platform in KiroAgent constructor (setQClientFactory, setLogger, etc.)
- [x] Configure autonomy mode provider (always Autopilot for ACP)
- [x] Configure execution logger, spec agent, and execution log controller stubs

## Deferred (Pending Tool Migration PR)

- [x] Wire up FS tools (FsWrite, FsAppend, StrReplace, DeleteFile, ListDirectory, ReadFile, ReadMultipleFiles)
- [x] Wire up shell tools (ExecuteBash, ControlProcess, ListProcesses, GetProcessOutput)
- [x] Wire up subagent tools (InvokeSubAgent, ReportProgress, SubagentResponse)
- [ ] Wire up other tools (FileSearch, GrepSearch, etc.) as they are migrated
