Skip to content

refactor: driver SDK layout and DriverModule registry - #92

Merged
deymosh merged 1 commit into
masterfrom
feat/driver-module-registry
Oct 8, 2026
Merged

deymosh merged 1 commit into
masterfrom
feat/driver-module-registry

Conversation

@deymosh

@deymosh deymosh commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

This is the "Driver SDK layout and DriverModule registry" step of docs/AGENT-CANDIDATES.md. It shapes the agent host for install on demand and for further agents. Loading and warm-up behave exactly as before.

  • Layout: src/host/ holds the process, routing and the module list; src/sdk/ the driver SDK; src/install/ the pinned-runtime installer; drivers live in src/drivers/<agent>/. src/generated/ stays put, since the Rust type generator and CI's drift check write and check it there. The bundle entry is now src/host/main.ts; the output is still dist/main.js, so the image and release archives are unchanged.
  • DriverModule (sdk/module.ts): each driver folder exports one from module.ts. It holds:
    • the agent's id and label;
    • the environment variables that are its alone, claimed before any driver is built (the DeepSeek Harness's endpoint and key);
    • how to build the driver;
    • its runtime: what the machine already has, and how to install the pinned one.
  • Module list: host/modules.ts replaces the two switch statements in main.ts. Loading and the warm-up mode iterate it, and install on demand will too.
  • Layout test (host/__tests__/layout.test.ts) fails when:
    • a driver imports anything outside sdk/, install/, generated/ or its own folder;
    • sdk/ or install/ imports the host or a driver;
    • anything but the module list names a driver;
    • a driver folder has no registered module.
  • Docs: docs/PROTOCOL.md "Adding an agent" and docs/AGENT-CANDIDATES.md "Package layout" describe the new shape.

Verification

  • The agent host's typecheck and tests (521, including the new module and layout tests) and its build pass. cargo test for the driver-protocol spawn test and the bridge end-to-end test pass against the new bundle (-- --ignored).
  • Live, in the bridge container, with the new bundle:
    • a DeepSeek Harness session on deepseek-v4.1-flash ran a turn, and its conversation delete still works;
    • warm-up mode resolved all three agents' runtimes.

🤖 Generated with Claude Code

…stry

The host's sources lay flat in src/, and main.ts knew every agent through
two switch statements (loading and the warm-up mode), with agent-specific
environment handling in them. Adding an agent meant editing both, and
install on demand would have needed a third.

The sources now sit by role: host/ (the process, routing and the list of
driver modules), sdk/ (what a driver builds on), install/ (pinned
runtimes) and drivers/<agent>/. generated/ stays where it is, since the
Rust type generator and CI's drift check write and check it there.

Each driver folder exports one DriverModule from module.ts: the agent's
id and label, the environment variables that are its alone (claimed
before any driver is built, so no other agent's process inherits them),
how to build its driver, and its runtime (what the machine already has,
and how to install the pinned one). host/modules.ts keeps the list;
loading and warm-up iterate it, with behaviour unchanged. A layout test
fails when a driver imports anything outside sdk/, install/, generated/
or its own folder, or when anything but the module list names a driver.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@deymosh
deymosh merged commit af5aa6a into master Oct 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant