WardrikACP (wardrik_acp v0.1.0-rc.1)
Copy MarkdownGives WardrikCore agents coding agents, such as Claude Code, as tools. Each one runs over the Agent Client Protocol (ACP).
children = [
{WardrikACP,
name: MyApp.ACP,
worktrees: "/var/lib/my_app/worktrees",
checkouts: [billing: "/srv/billing"],
harnesses: [claude: [command: "claude-agent-acp"]]}
]
WardrikCore.start_agent(
agent_id: "builder",
model: "anthropic:claude-haiku-4-5",
capabilities: [{WardrikACP, name: MyApp.ACP, harnesses: [:claude]}],
middleware: [{WardrikPolicy.Middleware, WardrikPolicy.new!(ask: ["claude/execute"])}]
)- The model sees a tool named
claude. Its arguments aretask,checkoutandwork. - Each
workname has its own worktree, branch and session. Calling it again continues them. - Each permission request from the coding agent runs through the agent's middleware as a tool
call named
claude__execute,claude__edit, and so on, by ACP tool kind. Its arguments are the request'srawInput. - A request that parks parks the call. Answer it by the call's ID, as for any tool call.
- The answer lists the branch, its commits, and the coding agent's last message.
- Harness options are in
WardrikACP.Harness.
Telemetry
[:wardrik_acp, :sweep]after each sweep. Measurements::removed. Metadata::acp,:removed(the paths).[:wardrik_acp, :update]for each session update. Metadata::agent_id,:span,:harness,:update(the ACPSessionUpdatemap).
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts WardrikACP. Coding agents start when a call first needs them.
Removes each worktree whose work is in its checkout's base, with its branch. Returns the paths
removed.
Returns a tool for each of the named coding agents.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts WardrikACP. Coding agents start when a call first needs them.
Options
:name(atom/0) - Required. The name agents and functions use to find it.:harnesses(list of tuple of ,keyword/0values) - Coding agents, as a list of name and options. SeeWardrikACP.Harness. The default value is[].:checkouts(list of tuple of , values) - Git repositories coding agents work in, as a list of name and path or options. SeeWardrikACP.Checkout. The default value is[].:sweep- Milliseconds between sweeps, or:infinity. The first runs at start. Seesweep/1. The default value is86400000.:worktrees(String.t/0) - Required. The directory for worktrees, one per piece of work.
Removes each worktree whose work is in its checkout's base, with its branch. Returns the paths
removed.
WardrikACP.sweep(MyApp.ACP)
#=> ["/var/lib/my_app/worktrees/claude/billing/builder/_/fix-login"]- Work is in the base when merging the branch would change nothing: merged, squashed or cherry-picked.
- A worktree stays while a call uses its coding agent, while a request waits, and while it has changes or untracked files. An idle coding agent is stopped first.
- With
fetch: true, the checkout runsgit fetchfirst.
Returns a tool for each of the named coding agents.
Options
:name- required. TheWardrikACPname.:harnesses- required. A coding agent's name or a list of them, as:claude.:checkouts- the checkouts the tools may work in. All of them by default.