import { type DialogueGraph } from "./dialogueGraph.js"; /** Caller-reviewed facts for one authoring revision; event ids are in strict chronological order. */ export interface NarrativeCanon { readonly revision: string; readonly characterIds: readonly string[]; readonly facts: Readonly>; readonly eventIds: readonly string[]; } /** An explicit assertion attached to a dialogue node; dialogue prose is never parsed. */ export type NarrativeClaim = { readonly nodeId: string; } & ({ readonly kind: "character"; readonly characterId: string; } | { readonly kind: "fact"; readonly factId: string; readonly value: string; } | { readonly kind: "before"; readonly earlier: string; readonly later: string; }); /** Authored dialogue with optional structured assertions against canon. */ export interface NarrativeDialogue { readonly id: string; readonly graph: DialogueGraph; readonly claims: readonly NarrativeClaim[]; } /** A candidate batch never changes canon; accepted new facts need a separately reviewed revision. */ export interface NarrativeBatch { readonly canonRevision: string; readonly dialogues: readonly NarrativeDialogue[]; } /** Caller budgets across the entire batch, including graph branches and explicit assertions. */ export interface NarrativeBatchLimits { readonly maxDialogues: number; readonly maxNodes: number; readonly maxChoices: number; readonly maxClaims: number; /** Sum of spoken lines and player choice text lengths (UTF-16 code units). */ readonly maxTextCharacters: number; } /** A repair diagnostic with a JSON-pointer location in the candidate batch. */ export interface NarrativeIssue { readonly code: string; readonly severity: "error" | "warning"; readonly path: string; readonly message: string; } /** * Detach and freeze reviewed canon before passing it to an asynchronous authoring callback. * Duplicate character/event ids and an empty revision throw; facts retain exact caller values. * * @capability narrative-canon freeze caller-reviewed character ids, facts and chronology for a narrative authoring revision */ export declare function freezeNarrativeCanon(canon: NarrativeCanon): NarrativeCanon; /** * Check a typed candidate against caller budgets, canon revision, explicit claims and graph topology. * Stops at the first exceeded budget before topology work; stale revisions also stop immediately. * Claims check exact fact values and the declared strict event order, never prose, speaker labels, * motivations, branch consequences or story quality. O(canon + bounded nodes + choices + claims). * Validate/parse external JSON before calling; this is not an untrusted JSON decoder. * * @capability narrative-batch-validation locate stale canon, oversized batches, explicit character/fact/chronology contradictions and dialogue graph issues for bounded repair */ export declare function validateNarrativeBatch(canon: NarrativeCanon, batch: NarrativeBatch, limits: NarrativeBatchLimits): NarrativeIssue[];