Skip to content

refactor: fold construct-mcp and construct-adapter-* into single construct binary#441

Merged
edwin-zvs merged 2 commits into
mainfrom
worktree-agent-ad99171bcd98f0d01
Jun 20, 2026
Merged

refactor: fold construct-mcp and construct-adapter-* into single construct binary#441
edwin-zvs merged 2 commits into
mainfrom
worktree-agent-ad99171bcd98f0d01

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • All 7 previously separate binaries consolidated into construct
  • Adapters dispatched via construct __adapter <name> (hidden clap subcommand)
  • MCP server dispatched via construct __mcp (hidden clap subcommand)
  • install.sh now ships a single binary
  • e2e relocatable-daemon test no longer needs to copy adapter siblings

Implementation

Each adapter/mcp crate becomes a pure library (src/main.rssrc/lib.rs, [[bin]] removed, [lib] added, logic exposed as pub async fn run()). The cli crate grows deps on all of them.

BUILTIN_ADAPTERS gains an args: &[&str] field; every built-in sets binary = "construct" with args = ["__adapter", "<name>"], so the daemon's existing AdapterConfig.args layering carries the routing prefix into spawned processes automatically.

MCP injection (maybe_inject_mcp_config, maybe_inject_codex_mcp_args) now locates construct and passes ["__mcp"] as args. generate_auto_title accepts a prefix_args parameter for the same reason.

Test plan

  • cargo build succeeds (no new errors)
  • construct __adapter shell spawns a shell session
  • construct __adapter smith starts the smith harness
  • construct __mcp connects to daemon and serves MCP tools
  • construct __adapter smith --title-mode "implement a todo app" prints a short title
  • construct new smith "hello" creates a session (daemon resolves via builtin args)
  • Claude/Codex sessions receive MCP tools as before (agentd_list_sessions works)

🤖 Generated with Claude Code

…truct binary

All 7 previously separate binaries are now dispatched through hidden
subcommands: `construct __mcp` and `construct __adapter <name>`.

Each adapter/mcp crate becomes a library crate (src/main.rs → src/lib.rs,
[[bin]] removed, [lib] added). The cli crate grows deps on all of them and
routes via two new hidden clap subcommands: `__mcp` and `__adapter`.

BUILTIN_ADAPTERS gains an `args` field; all built-ins now set
binary="construct" with args=["__adapter","<name>"], so the daemon's
existing AdapterConfig.args layering carries the routing prefix into every
spawned adapter process.

MCP injection (maybe_inject_mcp_config, maybe_inject_codex_mcp_args) now
locates `construct` and passes `["__mcp"]` as args in the generated configs.

generate_auto_title in session.rs gains a prefix_args param so the
smith --title-mode invocation becomes `construct __adapter smith --title-mode`.

install.sh ships a single `construct` binary. e2e tests no longer copy
sibling adapter binaries in the relocatable daemon case.
Removes references to construct-mcp, construct-adapter-shell,
construct-adapter-claude, construct-adapter-codex,
construct-adapter-antigravity, construct-adapter-smith as standalone
binaries, replacing them with the single-binary dispatch form
(construct __mcp, construct __adapter <name>) throughout docs and
examples/config.toml.
@edwin-zvs
edwin-zvs merged commit 3490cfb into main Jun 20, 2026
1 check passed
edwin-zvs added a commit that referenced this pull request Jun 23, 2026
PR #441 folded construct-mcp and every construct-adapter-* into the single
construct binary, but the release workflow still listed them in BINS and built
them with `-p`. The adapter/mcp crates are now libraries with no [[bin]], so
`cargo build -p construct-mcp` produces no binary and the packaging step's
`cp target/<triple>/release/construct-mcp` fails — which is why the v0.11.0
release build failed on all four targets.

Build just `--bin construct` and ship that single binary in the tarball
(adapters/mcp run as `construct __adapter <name>` / `construct __mcp`).
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