/** * Chapters — auto-fold transcript turns by detected intent. * * The TUI keeps a flat history; chapters group consecutive turns that share * a detected intent ("debug", "refactor", "test", "explain", …) into a * single foldable unit. Detection is heuristic (keyword + tool-pattern) so * the UX stays predictable and predictable-feeling cheap. */ export type Intent = "implement" | "debug" | "refactor" | "test" | "explain" | "review" | "plan" | "memory" | "other"; export interface Turn { id: string; role: "user" | "assistant" | "tool"; text: string; tools?: string[]; timestamp: number; } export interface Chapter { id: string; intent: Intent; title: string; turns: Turn[]; startedAt: number; endedAt: number; folded: boolean; } /** * Classify a single turn into an intent. The first matching rule wins; ties * are broken by rule order, which mirrors how a user perceives priority * (test/debug/refactor before generic implement). */ export declare function detectIntent(turn: Turn): Intent; /** * Group a turn stream into chapters. Consecutive same-intent turns merge; * tool-only turns inherit the previous user/assistant intent so they don't * fragment a chapter. */ export declare function groupTurnsIntoChapters(turns: Turn[]): Chapter[]; /** Toggle a chapter's folded state. Returns a new array (immutable). */ export declare function toggleChapter(chapters: Chapter[], id: string): Chapter[]; export declare const intentLabel: (intent: Intent) => string; //# sourceMappingURL=Chapters.d.ts.map