> ## Documentation Index
> Fetch the complete documentation index at: https://usefused.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# harnest.orchestrator

> Public Python signatures, fields, and methods.

[All Python modules](https://usefused.com/docs/harnest/reference/api/overview.md) · [Import and compatibility guidance](https://usefused.com/docs/harnest/build/python-imports.md)

## Exports

| Name | Kind |
| - | - |
| [`AgentSource`](#agentsource) | Class |
| [`Orchestrator`](#orchestrator) | Class |
| [`define_orchestrator`](#define_orchestrator) | Function |

## AgentSource

Select agent directories included in a deployment plan.

```python theme={null}
AgentSource(root: str, include: Sequence[str] = ..., exclude: Sequence[str] = ...) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `root` | `str` | `—` |
| `include` | `Sequence[str]` | `<lambda>()` |
| `exclude` | `Sequence[str]` | `tuple()` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `root` | `str` | Required |
> | `include` | `Sequence[str]` | `...` |
> | `exclude` | `Sequence[str]` | `...` |
>
> ```python theme={null}
> from harnest.orchestrator import AgentSource
>
> source = AgentSource(root=...)
> ```

### AgentSource.directory

```python theme={null}
AgentSource.directory(root: str, *, include: Sequence[str] = ('*',), exclude: Sequence[str] = ()) -> 'AgentSource'
```

Create a directory source with optional include and exclude globs.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `root` | `str` | Required |
> | `include` | `Sequence[str]` | `('*',)` |
> | `exclude` | `Sequence[str]` | `()` |
>
> ```python theme={null}
> from harnest.orchestrator import AgentSource
>
> source = AgentSource.directory(root=...)
> ```

## Orchestrator

Describe a deterministic multi-agent deployment plan.

```python theme={null}
Orchestrator(
    sources: Sequence[AgentSource | str],
    parallelism: int = 4,
    fail_fast: bool = False,
    labels: Mapping[str, str] = ...,
) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `sources` | `Sequence[AgentSource \| str]` | `—` |
| `parallelism` | `int` | `4` |
| `fail_fast` | `bool` | `False` |
| `labels` | `Mapping[str, str]` | `dict()` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `sources` | `Sequence[AgentSource \| str]` | Required |
> | `parallelism` | `int` | `4` |
> | `fail_fast` | `bool` | `False` |
> | `labels` | `Mapping[str, str]` | `...` |
>
> ```python theme={null}
> from harnest.orchestrator import Orchestrator
>
> orchestrator = Orchestrator(sources=...)
> ```

### Orchestrator.plan

```python theme={null}
Orchestrator.plan(*, project_root: str | Path) -> dict[str, Any]
```

Build the JSON-compatible deployment plan for a project root.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `project_root` | `str \| Path` | Required |
>
> ```python theme={null}
> from harnest.orchestrator import Orchestrator
>
> orchestrator: Orchestrator
> result = orchestrator.plan(project_root=...)
> ```

### Orchestrator.to\_json

```python theme={null}
Orchestrator.to_json(*, project_root: str | Path) -> str
```

Serialize the deployment plan as stable, human-readable JSON.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `project_root` | `str \| Path` | Required |
>
> ```python theme={null}
> from harnest.orchestrator import Orchestrator
>
> orchestrator: Orchestrator
> result = orchestrator.to_json(project_root=...)
> ```

## define\_orchestrator

Create an orchestrator from agent directory sources and plan options.

```python theme={null}
define_orchestrator(
    *,
    agents: Sequence[AgentSource | str],
    parallelism: int = 4,
    fail_fast: bool = False,
    labels: Mapping[str, str] | None = None,
) -> Orchestrator
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `agents` | `Sequence[AgentSource \| str]` | Required |
> | `parallelism` | `int` | `4` |
> | `fail_fast` | `bool` | `False` |
> | `labels` | `Mapping[str, str] \| None` | `None` |
>
> ```python theme={null}
> from harnest.orchestrator import define_orchestrator
>
> orchestrator = define_orchestrator(agents=...)
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.