• Analyzes a story definition for common structural issues.

    This function checks for:

    • Unreachable nodes: Nodes that cannot be reached from the entry point
    • Dead ends: Nodes with no choices and no ending marker
    • Inescapable loops: Loops that cannot be exited (no ending, no way out)

    Type Parameters

    • TEffect

      The type of effects used in the story

    Parameters

    Returns AnalysisResult

    Analysis result containing any issues found

    Example

    const result = analyzeStory(myStory);
    if (result.issues.length > 0) {
    console.warn('Story has issues:', result.issues);
    }