> ## 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.bundle

> 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 |
| - | - |
| [`BundleError`](#bundleerror) | Class |
| [`BundleConventionError`](#bundleconventionerror) | Class |
| [`BundleImportError`](#bundleimporterror) | Class |
| [`BundleExportError`](#bundleexporterror) | Class |
| [`BundleDuplicateError`](#bundleduplicateerror) | Class |
| [`BundleSkillError`](#bundleskillerror) | Class |
| [`BundleEvalError`](#bundleevalerror) | Class |
| [`EvalSuite`](#evalsuite) | Class |
| [`compile_agent`](#compile_agent) | Function |
| [`compile_app`](#compile_app) | Function |
| [`compile_application`](#compile_application) | Function |
| [`compile_artifact`](#compile_artifact) | Function |
| [`bundle_agent`](#bundle_agent) | Function |
| [`discover_evals`](#discover_evals) | Function |

## BundleError

Base error for invalid filesystem agent bundles.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleError
>
> try:
>     ...
> except BundleError as error:
>     ...
> ```

## BundleConventionError

A bundle path does not follow the filesystem convention.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleConventionError
>
> try:
>     ...
> except BundleConventionError as error:
>     ...
> ```

## BundleImportError

A discovered resource module could not be imported.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleImportError
>
> try:
>     ...
> except BundleImportError as error:
>     ...
> ```

## BundleExportError

A discovered module does not export its file-stem resource.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleExportError
>
> try:
>     ...
> except BundleExportError as error:
>     ...
> ```

## BundleDuplicateError

Two explicit or discovered resources have the same identity.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleDuplicateError
>
> try:
>     ...
> except BundleDuplicateError as error:
>     ...
> ```

## BundleSkillError

A discovered progressive skill is invalid or cannot be loaded.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleSkillError
>
> try:
>     ...
> except BundleSkillError as error:
>     ...
> ```

## BundleEvalError

A discovered ADK evaluation file is invalid.

> [accordion] Example
>
> ```python theme={null}
> from harnest.bundle import BundleEvalError
>
> try:
>     ...
> except BundleEvalError as error:
>     ...
> ```

## EvalSuite

Validated evaluation files associated with one agent folder.

```python theme={null}
EvalSuite(eval_sets: tuple[Path, ...], config: Path | None = None) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `eval_sets` | `tuple[Path, ...]` | `—` |
| `config` | `Path \| None` | `None` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `eval_sets` | `tuple[Path, ...]` | Required |
> | `config` | `Path \| None` | `None` |
>
> ```python theme={null}
> from harnest.bundle import EvalSuite
>
> suite = EvalSuite(eval_sets=...)
> ```

## compile\_agent

Compile a filesystem definition into its framework-native target.

`source` may be the agent directory or its `agent.py` file. Authored
modules import the compiler-provided namespace explicitly, for example
`from harnest.agent import Agent`. The Harnest compiler/runtime provides
that namespace; it does not belong in the agent's requirements file.

```python theme={null}
compile_agent(
    source: str | Path,
    *,
    entrypoint: str = 'agent:root_agent',
    framework: str = 'adk',
    mode: str = 'managed',
) -> Any
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `source` | `str \| Path` | Required |
> | `entrypoint` | `str` | `'agent:root_agent'` |
> | `framework` | `str` | `'adk'` |
> | `mode` | `str` | `'managed'` |
>
> ```python theme={null}
> from harnest.bundle import compile_agent
>
> result = compile_agent(source=...)
> ```

## compile\_app

Compile a filesystem definition and return its provider application.

```python theme={null}
compile_app(
    source: str | Path,
    *,
    entrypoint: str = 'agent:root_agent',
    framework: str = 'adk',
    mode: str = 'managed',
) -> Any
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `source` | `str \| Path` | Required |
> | `entrypoint` | `str` | `'agent:root_agent'` |
> | `framework` | `str` | `'adk'` |
> | `mode` | `str` | `'managed'` |
>
> ```python theme={null}
> from harnest.bundle import compile_app
>
> result = compile_app(source=...)
> ```

## compile\_application

Compile one managed definition or advanced framework application.

```python theme={null}
compile_application(
    source: str | Path,
    *,
    entrypoint: str,
    framework: str = 'adk',
    mode: str = 'managed',
) -> CompiledApplication
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `source` | `str \| Path` | Required |
> | `entrypoint` | `str` | Required |
> | `framework` | `str` | `'adk'` |
> | `mode` | `str` | `'managed'` |
>
> ```python theme={null}
> from harnest.bundle import compile_application
>
> application = compile_application(source=..., entrypoint=...)
> ```

## compile\_artifact

Build an artifact; source-run callers bypass compile-only bundle declarations.

```python theme={null}
compile_artifact(
    source: str | Path,
    output: str | Path,
    *,
    entrypoint: str = 'agent:root_agent',
    framework: str = 'adk',
    mode: str = 'managed',
    cli_enabled: bool = False,
    bundle_selection: bool = True,
) -> dict[str, Any]
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `source` | `str \| Path` | Required |
> | `output` | `str \| Path` | Required |
> | `entrypoint` | `str` | `'agent:root_agent'` |
> | `framework` | `str` | `'adk'` |
> | `mode` | `str` | `'managed'` |
> | `cli_enabled` | `bool` | `False` |
> | `bundle_selection` | `bool` | `True` |
>
> ```python theme={null}
> from harnest.bundle import compile_artifact
>
> result = compile_artifact(source=..., output=...)
> ```

## bundle\_agent

Discover sibling resources and build an ADK root agent.

Pass `__file__` from an agent folder's `agent.py`. Public Python files
below `tools/`, `subagents/`, and `mcp/` are imported in
sorted path order and must export an object named after their file stem.
Directory-first `plugins/` contribute MCP clients and skills without an
aggregation import.

```python theme={null}
bundle_agent(anchor: str | Path, root: AgentDefinition) -> Any
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `anchor` | `str \| Path` | Required |
> | `root` | `AgentDefinition` | Required |
>
> ```python theme={null}
> from harnest.bundle import bundle_agent
>
> result = bundle_agent(anchor=..., root=...)
> ```

## discover\_evals

Return validated, sorted ADK eval paths without building the agent.

```python theme={null}
discover_evals(anchor: str | Path) -> EvalSuite
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `anchor` | `str \| Path` | Required |
>
> ```python theme={null}
> from harnest.bundle import discover_evals
>
> suite = discover_evals(anchor=...)
> ```


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