/** * Story-structure beat templates (deterministic, no LLM). * * Each template maps named story beats to a fractional position (0..1) within * the manuscript. Multiplying a beat's `position` by the project's * `target_word_count` yields the target word-count position for that beat. * * Templates: * - `three-act` — classic three-act structure * - `save-the-cat` — Blake Snyder's 15-beat sheet * - `heros-journey` — Campbell / Vogler 12-stage monomyth */ export type StructureTemplateId = 'three-act' | 'save-the-cat' | 'heros-journey'; export interface StructureBeat { /** Stable slug, unique within its template. */ id: string; /** Human-readable beat name. */ name: string; /** Fractional position within the manuscript, 0..1 inclusive. */ position: number; /** Short description of the beat's narrative purpose. */ description: string; } export interface StructureTemplate { id: StructureTemplateId | string; /** Display name. */ name: string; /** One-line summary of the model. */ description: string; /** Attribution for the model. */ source: string; /** Beats in ascending `position` order. */ beats: StructureBeat[]; } /** Registry of all built-in templates, keyed by id. */ export declare const STRUCTURE_TEMPLATES: Readonly>; /** Return all built-in templates as a list. */ export declare function listTemplates(): StructureTemplate[]; /** Look up a template by id, or `undefined` if no such template exists. */ export declare function getTemplate(id: string): StructureTemplate | undefined; export interface AppliedStructurePlanBeat { id: string; name: string; position: number; /** Target word-count position, `round(position * targetWordCount)`. */ targetWord: number; description: string; } export interface AppliedStructurePlan { /** Template id this plan was generated from. */ template: StructureTemplateId | string; templateName: string; targetWordCount: number; /** ISO-8601 timestamp of when the plan was applied. */ appliedAt: string; beats: AppliedStructurePlanBeat[]; } /** Round a beat position to its target word-count position. */ export declare function beatTargetWord(position: number, targetWordCount: number): number; /** * Build a concrete, word-count-resolved plan from a template and a target * word count. */ export declare function buildAppliedPlan(template: StructureTemplate, targetWordCount: number, appliedAt?: Date): AppliedStructurePlan; /** * Pacing label for a beat relative to the current drafted position: * - `passed` — drafted well past this beat's target word * - `due` — drafted position is within tolerance of this beat's target * - `upcoming` — this beat's target is still ahead */ export type BeatPaceLabel = 'passed' | 'due' | 'upcoming'; export interface BeatStatus { beat: StructureBeat; targetWord: number; /** `currentWords - targetWord` (positive = drafted past the beat). */ delta: number; /** Whether the drafted word count has reached the beat's target word. */ reached: boolean; label: BeatPaceLabel; } export interface StructureStatusReport { templateId: string; templateName: string; targetWordCount: number; currentWords: number; /** `currentWords / targetWordCount`, or 0 when the target is 0. */ fractionComplete: number; beats: BeatStatus[]; /** Count of beats whose target word position has been reached. */ reachedCount: number; /** First beat not yet reached, or `null` when all are reached. */ nextBeat: BeatStatus | null; /** Words remaining to the next beat, or `null` when all are reached. */ wordsToNextBeat: number | null; } /** * Compare a template's beats against the current drafted word count. * * Deterministic: a beat is "reached" once `currentWords >= targetWord`. A beat * is "due" when the drafted position is within `tolerance` (a fraction of the * target word count) of the beat's target — i.e. you are at that beat now. * * @param template the structure template (or a plan-derived template) * @param targetWordCount the project's target word count * @param currentWords total drafted words so far * @param tolerance band, as a fraction of target, for the `due` label */ export declare function computeStructureStatus(template: StructureTemplate, targetWordCount: number, currentWords: number, tolerance?: number): StructureStatusReport; /** * Reconstruct a `StructureTemplate` from a previously-applied plan. Used by the * status command when the plan's template id is not a built-in (e.g. the plan * file was hand-edited) so status can still be computed from the saved beats. */ export declare function templateFromPlan(plan: AppliedStructurePlan): StructureTemplate; //# sourceMappingURL=structure-templates.d.ts.map