"""多章工作流链（chain-workflow 设计）——`write → review → decide → accept` 有环图。

第一个真正需要 LangGraph 的场景（有环 + 可持久 + 可中断）：批量量产 K 章，每章过
`assemble → write → 四审 → digest` 闭环，遇冲突 `interrupt()` 暂停交人裁决，resume 续跑。
激活休眠资产（checkpointer + interrupt）。详见 docs/design/chain-workflow.md。
"""

from __future__ import annotations

from .graph import (
    ACCEPT_CHAPTER,
    DECIDE,
    REVIEW_CHAPTER,
    WRITE_CHAPTER,
    build_chain_graph,
    initial_chain_state,
)
from .nodes import (
    AcceptChapterOp,
    AssembleContext,
    AssembleFn,
    ChapterDraftRepo,
    GatewayBuilder,
    MemoryReposFactory,
    ReviewRecordRepo,
    SessionFactory,
    accept_chapter,
    decide,
    has_conflicts,
    review_chapter,
    write_chapter,
)
from .state import ChainState

__all__ = [
    "ACCEPT_CHAPTER",
    "DECIDE",
    "REVIEW_CHAPTER",
    "WRITE_CHAPTER",
    "AcceptChapterOp",
    "AssembleContext",
    "AssembleFn",
    "ChainState",
    "ChapterDraftRepo",
    "GatewayBuilder",
    "MemoryReposFactory",
    "ReviewRecordRepo",
    "SessionFactory",
    "accept_chapter",
    "build_chain_graph",
    "decide",
    "has_conflicts",
    "initial_chain_state",
    "review_chapter",
    "write_chapter",
]
