Repository navigation
Extract built-in clients into per-client packages - #167
Merged
Merged
Conversation
Adds an agent.Plugin interface so per-client behavior (MCP config emission, host credential seeding) lives alongside each client's declarative data, and moves the five built-in clients (claude-code, codex, opencode, hermes, gemini) into pkg/clients/<name>/. The central MCPConfigFormat enum and the credentialSeederForAgent name-switch are gone; dispatch is polymorphic through the registry. infraagent.NewRegistry no longer auto-loads builtins — composition roots pass clients.Builtins(logger) explicitly so SDK consumers can register their own client packages alongside the standard set. Adding a new client now means a new pkg/clients/<name>/ package, an entry in Builtins(), and a Dockerfile + Taskfile target. No edits to the registry, no enum to extend, no switch to update. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
pkg/clients/<name>/as a public plugin layer with one package per built-in coding agent (claudecode,codex,opencode,hermes,gemini). Each package exposesNew() agent.ClientEntryreturning the declarativeagent.Agentvalue plus aPluginimplementation.agent.Plugininterface so the small per-client behavior fragments — MCP config emission (different file, format, and key shape per agent) and host credential seeding (claude-code only today) — live alongside each client's data. The centralMCPConfigFormatenum / switch ininternal/infra/vm/hooks.goand thecredentialSeederForAgentname-switch incmd/bbox/main.goare gone; dispatch is polymorphic through the registry.infraagent.NewRegistryno longer auto-loads builtins. Composition roots (cmd/bbox/main.go,pkg/runtime) now passclients.Builtins(logger)...explicitly, so SDK consumers can register their own client packages alongside the standard set.Adding a new client now means: create a
pkg/clients/<name>/package, add an entry toBuiltins(), and add theimages/<name>/Dockerfile+ Taskfile target. No edits to the registry, no enum to extend, no switch to update. CLAUDE.md documents the new layer and a 3-step "Adding a new client" guide.Net diff: +2349 / −1698 lines (most of the addition is per-client test coverage that previously lived in one large
mcpconfig_test.go).Test plan
task fmtcleantask lintcleantask testpasses with race detector (full suite)bbox listto verify all five built-in agents still appearbbox claude-code(MCP config injection + credential seeder path)bbox codex) to confirm the data-only plugin path🤖 Generated with Claude Code