import { z } from "zod"; export declare const BookRulesSchema: z.ZodObject<{ version: z.ZodDefault; protagonist: z.ZodOptional>; behavioralConstraints: z.ZodDefault>; }, "strip", z.ZodTypeAny, { name: string; personalityLock: string[]; behavioralConstraints: string[]; }, { name: string; personalityLock?: string[] | undefined; behavioralConstraints?: string[] | undefined; }>>; genreLock: z.ZodOptional>; }, "strip", z.ZodTypeAny, { primary: string; forbidden: string[]; }, { primary: string; forbidden?: string[] | undefined; }>>; numericalSystemOverrides: z.ZodOptional>; resourceTypes: z.ZodDefault>; }, "strip", z.ZodTypeAny, { resourceTypes: string[]; hardCap?: string | number | undefined; }, { hardCap?: string | number | undefined; resourceTypes?: string[] | undefined; }>>; eraConstraints: z.ZodOptional; period: z.ZodOptional; region: z.ZodOptional; }, "strip", z.ZodTypeAny, { enabled: boolean; period?: string | undefined; region?: string | undefined; }, { enabled?: boolean | undefined; period?: string | undefined; region?: string | undefined; }>>; prohibitions: z.ZodDefault>; chapterTypesOverride: z.ZodDefault>; fatigueWordsOverride: z.ZodDefault>; additionalAuditDimensions: z.ZodDefault, "many">>; enableFullCastTracking: z.ZodDefault; fanficMode: z.ZodOptional>; allowedDeviations: z.ZodDefault>; }, "strip", z.ZodTypeAny, { version: string; prohibitions: string[]; chapterTypesOverride: string[]; fatigueWordsOverride: string[]; additionalAuditDimensions: (string | number)[]; enableFullCastTracking: boolean; allowedDeviations: string[]; fanficMode?: "canon" | "au" | "ooc" | "cp" | undefined; protagonist?: { name: string; personalityLock: string[]; behavioralConstraints: string[]; } | undefined; genreLock?: { primary: string; forbidden: string[]; } | undefined; numericalSystemOverrides?: { resourceTypes: string[]; hardCap?: string | number | undefined; } | undefined; eraConstraints?: { enabled: boolean; period?: string | undefined; region?: string | undefined; } | undefined; }, { fanficMode?: "canon" | "au" | "ooc" | "cp" | undefined; version?: string | undefined; protagonist?: { name: string; personalityLock?: string[] | undefined; behavioralConstraints?: string[] | undefined; } | undefined; genreLock?: { primary: string; forbidden?: string[] | undefined; } | undefined; numericalSystemOverrides?: { hardCap?: string | number | undefined; resourceTypes?: string[] | undefined; } | undefined; eraConstraints?: { enabled?: boolean | undefined; period?: string | undefined; region?: string | undefined; } | undefined; prohibitions?: string[] | undefined; chapterTypesOverride?: string[] | undefined; fatigueWordsOverride?: string[] | undefined; additionalAuditDimensions?: (string | number)[] | undefined; enableFullCastTracking?: boolean | undefined; allowedDeviations?: string[] | undefined; }>; export type BookRules = z.infer; export interface ParsedBookRules { readonly rules: BookRules; readonly body: string; } /** * Phase 5 cleanup #3: book_rules.md is now a compat pointer shim — the * authoritative YAML frontmatter lives on outline/story_frame.md. Detect a * shim by its architect-emitted heading + pointer line so we can avoid * treating it as a legitimate (default-empty) rules source. * * Markers (must match buildBookRulesShim() in architect.ts): * - 本书规则(兼容指针——已废弃) / Book Rules (compat pointer — deprecated) * - 本文件仅为外部读取保留 / This file is kept for external readers only */ export declare function isBookRulesShim(raw: string): boolean; export declare function parseBookRules(raw: string): ParsedBookRules | null; /** * Stricter variant of parseBookRules: returns null if the input has no valid * YAML frontmatter OR if the frontmatter fails to parse / validate. Unlike * parseBookRules, this never falls back to default rules — callers can use * the null return to trigger their own fallback (e.g. legacy book_rules.md). * * Phase 5 hotfix 3: readBookRules() uses this to detect a broken YAML block * on story_frame.md and fall back to legacy book_rules.md instead of * silently clearing protagonist / prohibitions / genreLock. */ export declare function tryParseBookRulesFrontmatter(raw: string, onError?: (error: unknown) => void): ParsedBookRules | null; //# sourceMappingURL=book-rules.d.ts.map