# `WardrikACP.Harness`

A coding agent that `WardrikACP` starts over ACP, such as Claude Code.

    claude: [
      command: "claude-agent-acp",
      env: %{"ANTHROPIC_API_KEY" => System.fetch_env!("ANTHROPIC_API_KEY")},
      meta: %{"claudeCode" => %{"options" => %{"settingSources" => []}}},
      options: %{"mode" => "default"},
      context: ["CLAUDE.md", "AGENTS.md"]
    ]

  * The command receives its `env` plus `HOME`, `PATH` and a few other basics, not your app's
    whole environment.
  * The command runs in the worktree. It reads and writes files there itself.
  * `meta` and `options` are specific to each coding agent. Check its ACP docs for the ones that
    make it ask before it acts.

## Options

* `:command` (`t:String.t/0`) - Required. The executable, found on `PATH`.

* `:args` (list of `t:String.t/0`) - Arguments for the command. The default value is `[]`.

* `:env` (map of `t:String.t/0` keys and `t:String.t/0` values) - Environment variables for the command. The default value is `%{}`.

* `:meta` (map of `t:String.t/0` keys and `t:term/0` values) - Sent as `_meta` when a session starts. The default value is `%{}`.

* `:options` - Session config options to set, by category or ID, such as `%{"model" => "opus"}`. The default value is `%{}`.

* `:instructions` (`t:String.t/0`) - Instructions for every session.

* `:context` (list of `t:String.t/0`) - Files in the checkout added to the instructions, when present. The default value is `[]`.

* `:description` (`t:String.t/0`) - What the calling model reads about the tool.

* `:timeout` (`t:pos_integer/0`) - Milliseconds a call may take. The default value is `1800000`.

* `:idle` (`t:pos_integer/0`) - Milliseconds the process runs with no call attached. It then stops. The default value is `900000`.

# `t`

```elixir
@type t() :: %WardrikACP.Harness{
  args: [String.t()],
  command: String.t(),
  context: [String.t()],
  description: String.t() | nil,
  env: %{required(String.t()) =&gt; String.t()},
  idle: pos_integer(),
  instructions: String.t() | nil,
  meta: map(),
  name: String.t(),
  options: %{required(String.t()) =&gt; String.t() | boolean()},
  timeout: pos_integer()
}
```

# `new!`

```elixir
@spec new!(atom() | String.t(), keyword()) :: t()
```

Builds a harness named `name`. Raises if an option is invalid.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
