Skip to content

WIP: Wizard program/agent split #1320

Description

@gewenyu99

Wizard refactor

Today the agent is tightly coupled to the store and to programs. We're splitting them apart. Then you can run a single program headlessly or from code, or import the agent on its own and pass in the bindings and prompts, without touching the rest of the wizard. It also lets us split the code better.

What A changes

Image Image
  • A draws a boundary around the agent: one exported interface, so the agent is a clean module that isn't tightly coupled to the store.
  • The agent gets everything it needs to run from the program's binding, passed in directly.
  • It doesn't touch the store. When it needs to surface something to the user, it goes through interaction callbacks.

What B changes

Image Image
  • B separates the wizard TUI, with its store and screen logic, from the logic that just runs a program.
  • That makes room for the following, which are part of C:
    • Running a program directly.
    • Clean boundaries between programs.
    • Running the agent directly.

What C changes

Image Image
  • C gives each host its own state and one way in: the TUI, headless and embedders all call runProgram. The old adapter goes away.
  • Other agents and tests can call runAgent directly.
  • Every layer gets its own folder, and the compiler enforces both fences.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions