This directory contains the refactored IPC (Inter-Process Communication) handlers for Auto Code UI, organized into domain-specific modules for better maintainability and code organization.
The original monolithic ipc-handlers.ts file (6,913 lines, 220KB) has been refactored into 16 focused modules, each handling a specific domain of the application.
Handles project lifecycle and Python environment management:
PROJECT_ADD- Add new project to workspacePROJECT_REMOVE- Remove projectPROJECT_LIST- List all projectsPROJECT_UPDATE_SETTINGS- Update project settingsPROJECT_INITIALIZE- Initialize .auto-claude directoryPROJECT_CHECK_VERSION- Check initialization statusproject:has-local-source- Check if project has local auto-claude source- Python environment initialization and status events
Manages task lifecycle and execution:
TASK_LIST- List tasks for projectTASK_CREATE- Create new task with auto-generated titleTASK_DELETE- Delete taskTASK_UPDATE- Update task propertiesTASK_START- Start task executionTASK_STOP- Stop running taskTASK_REVIEW- Review task resultsTASK_UPDATE_STATUS- Update task statusTASK_RECOVER_STUCK- Recover stuck tasksTASK_CHECK_RUNNING- Check if task is runningTASK_ARCHIVE/TASK_UNARCHIVE- Archive management- Worktree operations (status, diff, merge, discard)
- Task logs (get, watch, unwatch)
Terminal and Claude profile management:
TERMINAL_CREATE- Create terminal sessionTERMINAL_DESTROY- Destroy terminalTERMINAL_INPUT- Send input to terminalTERMINAL_RESIZE- Resize terminalTERMINAL_INVOKE_CLAUDE- Invoke Claude in terminal- Claude profile management (CRUD operations)
- Profile auto-switching and usage tracking
- Terminal session persistence and restoration
Application settings and dialogs:
SETTINGS_GET- Get app settingsSETTINGS_SAVE- Save app settingsDIALOG_SELECT_DIRECTORY- Directory selection dialogDIALOG_CREATE_PROJECT_FOLDER- Create project folderDIALOG_GET_DEFAULT_PROJECT_LOCATION- Get default locationAPP_VERSION- Get application version
File system operations:
FILE_EXPLORER_LIST- List directory contents with filtering
Roadmap generation and management:
ROADMAP_GET- Get project roadmapROADMAP_GENERATE- Generate roadmap with AIROADMAP_REFRESH- Refresh roadmapROADMAP_UPDATE_FEATURE- Update feature statusROADMAP_CONVERT_TO_SPEC- Convert feature to task spec
AI-powered ideation system:
IDEATION_GET- Get ideation sessionIDEATION_GENERATE- Generate ideas with AIIDEATION_REFRESH- Refresh ideasIDEATION_STOP- Stop generationIDEATION_UPDATE_IDEA- Update ideaIDEATION_CONVERT_TO_TASK- Convert idea to taskIDEATION_DISMISS/IDEATION_DISMISS_ALL- Dismiss ideas
AI insights chat system:
INSIGHTS_GET_SESSION- Get chat sessionINSIGHTS_SEND_MESSAGE- Send chat messageINSIGHTS_CLEAR_SESSION- Clear sessionINSIGHTS_CREATE_TASK- Create task from insights- Session management (list, new, switch, delete, rename)
Agent performance analytics:
ANALYTICS_GET_SUMMARY- Get analytics summaryANALYTICS_GET_AGENT_STATS- Get per-agent statisticsANALYTICS_GET_TRENDS- Get trend data over timeANALYTICS_GET_REPORT- Generate analytics report- Tracks success rates, completion times, error patterns, QA metrics
Changelog generation:
CHANGELOG_GET_DONE_TASKS- Get completed tasksCHANGELOG_LOAD_TASK_SPECS- Load task specificationsCHANGELOG_GENERATE- Generate changelog with AICHANGELOG_SAVE- Save changelogCHANGELOG_READ_EXISTING- Read existing changelogCHANGELOG_SUGGEST_VERSION- Suggest version number- Git operations (branches, tags, commits)
Project context and memory:
CONTEXT_GET- Get project contextCONTEXT_REFRESH_INDEX- Refresh project indexCONTEXT_MEMORY_STATUS- Get Graphiti memory statusCONTEXT_SEARCH_MEMORIES- Search memory episodesCONTEXT_GET_MEMORIES- Get memory episodes
GitHub integration:
GITHUB_GET_REPOSITORIES- List repositoriesGITHUB_GET_ISSUES- List issuesGITHUB_GET_ISSUE- Get single issueGITHUB_CHECK_CONNECTION- Test connectionGITHUB_INVESTIGATE_ISSUE- AI investigationGITHUB_IMPORT_ISSUES- Import issues as tasksGITHUB_CREATE_RELEASE- Create GitHub release
Linear integration:
LINEAR_GET_TEAMS- List teamsLINEAR_GET_PROJECTS- List projectsLINEAR_GET_ISSUES- List issuesLINEAR_IMPORT_ISSUES- Import issues as tasksLINEAR_CHECK_CONNECTION- Test connection
Environment configuration:
ENV_GET- Get project environmentENV_UPDATE- Update environment variablesENV_CHECK_CLAUDE_AUTH- Check Claude authenticationENV_INVOKE_CLAUDE_SETUP- Run Claude setup
Auto-build source updates:
AUTOBUILD_SOURCE_CHECK- Check for updatesAUTOBUILD_SOURCE_DOWNLOAD- Download updatesAUTOBUILD_SOURCE_VERSION- Get version info- Source environment configuration
Agent event forwarding to renderer:
- Agent log events
- Agent error events
- SDK rate limit events
- Agent exit events with status transitions
- Execution progress events
- File watcher events
- Implementation plan updates
Central registration point that:
- Imports all handler modules
- Exports
setupIpcHandlers()function - Configures services with dependencies
- Registers all handlers in organized sequence
- Re-exports individual registration functions
The refactored ipc-handlers.ts now:
- Imports
setupIpcHandlersfrom./ipc-handlers - Delegates all registration to modular handlers
- Provides clear documentation of module organization
- Reduced from 6,913 lines to ~50 lines
- Focused Modules: Each module has a single responsibility
- Clear Boundaries: Domain separation makes code easier to understand
- Reduced Complexity: Smaller files are easier to navigate and modify
- Better Organization: Related handlers grouped together
- Isolated Testing: Each module can be tested independently
- Mock Dependencies: Easier to mock services for unit tests
- Focused Test Suites: Test files can mirror module structure
- Easier Navigation: Find handlers by domain, not by scrolling
- Reduced Conflicts: Multiple developers can work on different modules
- Clear Imports: Each module declares its dependencies explicitly
- Better IDE Support: Faster intellisense and type checking
- Explicit Dependencies: Each module imports only what it needs
- Type Safety: Proper TypeScript imports throughout
- Consistent Patterns: Uniform registration pattern across modules
- Documentation: Each module has clear purpose and scope
To register all IPC handlers:
import { setupIpcHandlers } from './ipc-handlers';
import { AgentManager } from './agent-manager';
import { TerminalManager } from './terminal-manager';
import { PythonEnvManager } from './python-env-manager';
// Initialize services
const agentManager = new AgentManager();
const terminalManager = new TerminalManager();
const pythonEnvManager = new PythonEnvManager();
// Register all handlers
setupIpcHandlers(
agentManager,
terminalManager,
() => mainWindow,
pythonEnvManager
);To register individual modules:
import { registerTaskHandlers } from './ipc-handlers/task-handlers';
registerTaskHandlers(agentManager, () => mainWindow);The refactoring maintains 100% backward compatibility:
- All IPC channel names unchanged
- All handler signatures unchanged
- All service dependencies preserved
- Event forwarding logic unchanged
Original file backed up as ipc-handlers.ts.backup.
Each module may depend on:
- Services: AgentManager, TerminalManager, ChangelogService, etc.
- Stores: projectStore
- Utilities: fileWatcher, titleGenerator
- Constants: IPC_CHANNELS, AUTO_BUILD_PATHS, getSpecsDir
- Types: Extensive TypeScript types from shared/types
All dependencies are explicitly imported at the module level.