/** * storytellingjs - Core Type Definitions * * Parity with Python storytelling/data_models.py and related types */ import { z } from 'zod'; /** Session status states */ export type SessionStatus = 'in_progress' | 'completed' | 'failed' | 'interrupted'; /** Model provider schemes */ export type ModelProvider = 'google' | 'ollama' | 'openrouter' | 'myflowise'; /** Workflow node names */ export type WorkflowNode = 'generate_story_elements' | 'generate_initial_outline' | 'determine_chapter_count' | 'generate_single_chapter_scene_by_scene' | 'critique_chapter' | 'check_chapter_complete' | 'revise_chapter' | 'increment_chapter_index' | 'generate_final_story'; /** Style glossary enforcement levels */ export type EnforcementLevel = 'strict' | 'moderate' | 'lenient'; /** Chapter count schema - determines total chapters */ export interface ChapterCount { totalChapters: number; } /** Completion check schema - validates content quality */ export interface CompletionCheck { isComplete: boolean; } /** Summary check schema - verifies chapter follows outline */ export interface SummaryCheck { didFollowOutline: boolean; suggestions: string; } /** Story metadata schema */ export interface StoryInfo { title: string; summary: string; tags: string; overallRating: number; } /** Scene list for a chapter */ export interface SceneList { scenes: string[]; } /** Checkpoint state representation */ export interface SessionCheckpoint { checkpointId: string; nodeName: WorkflowNode; timestamp: string; state: Record; metadata: Record; } /** Complete session information */ export interface SessionInfo { sessionId: string; createdAt: string; lastCheckpoint: string; status: SessionStatus; promptFile: string; outputFile: string; checkpoints: SessionCheckpoint[]; configuration: Record; } /** Style glossary for buzz term detection */ export interface StyleGlossary { avoidTerms: string[]; preferredAlternatives: Record; customAvoidPhrases: string[]; toneWords: Record; enforcementLevel: EnforcementLevel; } /** Main configuration options */ export interface StorytellingConfig { promptFile?: string; outputFile?: string; initialOutlineModel: string; chapterOutlineModel: string; chapterS1Model: string; chapterS2Model: string; chapterS3Model: string; chapterS4Model: string; chapterRevisionModel: string; revisionModel: string; evalModel: string; infoModel: string; scrubModel: string; checkerModel: string; translatorModel: string; knowledgeBasePath?: string; embeddingModel?: string; ollamaBaseUrl: string; outlineRagEnabled: boolean; outlineContextMaxTokens: number; outlineRagTopK: number; outlineRagSimilarityThreshold: number; chapterRagEnabled: boolean; chapterContextMaxTokens: number; chapterRagTopK: number; expandOutline: boolean; enableFinalEditPass: boolean; noScrubChapters: boolean; sceneGenerationPipeline: boolean; outlineMinRevisions: number; outlineMaxRevisions: number; chapterMinRevisions: number; chapterMaxRevisions: number; noChapterRevision: boolean; translate?: string; translatePrompt?: string; styleGlossaryPath?: string; styleGlossary?: StyleGlossary; enableBuzzTermRevision: boolean; seed: number; sleepTime: number; debug: boolean; mockMode: boolean; } /** Basic story representation */ export interface Story { title: string; content: string; metadata: Record; } /** Story beat with optional universe analysis */ export interface StoryBeat { id: string; text: string; timestamp: string; emotionalTone?: string; thematicRelevance?: string[]; characterInvolved?: string[]; universeAnalysis?: { engineer?: string; ceremony?: string; storyEngine?: string; }; } /** Character arc state */ export interface CharacterArcState { characterId: string; characterName: string; currentPosition: number; arcType: string; keyMoments: string[]; developmentNotes: string[]; } /** Gap identified in quality analysis */ export interface Gap { type: string; severity: 'critical' | 'major' | 'minor'; description: string; affectedBeats?: string[]; suggestion?: string; } /** NCP state container */ export interface NCPState { beats: StoryBeat[]; characterArcs: CharacterArcState[]; gaps: Gap[]; currentPhase: string; } /** Tool definition for MCP */ export interface ToolDefinition { name: string; description: string; inputSchema: { type: 'object'; properties: Record; required?: string[]; }; } /** Property schema for tool inputs */ export interface PropertySchema { type: 'string' | 'number' | 'boolean' | 'array' | 'object'; description?: string; enum?: string[]; items?: PropertySchema; minimum?: number; maximum?: number; default?: unknown; } /** Tool execution handler */ export interface ToolHandler { definition: ToolDefinition; execute: (args: Record) => Promise; } /** Tool execution result */ export interface ToolResult { content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; }>; isError?: boolean; } export declare const ChapterCountSchema: z.ZodObject<{ totalChapters: z.ZodNumber; }, "strip", z.ZodTypeAny, { totalChapters: number; }, { totalChapters: number; }>; export declare const CompletionCheckSchema: z.ZodObject<{ isComplete: z.ZodBoolean; }, "strip", z.ZodTypeAny, { isComplete: boolean; }, { isComplete: boolean; }>; export declare const SummaryCheckSchema: z.ZodObject<{ didFollowOutline: z.ZodBoolean; suggestions: z.ZodString; }, "strip", z.ZodTypeAny, { didFollowOutline: boolean; suggestions: string; }, { didFollowOutline: boolean; suggestions: string; }>; export declare const StoryInfoSchema: z.ZodObject<{ title: z.ZodString; summary: z.ZodString; tags: z.ZodString; overallRating: z.ZodNumber; }, "strip", z.ZodTypeAny, { title: string; summary: string; tags: string; overallRating: number; }, { title: string; summary: string; tags: string; overallRating: number; }>; export declare const SessionInfoSchema: z.ZodObject<{ sessionId: z.ZodString; createdAt: z.ZodString; lastCheckpoint: z.ZodString; status: z.ZodEnum<["in_progress", "completed", "failed", "interrupted"]>; promptFile: z.ZodString; outputFile: z.ZodString; checkpoints: z.ZodArray; metadata: z.ZodRecord; }, "strip", z.ZodTypeAny, { checkpointId: string; nodeName: string; timestamp: string; state: Record; metadata: Record; }, { checkpointId: string; nodeName: string; timestamp: string; state: Record; metadata: Record; }>, "many">; configuration: z.ZodRecord; }, "strip", z.ZodTypeAny, { status: "in_progress" | "completed" | "failed" | "interrupted"; sessionId: string; createdAt: string; lastCheckpoint: string; promptFile: string; outputFile: string; checkpoints: { checkpointId: string; nodeName: string; timestamp: string; state: Record; metadata: Record; }[]; configuration: Record; }, { status: "in_progress" | "completed" | "failed" | "interrupted"; sessionId: string; createdAt: string; lastCheckpoint: string; promptFile: string; outputFile: string; checkpoints: { checkpointId: string; nodeName: string; timestamp: string; state: Record; metadata: Record; }[]; configuration: Record; }>; export declare const ModelUriSchema: z.ZodString; //# sourceMappingURL=types.d.ts.map