# HooksRuntime

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime)

Client-owned session runtime around an immutable Hooks snapshot.

Owns configuration snapshot identity, transcript materialization, and the
`HookEngine`. Server-owned lifecycle events reach this runtime through the
interrupt fulfill path in `hooks.client`.

## Signature

```python
HooksRuntime(
    self,
    snapshot: HooksSnapshot,
    transcripts: TranscriptStore,
    engine: HookEngine,
    cwd: Path,
    workspace_trusted: bool,
    project_hooks_loaded: bool,
    project_hooks_fingerprint: str | None,
    presenter: HookPresenter,
    fulfillments: HookFulfillmentLedger,
)
```

## Constructors

```python
__init__(
    self,
    snapshot: HooksSnapshot,
    transcripts: TranscriptStore,
    engine: HookEngine,
    cwd: Path,
    workspace_trusted: bool,
    project_hooks_loaded: bool,
    project_hooks_fingerprint: str | None,
    presenter: HookPresenter,
    fulfillments: HookFulfillmentLedger,
) -> None
```

| Name | Type |
|------|------|
| `snapshot` | `HooksSnapshot` |
| `transcripts` | `TranscriptStore` |
| `engine` | `HookEngine` |
| `cwd` | `Path` |
| `workspace_trusted` | `bool` |
| `project_hooks_loaded` | `bool` |
| `project_hooks_fingerprint` | `str \| None` |
| `presenter` | `HookPresenter` |
| `fulfillments` | `HookFulfillmentLedger` |


## Properties

- `snapshot`
- `transcripts`
- `engine`
- `cwd`
- `workspace_trusted`
- `project_hooks_loaded`
- `project_hooks_fingerprint`
- `presenter`
- `fulfillments`
- `snapshot_id`

## Methods

- [`create()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/create)
- [`configured_server_events()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/configured_server_events)
- [`configured_events()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/configured_events)
- [`append_messages()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/append_messages)
- [`invoke()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/invoke)
- [`prepare_invocation()`](https://reference.langchain.com/python/deepagents-code/hooks/runtime/HooksRuntime/prepare_invocation)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/hooks/runtime.py#L48)