/** * The list of steps a run is working through, kept where the model can see it every turn. * * The failure this exists for: asked to build a Stokvel platform, a run listed directories, read * a file, narrated what it would do next, listed the same directories again, and eventually * halted having built nothing. Nothing was holding the shape of the job. Each turn the model saw * a transcript and had to reconstruct what it was doing from it, and by the time the transcript * was long it reconstructed something different every time. * * A plan makes that state explicit rather than inferred. It is written by the model, restated to * it on every turn, and shown to the person watching — who can then see the agent forget, which * is the difference between "it is stuck" and "it says step 4 of 7 and is on step 4". */ export type StepState = 'todo' | 'doing' | 'done' | 'blocked'; export interface PlanStep { text: string; state: StepState; /** Why it is blocked, when it is. */ note?: string; } export interface Plan { steps: PlanStep[]; /** When the plan was last written, for showing staleness in a long session. */ updatedAt: number; } export declare const EMPTY_PLAN: Plan; /** At most this many steps. A plan nobody can hold in their head is a transcript with bullets. */ export declare const MAX_STEPS = 20; /** * A plan from whatever shape the model sent. * * Deliberately forgiving. A model that writes `{"steps": ["a", "b"]}` has expressed a perfectly * good plan and should not be argued with about the schema; rejecting it teaches it to stop using * the tool, and the tool only helps if it is used. */ export declare function parsePlan(input: unknown, now: number): Plan | string; /** * The plan as the model is reminded of it, at the top of every turn. * * Written as instruction rather than decoration: the point is that the next action follows from * the plan, and that a step which is finished gets marked so rather than silently redone. */ /** * What the model is told when it has no plan and the job clearly needs one. * * Measured, not assumed: on a real three-file task the model called `plan` exactly zero times in * sixty-three turns and spent a million tokens. The tool was in its list and one line of the * rules mentioned it, which is not the same as being asked. This says so on every turn until * there is a plan, in the same place the plan itself would be — the one part of the prompt that * is rebuilt each turn rather than scrolling away behind the transcript. */ export declare function noPlanReminder(): string; export declare function planReminder(plan: Plan): string; /** One line for a status bar: how far along, and what is being done now. */ export declare function planSummary(plan: Plan): string; /** What the model is told after it writes a plan, so the next step is unambiguous. */ export declare function planAck(plan: Plan): string; //# sourceMappingURL=plan.d.ts.map