import { type SessionPlan } from "../store/plan.js"; import type { LoopGuard } from "./loop-guard.js"; import type { SessionPolicy } from "./session-policy.js"; import type { ToolCall } from "../types.js"; /** Titles match for plan merge (exact or mutual long substring). */ export declare function titlesMatchForPlan(a: string, b: string): boolean; /** Final coding-plan task: start server / probe localhost / leave running. */ export declare function looksLikeRunServerTask(title: string): boolean; export declare function looksLikeLocalAppScaffold(kind: string, goal: string, detail: string, tasks: string[]): boolean; export declare function codingPlanNeedsRunVerifyTask(kind: string, goal: string, detail: string, tasks: string[]): boolean; /** * Ensure coding app plans have an explicit install step after scaffold. * Avoids "implement blocked from npm install" + install attributed to wrong task. */ export declare function ensureCodingPlanInstallTask(kind: string, goal: string, detail: string, tasks: string[]): string[]; /** * Ensure feature-app plans include an implement-feature task (not scaffold-only). */ export declare function ensureCodingPlanFeatureTask(kind: string, goal: string, detail: string, tasks: string[]): string[]; /** Ensure local app plans end with shell.start + probe + leave running. */ export declare function ensureCodingPlanRunVerifyTask(kind: string, goal: string, detail: string, tasks: string[]): string[]; /** Preserve the model/user-authored checklist exactly for fresh coding plans. */ export declare function normalizeCodingPlanTasks(_kind: string, _goal: string, _detail: string, tasks: string[]): string[]; /** Goal is only "run/start the existing app" — do not open a new plan. */ export declare function looksLikeRunOnlyGoal(goal: string, detail: string): boolean; export declare function slugifyTaskId(text: string): string; export interface NormalizedPlanTask { title: string; aliases: string[]; dependencies: string[]; dependenciesSpecified: boolean; resourceLocks: string[]; } /** Full entries including model-supplied id/name aliases (X3). */ export declare function normalizePlanTaskEntries(args: Record): NormalizedPlanTask[]; /** Resolve model taskId (t1 or slug) to the canonical plan task id. */ export declare function resolvePlanTaskId(plan: SessionPlan, taskId: string): string | undefined; /** Render the portable inline form; the Ink TUI owns its responsive sidebar. */ export declare function renderPlanForTerminal(plan: SessionPlan): string; export interface PlanToolResult { handled: boolean; ok: boolean; plan?: SessionPlan | undefined; cleared?: boolean | undefined; /** What to print to the user's terminal. */ display: string; /** What to feed back to the model as the tool result. */ modelNote: string; /** Soft reminder (held, not applied) — skip loop-guard accounting. */ reminder?: boolean | undefined; /** Short identifiable toast to surface when this result is a reminder. */ toast?: string | undefined; } /** Build the system-context block describing the session's active plan. */ export declare const PLAN_CONTEXT_PREFIX = "ACTIVE PLAN"; export declare function upsertPlanContextMessage(messages: Array<{ role: string; content: string; }>, content: string): void; export declare function removePlanContextMessage(messages: Array<{ role: string; content: string; }>): void; export declare function planContextMessage(plan: SessionPlan, approved: boolean): string; /** * Handle plan.create / task.update inline. These are session-scoped and * persisted via the plan store so the user can view the plan (Ctrl+P) and * the agent keeps it in context across the whole session. */ export declare function handlePlanTool(call: ToolCall, session: SessionPolicy, ctx: { loopGuard: LoopGuard; step: number; autoApprove?: boolean; }): Promise;