import { type LessonSelection } from "./design-knowledge.ts"; import { referenceContext } from "./reference-library.ts"; export type PreSelectedLesson = Pick; export type DesignContextExpansion = { id: string; hash: string; chars: number; text: string; }; export type DesignContextManifest = { schemaVersion: 1; nodeId: string; sourceHashes: Record; selectedLessons: { id: string; version: number; contentHash: string; }[]; selectedRequirements: { id: string; version: number; sourceIds: string[]; reason: string; }[]; requiredSections: string[]; optionalSections: string[]; expansions: { id: string; hash: string; chars: number; }[]; charCount: number; byteCount: number; tokenEstimate: number; tokenEstimateMethod: "chars/4"; authoringPolicy?: { mode: string; lessonRelease: string | null; hash: string; }; compositionSelection?: { selectorVersion: string; inputSignalHash: string; manifestHash: string; selectedIds: string[]; }; compositionPageSelections?: { page: string; inputSignalHash: string; selectedIds: string[]; }[]; referenceSelection?: ReturnType extends infer T ? T extends { receipt: infer R; } ? R : never : never; }; export type DesignContextPacket = { manifest: DesignContextManifest; text: string; expansions: DesignContextExpansion[]; }; export declare const DESIGN_CONTEXT_STAGES: Set; export declare function buildDesignContextPacket(opts: { root: string; nodeId: string; allowedWrites?: string[]; jevMode?: "off" | "shadow" | "assist"; advisory?: string; /** Lifecycle-selected lessons before reference-analysis is written. */ preSelectedLessons?: PreSelectedLesson[]; preparationId?: string; kernel?: string; optionalCharBudget?: number; }): DesignContextPacket; /** Keep workflow instructions. Drop the design packet's stage header when the instruction packet already names the node and outputs. */ export declare function supplementDesignContext(instruction: string, designText: string): string; export declare function expandDesignContextItem(packet: DesignContextPacket, id: string): { ok: true; text: string; } | { ok: false; reason: string; };