/** * useAgentOrchestrator — React hook that bridges the agent orchestrator * lifecycle to TUI state via callbacks. * * Creates the orchestrator, runs it via stream(), and interprets tool * calls into structured state (active issue, queue, completed, log). * Exposes an abort() function for clean shutdown on q/Esc. */ import type { AgentOrchestratorEvent, AgentIssueState, AgentLogEntry, ReviewMode } from '../../agent/types.js'; import { type LoopStatus, type TaskCounts, type ActivityEvent } from '../utils/loop-status.js'; import { type CommitLogEntry } from '../utils/git-summary.js'; export type AgentStatus = 'idle' | 'running' | 'complete' | 'error'; export interface UseAgentOrchestratorOptions { projectRoot: string; modelOverride?: string; maxItems?: number; maxSteps?: number; labels?: string[]; issues?: number[]; reviewMode?: ReviewMode; dryRun?: boolean; } export interface LoopMonitorData { loopStatus: LoopStatus; tasks: TaskCounts; branch: string; recentCommits: CommitLogEntry[]; activityEvents: ActivityEvent[]; startTime: number; } export interface UseAgentOrchestratorResult { status: AgentStatus; activeIssue: AgentIssueState | null; queue: AgentIssueState[]; completed: AgentIssueState[]; logEntries: AgentLogEntry[]; loopMonitor: LoopMonitorData | null; error: string | null; abort: () => void; } export declare function applyOrchestratorEvent(event: AgentOrchestratorEvent, setActiveIssue: React.Dispatch>, setQueue: React.Dispatch>, setCompleted: React.Dispatch>, setLogEntries: React.Dispatch>, completedIssuesRef: React.MutableRefObject>): void; export declare function useAgentOrchestrator(options: UseAgentOrchestratorOptions): UseAgentOrchestratorResult;