import type { WebSocket } from 'ws'; import type { Agent, WSIncomingMessage, WSOutgoingMessage } from '../types.js'; import type { GitManager, GitManagerError as GitManagerErrorType } from '../services/git-manager.js'; export { GitManagerError } from '../services/git-manager.js'; export interface ConnectionState { session: any | null; agentName: string | null; agent: Agent | null; gitManager: GitManager | null; currentCheckpointId: string | null; sessionId: string | null; wsRef: import('../types.js').WebSocketRef | null; } export interface MessageHandlerDeps { projectDir: string; detectAgents: () => Promise; getAgent: (name: string) => Promise; } export declare function sendMessage(ws: WebSocket, msg: WSOutgoingMessage): void; /** * Handle get_agents message */ export declare function handleGetAgents(ws: WebSocket, deps: MessageHandlerDeps): Promise; /** * Handle select_agent message */ export declare function handleSelectAgent(ws: WebSocket, state: ConnectionState, msg: WSIncomingMessage, deps: MessageHandlerDeps): Promise; /** * Handle batch message */ export declare function handleBatch(ws: WebSocket, state: ConnectionState, msg: WSIncomingMessage, deps: MessageHandlerDeps): Promise; /** * Handle message (follow-up message to agent) */ export declare function handleMessage(ws: WebSocket, state: ConnectionState, msg: WSIncomingMessage, deps: MessageHandlerDeps): Promise; /** * Handle reset message */ export declare function handleReset(ws: WebSocket, state: ConnectionState): Promise; /** * Handle stop message */ export declare function handleStop(ws: WebSocket, state: ConnectionState): Promise; /** * Handle get_history message */ export declare function handleGetHistory(ws: WebSocket, state: ConnectionState): Promise; /** * Handle undo message */ export declare function handleUndo(ws: WebSocket, state: ConnectionState, GitManagerError: typeof GitManagerErrorType): Promise; /** * Handle revert_to message */ export declare function handleRevertTo(ws: WebSocket, state: ConnectionState, msg: WSIncomingMessage, GitManagerError: typeof GitManagerErrorType): Promise; /** * Handle clear_history message */ export declare function handleClearHistory(ws: WebSocket, state: ConnectionState): Promise;