import type { Stats } from 'node:fs'; import type { ReadStream, WriteStream } from 'node:tty'; export type Subscription = 'codex' | 'claude'; export type WorkKind = 'development' | 'review' | 'coordination'; export type ReasoningPreference = 'quick' | 'balanced' | 'thorough'; export type AssignmentStrategy = 'one-model' | 'per-job'; export interface CatalogModel { harness: 'codex' | 'claude-code'; session: 'acp'; model: string; efforts: string[]; } export interface InitAnswers { subscriptions: Subscription[]; assignmentStrategy: AssignmentStrategy; models: Record; reasoning: ReasoningPreference; } export interface Choice { label: string; value: T; } export interface InitPrompter { confirm(message: string, detail: string): Promise; multiSelect(message: string, choices: Choice[]): Promise; select(message: string, choices: Choice[], initial?: number): Promise; note(message: string): void; } export interface BrainCatalog { schema_version: number; models: CatalogModel[]; } export interface GeneratedSetup { files: Map; answers: InitAnswers; } export interface InitPublishResult { configPath: string; splitRoot: string; recoveryPath: string; replacedExisting: boolean; manifestExisted: boolean; rootExisted: boolean; } export declare function validateCatalog(value: BrainCatalog, path?: string): BrainCatalog; export declare function askInitQuestions(prompter: InitPrompter, configuration: string): Promise; export declare function formatSetupSummary(answers: InitAnswers, configuration: string): string; /** Build the exact, deterministic default experience without writing to disk. */ export declare function generateSetup(answers: InitAnswers): GeneratedSetup; /** Run the mutation boundary only after the complete questionnaire is accepted. */ export declare function executeInitWizard(prompter: InitPrompter, configuration: string, deps: { hostSetup(): Promise; publish(configuration: string, setup: GeneratedSetup): Promise; generate?(answers: InitAnswers): GeneratedSetup; preflight?(configuration: string): InitPathState; }): Promise; export interface InitPathInspectionDeps { exists?(path: string): boolean; lstat?(path: string): Stats; stat?(path: string): Stats; uid?(): number | undefined; entries?(path: string): string[]; } export interface InitPathState { configPath: string; splitRoot: string; parent: string; manifestExisted: boolean; rootExisted: boolean; } /** Read-only safety gate. Run once before host setup and again under the init lock. */ export declare function preflightInitPaths(configuration: string, overrides?: InitPathInspectionDeps): InitPathState; /** Replace the complete configuration under one lock, retaining a private recovery copy. */ export declare function publishSetup(configuration: string, setup: GeneratedSetup, hooks?: { beforeArtifact?(entry: 'stage' | 'recovery'): void; beforePublish?(entry: 'root' | 'manifest'): void; }): Promise; type Key = 'up' | 'down' | 'space' | 'enter' | 'escape' | 'yes' | 'no' | 'other'; export declare function decodeKey(chunk: Buffer | string): Key; export interface MultiSelectState { cursor: number; selected: boolean[]; } export declare function updateMultiSelect(state: MultiSelectState, key: Key): MultiSelectState; export declare class TerminalPrompter implements InitPrompter { private readonly input; private readonly output; private readonly notes; constructor(input: ReadStream, output: WriteStream); note(message: string): void; confirm(message: string, detail: string): Promise; multiSelect(message: string, choices: Choice[]): Promise; select(message: string, choices: Choice[], initial?: number): Promise; private render; private key; } export declare const isInteractiveTerminal: (input: NodeJS.ReadStream, output: NodeJS.WriteStream) => boolean; export {};