/** * Main Ink Application Entry Point * * The root component for the Ink-based TUI. Routes to different screens * based on the current screen state. Manages session state and navigation. * * Uses an AppShell-based layout where each screen wraps itself in * with a shared header element. No Static/thread model - * screen transitions are clean React mount/unmount cycles. */ import React from 'react'; import { type Instance } from 'ink'; import type { AIProvider } from '../ai/providers.js'; import type { ScanResult } from '../scanner/types.js'; import type { SessionState } from '../repl/session-state.js'; /** * Available screen types for the App component */ export type AppScreen = 'shell' | 'interview' | 'init' | 'run' | 'agent'; /** * Props for the interview screen */ export interface InterviewAppProps { /** Name of the feature being specified */ featureName: string; /** Project root directory path */ projectRoot: string; /** AI provider to use */ provider: AIProvider; /** Model ID to use */ model: string; /** Optional scan result with detected tech stack */ scanResult?: ScanResult; /** References to auto-add during context phase (from CLI --issue/--context flags) */ initialReferences?: string[]; } /** * Props for the agent screen when launched directly from CLI */ export interface AgentAppProps { modelOverride?: string; maxItems?: number; maxSteps?: number; labels?: string[]; issues?: number[]; reviewMode?: 'manual' | 'auto' | 'merge'; dryRun?: boolean; } /** * Props for the run/monitor screen when launched directly from CLI */ export interface RunAppProps { /** Name of the feature to run or monitor */ featureName: string; /** If true, opens in monitor-only (read-only) mode — no loop is spawned */ monitorOnly?: boolean; /** Review mode override */ reviewMode?: 'manual' | 'auto' | 'merge'; /** Implementation CLI override */ cli?: 'claude' | 'codex'; /** Review CLI override */ reviewCli?: 'claude' | 'codex'; } /** * Props for the main App component */ export interface AppProps { /** Initial screen to display */ screen: AppScreen; /** Initial session state */ initialSessionState: SessionState; /** CLI version */ version?: string; /** Props for the interview screen (required when screen is 'interview') */ interviewProps?: InterviewAppProps; /** Props for the run/monitor screen (required when screen is 'run') */ runProps?: RunAppProps; /** Props for the agent screen (required when screen is 'agent') */ agentProps?: AgentAppProps; /** Called when the screen completes successfully */ onComplete?: (result: string) => void; /** Called when the user exits/cancels */ onExit?: () => void; } /** * Main App component for the Ink-based TUI * * Simple routing + shared state. Each screen wraps itself in AppShell * and receives a shared headerElement prop. */ export declare function App({ screen: initialScreen, initialSessionState, version, // Fallback if package.json read fails (keep in sync with index.ts) interviewProps, runProps, agentProps, onComplete, onExit, }: AppProps): React.ReactElement | null; /** * Render options for renderApp */ export interface RenderAppOptions { /** Initial screen to display */ screen: AppScreen; /** Initial session state */ initialSessionState: SessionState; /** CLI version */ version?: string; /** Props for interview screen (if starting directly on interview) */ interviewProps?: InterviewAppProps; /** Props for run/monitor screen (if starting directly on run screen) */ runProps?: RunAppProps; /** Props for agent screen (if starting directly on agent screen) */ agentProps?: AgentAppProps; /** Called when spec generation completes */ onComplete?: (result: string) => void; /** Called when user exits */ onExit?: () => void; } /** * Render the App component to the terminal */ export declare function renderApp(options: RenderAppOptions): Instance;