Repository navigation
refactor: driver SDK layout and DriverModule registry - #92
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the "Driver SDK layout and
DriverModuleregistry" step ofdocs/AGENT-CANDIDATES.md. It shapes the agent host for install on demand and for further agents. Loading and warm-up behave exactly as before.src/host/holds the process, routing and the module list;src/sdk/the driver SDK;src/install/the pinned-runtime installer; drivers live insrc/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 nowsrc/host/main.ts; the output is stilldist/main.js, so the image and release archives are unchanged.DriverModule(sdk/module.ts): each driver folder exports one frommodule.ts. It holds:host/modules.tsreplaces the twoswitchstatements inmain.ts. Loading and the warm-up mode iterate it, and install on demand will too.host/__tests__/layout.test.ts) fails when:sdk/,install/,generated/or its own folder;sdk/orinstall/imports the host or a driver;docs/PROTOCOL.md"Adding an agent" anddocs/AGENT-CANDIDATES.md"Package layout" describe the new shape.Verification
cargo testfor the driver-protocol spawn test and the bridge end-to-end test pass against the new bundle (-- --ignored).deepseek-v4.1-flashran a turn, and its conversation delete still works;🤖 Generated with Claude Code