The host layer is what the two hosts, the TUI and headless, share about running the wizard as a process: how a run ends. It owns:
- The exit. A host starts its exit with
startHostExitand resolves an exit code; only the CLI andbin.tscallprocess.exit.wizardAbortends a decided failure with the presenter its caller passes, andregisterShutdownadds a hook the end runs first.
The TUI and headless import it through @host/*: @host/wizard-abort for the
exit. The CLI and the e2e harness may import it too.
The host layer may import @env, @shared/* and @utils/*, and nothing else:
the programs, the agent, the TUI, headless and the CLI are out of its reach, and
the programs and the agent never import it. See
layer boundaries.
| What | Where |
|---|---|
| The exit, aborts and shutdown hooks | wizard-abort.ts |