import { D as DocBridgeConfigV1 } from '../../schema-CMKrwMYs.js'; import { S as SearchMatch, D as DoctorReport, G as GateRunResult, a as GateResult } from '../../run-doctor-Dlcc7FlA.js'; import { a as DocBridgeIndexV1, K as KnowledgeDiagnostic } from '../../knowledge-BSFT4d03.js'; import * as react from 'react'; import { ReactElement } from 'react'; import 'zod'; type RichOutputInput = { readonly stdout: { readonly isTTY?: boolean | undefined; }; readonly flags: ReadonlySet | readonly string[]; readonly env: Readonly>; }; /** * Whether a command prints the Ink view. Rich output is for a person at a terminal: a pipe, a CI * log, an agent (`--json`, `--agent`) or an explicit `--text` / `NO_COLOR` / `AK_DOCS_PLAIN=1` * keeps the plain output every script already parses. */ declare const richOutput: ({ stdout, flags, env }: RichOutputInput) => boolean; type AskHandoff = { readonly startHere?: string; readonly editRoots?: readonly string[]; readonly checks?: readonly string[]; }; /** What `ak-docs ask` knows about a question: the ranked matches, the one to start from, and what to run next. */ type AskResult = { readonly question: string; readonly best?: SearchMatch; readonly handoff?: AskHandoff; readonly matches: readonly SearchMatch[]; readonly nextCommands: readonly string[]; }; /** The same routing `ak-docs ask` prints: prefer an ownership match, then fall back to the top hit. */ declare const buildAskResult: (index: DocBridgeIndexV1, config: DocBridgeConfigV1, question: string, limit?: number) => AskResult; /** Where relative paths are anchored; defaults to the current directory. */ type ViewOptions = { readonly root?: string; }; declare const AskView: ({ result, root }: { readonly result: AskResult; } & ViewOptions) => ReactElement; declare const GateView: ({ result }: { readonly result: GateRunResult; }) => ReactElement; type IndexPublished = { readonly ok: true; readonly publication?: { readonly pendingReferenceFindings?: { readonly override: string; readonly reason?: string | undefined; readonly pendingCount?: number | undefined; }; }; readonly indexPath: string; readonly llmsTxtPath?: string; readonly capabilitiesPath?: string; readonly contentHash: string; readonly knowledgeCount: number; readonly packageCount: number; readonly handoffCount: number; readonly diagnostics?: readonly string[]; readonly nextCommands: readonly string[]; }; type IndexBlocked = { readonly ok: false; readonly blockedBy: string; readonly gate: GateResult; }; type IndexResult = IndexPublished | IndexBlocked; declare const IndexView: ({ result, root }: { readonly result: IndexResult; } & ViewOptions) => ReactElement; type DiffViewResult = { readonly findings: readonly KnowledgeDiagnostic[]; }; declare const DiffView: ({ result }: { readonly result: DiffViewResult; }) => ReactElement; declare const DoctorView: ({ report }: { readonly report: DoctorReport; }) => ReactElement; type VaultExportResult = { readonly ok?: boolean; readonly output: string; readonly notes: number; readonly removed: number; readonly findings?: number; readonly warnings?: readonly string[]; }; declare const VaultExportView: ({ result, root }: { readonly result: VaultExportResult; } & ViewOptions) => ReactElement; /** One view per command id, taking the result the command already produces. */ declare const RICH_VIEWS: { readonly ask: (result: AskResult, options?: ViewOptions) => react.JSX.Element; readonly gate: (result: GateRunResult) => react.JSX.Element; readonly index: (result: IndexResult, options?: ViewOptions) => react.JSX.Element; readonly diff: (result: DiffViewResult) => react.JSX.Element; readonly doctor: (report: DoctorReport) => react.JSX.Element; readonly vault: (result: VaultExportResult, options?: ViewOptions) => react.JSX.Element; }; type RichCommand = keyof typeof RICH_VIEWS; /** * Renders once into the scrollback at the terminal's width: a static frame, no input, no live * region, so nothing is redrawn or duplicated when the process exits. */ declare const printRich: (element: ReactElement, options?: { readonly stdout?: NodeJS.WriteStream; }) => Promise; type Freshness = 'fresh' | 'stale' | 'missing'; type DocumentContext = { /** 1-based number of the first line in `lines`. */ readonly start: number; readonly lines: readonly string[]; /** 1-based number of the cited line. */ readonly focus: number; }; /** What the interactive UI calls. The real implementation is the library; tests substitute their own. */ type UiServices = { readonly name: string; readonly ask: (question: string) => AskResult; readonly findings: () => GateResult; readonly publicationGate: () => GateResult | undefined; readonly publish: (options: { readonly allowPendingFindings: boolean; }) => IndexResult; readonly doctor: () => DoctorReport; readonly freshness: () => Freshness; readonly context: (document: string, line: number | undefined, radius?: number) => DocumentContext | undefined; }; declare const createServices: ({ root, config }: { readonly root: string; readonly config: DocBridgeConfigV1; }) => UiServices; type UiAppProps = { readonly services: UiServices; }; /** The interactive app: sections on ←/→, Enter to act, `q` to quit. */ declare const UiApp: ({ services }: UiAppProps) => ReactElement; /** `ak-docs ui`: the full-screen app over the library functions. Resolves when the user quits. */ declare const runUi: ({ root, config }: { readonly root: string; readonly config: DocBridgeConfigV1; }) => Promise; export { type AskResult, AskView, DiffView, DoctorView, GateView, IndexView, RICH_VIEWS, type RichCommand, type RichOutputInput, UiApp, type UiServices, VaultExportView, buildAskResult, createServices, printRich, richOutput, runUi };