# edsger-tools

Edsger's in-process Claude Agent SDK tool layer.

## What it does

- Takes `ContractEntry`s from [`edsger-contract`](../edsger-contract) and
  turns them into Claude Agent SDK `tool()` instances.
- Bundles tools into per-domain MCP servers (chat, checklists, bug-fixing,
  functional-testing, agents, …) suitable for `query()` `mcpServers` config.
- **Transport-agnostic** — consumers inject an `McpTransport` /
  `AgentsApiTransport` so `edsger-tools` itself never reads auth tokens or
  environment variables.

## Architecture

```
contract entries ──┐
                   ├─► factories.fromContract ──► tool() instance
transport (DI) ────┘                                   │
                                                       ▼
                                          createXxxMcpServer(deps)
                                                       │
                                                       ▼
                                       passed to query() mcpServers config
```

## Consumers

- [`edsger`](../edsger) — CLI; injects auth-store-backed transport.
- [`edsger-agents`](../edsger-agents) — worker; injects its own transport
  (with circuit breaker).
- Future: web demo, VS Code extension, third-party MCP clients — each
  brings its own transport implementation.

## Public API

```ts
import { createBugFixingMcpServer, type ToolDeps } from 'edsger-tools'

const server = createBugFixingMcpServer(deps)
```

See `src/index.ts` for the complete export surface.

## Releasing

Published using [Changesets](https://github.com/changesets/changesets),
**linked with `edsger-contract`** (the two packages always bump to the
same version).

```bash
# In the repo root, after merging a tool / factory change:
npm run changeset            # describe the bump (patch/minor/major)
npm run version-packages     # apply versions + write CHANGELOG.md
git commit -am "chore: release"
npm run release              # turbo build + changeset publish
```

See [`RELEASING.md`](../../RELEASING.md) at the repo root for the full
sequence (including how the `edsger` CLI consumes new versions of this
package).
