/** * Inline plan approval component. * Shows a submitted plan as rendered markdown with Approve/Use as Goal/Request Changes options * directly in the conversation flow. When a previous plan exists, shows a diff of changes. * * "Request changes" rejects the plan and stops the agent — the user provides * revision feedback via a regular chat message rather than inline input. */ import { Container } from '@earendil-works/pi-tui'; import type { Component, Focusable, TUI } from '@earendil-works/pi-tui'; import type { ChatSpacingKind } from './chat-spacing.js'; export interface PlanApprovalInlineOptions { toolCallId: string; title: string; plan: string; /** Filename on disk (e.g. `add-dark-mode.md`). */ planFilename?: string; /** Previous plan content for diff display on resubmission. */ previousPlan?: string; onApprove: () => void; onGoal: () => void; onReject: () => void; } /** Exported for tests. */ export declare class PlanContentBox implements Component { private plan; private cachedLines?; private cachedWidth?; private cachedThemeGeneration?; constructor(plan: string); invalidate(): void; render(width: number): string[]; } /** * Renders a unified diff between two plan texts inside a bordered box. * Long lines are wrapped (not truncated) so the full plan text is visible. */ export declare class PlanDiffBox implements Component { private diffEntries; private cachedLines?; private cachedWidth?; private cachedThemeGeneration?; constructor(oldPlan: string, newPlan: string); invalidate(): void; render(width: number): string[]; } export declare class PlanApprovalInlineComponent extends Container implements Focusable { private ui; private contentBox; private selectList?; private onApprove?; private onGoal?; private onReject?; private resolved; private mode; private planTitle; private planContent; private planFilename?; private previousPlan?; private _focused; get focused(): boolean; set focused(value: boolean); constructor(options: PlanApprovalInlineOptions, ui: TUI); static createStreaming(ui: TUI): PlanApprovalInlineComponent; activate(options: PlanApprovalInlineOptions): void; getChatSpacingKind(): ChatSpacingKind; updateArgs(args: unknown): void; private renderSelectable; private renderStreaming; private renderPlanHeader; private renderPlanContent; private handleSelection; private handleApprove; private handleGoal; private handleReject; private showResult; handleInput(data: string): void; } /** * Static component for rendering a resolved plan in history. * Shows the plan content with approval/rejection status. */ export interface PlanResultOptions { title: string; plan: string; /** Filename on disk (e.g. `add-dark-mode.md`). */ planFilename?: string; isApproved: boolean; feedback?: string; } export declare class PlanResultComponent extends Container { getChatSpacingKind(): ChatSpacingKind; constructor(options: PlanResultOptions); } //# sourceMappingURL=plan-approval-inline.d.ts.map