Adding a backend¶
Repowire keeps the serialized backend identity in daemon-go/proto and the
runtime-specific launch/resume/setup behavior in the native service and CLI
packages.
Required changes¶
- Add the persisted
AgentTypevalue and validation case indaemon-go/proto/proto.go. Changing an existing value is a state migration. - Add resume capability and command construction in
daemon-go/service/agent_backends.go. - Add CLI detection, setup/uninstall, MCP configuration, and embedded runtime
assets in
daemon-go/cli/. - Add native hook normalization in
daemon-go/hooks/or an embedded WebSocket/plugin transport when the runtime has no hook surface. - Add the default spawn command in setup and document any runtime-specific session storage used for safe resume prevalidation.
Keep backend-specific decisions at these seams. Routes, jobs, peer state, and
delivery should continue operating on proto.AgentType without runtime-name
conditionals.
Resume contract¶
Runtime resume is a backend capability, not a jobs-only special case. When a hook reports a runtime session ID, Repowire records it and later acquires an executor in this order:
- reuse a suitable live peer;
- prevalidate and spawn the backend-native resume command;
- spawn fresh when no durable binding is usable.
The prevalidation step must prove the session exists before any pane is killed.
Tests¶
At minimum, cover:
AgentType.Validand wire serialization;- detection plus setup/uninstall behavior;
- resume capability, prevalidation, and command construction;
- spawn/session acquisition for reuse, resume, and fresh execution;
- MCP config edits when supported;
- hook/plugin registration and one real delivery round trip.