System Architecture And Why The Codebase Is Designed This Way
The Architecture In One Sentence
This is one runtime with several entry surfaces. Interactive REPL, headless SDK and print mode, remote-control bridge, and remote-session viewing all share the same model, tool, and session core, then diverge only where transport or UI requirements force them to.
Major Architectural Decisions
1. One shared query and tool core for both TUI and SDK
query.tsowns the turn-level state machine.QueryEngine.tsowns conversation-level state for headless and SDK flows.Tool.ts, , and own tool contracts and execution behavior.