# Dirigent

<p align="center">
  <img src="dirigent.svg" alt="Dirigent" width="64" height="64">
</p>

<p align="center">Core libraries for the Dirigent agent orchestration platform.</p>

> **Alpha software.** Dirigent is in early active development and not fully battle-tested. Most crates are experimental — APIs will change without notice. There is nothing to install from this repository yet. The standalone tools listed below have their own repositories and maturity levels.

---

## Standalone Tools

These tools are developed in this monorepo but distributed as independent repositories. Install them from their own repos:

| Tool | Repository | Maturity | Description |
|------|-----------|----------|-------------|
| **fermata** | [git.g4b.org/dirigence/fermata](https://git.g4b.org/dirigence/fermata) | production (core), beta (toml config) | Policy gate for AI coding agents — `.botignore` enforcement |
| **anth** | [git.g4b.org/dirigence/dirigent_anth](https://git.g4b.org/dirigence/dirigent_anth) | production (library), beta (CLIs) | Tools for working with Claude Code session data |
| **dirigate** | [git.g4b.org/dirigence/dirigate](https://git.g4b.org/dirigence/dirigate) | beta (bridge/mock), concept (connect/ingest) | ACP bridge connecting stdio agents to Dirigent |

---

## Architecture

<p align="center">
  <img src="architecture.svg" alt="Dirigent package architecture" width="720">
</p>

**Layers top-to-bottom:**
- **Standalone Tools** — installable from their own repositories; depend on foundation crates
- **Orchestration** — multi-connector runtime, ACP server, task management, archival
- **Foundation** — protocol types, tool sandbox, configuration, auth
- **Integrations** — Matrix, Langfuse, Zed, and other external system connectors
- **Parsers** — readers for third-party session formats (OpenCode, ChatGPT, Codex)

---

## Crates

| Crate | Maturity | Description |
|-------|----------|-------------|
| `dirigent_protocol` | beta | ACP protocol types — messages, events, and RPC definitions |
| `dirigent_core` | beta | Multi-connector orchestration runtime |
| `dirigent_tools` | concept | Tool sandbox and execution abstractions |
| `dirigent_fermata` | production | Policy gate for AI coding agents (`.botignore` / `botignore.toml`) |
| `dirigent_auth` | concept | User authorization model |
| `dirigent_config` | beta | Configuration management |
| `dirigent_acp_api` | beta | ACP server for incoming agent connections |
| `dirigent_archivist` | production | Event-driven session archival |
| `dirigent_process` | beta | Child process management |
| `dirigent_taskrunner` | beta | Background task runner |
| `dirigent_anth` | production | Claude Code JSONL session parser |
| `dirigent_inspector` | concept | Session inspection tools |
| `dirigent_projects` | concept | Project management primitives |
| `dirigent_matrix` | concept | Matrix integration for session sharing |
| `dirigent_zed` | concept | Zed editor integration |
| `dirigent_langfuse` | concept | Langfuse observability integration |
| `dirigent_chatgpt` | beta | ChatGPT `conversations.json` parser |
| `dirigent_codex` | beta | OpenAI Codex session parser |
| `dirigent_testing` | beta | Test utilities |
| `opencode_client` | beta | OpenCode.ai HTTP client |

---

## Library Usage

Add a crate to your `Cargo.toml`:

```toml
[dependencies]
dirigent_protocol = { git = "https://git.g4b.org/dirigence/dirigent", path = "crates/dirigent_protocol" }
dirigent_core     = { git = "https://git.g4b.org/dirigence/dirigent", path = "crates/dirigent_core" }
```

Replace the crate name and path with the one you need. All crates follow the same pattern.

> **Expect breakage.** These are internal library crates under active development. Pin to a specific commit if you depend on stability.

---

## License

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT License ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)

at your option.
