diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0185f06c..8a899fe0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,10 +21,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
- uses: astral-sh/setup-uv@v5
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'
@@ -43,10 +43,10 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
- uses: astral-sh/setup-uv@v5
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'
@@ -61,7 +61,7 @@ jobs:
github.repository == 'stainless-sdks/hyperspell-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
- uses: actions/github-script@v8
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());
@@ -81,10 +81,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
- uses: astral-sh/setup-uv@v5
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index 585c39f2..ea7fb3fd 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -17,10 +17,10 @@ jobs:
id-token: write
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
- uses: astral-sh/setup-uv@v5
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.9.13'
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index b7b5ce04..fe86cc65 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'hyperspell/python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check release environment
run: |
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 51acdaa4..8ea07c9a 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.37.0"
+ ".": "0.38.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 60ac02f6..90a3f880 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 30
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-6d6dbb68dd9021348431b28e08378d086b3eaf5e65b3dfa03125b1fdec417fa6.yml
-openapi_spec_hash: 6ad2b84ac07c482fe838929694e49015
-config_hash: bd8505e17db740d82e578d0edaa9bfe0
+configured_endpoints: 31
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell/hyperspell-f99fdfa6de4f48d8e2af1a0bfbb8a86c463459e092f6e479d977472a7e5d949c.yml
+openapi_spec_hash: 05db69adafa2f99a63fb5287e78b5fad
+config_hash: e94cd277a0f8a93fc9dbadfd0a99ffcb
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 86d769ac..f9890d31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,50 @@
# Changelog
+## 0.38.0 (2026-06-13)
+
+Full Changelog: [v0.37.0...v0.38.0](https://github.com/hyperspell/python-sdk/compare/v0.37.0...v0.38.0)
+
+### Features
+
+* **api:** api update ([22cdd86](https://github.com/hyperspell/python-sdk/commit/22cdd8677c2d30fad4ebc6fe97715fcf01628506))
+* **api:** api update ([eeb82b7](https://github.com/hyperspell/python-sdk/commit/eeb82b767927c783df8233b637e63f7c4c14640c))
+* **api:** api update ([02ef637](https://github.com/hyperspell/python-sdk/commit/02ef6374b47293a4b3cd5c5f1bd179a80973aac2))
+* **api:** api update ([e991d68](https://github.com/hyperspell/python-sdk/commit/e991d68d0bd84df2fc52804c431a03127374d1bb))
+* **api:** api update ([a95dee2](https://github.com/hyperspell/python-sdk/commit/a95dee2cb72e8c64be1a4523d7325848c6d9e227))
+* **api:** api update ([e160f73](https://github.com/hyperspell/python-sdk/commit/e160f73c629eff27681b2d13d8cdd9c645cad17e))
+* **api:** api update ([58c8d7c](https://github.com/hyperspell/python-sdk/commit/58c8d7cd0aeb73b2a28dcc30dadac3b5d63bdcb8))
+* **api:** api update ([42d3c82](https://github.com/hyperspell/python-sdk/commit/42d3c825a891a655d999e55ab02572c8cf7d283b))
+* **api:** api update ([edd9b41](https://github.com/hyperspell/python-sdk/commit/edd9b41ea428964bb74381e415df2e3616c6a46e))
+* **api:** api update ([cc26c43](https://github.com/hyperspell/python-sdk/commit/cc26c43e007a42b9ac4de6554d0280ef56b2b713))
+* **api:** api update ([aa0cc75](https://github.com/hyperspell/python-sdk/commit/aa0cc7576de289e8e8dd152c773339e9ac27aafe))
+* **api:** api update ([335d028](https://github.com/hyperspell/python-sdk/commit/335d0288f43e7f681a783f887ce1415ee57cad22))
+* **api:** api update ([3b25c10](https://github.com/hyperspell/python-sdk/commit/3b25c10a9f2be985dcfbfaf059f5595ea316d5f5))
+* **api:** api update ([92fd43a](https://github.com/hyperspell/python-sdk/commit/92fd43a735c10a678fb2e9b3f052c43607b6fb8a))
+* **api:** api update ([7a8e495](https://github.com/hyperspell/python-sdk/commit/7a8e495ee6b8f162dce5c3124b007d2d60f6cdd6))
+* **api:** manual updates ([5e31b8a](https://github.com/hyperspell/python-sdk/commit/5e31b8a01c916a8e9afaf744f7bb8e670c8692c4))
+* **api:** manual updates ([cb78a3e](https://github.com/hyperspell/python-sdk/commit/cb78a3e76e04a5ead28e3ea0d5433d05cc6a64d1))
+* **api:** manual updates ([23c9221](https://github.com/hyperspell/python-sdk/commit/23c9221674f7d4d4d563b3e8d80d55c0b884114a))
+* **internal/types:** support eagerly validating pydantic iterators ([e47301a](https://github.com/hyperspell/python-sdk/commit/e47301a63173dd90013f6a2f127baf4cfd9e1553))
+* support setting headers via env ([eba0398](https://github.com/hyperspell/python-sdk/commit/eba039883cd57a0b9df0c4779d1370af59cd36ce))
+
+
+### Bug Fixes
+
+* **client:** add missing f-string prefix in file type error message ([6dbd3ec](https://github.com/hyperspell/python-sdk/commit/6dbd3ecf89c76051dde508e759d15db97acc4141))
+* use correct field name format for multipart file arrays ([0f569cc](https://github.com/hyperspell/python-sdk/commit/0f569cccc70ea96a2da668846b62bf65af449561))
+
+
+### Performance Improvements
+
+* **client:** optimize file structure copying in multipart requests ([c28640c](https://github.com/hyperspell/python-sdk/commit/c28640c64d25fd5dde07836e60e970069b0b65fe))
+
+
+### Chores
+
+* **internal:** more robust bootstrap script ([d4a39dc](https://github.com/hyperspell/python-sdk/commit/d4a39dc3c6f710bf9b9c481197043eeb4a9f8ac9))
+* **internal:** reformat pyproject.toml ([19a83c3](https://github.com/hyperspell/python-sdk/commit/19a83c32f936735d997727bda0bb0ba523f8086c))
+* **tests:** bump steady to v0.22.1 ([7d67d91](https://github.com/hyperspell/python-sdk/commit/7d67d91802b13e3110af4e1ab313cc36ed66ca74))
+
## 0.37.0 (2026-04-16)
Full Changelog: [v0.36.0...v0.37.0](https://github.com/hyperspell/python-sdk/compare/v0.36.0...v0.37.0)
diff --git a/README.md b/README.md
index 4b0ec922..da027aea 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/).
Use the Hyperspell MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
-[](https://cursor.com/en-US/install-mcp?name=hyperspell-mcp&config=eyJuYW1lIjoiaHlwZXJzcGVsbC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9oeXBlcnNwZWxsLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtaHlwZXJzcGVsbC1hcGkta2V5IjoiTXkgQVBJIEtleSIsIlgtQXMtVXNlciI6Ik15IFVzZXIgSUQifX0)
-[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22hyperspell-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fhyperspell.stlmcp.com%22%2C%22headers%22%3A%7B%22x-hyperspell-api-key%22%3A%22My%20API%20Key%22%2C%22X-As-User%22%3A%22My%20User%20ID%22%7D%7D)
+[](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJuYW1lIjoiQGh5cGVyc3BlbGwvaHlwZXJzcGVsbC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9oeXBlcnNwZWxsLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtaHlwZXJzcGVsbC1hcGkta2V5IjoiTXkgQVBJIEtleSIsIlgtQXMtVXNlciI6Ik15IFVzZXIgSUQifX0)
+[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40hyperspell%2Fhyperspell-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fhyperspell.stlmcp.com%22%2C%22headers%22%3A%7B%22x-hyperspell-api-key%22%3A%22My%20API%20Key%22%2C%22X-As-User%22%3A%22My%20User%20ID%22%7D%7D)
> Note: You may need to set environment variables in your MCP client.
diff --git a/api.md b/api.md
index b7b2c535..22715753 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from hyperspell.types import Metadata, Notification, QueryResult, Resource
+from hyperspell.types import Metadata, QueryResult
```
# Connections
@@ -86,10 +86,11 @@ Types:
```python
from hyperspell.types import (
- Memory,
MemoryStatus,
+ MemoryListResponse,
MemoryDeleteResponse,
MemoryAddBulkResponse,
+ MemoryGetResponse,
MemoryStatusResponse,
)
```
@@ -97,11 +98,11 @@ from hyperspell.types import (
Methods:
- client.memories.update(resource_id, \*, source, \*\*params) -> MemoryStatus
-- client.memories.list(\*\*params) -> SyncCursorPage[Resource]
+- client.memories.list(\*\*params) -> SyncCursorPage[MemoryListResponse]
- client.memories.delete(resource_id, \*, source) -> MemoryDeleteResponse
- client.memories.add(\*\*params) -> MemoryStatus
- client.memories.add_bulk(\*\*params) -> MemoryAddBulkResponse
-- client.memories.get(resource_id, \*, source) -> Memory
+- client.memories.get(resource_id, \*, source) -> MemoryGetResponse
- client.memories.search(\*\*params) -> QueryResult
- client.memories.status() -> MemoryStatusResponse
- client.memories.upload(\*\*params) -> MemoryStatus
@@ -111,12 +112,17 @@ Methods:
Types:
```python
-from hyperspell.types import EvaluateScoreHighlightResponse, EvaluateScoreQueryResponse
+from hyperspell.types import (
+ EvaluateListQueriesResponse,
+ EvaluateScoreHighlightResponse,
+ EvaluateScoreQueryResponse,
+)
```
Methods:
- client.evaluate.get_query(query_id) -> QueryResult
+- client.evaluate.list_queries(\*\*params) -> SyncCursorPage[EvaluateListQueriesResponse]
- client.evaluate.score_highlight(highlight_id, \*\*params) -> EvaluateScoreHighlightResponse
- client.evaluate.score_query(query_id, \*\*params) -> EvaluateScoreQueryResponse
diff --git a/pyproject.toml b/pyproject.toml
index 7a6fa077..8ac832e5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "hyperspell"
-version = "0.37.0"
+version = "0.38.0"
description = "The official Python library for the hyperspell API"
dynamic = ["readme"]
license = "MIT"
@@ -154,7 +154,7 @@ show_error_codes = true
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
-exclude = ['src/hyperspell/_files.py', '_dev/.*.py', 'tests/.*']
+exclude = ["src/hyperspell/_files.py", "_dev/.*.py", "tests/.*"]
strict_equality = true
implicit_reexport = true
diff --git a/scripts/bootstrap b/scripts/bootstrap
index 4638ec69..5a23841b 100755
--- a/scripts/bootstrap
+++ b/scripts/bootstrap
@@ -4,7 +4,7 @@ set -e
cd "$(dirname "$0")/.."
-if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
+if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
diff --git a/scripts/mock b/scripts/mock
index 5cd7c157..feebe5ed 100755
--- a/scripts/mock
+++ b/scripts/mock
@@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}"
# Run steady mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
- npm exec --package=@stdy/cli@0.20.2 -- steady --version
+ npm exec --package=@stdy/cli@0.22.1 -- steady --version
- npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
+ npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &
# Wait for server to come online via health endpoint (max 30s)
echo -n "Waiting for server"
@@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then
echo
else
- npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
+ npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
fi
diff --git a/scripts/test b/scripts/test
index b754adab..a47c5b42 100755
--- a/scripts/test
+++ b/scripts/test
@@ -43,7 +43,7 @@ elif ! steady_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the steady command:"
echo
- echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
+ echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
echo
exit 1
diff --git a/src/hyperspell/_client.py b/src/hyperspell/_client.py
index 78cfb089..20dbdf4a 100644
--- a/src/hyperspell/_client.py
+++ b/src/hyperspell/_client.py
@@ -19,7 +19,11 @@
RequestOptions,
not_given,
)
-from ._utils import is_given, get_async_library
+from ._utils import (
+ is_given,
+ is_mapping_t,
+ get_async_library,
+)
from ._compat import cached_property
from ._version import __version__
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
@@ -102,6 +106,15 @@ def __init__(
if base_url is None:
base_url = f"https://api.hyperspell.com"
+ custom_headers_env = os.environ.get("HYPERSPELL_CUSTOM_HEADERS")
+ if custom_headers_env is not None:
+ parsed: dict[str, str] = {}
+ for line in custom_headers_env.split("\n"):
+ colon = line.find(":")
+ if colon >= 0:
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
+
super().__init__(
version=__version__,
base_url=base_url,
@@ -341,6 +354,15 @@ def __init__(
if base_url is None:
base_url = f"https://api.hyperspell.com"
+ custom_headers_env = os.environ.get("HYPERSPELL_CUSTOM_HEADERS")
+ if custom_headers_env is not None:
+ parsed: dict[str, str] = {}
+ for line in custom_headers_env.split("\n"):
+ colon = line.find(":")
+ if colon >= 0:
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
+
super().__init__(
version=__version__,
base_url=base_url,
diff --git a/src/hyperspell/_files.py b/src/hyperspell/_files.py
index 155adfec..e5146d91 100644
--- a/src/hyperspell/_files.py
+++ b/src/hyperspell/_files.py
@@ -3,8 +3,8 @@
import io
import os
import pathlib
-from typing import overload
-from typing_extensions import TypeGuard
+from typing import Sequence, cast, overload
+from typing_extensions import TypeVar, TypeGuard
import anyio
@@ -17,7 +17,9 @@
HttpxFileContent,
HttpxRequestFiles,
)
-from ._utils import is_tuple_t, is_mapping_t, is_sequence_t
+from ._utils import is_list, is_mapping, is_tuple_t, is_mapping_t, is_sequence_t
+
+_T = TypeVar("_T")
def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]:
@@ -97,7 +99,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles
elif is_sequence_t(files):
files = [(key, await _async_transform_file(file)) for key, file in files]
else:
- raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence")
+ raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence")
return files
@@ -121,3 +123,51 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
return await anyio.Path(file).read_bytes()
return file
+
+
+def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T:
+ """Copy only the containers along the given paths.
+
+ Used to guard against mutation by extract_files without copying the entire structure.
+ Only dicts and lists that lie on a path are copied; everything else
+ is returned by reference.
+
+ For example, given paths=[["foo", "files", "file"]] and the structure:
+ {
+ "foo": {
+ "bar": {"baz": {}},
+ "files": {"file": }
+ }
+ }
+ The root dict, "foo", and "files" are copied (they lie on the path).
+ "bar" and "baz" are returned by reference (off the path).
+ """
+ return _deepcopy_with_paths(item, paths, 0)
+
+
+def _deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]], index: int) -> _T:
+ if not paths:
+ return item
+ if is_mapping(item):
+ key_to_paths: dict[str, list[Sequence[str]]] = {}
+ for path in paths:
+ if index < len(path):
+ key_to_paths.setdefault(path[index], []).append(path)
+
+ # if no path continues through this mapping, it won't be mutated and copying it is redundant
+ if not key_to_paths:
+ return item
+
+ result = dict(item)
+ for key, subpaths in key_to_paths.items():
+ if key in result:
+ result[key] = _deepcopy_with_paths(result[key], subpaths, index + 1)
+ return cast(_T, result)
+ if is_list(item):
+ array_paths = [path for path in paths if index < len(path) and path[index] == ""]
+
+ # if no path expects a list here, nothing will be mutated inside it - return by reference
+ if not array_paths:
+ return cast(_T, item)
+ return cast(_T, [_deepcopy_with_paths(entry, array_paths, index + 1) for entry in item])
+ return item
diff --git a/src/hyperspell/_models.py b/src/hyperspell/_models.py
index 29070e05..8c5ab260 100644
--- a/src/hyperspell/_models.py
+++ b/src/hyperspell/_models.py
@@ -25,7 +25,9 @@
ClassVar,
Protocol,
Required,
+ Annotated,
ParamSpec,
+ TypeAlias,
TypedDict,
TypeGuard,
final,
@@ -79,7 +81,15 @@
from ._constants import RAW_RESPONSE_HEADER
if TYPE_CHECKING:
+ from pydantic import GetCoreSchemaHandler, ValidatorFunctionWrapHandler
+ from pydantic_core import CoreSchema, core_schema
from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
+else:
+ try:
+ from pydantic_core import CoreSchema, core_schema
+ except ImportError:
+ CoreSchema = None
+ core_schema = None
__all__ = ["BaseModel", "GenericModel"]
@@ -396,6 +406,76 @@ def model_dump_json(
)
+class _EagerIterable(list[_T], Generic[_T]):
+ """
+ Accepts any Iterable[T] input (including generators), consumes it
+ eagerly, and validates all items upfront.
+
+ Validation preserves the original container type where possible
+ (e.g. a set[T] stays a set[T]). Serialization (model_dump / JSON)
+ always emits a list — round-tripping through model_dump() will not
+ restore the original container type.
+ """
+
+ @classmethod
+ def __get_pydantic_core_schema__(
+ cls,
+ source_type: Any,
+ handler: GetCoreSchemaHandler,
+ ) -> CoreSchema:
+ (item_type,) = get_args(source_type) or (Any,)
+ item_schema: CoreSchema = handler.generate_schema(item_type)
+ list_of_items_schema: CoreSchema = core_schema.list_schema(item_schema)
+
+ return core_schema.no_info_wrap_validator_function(
+ cls._validate,
+ list_of_items_schema,
+ serialization=core_schema.plain_serializer_function_ser_schema(
+ cls._serialize,
+ info_arg=False,
+ ),
+ )
+
+ @staticmethod
+ def _validate(v: Iterable[_T], handler: "ValidatorFunctionWrapHandler") -> Any:
+ original_type: type[Any] = type(v)
+
+ # Normalize to list so list_schema can validate each item
+ if isinstance(v, list):
+ items: list[_T] = v
+ else:
+ try:
+ items = list(v)
+ except TypeError as e:
+ raise TypeError("Value is not iterable") from e
+
+ # Validate items against the inner schema
+ validated: list[_T] = handler(items)
+
+ # Reconstruct original container type
+ if original_type is list:
+ return validated
+ # str(list) produces the list's repr, not a string built from items,
+ # so skip reconstruction for str and its subclasses.
+ if issubclass(original_type, str):
+ return validated
+ try:
+ return original_type(validated)
+ except (TypeError, ValueError):
+ # If the type cannot be reconstructed, just return the validated list
+ return validated
+
+ @staticmethod
+ def _serialize(v: Iterable[_T]) -> list[_T]:
+ """Always serialize as a list so Pydantic's JSON encoder is happy."""
+ if isinstance(v, list):
+ return v
+ return list(v)
+
+
+EagerIterable: TypeAlias = Annotated[Iterable[_T], _EagerIterable]
+
+
def _construct_field(value: object, field: FieldInfo, key: str) -> object:
if value is None:
return field_get_default(field)
diff --git a/src/hyperspell/_qs.py b/src/hyperspell/_qs.py
index de8c99bc..4127c19c 100644
--- a/src/hyperspell/_qs.py
+++ b/src/hyperspell/_qs.py
@@ -2,17 +2,13 @@
from typing import Any, List, Tuple, Union, Mapping, TypeVar
from urllib.parse import parse_qs, urlencode
-from typing_extensions import Literal, get_args
+from typing_extensions import get_args
-from ._types import NotGiven, not_given
+from ._types import NotGiven, ArrayFormat, NestedFormat, not_given
from ._utils import flatten
_T = TypeVar("_T")
-
-ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
-NestedFormat = Literal["dots", "brackets"]
-
PrimitiveData = Union[str, int, float, bool, None]
# this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"]
# https://github.com/microsoft/pyright/issues/3555
diff --git a/src/hyperspell/_types.py b/src/hyperspell/_types.py
index c331e84c..a0a7f696 100644
--- a/src/hyperspell/_types.py
+++ b/src/hyperspell/_types.py
@@ -47,6 +47,9 @@
ModelT = TypeVar("ModelT", bound=pydantic.BaseModel)
_T = TypeVar("_T")
+ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
+NestedFormat = Literal["dots", "brackets"]
+
# Approximates httpx internal ProxiesTypes and RequestFiles types
# while adding support for `PathLike` instances
diff --git a/src/hyperspell/_utils/__init__.py b/src/hyperspell/_utils/__init__.py
index 10cb66d2..1c090e51 100644
--- a/src/hyperspell/_utils/__init__.py
+++ b/src/hyperspell/_utils/__init__.py
@@ -24,7 +24,6 @@
coerce_integer as coerce_integer,
file_from_path as file_from_path,
strip_not_given as strip_not_given,
- deepcopy_minimal as deepcopy_minimal,
get_async_library as get_async_library,
maybe_coerce_float as maybe_coerce_float,
get_required_header as get_required_header,
diff --git a/src/hyperspell/_utils/_utils.py b/src/hyperspell/_utils/_utils.py
index 63b8cd60..199cd231 100644
--- a/src/hyperspell/_utils/_utils.py
+++ b/src/hyperspell/_utils/_utils.py
@@ -17,11 +17,11 @@
)
from pathlib import Path
from datetime import date, datetime
-from typing_extensions import TypeGuard
+from typing_extensions import TypeGuard, get_args
import sniffio
-from .._types import Omit, NotGiven, FileTypes, HeadersLike
+from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike
_T = TypeVar("_T")
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -40,25 +40,45 @@ def extract_files(
query: Mapping[str, object],
*,
paths: Sequence[Sequence[str]],
+ array_format: ArrayFormat = "brackets",
) -> list[tuple[str, FileTypes]]:
"""Recursively extract files from the given dictionary based on specified paths.
A path may look like this ['foo', 'files', '', 'data'].
+ ``array_format`` controls how ```` segments contribute to the emitted
+ field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and
+ ``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``).
+
Note: this mutates the given dictionary.
"""
files: list[tuple[str, FileTypes]] = []
for path in paths:
- files.extend(_extract_items(query, path, index=0, flattened_key=None))
+ files.extend(_extract_items(query, path, index=0, flattened_key=None, array_format=array_format))
return files
+def _array_suffix(array_format: ArrayFormat, array_index: int) -> str:
+ if array_format == "brackets":
+ return "[]"
+ if array_format == "indices":
+ return f"[{array_index}]"
+ if array_format == "repeat" or array_format == "comma":
+ # Both repeat the bare field name for each file part; there is no
+ # meaningful way to comma-join binary parts.
+ return ""
+ raise NotImplementedError(
+ f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}"
+ )
+
+
def _extract_items(
obj: object,
path: Sequence[str],
*,
index: int,
flattened_key: str | None,
+ array_format: ArrayFormat,
) -> list[tuple[str, FileTypes]]:
try:
key = path[index]
@@ -75,9 +95,11 @@ def _extract_items(
if is_list(obj):
files: list[tuple[str, FileTypes]] = []
- for entry in obj:
- assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
- files.append((flattened_key + "[]", cast(FileTypes, entry)))
+ for array_index, entry in enumerate(obj):
+ suffix = _array_suffix(array_format, array_index)
+ emitted_key = (flattened_key + suffix) if flattened_key else suffix
+ assert_is_file_content(entry, key=emitted_key)
+ files.append((emitted_key, cast(FileTypes, entry)))
return files
assert_is_file_content(obj, key=flattened_key)
@@ -106,6 +128,7 @@ def _extract_items(
path,
index=index,
flattened_key=flattened_key,
+ array_format=array_format,
)
elif is_list(obj):
if key != "":
@@ -117,9 +140,12 @@ def _extract_items(
item,
path,
index=index,
- flattened_key=flattened_key + "[]" if flattened_key is not None else "[]",
+ flattened_key=(
+ (flattened_key if flattened_key is not None else "") + _array_suffix(array_format, array_index)
+ ),
+ array_format=array_format,
)
- for item in obj
+ for array_index, item in enumerate(obj)
]
)
@@ -177,21 +203,6 @@ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]:
return isinstance(obj, Iterable)
-def deepcopy_minimal(item: _T) -> _T:
- """Minimal reimplementation of copy.deepcopy() that will only copy certain object types:
-
- - mappings, e.g. `dict`
- - list
-
- This is done for performance reasons.
- """
- if is_mapping(item):
- return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()})
- if is_list(item):
- return cast(_T, [deepcopy_minimal(entry) for entry in item])
- return item
-
-
# copied from https://github.com/Rapptz/RoboDanny
def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str:
size = len(seq)
diff --git a/src/hyperspell/_version.py b/src/hyperspell/_version.py
index ea4e056d..db685eed 100644
--- a/src/hyperspell/_version.py
+++ b/src/hyperspell/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "hyperspell"
-__version__ = "0.37.0" # x-release-please-version
+__version__ = "0.38.0" # x-release-please-version
diff --git a/src/hyperspell/resources/actions.py b/src/hyperspell/resources/actions.py
index 2537a806..6cb1bbc1 100644
--- a/src/hyperspell/resources/actions.py
+++ b/src/hyperspell/resources/actions.py
@@ -65,6 +65,14 @@ def add_reaction(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
timestamp: str,
connection: Optional[str] | Omit = omit,
@@ -133,6 +141,14 @@ def send_message(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
text: str,
channel: Optional[str] | Omit = omit,
@@ -226,6 +242,14 @@ async def add_reaction(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
timestamp: str,
connection: Optional[str] | Omit = omit,
@@ -294,6 +318,14 @@ async def send_message(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
text: str,
channel: Optional[str] | Omit = omit,
diff --git a/src/hyperspell/resources/evaluate.py b/src/hyperspell/resources/evaluate.py
index 02b1c4d1..5dee99db 100644
--- a/src/hyperspell/resources/evaluate.py
+++ b/src/hyperspell/resources/evaluate.py
@@ -6,7 +6,7 @@
import httpx
-from ..types import evaluate_score_query_params, evaluate_score_highlight_params
+from ..types import evaluate_score_query_params, evaluate_list_queries_params, evaluate_score_highlight_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
@@ -17,9 +17,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .._base_client import make_request_options
+from ..pagination import SyncCursorPage, AsyncCursorPage
+from .._base_client import AsyncPaginator, make_request_options
from ..types.shared.query_result import QueryResult
from ..types.evaluate_score_query_response import EvaluateScoreQueryResponse
+from ..types.evaluate_list_queries_response import EvaluateListQueriesResponse
from ..types.evaluate_score_highlight_response import EvaluateScoreHighlightResponse
__all__ = ["EvaluateResource", "AsyncEvaluateResource"]
@@ -78,6 +80,56 @@ def get_query(
cast_to=QueryResult,
)
+ def list_queries(
+ self,
+ *,
+ cursor: Optional[str] | Omit = omit,
+ size: int | Omit = omit,
+ user_id: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncCursorPage[EvaluateListQueriesResponse]:
+ """
+ Paginate through all prior queries for the app, newest first.
+
+ User tokens only see their own queries; admin tokens see every query in the app
+ and can narrow to a single user with the `user_id` filter.
+
+ Args:
+ user_id: Filter queries by the user that issued them.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/evaluate/queries",
+ page=SyncCursorPage[EvaluateListQueriesResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "cursor": cursor,
+ "size": size,
+ "user_id": user_id,
+ },
+ evaluate_list_queries_params.EvaluateListQueriesParams,
+ ),
+ ),
+ model=EvaluateListQueriesResponse,
+ )
+
def score_highlight(
self,
highlight_id: str,
@@ -215,6 +267,56 @@ async def get_query(
cast_to=QueryResult,
)
+ def list_queries(
+ self,
+ *,
+ cursor: Optional[str] | Omit = omit,
+ size: int | Omit = omit,
+ user_id: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[EvaluateListQueriesResponse, AsyncCursorPage[EvaluateListQueriesResponse]]:
+ """
+ Paginate through all prior queries for the app, newest first.
+
+ User tokens only see their own queries; admin tokens see every query in the app
+ and can narrow to a single user with the `user_id` filter.
+
+ Args:
+ user_id: Filter queries by the user that issued them.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/evaluate/queries",
+ page=AsyncCursorPage[EvaluateListQueriesResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "cursor": cursor,
+ "size": size,
+ "user_id": user_id,
+ },
+ evaluate_list_queries_params.EvaluateListQueriesParams,
+ ),
+ ),
+ model=EvaluateListQueriesResponse,
+ )
+
async def score_highlight(
self,
highlight_id: str,
@@ -306,6 +408,9 @@ def __init__(self, evaluate: EvaluateResource) -> None:
self.get_query = to_raw_response_wrapper(
evaluate.get_query,
)
+ self.list_queries = to_raw_response_wrapper(
+ evaluate.list_queries,
+ )
self.score_highlight = to_raw_response_wrapper(
evaluate.score_highlight,
)
@@ -321,6 +426,9 @@ def __init__(self, evaluate: AsyncEvaluateResource) -> None:
self.get_query = async_to_raw_response_wrapper(
evaluate.get_query,
)
+ self.list_queries = async_to_raw_response_wrapper(
+ evaluate.list_queries,
+ )
self.score_highlight = async_to_raw_response_wrapper(
evaluate.score_highlight,
)
@@ -336,6 +444,9 @@ def __init__(self, evaluate: EvaluateResource) -> None:
self.get_query = to_streamed_response_wrapper(
evaluate.get_query,
)
+ self.list_queries = to_streamed_response_wrapper(
+ evaluate.list_queries,
+ )
self.score_highlight = to_streamed_response_wrapper(
evaluate.score_highlight,
)
@@ -351,6 +462,9 @@ def __init__(self, evaluate: AsyncEvaluateResource) -> None:
self.get_query = async_to_streamed_response_wrapper(
evaluate.get_query,
)
+ self.list_queries = async_to_streamed_response_wrapper(
+ evaluate.list_queries,
+ )
self.score_highlight = async_to_streamed_response_wrapper(
evaluate.score_highlight,
)
diff --git a/src/hyperspell/resources/memories.py b/src/hyperspell/resources/memories.py
index d731f93a..01b9e145 100644
--- a/src/hyperspell/resources/memories.py
+++ b/src/hyperspell/resources/memories.py
@@ -16,8 +16,9 @@
memory_upload_params,
memory_add_bulk_params,
)
+from .._files import deepcopy_with_paths
from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
-from .._utils import extract_files, path_template, maybe_transform, deepcopy_minimal, async_maybe_transform
+from .._utils import extract_files, path_template, maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -28,10 +29,10 @@
)
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import AsyncPaginator, make_request_options
-from ..types.memory import Memory
from ..types.memory_status import MemoryStatus
-from ..types.shared.resource import Resource
+from ..types.memory_get_response import MemoryGetResponse
from ..types.shared.query_result import QueryResult
+from ..types.memory_list_response import MemoryListResponse
from ..types.memory_delete_response import MemoryDeleteResponse
from ..types.memory_status_response import MemoryStatusResponse
from ..types.memory_add_bulk_response import MemoryAddBulkResponse
@@ -78,8 +79,17 @@ def update(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
collection: Union[str, object, None] | Omit = omit,
+ date: Union[Union[str, datetime], object, None] | Omit = omit,
metadata: Union[Dict[str, Union[str, float, bool, None]], object, None] | Omit = omit,
text: Union[str, object, None] | Omit = omit,
title: Union[str, object, None] | Omit = omit,
@@ -102,6 +112,8 @@ def update(
collection: The collection to move the document to — deprecated, set the collection using
metadata instead.
+ date: Date of the document for ranking and filtering.
+
metadata: Custom metadata for filtering. Keys must be alphanumeric with underscores, max
64 chars. Values must be string, number, boolean, or null. Will be merged with
existing metadata.
@@ -127,6 +139,7 @@ def update(
body=maybe_transform(
{
"collection": collection,
+ "date": date,
"metadata": metadata,
"text": text,
"title": title,
@@ -162,6 +175,14 @@ def list(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
| Omit = omit,
@@ -173,7 +194,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> SyncCursorPage[Resource]:
+ ) -> SyncCursorPage[MemoryListResponse]:
"""This endpoint allows you to paginate through all documents in the index.
You can
@@ -200,7 +221,7 @@ def list(
"""
return self._get_api_list(
"/memories/list",
- page=SyncCursorPage[Resource],
+ page=SyncCursorPage[MemoryListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -218,7 +239,7 @@ def list(
memory_list_params.MemoryListParams,
),
),
- model=Resource,
+ model=MemoryListResponse,
)
def delete(
@@ -240,6 +261,14 @@ def delete(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -255,7 +284,9 @@ def delete(
operation deletes:
1. All chunks associated with the resource (including embeddings)
- 2. The resource record itself
+ 2. The documents row AND any legacy resources rows sharing the identity —
+ leaving either one behind would resurrect the memory through the double-read
+ path (ENG-2477).
Args: source: The document provider (e.g., gmail, notion, vault) resource_id:
The unique identifier of the resource to delete api_token: Authentication token
@@ -414,6 +445,14 @@ def get(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -421,9 +460,10 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> Memory:
+ ) -> MemoryGetResponse:
"""
- Retrieves a document by provider and resource_id.
+ Retrieves a document by provider and resource_id, as a document-shaped response
+ carrying the full hyperdoc tree (ENG-2479 Phase 4).
Args:
extra_headers: Send extra headers
@@ -443,7 +483,7 @@ def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Memory,
+ cast_to=MemoryGetResponse,
)
def search(
@@ -451,9 +491,10 @@ def search(
*,
query: str,
answer: bool | Omit = omit,
- effort: int | Omit = omit,
+ effort: Literal["minimal", "low", "medium", "high", "very_high"] | Omit = omit,
max_results: int | Omit = omit,
options: memory_search_params.Options | Omit = omit,
+ provenance: bool | Omit = omit,
sources: List[
Literal[
"reddit",
@@ -470,6 +511,14 @@ def search(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
| Omit = omit,
@@ -488,13 +537,24 @@ def search(
answer: If true, the query will be answered along with matching source documents.
- effort: Effort level. 0 = pass query through verbatim. 1 = LLM rewrites the query for
- better retrieval and extracts date filters.
+ effort: How much compute to spend on retrieval. Mirrors the dial popularized by
+ frontier-model APIs (OpenAI reasoning_effort, etc.). 'minimal' = verbatim
+ single-shot retrieval (fastest). 'low' = LLM rewrites the query for better
+ retrieval and extracts date filters. 'medium' = rewrite + agentic refinement
+ loop (the answer LLM may request additional retrieval rounds, up to 3). 'high' =
+ rewrite + extended refinement (up to 6 rounds). Higher = better recall, more
+ latency, more cost.
max_results: Maximum number of results to return.
options: Search options for the query.
+ provenance:
+ If true (effort='very_high' only), attach a provenance record to the response:
+ the source documents and entities the answer was grounded in, the agent's search
+ trajectory, and any sources that failed. Adds one indexed lookup; intended for
+ auditability / compliance use cases.
+
sources: Only query documents from these sources.
extra_headers: Send extra headers
@@ -514,6 +574,7 @@ def search(
"effort": effort,
"max_results": max_results,
"options": options,
+ "provenance": provenance,
"sources": sources,
},
memory_search_params.MemorySearchParams,
@@ -583,12 +644,13 @@ def upload(
timeout: Override the client-level default timeout for this request, in seconds
"""
- body = deepcopy_minimal(
+ body = deepcopy_with_paths(
{
"file": file,
"collection": collection,
"metadata": metadata,
- }
+ },
+ [["file"]],
)
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
# It should be noted that the actual Content-Type header that will be
@@ -645,8 +707,17 @@ async def update(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
collection: Union[str, object, None] | Omit = omit,
+ date: Union[Union[str, datetime], object, None] | Omit = omit,
metadata: Union[Dict[str, Union[str, float, bool, None]], object, None] | Omit = omit,
text: Union[str, object, None] | Omit = omit,
title: Union[str, object, None] | Omit = omit,
@@ -669,6 +740,8 @@ async def update(
collection: The collection to move the document to — deprecated, set the collection using
metadata instead.
+ date: Date of the document for ranking and filtering.
+
metadata: Custom metadata for filtering. Keys must be alphanumeric with underscores, max
64 chars. Values must be string, number, boolean, or null. Will be merged with
existing metadata.
@@ -694,6 +767,7 @@ async def update(
body=await async_maybe_transform(
{
"collection": collection,
+ "date": date,
"metadata": metadata,
"text": text,
"title": title,
@@ -729,6 +803,14 @@ def list(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
| Omit = omit,
@@ -740,7 +822,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AsyncPaginator[Resource, AsyncCursorPage[Resource]]:
+ ) -> AsyncPaginator[MemoryListResponse, AsyncCursorPage[MemoryListResponse]]:
"""This endpoint allows you to paginate through all documents in the index.
You can
@@ -767,7 +849,7 @@ def list(
"""
return self._get_api_list(
"/memories/list",
- page=AsyncCursorPage[Resource],
+ page=AsyncCursorPage[MemoryListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -785,7 +867,7 @@ def list(
memory_list_params.MemoryListParams,
),
),
- model=Resource,
+ model=MemoryListResponse,
)
async def delete(
@@ -807,6 +889,14 @@ async def delete(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -822,7 +912,9 @@ async def delete(
operation deletes:
1. All chunks associated with the resource (including embeddings)
- 2. The resource record itself
+ 2. The documents row AND any legacy resources rows sharing the identity —
+ leaving either one behind would resurrect the memory through the double-read
+ path (ENG-2477).
Args: source: The document provider (e.g., gmail, notion, vault) resource_id:
The unique identifier of the resource to delete api_token: Authentication token
@@ -981,6 +1073,14 @@ async def get(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -988,9 +1088,10 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> Memory:
+ ) -> MemoryGetResponse:
"""
- Retrieves a document by provider and resource_id.
+ Retrieves a document by provider and resource_id, as a document-shaped response
+ carrying the full hyperdoc tree (ENG-2479 Phase 4).
Args:
extra_headers: Send extra headers
@@ -1010,7 +1111,7 @@ async def get(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Memory,
+ cast_to=MemoryGetResponse,
)
async def search(
@@ -1018,9 +1119,10 @@ async def search(
*,
query: str,
answer: bool | Omit = omit,
- effort: int | Omit = omit,
+ effort: Literal["minimal", "low", "medium", "high", "very_high"] | Omit = omit,
max_results: int | Omit = omit,
options: memory_search_params.Options | Omit = omit,
+ provenance: bool | Omit = omit,
sources: List[
Literal[
"reddit",
@@ -1037,6 +1139,14 @@ async def search(
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
| Omit = omit,
@@ -1055,13 +1165,24 @@ async def search(
answer: If true, the query will be answered along with matching source documents.
- effort: Effort level. 0 = pass query through verbatim. 1 = LLM rewrites the query for
- better retrieval and extracts date filters.
+ effort: How much compute to spend on retrieval. Mirrors the dial popularized by
+ frontier-model APIs (OpenAI reasoning_effort, etc.). 'minimal' = verbatim
+ single-shot retrieval (fastest). 'low' = LLM rewrites the query for better
+ retrieval and extracts date filters. 'medium' = rewrite + agentic refinement
+ loop (the answer LLM may request additional retrieval rounds, up to 3). 'high' =
+ rewrite + extended refinement (up to 6 rounds). Higher = better recall, more
+ latency, more cost.
max_results: Maximum number of results to return.
options: Search options for the query.
+ provenance:
+ If true (effort='very_high' only), attach a provenance record to the response:
+ the source documents and entities the answer was grounded in, the agent's search
+ trajectory, and any sources that failed. Adds one indexed lookup; intended for
+ auditability / compliance use cases.
+
sources: Only query documents from these sources.
extra_headers: Send extra headers
@@ -1081,6 +1202,7 @@ async def search(
"effort": effort,
"max_results": max_results,
"options": options,
+ "provenance": provenance,
"sources": sources,
},
memory_search_params.MemorySearchParams,
@@ -1150,12 +1272,13 @@ async def upload(
timeout: Override the client-level default timeout for this request, in seconds
"""
- body = deepcopy_minimal(
+ body = deepcopy_with_paths(
{
"file": file,
"collection": collection,
"metadata": metadata,
- }
+ },
+ [["file"]],
)
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
# It should be noted that the actual Content-Type header that will be
diff --git a/src/hyperspell/types/__init__.py b/src/hyperspell/types/__init__.py
index ce27266d..462e7a3d 100644
--- a/src/hyperspell/types/__init__.py
+++ b/src/hyperspell/types/__init__.py
@@ -3,8 +3,7 @@
from __future__ import annotations
from .token import Token as Token
-from .memory import Memory as Memory
-from .shared import Metadata as Metadata, Resource as Resource, QueryResult as QueryResult, Notification as Notification
+from .shared import Metadata as Metadata, QueryResult as QueryResult
from .memory_status import MemoryStatus as MemoryStatus
from .auth_me_response import AuthMeResponse as AuthMeResponse
from .memory_add_params import MemoryAddParams as MemoryAddParams
@@ -12,8 +11,10 @@
from .folder_list_params import FolderListParams as FolderListParams
from .memory_list_params import MemoryListParams as MemoryListParams
from .session_add_params import SessionAddParams as SessionAddParams
+from .memory_get_response import MemoryGetResponse as MemoryGetResponse
from .vault_list_response import VaultListResponse as VaultListResponse
from .folder_list_response import FolderListResponse as FolderListResponse
+from .memory_list_response import MemoryListResponse as MemoryListResponse
from .memory_search_params import MemorySearchParams as MemorySearchParams
from .memory_update_params import MemoryUpdateParams as MemoryUpdateParams
from .memory_upload_params import MemoryUploadParams as MemoryUploadParams
@@ -33,10 +34,12 @@
from .evaluate_score_query_params import EvaluateScoreQueryParams as EvaluateScoreQueryParams
from .action_add_reaction_response import ActionAddReactionResponse as ActionAddReactionResponse
from .action_send_message_response import ActionSendMessageResponse as ActionSendMessageResponse
+from .evaluate_list_queries_params import EvaluateListQueriesParams as EvaluateListQueriesParams
from .folder_set_policies_response import FolderSetPoliciesResponse as FolderSetPoliciesResponse
from .integration_connect_response import IntegrationConnectResponse as IntegrationConnectResponse
from .evaluate_score_query_response import EvaluateScoreQueryResponse as EvaluateScoreQueryResponse
from .folder_delete_policy_response import FolderDeletePolicyResponse as FolderDeletePolicyResponse
from .folder_list_policies_response import FolderListPoliciesResponse as FolderListPoliciesResponse
+from .evaluate_list_queries_response import EvaluateListQueriesResponse as EvaluateListQueriesResponse
from .evaluate_score_highlight_params import EvaluateScoreHighlightParams as EvaluateScoreHighlightParams
from .evaluate_score_highlight_response import EvaluateScoreHighlightResponse as EvaluateScoreHighlightResponse
diff --git a/src/hyperspell/types/action_add_reaction_params.py b/src/hyperspell/types/action_add_reaction_params.py
index a72da448..5bd9d41f 100644
--- a/src/hyperspell/types/action_add_reaction_params.py
+++ b/src/hyperspell/types/action_add_reaction_params.py
@@ -31,6 +31,14 @@ class ActionAddReactionParams(TypedDict, total=False):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
"""Integration provider (e.g., slack)"""
diff --git a/src/hyperspell/types/action_send_message_params.py b/src/hyperspell/types/action_send_message_params.py
index 2df01983..56da6bd7 100644
--- a/src/hyperspell/types/action_send_message_params.py
+++ b/src/hyperspell/types/action_send_message_params.py
@@ -25,6 +25,14 @@ class ActionSendMessageParams(TypedDict, total=False):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
"""Integration provider (e.g., slack)"""
diff --git a/src/hyperspell/types/auth_me_response.py b/src/hyperspell/types/auth_me_response.py
index 93ea0975..1232ee92 100644
--- a/src/hyperspell/types/auth_me_response.py
+++ b/src/hyperspell/types/auth_me_response.py
@@ -48,6 +48,14 @@ class AuthMeResponse(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
"""All integrations available for the app"""
@@ -68,6 +76,14 @@ class AuthMeResponse(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
"""All integrations installed for the user"""
diff --git a/src/hyperspell/types/connection_list_response.py b/src/hyperspell/types/connection_list_response.py
index 8092529b..da54b21a 100644
--- a/src/hyperspell/types/connection_list_response.py
+++ b/src/hyperspell/types/connection_list_response.py
@@ -33,9 +33,23 @@ class Connection(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
"""The connection's provider"""
+ selected_count: Optional[int] = None
+ """
+ Count of items in user_options.channels (Teams: workspaces selected; 0 means
+ nothing is being indexed for integrations that require selection).
+ """
+
class ConnectionListResponse(BaseModel):
connections: List[Connection]
diff --git a/src/hyperspell/types/evaluate_list_queries_params.py b/src/hyperspell/types/evaluate_list_queries_params.py
new file mode 100644
index 00000000..2c9b765d
--- /dev/null
+++ b/src/hyperspell/types/evaluate_list_queries_params.py
@@ -0,0 +1,17 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import TypedDict
+
+__all__ = ["EvaluateListQueriesParams"]
+
+
+class EvaluateListQueriesParams(TypedDict, total=False):
+ cursor: Optional[str]
+
+ size: int
+
+ user_id: Optional[str]
+ """Filter queries by the user that issued them."""
diff --git a/src/hyperspell/types/evaluate_list_queries_response.py b/src/hyperspell/types/evaluate_list_queries_response.py
new file mode 100644
index 00000000..1f1692d1
--- /dev/null
+++ b/src/hyperspell/types/evaluate_list_queries_response.py
@@ -0,0 +1,22 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+
+from .._models import BaseModel
+
+__all__ = ["EvaluateListQueriesResponse"]
+
+
+class EvaluateListQueriesResponse(BaseModel):
+ query: str
+ """The query string that was issued."""
+
+ query_id: str
+ """The ID of the query."""
+
+ time: datetime
+ """When the query was issued."""
+
+ user_id: Optional[str] = None
+ """The ID of the user that issued the query, if any."""
diff --git a/src/hyperspell/types/integration_list_response.py b/src/hyperspell/types/integration_list_response.py
index 47292e38..04d6d807 100644
--- a/src/hyperspell/types/integration_list_response.py
+++ b/src/hyperspell/types/integration_list_response.py
@@ -39,12 +39,23 @@ class Integration(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
"""The integration's provider"""
actions_only: Optional[bool] = None
"""Whether this integration only supports write actions (no sync)"""
+ requires_channel_selection: Optional[bool] = None
+ """Whether the user must select channels before indexing starts"""
+
class IntegrationListResponse(BaseModel):
integrations: List[Integration]
diff --git a/src/hyperspell/types/integrations/web_crawler_index_response.py b/src/hyperspell/types/integrations/web_crawler_index_response.py
index 16dc13e3..c8b9dca6 100644
--- a/src/hyperspell/types/integrations/web_crawler_index_response.py
+++ b/src/hyperspell/types/integrations/web_crawler_index_response.py
@@ -25,6 +25,14 @@ class WebCrawlerIndexResponse(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
status: Literal["pending", "processing", "completed", "failed", "pending_review", "skipped"]
diff --git a/src/hyperspell/types/memory.py b/src/hyperspell/types/memory.py
deleted file mode 100644
index 4ac829ef..00000000
--- a/src/hyperspell/types/memory.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import TYPE_CHECKING, Dict, List, Optional
-from typing_extensions import Literal
-
-from pydantic import Field as FieldInfo
-
-from .._models import BaseModel
-from .shared.metadata import Metadata
-
-__all__ = ["Memory"]
-
-
-class Memory(BaseModel):
- """Response model for the GET /memories/get endpoint."""
-
- resource_id: str
-
- source: Literal[
- "reddit",
- "notion",
- "slack",
- "google_calendar",
- "google_mail",
- "box",
- "dropbox",
- "github",
- "google_drive",
- "vault",
- "web_crawler",
- "trace",
- "microsoft_teams",
- "gmail_actions",
- ]
-
- type: str
- """The type of document (e.g. Document, Website, Email)"""
-
- data: Optional[List[object]] = None
- """The structured content of the document"""
-
- memories: Optional[List[str]] = None
- """Summaries of all memories extracted from this document"""
-
- metadata: Optional[Metadata] = None
-
- title: Optional[str] = None
-
- if TYPE_CHECKING:
- # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
- # value to this field, so for compatibility we avoid doing it at runtime.
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
-
- # Stub to indicate that arbitrary properties are accepted.
- # To access properties that are not valid identifiers you can use `getattr`, e.g.
- # `getattr(obj, '$type')`
- def __getattr__(self, attr: str) -> object: ...
- else:
- __pydantic_extra__: Dict[str, object]
diff --git a/src/hyperspell/types/memory_delete_response.py b/src/hyperspell/types/memory_delete_response.py
index 5f0432d1..ea0b4ed1 100644
--- a/src/hyperspell/types/memory_delete_response.py
+++ b/src/hyperspell/types/memory_delete_response.py
@@ -29,6 +29,14 @@ class MemoryDeleteResponse(BaseModel):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
success: bool
diff --git a/src/hyperspell/types/memory_get_response.py b/src/hyperspell/types/memory_get_response.py
new file mode 100644
index 00000000..f1a79df0
--- /dev/null
+++ b/src/hyperspell/types/memory_get_response.py
@@ -0,0 +1,38644 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, List, Union, Optional
+from datetime import date, datetime
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from .._utils import PropertyInfo
+from .._models import BaseModel
+from .shared.metadata import Metadata
+
+__all__ = [
+ "MemoryGetResponse",
+ "Document",
+ "DocumentDocument",
+ "DocumentDocumentChild",
+ "DocumentDocumentChildBlob",
+ "DocumentDocumentChildCallout",
+ "DocumentDocumentChildCalloutChild",
+ "DocumentDocumentChildCalloutChildBlob",
+ "DocumentDocumentChildCalloutChildCode",
+ "DocumentDocumentChildCalloutChildComment",
+ "DocumentDocumentChildCalloutChildDivider",
+ "DocumentDocumentChildCalloutChildImage",
+ "DocumentDocumentChildCalloutChildLink",
+ "DocumentDocumentChildCalloutChildLineBreak",
+ "DocumentDocumentChildCalloutChildText",
+ "DocumentDocumentChildCalloutChildToolCall",
+ "DocumentDocumentChildCalloutChildToolResult",
+ "DocumentDocumentChildCalloutChildTraceMessage",
+ "DocumentDocumentChildChunk",
+ "DocumentDocumentChildChunkChild",
+ "DocumentDocumentChildChunkChildBlob",
+ "DocumentDocumentChildChunkChildCode",
+ "DocumentDocumentChildChunkChildComment",
+ "DocumentDocumentChildChunkChildDivider",
+ "DocumentDocumentChildChunkChildImage",
+ "DocumentDocumentChildChunkChildLink",
+ "DocumentDocumentChildChunkChildLineBreak",
+ "DocumentDocumentChildChunkChildText",
+ "DocumentDocumentChildChunkChildToolCall",
+ "DocumentDocumentChildChunkChildToolResult",
+ "DocumentDocumentChildChunkChildTraceMessage",
+ "DocumentDocumentChildCode",
+ "DocumentDocumentChildComment",
+ "DocumentDocumentChildDivider",
+ "DocumentDocumentChildEquation",
+ "DocumentDocumentChildEquationChild",
+ "DocumentDocumentChildEquationChildBlob",
+ "DocumentDocumentChildEquationChildCode",
+ "DocumentDocumentChildEquationChildComment",
+ "DocumentDocumentChildEquationChildDivider",
+ "DocumentDocumentChildEquationChildImage",
+ "DocumentDocumentChildEquationChildLink",
+ "DocumentDocumentChildEquationChildLineBreak",
+ "DocumentDocumentChildEquationChildText",
+ "DocumentDocumentChildEquationChildToolCall",
+ "DocumentDocumentChildEquationChildToolResult",
+ "DocumentDocumentChildEquationChildTraceMessage",
+ "DocumentDocumentChildFootnote",
+ "DocumentDocumentChildFootnoteChild",
+ "DocumentDocumentChildFootnoteChildBlob",
+ "DocumentDocumentChildFootnoteChildCode",
+ "DocumentDocumentChildFootnoteChildComment",
+ "DocumentDocumentChildFootnoteChildDivider",
+ "DocumentDocumentChildFootnoteChildImage",
+ "DocumentDocumentChildFootnoteChildLink",
+ "DocumentDocumentChildFootnoteChildLineBreak",
+ "DocumentDocumentChildFootnoteChildText",
+ "DocumentDocumentChildFootnoteChildToolCall",
+ "DocumentDocumentChildFootnoteChildToolResult",
+ "DocumentDocumentChildFootnoteChildTraceMessage",
+ "DocumentDocumentChildHeading",
+ "DocumentDocumentChildHeadingChild",
+ "DocumentDocumentChildHeadingChildBlob",
+ "DocumentDocumentChildHeadingChildCode",
+ "DocumentDocumentChildHeadingChildComment",
+ "DocumentDocumentChildHeadingChildDivider",
+ "DocumentDocumentChildHeadingChildImage",
+ "DocumentDocumentChildHeadingChildLink",
+ "DocumentDocumentChildHeadingChildLineBreak",
+ "DocumentDocumentChildHeadingChildText",
+ "DocumentDocumentChildHeadingChildToolCall",
+ "DocumentDocumentChildHeadingChildToolResult",
+ "DocumentDocumentChildHeadingChildTraceMessage",
+ "DocumentDocumentChildImage",
+ "DocumentDocumentChildLink",
+ "DocumentDocumentChildLineBreak",
+ "DocumentDocumentChildList",
+ "DocumentDocumentChildListItem",
+ "DocumentDocumentChildListItemChild",
+ "DocumentDocumentChildListItemChildBlob",
+ "DocumentDocumentChildListItemChildCode",
+ "DocumentDocumentChildListItemChildComment",
+ "DocumentDocumentChildListItemChildDivider",
+ "DocumentDocumentChildListItemChildImage",
+ "DocumentDocumentChildListItemChildLink",
+ "DocumentDocumentChildListItemChildLineBreak",
+ "DocumentDocumentChildListItemChildText",
+ "DocumentDocumentChildListItemChildToolCall",
+ "DocumentDocumentChildListItemChildToolResult",
+ "DocumentDocumentChildListItemChildTraceMessage",
+ "DocumentDocumentChildParagraph",
+ "DocumentDocumentChildParagraphChild",
+ "DocumentDocumentChildParagraphChildBlob",
+ "DocumentDocumentChildParagraphChildCode",
+ "DocumentDocumentChildParagraphChildComment",
+ "DocumentDocumentChildParagraphChildDivider",
+ "DocumentDocumentChildParagraphChildImage",
+ "DocumentDocumentChildParagraphChildLink",
+ "DocumentDocumentChildParagraphChildLineBreak",
+ "DocumentDocumentChildParagraphChildText",
+ "DocumentDocumentChildParagraphChildToolCall",
+ "DocumentDocumentChildParagraphChildToolResult",
+ "DocumentDocumentChildParagraphChildTraceMessage",
+ "DocumentDocumentChildQuote",
+ "DocumentDocumentChildQuoteChild",
+ "DocumentDocumentChildQuoteChildBlob",
+ "DocumentDocumentChildQuoteChildCode",
+ "DocumentDocumentChildQuoteChildComment",
+ "DocumentDocumentChildQuoteChildDivider",
+ "DocumentDocumentChildQuoteChildImage",
+ "DocumentDocumentChildQuoteChildLink",
+ "DocumentDocumentChildQuoteChildLineBreak",
+ "DocumentDocumentChildQuoteChildText",
+ "DocumentDocumentChildQuoteChildToolCall",
+ "DocumentDocumentChildQuoteChildToolResult",
+ "DocumentDocumentChildQuoteChildTraceMessage",
+ "DocumentDocumentChildTable",
+ "DocumentDocumentChildTableCell",
+ "DocumentDocumentChildTableCellChild",
+ "DocumentDocumentChildTableCellChildBlob",
+ "DocumentDocumentChildTableCellChildCode",
+ "DocumentDocumentChildTableCellChildComment",
+ "DocumentDocumentChildTableCellChildDivider",
+ "DocumentDocumentChildTableCellChildImage",
+ "DocumentDocumentChildTableCellChildLink",
+ "DocumentDocumentChildTableCellChildLineBreak",
+ "DocumentDocumentChildTableCellChildText",
+ "DocumentDocumentChildTableCellChildToolCall",
+ "DocumentDocumentChildTableCellChildToolResult",
+ "DocumentDocumentChildTableCellChildTraceMessage",
+ "DocumentDocumentChildTableRow",
+ "DocumentDocumentChildText",
+ "DocumentDocumentChildToDo",
+ "DocumentDocumentChildToDoChild",
+ "DocumentDocumentChildToDoChildBlob",
+ "DocumentDocumentChildToDoChildCode",
+ "DocumentDocumentChildToDoChildComment",
+ "DocumentDocumentChildToDoChildDivider",
+ "DocumentDocumentChildToDoChildImage",
+ "DocumentDocumentChildToDoChildLink",
+ "DocumentDocumentChildToDoChildLineBreak",
+ "DocumentDocumentChildToDoChildText",
+ "DocumentDocumentChildToDoChildToolCall",
+ "DocumentDocumentChildToDoChildToolResult",
+ "DocumentDocumentChildToDoChildTraceMessage",
+ "DocumentDocumentChildToolCall",
+ "DocumentDocumentChildToolResult",
+ "DocumentDocumentChildTraceMessage",
+ "DocumentDocumentChildUtterance",
+ "DocumentWebsite",
+ "DocumentWebsiteChild",
+ "DocumentWebsiteChildBlob",
+ "DocumentWebsiteChildCallout",
+ "DocumentWebsiteChildCalloutChild",
+ "DocumentWebsiteChildCalloutChildBlob",
+ "DocumentWebsiteChildCalloutChildCode",
+ "DocumentWebsiteChildCalloutChildComment",
+ "DocumentWebsiteChildCalloutChildDivider",
+ "DocumentWebsiteChildCalloutChildImage",
+ "DocumentWebsiteChildCalloutChildLink",
+ "DocumentWebsiteChildCalloutChildLineBreak",
+ "DocumentWebsiteChildCalloutChildText",
+ "DocumentWebsiteChildCalloutChildToolCall",
+ "DocumentWebsiteChildCalloutChildToolResult",
+ "DocumentWebsiteChildCalloutChildTraceMessage",
+ "DocumentWebsiteChildChunk",
+ "DocumentWebsiteChildChunkChild",
+ "DocumentWebsiteChildChunkChildBlob",
+ "DocumentWebsiteChildChunkChildCode",
+ "DocumentWebsiteChildChunkChildComment",
+ "DocumentWebsiteChildChunkChildDivider",
+ "DocumentWebsiteChildChunkChildImage",
+ "DocumentWebsiteChildChunkChildLink",
+ "DocumentWebsiteChildChunkChildLineBreak",
+ "DocumentWebsiteChildChunkChildText",
+ "DocumentWebsiteChildChunkChildToolCall",
+ "DocumentWebsiteChildChunkChildToolResult",
+ "DocumentWebsiteChildChunkChildTraceMessage",
+ "DocumentWebsiteChildCode",
+ "DocumentWebsiteChildComment",
+ "DocumentWebsiteChildDivider",
+ "DocumentWebsiteChildEquation",
+ "DocumentWebsiteChildEquationChild",
+ "DocumentWebsiteChildEquationChildBlob",
+ "DocumentWebsiteChildEquationChildCode",
+ "DocumentWebsiteChildEquationChildComment",
+ "DocumentWebsiteChildEquationChildDivider",
+ "DocumentWebsiteChildEquationChildImage",
+ "DocumentWebsiteChildEquationChildLink",
+ "DocumentWebsiteChildEquationChildLineBreak",
+ "DocumentWebsiteChildEquationChildText",
+ "DocumentWebsiteChildEquationChildToolCall",
+ "DocumentWebsiteChildEquationChildToolResult",
+ "DocumentWebsiteChildEquationChildTraceMessage",
+ "DocumentWebsiteChildFootnote",
+ "DocumentWebsiteChildFootnoteChild",
+ "DocumentWebsiteChildFootnoteChildBlob",
+ "DocumentWebsiteChildFootnoteChildCode",
+ "DocumentWebsiteChildFootnoteChildComment",
+ "DocumentWebsiteChildFootnoteChildDivider",
+ "DocumentWebsiteChildFootnoteChildImage",
+ "DocumentWebsiteChildFootnoteChildLink",
+ "DocumentWebsiteChildFootnoteChildLineBreak",
+ "DocumentWebsiteChildFootnoteChildText",
+ "DocumentWebsiteChildFootnoteChildToolCall",
+ "DocumentWebsiteChildFootnoteChildToolResult",
+ "DocumentWebsiteChildFootnoteChildTraceMessage",
+ "DocumentWebsiteChildHeading",
+ "DocumentWebsiteChildHeadingChild",
+ "DocumentWebsiteChildHeadingChildBlob",
+ "DocumentWebsiteChildHeadingChildCode",
+ "DocumentWebsiteChildHeadingChildComment",
+ "DocumentWebsiteChildHeadingChildDivider",
+ "DocumentWebsiteChildHeadingChildImage",
+ "DocumentWebsiteChildHeadingChildLink",
+ "DocumentWebsiteChildHeadingChildLineBreak",
+ "DocumentWebsiteChildHeadingChildText",
+ "DocumentWebsiteChildHeadingChildToolCall",
+ "DocumentWebsiteChildHeadingChildToolResult",
+ "DocumentWebsiteChildHeadingChildTraceMessage",
+ "DocumentWebsiteChildImage",
+ "DocumentWebsiteChildLink",
+ "DocumentWebsiteChildLineBreak",
+ "DocumentWebsiteChildList",
+ "DocumentWebsiteChildListItem",
+ "DocumentWebsiteChildListItemChild",
+ "DocumentWebsiteChildListItemChildBlob",
+ "DocumentWebsiteChildListItemChildCode",
+ "DocumentWebsiteChildListItemChildComment",
+ "DocumentWebsiteChildListItemChildDivider",
+ "DocumentWebsiteChildListItemChildImage",
+ "DocumentWebsiteChildListItemChildLink",
+ "DocumentWebsiteChildListItemChildLineBreak",
+ "DocumentWebsiteChildListItemChildText",
+ "DocumentWebsiteChildListItemChildToolCall",
+ "DocumentWebsiteChildListItemChildToolResult",
+ "DocumentWebsiteChildListItemChildTraceMessage",
+ "DocumentWebsiteChildParagraph",
+ "DocumentWebsiteChildParagraphChild",
+ "DocumentWebsiteChildParagraphChildBlob",
+ "DocumentWebsiteChildParagraphChildCode",
+ "DocumentWebsiteChildParagraphChildComment",
+ "DocumentWebsiteChildParagraphChildDivider",
+ "DocumentWebsiteChildParagraphChildImage",
+ "DocumentWebsiteChildParagraphChildLink",
+ "DocumentWebsiteChildParagraphChildLineBreak",
+ "DocumentWebsiteChildParagraphChildText",
+ "DocumentWebsiteChildParagraphChildToolCall",
+ "DocumentWebsiteChildParagraphChildToolResult",
+ "DocumentWebsiteChildParagraphChildTraceMessage",
+ "DocumentWebsiteChildQuote",
+ "DocumentWebsiteChildQuoteChild",
+ "DocumentWebsiteChildQuoteChildBlob",
+ "DocumentWebsiteChildQuoteChildCode",
+ "DocumentWebsiteChildQuoteChildComment",
+ "DocumentWebsiteChildQuoteChildDivider",
+ "DocumentWebsiteChildQuoteChildImage",
+ "DocumentWebsiteChildQuoteChildLink",
+ "DocumentWebsiteChildQuoteChildLineBreak",
+ "DocumentWebsiteChildQuoteChildText",
+ "DocumentWebsiteChildQuoteChildToolCall",
+ "DocumentWebsiteChildQuoteChildToolResult",
+ "DocumentWebsiteChildQuoteChildTraceMessage",
+ "DocumentWebsiteChildTable",
+ "DocumentWebsiteChildTableCell",
+ "DocumentWebsiteChildTableCellChild",
+ "DocumentWebsiteChildTableCellChildBlob",
+ "DocumentWebsiteChildTableCellChildCode",
+ "DocumentWebsiteChildTableCellChildComment",
+ "DocumentWebsiteChildTableCellChildDivider",
+ "DocumentWebsiteChildTableCellChildImage",
+ "DocumentWebsiteChildTableCellChildLink",
+ "DocumentWebsiteChildTableCellChildLineBreak",
+ "DocumentWebsiteChildTableCellChildText",
+ "DocumentWebsiteChildTableCellChildToolCall",
+ "DocumentWebsiteChildTableCellChildToolResult",
+ "DocumentWebsiteChildTableCellChildTraceMessage",
+ "DocumentWebsiteChildTableRow",
+ "DocumentWebsiteChildText",
+ "DocumentWebsiteChildToDo",
+ "DocumentWebsiteChildToDoChild",
+ "DocumentWebsiteChildToDoChildBlob",
+ "DocumentWebsiteChildToDoChildCode",
+ "DocumentWebsiteChildToDoChildComment",
+ "DocumentWebsiteChildToDoChildDivider",
+ "DocumentWebsiteChildToDoChildImage",
+ "DocumentWebsiteChildToDoChildLink",
+ "DocumentWebsiteChildToDoChildLineBreak",
+ "DocumentWebsiteChildToDoChildText",
+ "DocumentWebsiteChildToDoChildToolCall",
+ "DocumentWebsiteChildToDoChildToolResult",
+ "DocumentWebsiteChildToDoChildTraceMessage",
+ "DocumentWebsiteChildToolCall",
+ "DocumentWebsiteChildToolResult",
+ "DocumentWebsiteChildTraceMessage",
+ "DocumentWebsiteChildUtterance",
+ "DocumentTask",
+ "DocumentTaskChild",
+ "DocumentTaskChildBlob",
+ "DocumentTaskChildCallout",
+ "DocumentTaskChildCalloutChild",
+ "DocumentTaskChildCalloutChildBlob",
+ "DocumentTaskChildCalloutChildCode",
+ "DocumentTaskChildCalloutChildComment",
+ "DocumentTaskChildCalloutChildDivider",
+ "DocumentTaskChildCalloutChildImage",
+ "DocumentTaskChildCalloutChildLink",
+ "DocumentTaskChildCalloutChildLineBreak",
+ "DocumentTaskChildCalloutChildText",
+ "DocumentTaskChildCalloutChildToolCall",
+ "DocumentTaskChildCalloutChildToolResult",
+ "DocumentTaskChildCalloutChildTraceMessage",
+ "DocumentTaskChildChunk",
+ "DocumentTaskChildChunkChild",
+ "DocumentTaskChildChunkChildBlob",
+ "DocumentTaskChildChunkChildCode",
+ "DocumentTaskChildChunkChildComment",
+ "DocumentTaskChildChunkChildDivider",
+ "DocumentTaskChildChunkChildImage",
+ "DocumentTaskChildChunkChildLink",
+ "DocumentTaskChildChunkChildLineBreak",
+ "DocumentTaskChildChunkChildText",
+ "DocumentTaskChildChunkChildToolCall",
+ "DocumentTaskChildChunkChildToolResult",
+ "DocumentTaskChildChunkChildTraceMessage",
+ "DocumentTaskChildCode",
+ "DocumentTaskChildComment",
+ "DocumentTaskChildDivider",
+ "DocumentTaskChildEquation",
+ "DocumentTaskChildEquationChild",
+ "DocumentTaskChildEquationChildBlob",
+ "DocumentTaskChildEquationChildCode",
+ "DocumentTaskChildEquationChildComment",
+ "DocumentTaskChildEquationChildDivider",
+ "DocumentTaskChildEquationChildImage",
+ "DocumentTaskChildEquationChildLink",
+ "DocumentTaskChildEquationChildLineBreak",
+ "DocumentTaskChildEquationChildText",
+ "DocumentTaskChildEquationChildToolCall",
+ "DocumentTaskChildEquationChildToolResult",
+ "DocumentTaskChildEquationChildTraceMessage",
+ "DocumentTaskChildFootnote",
+ "DocumentTaskChildFootnoteChild",
+ "DocumentTaskChildFootnoteChildBlob",
+ "DocumentTaskChildFootnoteChildCode",
+ "DocumentTaskChildFootnoteChildComment",
+ "DocumentTaskChildFootnoteChildDivider",
+ "DocumentTaskChildFootnoteChildImage",
+ "DocumentTaskChildFootnoteChildLink",
+ "DocumentTaskChildFootnoteChildLineBreak",
+ "DocumentTaskChildFootnoteChildText",
+ "DocumentTaskChildFootnoteChildToolCall",
+ "DocumentTaskChildFootnoteChildToolResult",
+ "DocumentTaskChildFootnoteChildTraceMessage",
+ "DocumentTaskChildHeading",
+ "DocumentTaskChildHeadingChild",
+ "DocumentTaskChildHeadingChildBlob",
+ "DocumentTaskChildHeadingChildCode",
+ "DocumentTaskChildHeadingChildComment",
+ "DocumentTaskChildHeadingChildDivider",
+ "DocumentTaskChildHeadingChildImage",
+ "DocumentTaskChildHeadingChildLink",
+ "DocumentTaskChildHeadingChildLineBreak",
+ "DocumentTaskChildHeadingChildText",
+ "DocumentTaskChildHeadingChildToolCall",
+ "DocumentTaskChildHeadingChildToolResult",
+ "DocumentTaskChildHeadingChildTraceMessage",
+ "DocumentTaskChildImage",
+ "DocumentTaskChildLink",
+ "DocumentTaskChildLineBreak",
+ "DocumentTaskChildList",
+ "DocumentTaskChildListItem",
+ "DocumentTaskChildListItemChild",
+ "DocumentTaskChildListItemChildBlob",
+ "DocumentTaskChildListItemChildCode",
+ "DocumentTaskChildListItemChildComment",
+ "DocumentTaskChildListItemChildDivider",
+ "DocumentTaskChildListItemChildImage",
+ "DocumentTaskChildListItemChildLink",
+ "DocumentTaskChildListItemChildLineBreak",
+ "DocumentTaskChildListItemChildText",
+ "DocumentTaskChildListItemChildToolCall",
+ "DocumentTaskChildListItemChildToolResult",
+ "DocumentTaskChildListItemChildTraceMessage",
+ "DocumentTaskChildParagraph",
+ "DocumentTaskChildParagraphChild",
+ "DocumentTaskChildParagraphChildBlob",
+ "DocumentTaskChildParagraphChildCode",
+ "DocumentTaskChildParagraphChildComment",
+ "DocumentTaskChildParagraphChildDivider",
+ "DocumentTaskChildParagraphChildImage",
+ "DocumentTaskChildParagraphChildLink",
+ "DocumentTaskChildParagraphChildLineBreak",
+ "DocumentTaskChildParagraphChildText",
+ "DocumentTaskChildParagraphChildToolCall",
+ "DocumentTaskChildParagraphChildToolResult",
+ "DocumentTaskChildParagraphChildTraceMessage",
+ "DocumentTaskChildQuote",
+ "DocumentTaskChildQuoteChild",
+ "DocumentTaskChildQuoteChildBlob",
+ "DocumentTaskChildQuoteChildCode",
+ "DocumentTaskChildQuoteChildComment",
+ "DocumentTaskChildQuoteChildDivider",
+ "DocumentTaskChildQuoteChildImage",
+ "DocumentTaskChildQuoteChildLink",
+ "DocumentTaskChildQuoteChildLineBreak",
+ "DocumentTaskChildQuoteChildText",
+ "DocumentTaskChildQuoteChildToolCall",
+ "DocumentTaskChildQuoteChildToolResult",
+ "DocumentTaskChildQuoteChildTraceMessage",
+ "DocumentTaskChildTable",
+ "DocumentTaskChildTableCell",
+ "DocumentTaskChildTableCellChild",
+ "DocumentTaskChildTableCellChildBlob",
+ "DocumentTaskChildTableCellChildCode",
+ "DocumentTaskChildTableCellChildComment",
+ "DocumentTaskChildTableCellChildDivider",
+ "DocumentTaskChildTableCellChildImage",
+ "DocumentTaskChildTableCellChildLink",
+ "DocumentTaskChildTableCellChildLineBreak",
+ "DocumentTaskChildTableCellChildText",
+ "DocumentTaskChildTableCellChildToolCall",
+ "DocumentTaskChildTableCellChildToolResult",
+ "DocumentTaskChildTableCellChildTraceMessage",
+ "DocumentTaskChildTableRow",
+ "DocumentTaskChildText",
+ "DocumentTaskChildToDo",
+ "DocumentTaskChildToDoChild",
+ "DocumentTaskChildToDoChildBlob",
+ "DocumentTaskChildToDoChildCode",
+ "DocumentTaskChildToDoChildComment",
+ "DocumentTaskChildToDoChildDivider",
+ "DocumentTaskChildToDoChildImage",
+ "DocumentTaskChildToDoChildLink",
+ "DocumentTaskChildToDoChildLineBreak",
+ "DocumentTaskChildToDoChildText",
+ "DocumentTaskChildToDoChildToolCall",
+ "DocumentTaskChildToDoChildToolResult",
+ "DocumentTaskChildToDoChildTraceMessage",
+ "DocumentTaskChildToolCall",
+ "DocumentTaskChildToolResult",
+ "DocumentTaskChildTraceMessage",
+ "DocumentTaskChildUtterance",
+ "DocumentTaskComment",
+ "DocumentTaskCommentSender",
+ "DocumentTaskCommentSenderChild",
+ "DocumentTaskCommentSenderChildBlob",
+ "DocumentTaskCommentSenderChildCode",
+ "DocumentTaskCommentSenderChildComment",
+ "DocumentTaskCommentSenderChildDivider",
+ "DocumentTaskCommentSenderChildImage",
+ "DocumentTaskCommentSenderChildLink",
+ "DocumentTaskCommentSenderChildLineBreak",
+ "DocumentTaskCommentSenderChildText",
+ "DocumentTaskCommentSenderChildToolCall",
+ "DocumentTaskCommentSenderChildToolResult",
+ "DocumentTaskCommentSenderChildTraceMessage",
+ "DocumentTaskCommentChild",
+ "DocumentTaskCommentChildBlob",
+ "DocumentTaskCommentChildCallout",
+ "DocumentTaskCommentChildCalloutChild",
+ "DocumentTaskCommentChildCalloutChildBlob",
+ "DocumentTaskCommentChildCalloutChildCode",
+ "DocumentTaskCommentChildCalloutChildComment",
+ "DocumentTaskCommentChildCalloutChildDivider",
+ "DocumentTaskCommentChildCalloutChildImage",
+ "DocumentTaskCommentChildCalloutChildLink",
+ "DocumentTaskCommentChildCalloutChildLineBreak",
+ "DocumentTaskCommentChildCalloutChildText",
+ "DocumentTaskCommentChildCalloutChildToolCall",
+ "DocumentTaskCommentChildCalloutChildToolResult",
+ "DocumentTaskCommentChildCalloutChildTraceMessage",
+ "DocumentTaskCommentChildChunk",
+ "DocumentTaskCommentChildChunkChild",
+ "DocumentTaskCommentChildChunkChildBlob",
+ "DocumentTaskCommentChildChunkChildCode",
+ "DocumentTaskCommentChildChunkChildComment",
+ "DocumentTaskCommentChildChunkChildDivider",
+ "DocumentTaskCommentChildChunkChildImage",
+ "DocumentTaskCommentChildChunkChildLink",
+ "DocumentTaskCommentChildChunkChildLineBreak",
+ "DocumentTaskCommentChildChunkChildText",
+ "DocumentTaskCommentChildChunkChildToolCall",
+ "DocumentTaskCommentChildChunkChildToolResult",
+ "DocumentTaskCommentChildChunkChildTraceMessage",
+ "DocumentTaskCommentChildCode",
+ "DocumentTaskCommentChildComment",
+ "DocumentTaskCommentChildDivider",
+ "DocumentTaskCommentChildEquation",
+ "DocumentTaskCommentChildEquationChild",
+ "DocumentTaskCommentChildEquationChildBlob",
+ "DocumentTaskCommentChildEquationChildCode",
+ "DocumentTaskCommentChildEquationChildComment",
+ "DocumentTaskCommentChildEquationChildDivider",
+ "DocumentTaskCommentChildEquationChildImage",
+ "DocumentTaskCommentChildEquationChildLink",
+ "DocumentTaskCommentChildEquationChildLineBreak",
+ "DocumentTaskCommentChildEquationChildText",
+ "DocumentTaskCommentChildEquationChildToolCall",
+ "DocumentTaskCommentChildEquationChildToolResult",
+ "DocumentTaskCommentChildEquationChildTraceMessage",
+ "DocumentTaskCommentChildFootnote",
+ "DocumentTaskCommentChildFootnoteChild",
+ "DocumentTaskCommentChildFootnoteChildBlob",
+ "DocumentTaskCommentChildFootnoteChildCode",
+ "DocumentTaskCommentChildFootnoteChildComment",
+ "DocumentTaskCommentChildFootnoteChildDivider",
+ "DocumentTaskCommentChildFootnoteChildImage",
+ "DocumentTaskCommentChildFootnoteChildLink",
+ "DocumentTaskCommentChildFootnoteChildLineBreak",
+ "DocumentTaskCommentChildFootnoteChildText",
+ "DocumentTaskCommentChildFootnoteChildToolCall",
+ "DocumentTaskCommentChildFootnoteChildToolResult",
+ "DocumentTaskCommentChildFootnoteChildTraceMessage",
+ "DocumentTaskCommentChildHeading",
+ "DocumentTaskCommentChildHeadingChild",
+ "DocumentTaskCommentChildHeadingChildBlob",
+ "DocumentTaskCommentChildHeadingChildCode",
+ "DocumentTaskCommentChildHeadingChildComment",
+ "DocumentTaskCommentChildHeadingChildDivider",
+ "DocumentTaskCommentChildHeadingChildImage",
+ "DocumentTaskCommentChildHeadingChildLink",
+ "DocumentTaskCommentChildHeadingChildLineBreak",
+ "DocumentTaskCommentChildHeadingChildText",
+ "DocumentTaskCommentChildHeadingChildToolCall",
+ "DocumentTaskCommentChildHeadingChildToolResult",
+ "DocumentTaskCommentChildHeadingChildTraceMessage",
+ "DocumentTaskCommentChildImage",
+ "DocumentTaskCommentChildLink",
+ "DocumentTaskCommentChildLineBreak",
+ "DocumentTaskCommentChildList",
+ "DocumentTaskCommentChildListItem",
+ "DocumentTaskCommentChildListItemChild",
+ "DocumentTaskCommentChildListItemChildBlob",
+ "DocumentTaskCommentChildListItemChildCode",
+ "DocumentTaskCommentChildListItemChildComment",
+ "DocumentTaskCommentChildListItemChildDivider",
+ "DocumentTaskCommentChildListItemChildImage",
+ "DocumentTaskCommentChildListItemChildLink",
+ "DocumentTaskCommentChildListItemChildLineBreak",
+ "DocumentTaskCommentChildListItemChildText",
+ "DocumentTaskCommentChildListItemChildToolCall",
+ "DocumentTaskCommentChildListItemChildToolResult",
+ "DocumentTaskCommentChildListItemChildTraceMessage",
+ "DocumentTaskCommentChildParagraph",
+ "DocumentTaskCommentChildParagraphChild",
+ "DocumentTaskCommentChildParagraphChildBlob",
+ "DocumentTaskCommentChildParagraphChildCode",
+ "DocumentTaskCommentChildParagraphChildComment",
+ "DocumentTaskCommentChildParagraphChildDivider",
+ "DocumentTaskCommentChildParagraphChildImage",
+ "DocumentTaskCommentChildParagraphChildLink",
+ "DocumentTaskCommentChildParagraphChildLineBreak",
+ "DocumentTaskCommentChildParagraphChildText",
+ "DocumentTaskCommentChildParagraphChildToolCall",
+ "DocumentTaskCommentChildParagraphChildToolResult",
+ "DocumentTaskCommentChildParagraphChildTraceMessage",
+ "DocumentTaskCommentChildQuote",
+ "DocumentTaskCommentChildQuoteChild",
+ "DocumentTaskCommentChildQuoteChildBlob",
+ "DocumentTaskCommentChildQuoteChildCode",
+ "DocumentTaskCommentChildQuoteChildComment",
+ "DocumentTaskCommentChildQuoteChildDivider",
+ "DocumentTaskCommentChildQuoteChildImage",
+ "DocumentTaskCommentChildQuoteChildLink",
+ "DocumentTaskCommentChildQuoteChildLineBreak",
+ "DocumentTaskCommentChildQuoteChildText",
+ "DocumentTaskCommentChildQuoteChildToolCall",
+ "DocumentTaskCommentChildQuoteChildToolResult",
+ "DocumentTaskCommentChildQuoteChildTraceMessage",
+ "DocumentTaskCommentChildTable",
+ "DocumentTaskCommentChildTableCell",
+ "DocumentTaskCommentChildTableCellChild",
+ "DocumentTaskCommentChildTableCellChildBlob",
+ "DocumentTaskCommentChildTableCellChildCode",
+ "DocumentTaskCommentChildTableCellChildComment",
+ "DocumentTaskCommentChildTableCellChildDivider",
+ "DocumentTaskCommentChildTableCellChildImage",
+ "DocumentTaskCommentChildTableCellChildLink",
+ "DocumentTaskCommentChildTableCellChildLineBreak",
+ "DocumentTaskCommentChildTableCellChildText",
+ "DocumentTaskCommentChildTableCellChildToolCall",
+ "DocumentTaskCommentChildTableCellChildToolResult",
+ "DocumentTaskCommentChildTableCellChildTraceMessage",
+ "DocumentTaskCommentChildTableRow",
+ "DocumentTaskCommentChildText",
+ "DocumentTaskCommentChildToDo",
+ "DocumentTaskCommentChildToDoChild",
+ "DocumentTaskCommentChildToDoChildBlob",
+ "DocumentTaskCommentChildToDoChildCode",
+ "DocumentTaskCommentChildToDoChildComment",
+ "DocumentTaskCommentChildToDoChildDivider",
+ "DocumentTaskCommentChildToDoChildImage",
+ "DocumentTaskCommentChildToDoChildLink",
+ "DocumentTaskCommentChildToDoChildLineBreak",
+ "DocumentTaskCommentChildToDoChildText",
+ "DocumentTaskCommentChildToDoChildToolCall",
+ "DocumentTaskCommentChildToDoChildToolResult",
+ "DocumentTaskCommentChildToDoChildTraceMessage",
+ "DocumentTaskCommentChildToolCall",
+ "DocumentTaskCommentChildToolResult",
+ "DocumentTaskCommentChildTraceMessage",
+ "DocumentTaskCommentChildUtterance",
+ "DocumentTaskCommentMentionedUser",
+ "DocumentTaskCommentMentionedUserChild",
+ "DocumentTaskCommentMentionedUserChildBlob",
+ "DocumentTaskCommentMentionedUserChildCode",
+ "DocumentTaskCommentMentionedUserChildComment",
+ "DocumentTaskCommentMentionedUserChildDivider",
+ "DocumentTaskCommentMentionedUserChildImage",
+ "DocumentTaskCommentMentionedUserChildLink",
+ "DocumentTaskCommentMentionedUserChildLineBreak",
+ "DocumentTaskCommentMentionedUserChildText",
+ "DocumentTaskCommentMentionedUserChildToolCall",
+ "DocumentTaskCommentMentionedUserChildToolResult",
+ "DocumentTaskCommentMentionedUserChildTraceMessage",
+ "DocumentPerson",
+ "DocumentPersonChild",
+ "DocumentPersonChildBlob",
+ "DocumentPersonChildCode",
+ "DocumentPersonChildComment",
+ "DocumentPersonChildDivider",
+ "DocumentPersonChildImage",
+ "DocumentPersonChildLink",
+ "DocumentPersonChildLineBreak",
+ "DocumentPersonChildText",
+ "DocumentPersonChildToolCall",
+ "DocumentPersonChildToolResult",
+ "DocumentPersonChildTraceMessage",
+ "DocumentMessage",
+ "DocumentMessageSender",
+ "DocumentMessageSenderChild",
+ "DocumentMessageSenderChildBlob",
+ "DocumentMessageSenderChildCode",
+ "DocumentMessageSenderChildComment",
+ "DocumentMessageSenderChildDivider",
+ "DocumentMessageSenderChildImage",
+ "DocumentMessageSenderChildLink",
+ "DocumentMessageSenderChildLineBreak",
+ "DocumentMessageSenderChildText",
+ "DocumentMessageSenderChildToolCall",
+ "DocumentMessageSenderChildToolResult",
+ "DocumentMessageSenderChildTraceMessage",
+ "DocumentMessageChild",
+ "DocumentMessageChildBlob",
+ "DocumentMessageChildCallout",
+ "DocumentMessageChildCalloutChild",
+ "DocumentMessageChildCalloutChildBlob",
+ "DocumentMessageChildCalloutChildCode",
+ "DocumentMessageChildCalloutChildComment",
+ "DocumentMessageChildCalloutChildDivider",
+ "DocumentMessageChildCalloutChildImage",
+ "DocumentMessageChildCalloutChildLink",
+ "DocumentMessageChildCalloutChildLineBreak",
+ "DocumentMessageChildCalloutChildText",
+ "DocumentMessageChildCalloutChildToolCall",
+ "DocumentMessageChildCalloutChildToolResult",
+ "DocumentMessageChildCalloutChildTraceMessage",
+ "DocumentMessageChildChunk",
+ "DocumentMessageChildChunkChild",
+ "DocumentMessageChildChunkChildBlob",
+ "DocumentMessageChildChunkChildCode",
+ "DocumentMessageChildChunkChildComment",
+ "DocumentMessageChildChunkChildDivider",
+ "DocumentMessageChildChunkChildImage",
+ "DocumentMessageChildChunkChildLink",
+ "DocumentMessageChildChunkChildLineBreak",
+ "DocumentMessageChildChunkChildText",
+ "DocumentMessageChildChunkChildToolCall",
+ "DocumentMessageChildChunkChildToolResult",
+ "DocumentMessageChildChunkChildTraceMessage",
+ "DocumentMessageChildCode",
+ "DocumentMessageChildComment",
+ "DocumentMessageChildDivider",
+ "DocumentMessageChildEquation",
+ "DocumentMessageChildEquationChild",
+ "DocumentMessageChildEquationChildBlob",
+ "DocumentMessageChildEquationChildCode",
+ "DocumentMessageChildEquationChildComment",
+ "DocumentMessageChildEquationChildDivider",
+ "DocumentMessageChildEquationChildImage",
+ "DocumentMessageChildEquationChildLink",
+ "DocumentMessageChildEquationChildLineBreak",
+ "DocumentMessageChildEquationChildText",
+ "DocumentMessageChildEquationChildToolCall",
+ "DocumentMessageChildEquationChildToolResult",
+ "DocumentMessageChildEquationChildTraceMessage",
+ "DocumentMessageChildFootnote",
+ "DocumentMessageChildFootnoteChild",
+ "DocumentMessageChildFootnoteChildBlob",
+ "DocumentMessageChildFootnoteChildCode",
+ "DocumentMessageChildFootnoteChildComment",
+ "DocumentMessageChildFootnoteChildDivider",
+ "DocumentMessageChildFootnoteChildImage",
+ "DocumentMessageChildFootnoteChildLink",
+ "DocumentMessageChildFootnoteChildLineBreak",
+ "DocumentMessageChildFootnoteChildText",
+ "DocumentMessageChildFootnoteChildToolCall",
+ "DocumentMessageChildFootnoteChildToolResult",
+ "DocumentMessageChildFootnoteChildTraceMessage",
+ "DocumentMessageChildHeading",
+ "DocumentMessageChildHeadingChild",
+ "DocumentMessageChildHeadingChildBlob",
+ "DocumentMessageChildHeadingChildCode",
+ "DocumentMessageChildHeadingChildComment",
+ "DocumentMessageChildHeadingChildDivider",
+ "DocumentMessageChildHeadingChildImage",
+ "DocumentMessageChildHeadingChildLink",
+ "DocumentMessageChildHeadingChildLineBreak",
+ "DocumentMessageChildHeadingChildText",
+ "DocumentMessageChildHeadingChildToolCall",
+ "DocumentMessageChildHeadingChildToolResult",
+ "DocumentMessageChildHeadingChildTraceMessage",
+ "DocumentMessageChildImage",
+ "DocumentMessageChildLink",
+ "DocumentMessageChildLineBreak",
+ "DocumentMessageChildList",
+ "DocumentMessageChildListItem",
+ "DocumentMessageChildListItemChild",
+ "DocumentMessageChildListItemChildBlob",
+ "DocumentMessageChildListItemChildCode",
+ "DocumentMessageChildListItemChildComment",
+ "DocumentMessageChildListItemChildDivider",
+ "DocumentMessageChildListItemChildImage",
+ "DocumentMessageChildListItemChildLink",
+ "DocumentMessageChildListItemChildLineBreak",
+ "DocumentMessageChildListItemChildText",
+ "DocumentMessageChildListItemChildToolCall",
+ "DocumentMessageChildListItemChildToolResult",
+ "DocumentMessageChildListItemChildTraceMessage",
+ "DocumentMessageChildParagraph",
+ "DocumentMessageChildParagraphChild",
+ "DocumentMessageChildParagraphChildBlob",
+ "DocumentMessageChildParagraphChildCode",
+ "DocumentMessageChildParagraphChildComment",
+ "DocumentMessageChildParagraphChildDivider",
+ "DocumentMessageChildParagraphChildImage",
+ "DocumentMessageChildParagraphChildLink",
+ "DocumentMessageChildParagraphChildLineBreak",
+ "DocumentMessageChildParagraphChildText",
+ "DocumentMessageChildParagraphChildToolCall",
+ "DocumentMessageChildParagraphChildToolResult",
+ "DocumentMessageChildParagraphChildTraceMessage",
+ "DocumentMessageChildQuote",
+ "DocumentMessageChildQuoteChild",
+ "DocumentMessageChildQuoteChildBlob",
+ "DocumentMessageChildQuoteChildCode",
+ "DocumentMessageChildQuoteChildComment",
+ "DocumentMessageChildQuoteChildDivider",
+ "DocumentMessageChildQuoteChildImage",
+ "DocumentMessageChildQuoteChildLink",
+ "DocumentMessageChildQuoteChildLineBreak",
+ "DocumentMessageChildQuoteChildText",
+ "DocumentMessageChildQuoteChildToolCall",
+ "DocumentMessageChildQuoteChildToolResult",
+ "DocumentMessageChildQuoteChildTraceMessage",
+ "DocumentMessageChildTable",
+ "DocumentMessageChildTableCell",
+ "DocumentMessageChildTableCellChild",
+ "DocumentMessageChildTableCellChildBlob",
+ "DocumentMessageChildTableCellChildCode",
+ "DocumentMessageChildTableCellChildComment",
+ "DocumentMessageChildTableCellChildDivider",
+ "DocumentMessageChildTableCellChildImage",
+ "DocumentMessageChildTableCellChildLink",
+ "DocumentMessageChildTableCellChildLineBreak",
+ "DocumentMessageChildTableCellChildText",
+ "DocumentMessageChildTableCellChildToolCall",
+ "DocumentMessageChildTableCellChildToolResult",
+ "DocumentMessageChildTableCellChildTraceMessage",
+ "DocumentMessageChildTableRow",
+ "DocumentMessageChildText",
+ "DocumentMessageChildToDo",
+ "DocumentMessageChildToDoChild",
+ "DocumentMessageChildToDoChildBlob",
+ "DocumentMessageChildToDoChildCode",
+ "DocumentMessageChildToDoChildComment",
+ "DocumentMessageChildToDoChildDivider",
+ "DocumentMessageChildToDoChildImage",
+ "DocumentMessageChildToDoChildLink",
+ "DocumentMessageChildToDoChildLineBreak",
+ "DocumentMessageChildToDoChildText",
+ "DocumentMessageChildToDoChildToolCall",
+ "DocumentMessageChildToDoChildToolResult",
+ "DocumentMessageChildToDoChildTraceMessage",
+ "DocumentMessageChildToolCall",
+ "DocumentMessageChildToolResult",
+ "DocumentMessageChildTraceMessage",
+ "DocumentMessageChildUtterance",
+ "DocumentMessageMentionedUser",
+ "DocumentMessageMentionedUserChild",
+ "DocumentMessageMentionedUserChildBlob",
+ "DocumentMessageMentionedUserChildCode",
+ "DocumentMessageMentionedUserChildComment",
+ "DocumentMessageMentionedUserChildDivider",
+ "DocumentMessageMentionedUserChildImage",
+ "DocumentMessageMentionedUserChildLink",
+ "DocumentMessageMentionedUserChildLineBreak",
+ "DocumentMessageMentionedUserChildText",
+ "DocumentMessageMentionedUserChildToolCall",
+ "DocumentMessageMentionedUserChildToolResult",
+ "DocumentMessageMentionedUserChildTraceMessage",
+ "DocumentEvent",
+ "DocumentEventAttendee",
+ "DocumentEventAttendeeChild",
+ "DocumentEventAttendeeChildBlob",
+ "DocumentEventAttendeeChildCode",
+ "DocumentEventAttendeeChildComment",
+ "DocumentEventAttendeeChildDivider",
+ "DocumentEventAttendeeChildImage",
+ "DocumentEventAttendeeChildLink",
+ "DocumentEventAttendeeChildLineBreak",
+ "DocumentEventAttendeeChildText",
+ "DocumentEventAttendeeChildToolCall",
+ "DocumentEventAttendeeChildToolResult",
+ "DocumentEventAttendeeChildTraceMessage",
+ "DocumentEventChild",
+ "DocumentEventChildBlob",
+ "DocumentEventChildCallout",
+ "DocumentEventChildCalloutChild",
+ "DocumentEventChildCalloutChildBlob",
+ "DocumentEventChildCalloutChildCode",
+ "DocumentEventChildCalloutChildComment",
+ "DocumentEventChildCalloutChildDivider",
+ "DocumentEventChildCalloutChildImage",
+ "DocumentEventChildCalloutChildLink",
+ "DocumentEventChildCalloutChildLineBreak",
+ "DocumentEventChildCalloutChildText",
+ "DocumentEventChildCalloutChildToolCall",
+ "DocumentEventChildCalloutChildToolResult",
+ "DocumentEventChildCalloutChildTraceMessage",
+ "DocumentEventChildChunk",
+ "DocumentEventChildChunkChild",
+ "DocumentEventChildChunkChildBlob",
+ "DocumentEventChildChunkChildCode",
+ "DocumentEventChildChunkChildComment",
+ "DocumentEventChildChunkChildDivider",
+ "DocumentEventChildChunkChildImage",
+ "DocumentEventChildChunkChildLink",
+ "DocumentEventChildChunkChildLineBreak",
+ "DocumentEventChildChunkChildText",
+ "DocumentEventChildChunkChildToolCall",
+ "DocumentEventChildChunkChildToolResult",
+ "DocumentEventChildChunkChildTraceMessage",
+ "DocumentEventChildCode",
+ "DocumentEventChildComment",
+ "DocumentEventChildDivider",
+ "DocumentEventChildEquation",
+ "DocumentEventChildEquationChild",
+ "DocumentEventChildEquationChildBlob",
+ "DocumentEventChildEquationChildCode",
+ "DocumentEventChildEquationChildComment",
+ "DocumentEventChildEquationChildDivider",
+ "DocumentEventChildEquationChildImage",
+ "DocumentEventChildEquationChildLink",
+ "DocumentEventChildEquationChildLineBreak",
+ "DocumentEventChildEquationChildText",
+ "DocumentEventChildEquationChildToolCall",
+ "DocumentEventChildEquationChildToolResult",
+ "DocumentEventChildEquationChildTraceMessage",
+ "DocumentEventChildFootnote",
+ "DocumentEventChildFootnoteChild",
+ "DocumentEventChildFootnoteChildBlob",
+ "DocumentEventChildFootnoteChildCode",
+ "DocumentEventChildFootnoteChildComment",
+ "DocumentEventChildFootnoteChildDivider",
+ "DocumentEventChildFootnoteChildImage",
+ "DocumentEventChildFootnoteChildLink",
+ "DocumentEventChildFootnoteChildLineBreak",
+ "DocumentEventChildFootnoteChildText",
+ "DocumentEventChildFootnoteChildToolCall",
+ "DocumentEventChildFootnoteChildToolResult",
+ "DocumentEventChildFootnoteChildTraceMessage",
+ "DocumentEventChildHeading",
+ "DocumentEventChildHeadingChild",
+ "DocumentEventChildHeadingChildBlob",
+ "DocumentEventChildHeadingChildCode",
+ "DocumentEventChildHeadingChildComment",
+ "DocumentEventChildHeadingChildDivider",
+ "DocumentEventChildHeadingChildImage",
+ "DocumentEventChildHeadingChildLink",
+ "DocumentEventChildHeadingChildLineBreak",
+ "DocumentEventChildHeadingChildText",
+ "DocumentEventChildHeadingChildToolCall",
+ "DocumentEventChildHeadingChildToolResult",
+ "DocumentEventChildHeadingChildTraceMessage",
+ "DocumentEventChildImage",
+ "DocumentEventChildLink",
+ "DocumentEventChildLineBreak",
+ "DocumentEventChildList",
+ "DocumentEventChildListItem",
+ "DocumentEventChildListItemChild",
+ "DocumentEventChildListItemChildBlob",
+ "DocumentEventChildListItemChildCode",
+ "DocumentEventChildListItemChildComment",
+ "DocumentEventChildListItemChildDivider",
+ "DocumentEventChildListItemChildImage",
+ "DocumentEventChildListItemChildLink",
+ "DocumentEventChildListItemChildLineBreak",
+ "DocumentEventChildListItemChildText",
+ "DocumentEventChildListItemChildToolCall",
+ "DocumentEventChildListItemChildToolResult",
+ "DocumentEventChildListItemChildTraceMessage",
+ "DocumentEventChildParagraph",
+ "DocumentEventChildParagraphChild",
+ "DocumentEventChildParagraphChildBlob",
+ "DocumentEventChildParagraphChildCode",
+ "DocumentEventChildParagraphChildComment",
+ "DocumentEventChildParagraphChildDivider",
+ "DocumentEventChildParagraphChildImage",
+ "DocumentEventChildParagraphChildLink",
+ "DocumentEventChildParagraphChildLineBreak",
+ "DocumentEventChildParagraphChildText",
+ "DocumentEventChildParagraphChildToolCall",
+ "DocumentEventChildParagraphChildToolResult",
+ "DocumentEventChildParagraphChildTraceMessage",
+ "DocumentEventChildQuote",
+ "DocumentEventChildQuoteChild",
+ "DocumentEventChildQuoteChildBlob",
+ "DocumentEventChildQuoteChildCode",
+ "DocumentEventChildQuoteChildComment",
+ "DocumentEventChildQuoteChildDivider",
+ "DocumentEventChildQuoteChildImage",
+ "DocumentEventChildQuoteChildLink",
+ "DocumentEventChildQuoteChildLineBreak",
+ "DocumentEventChildQuoteChildText",
+ "DocumentEventChildQuoteChildToolCall",
+ "DocumentEventChildQuoteChildToolResult",
+ "DocumentEventChildQuoteChildTraceMessage",
+ "DocumentEventChildTable",
+ "DocumentEventChildTableCell",
+ "DocumentEventChildTableCellChild",
+ "DocumentEventChildTableCellChildBlob",
+ "DocumentEventChildTableCellChildCode",
+ "DocumentEventChildTableCellChildComment",
+ "DocumentEventChildTableCellChildDivider",
+ "DocumentEventChildTableCellChildImage",
+ "DocumentEventChildTableCellChildLink",
+ "DocumentEventChildTableCellChildLineBreak",
+ "DocumentEventChildTableCellChildText",
+ "DocumentEventChildTableCellChildToolCall",
+ "DocumentEventChildTableCellChildToolResult",
+ "DocumentEventChildTableCellChildTraceMessage",
+ "DocumentEventChildTableRow",
+ "DocumentEventChildText",
+ "DocumentEventChildToDo",
+ "DocumentEventChildToDoChild",
+ "DocumentEventChildToDoChildBlob",
+ "DocumentEventChildToDoChildCode",
+ "DocumentEventChildToDoChildComment",
+ "DocumentEventChildToDoChildDivider",
+ "DocumentEventChildToDoChildImage",
+ "DocumentEventChildToDoChildLink",
+ "DocumentEventChildToDoChildLineBreak",
+ "DocumentEventChildToDoChildText",
+ "DocumentEventChildToDoChildToolCall",
+ "DocumentEventChildToDoChildToolResult",
+ "DocumentEventChildToDoChildTraceMessage",
+ "DocumentEventChildToolCall",
+ "DocumentEventChildToolResult",
+ "DocumentEventChildTraceMessage",
+ "DocumentEventChildUtterance",
+ "DocumentFile",
+ "DocumentFileChild",
+ "DocumentFileChildBlob",
+ "DocumentFileChildCallout",
+ "DocumentFileChildCalloutChild",
+ "DocumentFileChildCalloutChildBlob",
+ "DocumentFileChildCalloutChildCode",
+ "DocumentFileChildCalloutChildComment",
+ "DocumentFileChildCalloutChildDivider",
+ "DocumentFileChildCalloutChildImage",
+ "DocumentFileChildCalloutChildLink",
+ "DocumentFileChildCalloutChildLineBreak",
+ "DocumentFileChildCalloutChildText",
+ "DocumentFileChildCalloutChildToolCall",
+ "DocumentFileChildCalloutChildToolResult",
+ "DocumentFileChildCalloutChildTraceMessage",
+ "DocumentFileChildChunk",
+ "DocumentFileChildChunkChild",
+ "DocumentFileChildChunkChildBlob",
+ "DocumentFileChildChunkChildCode",
+ "DocumentFileChildChunkChildComment",
+ "DocumentFileChildChunkChildDivider",
+ "DocumentFileChildChunkChildImage",
+ "DocumentFileChildChunkChildLink",
+ "DocumentFileChildChunkChildLineBreak",
+ "DocumentFileChildChunkChildText",
+ "DocumentFileChildChunkChildToolCall",
+ "DocumentFileChildChunkChildToolResult",
+ "DocumentFileChildChunkChildTraceMessage",
+ "DocumentFileChildCode",
+ "DocumentFileChildComment",
+ "DocumentFileChildDivider",
+ "DocumentFileChildEquation",
+ "DocumentFileChildEquationChild",
+ "DocumentFileChildEquationChildBlob",
+ "DocumentFileChildEquationChildCode",
+ "DocumentFileChildEquationChildComment",
+ "DocumentFileChildEquationChildDivider",
+ "DocumentFileChildEquationChildImage",
+ "DocumentFileChildEquationChildLink",
+ "DocumentFileChildEquationChildLineBreak",
+ "DocumentFileChildEquationChildText",
+ "DocumentFileChildEquationChildToolCall",
+ "DocumentFileChildEquationChildToolResult",
+ "DocumentFileChildEquationChildTraceMessage",
+ "DocumentFileChildFootnote",
+ "DocumentFileChildFootnoteChild",
+ "DocumentFileChildFootnoteChildBlob",
+ "DocumentFileChildFootnoteChildCode",
+ "DocumentFileChildFootnoteChildComment",
+ "DocumentFileChildFootnoteChildDivider",
+ "DocumentFileChildFootnoteChildImage",
+ "DocumentFileChildFootnoteChildLink",
+ "DocumentFileChildFootnoteChildLineBreak",
+ "DocumentFileChildFootnoteChildText",
+ "DocumentFileChildFootnoteChildToolCall",
+ "DocumentFileChildFootnoteChildToolResult",
+ "DocumentFileChildFootnoteChildTraceMessage",
+ "DocumentFileChildHeading",
+ "DocumentFileChildHeadingChild",
+ "DocumentFileChildHeadingChildBlob",
+ "DocumentFileChildHeadingChildCode",
+ "DocumentFileChildHeadingChildComment",
+ "DocumentFileChildHeadingChildDivider",
+ "DocumentFileChildHeadingChildImage",
+ "DocumentFileChildHeadingChildLink",
+ "DocumentFileChildHeadingChildLineBreak",
+ "DocumentFileChildHeadingChildText",
+ "DocumentFileChildHeadingChildToolCall",
+ "DocumentFileChildHeadingChildToolResult",
+ "DocumentFileChildHeadingChildTraceMessage",
+ "DocumentFileChildImage",
+ "DocumentFileChildLink",
+ "DocumentFileChildLineBreak",
+ "DocumentFileChildList",
+ "DocumentFileChildListItem",
+ "DocumentFileChildListItemChild",
+ "DocumentFileChildListItemChildBlob",
+ "DocumentFileChildListItemChildCode",
+ "DocumentFileChildListItemChildComment",
+ "DocumentFileChildListItemChildDivider",
+ "DocumentFileChildListItemChildImage",
+ "DocumentFileChildListItemChildLink",
+ "DocumentFileChildListItemChildLineBreak",
+ "DocumentFileChildListItemChildText",
+ "DocumentFileChildListItemChildToolCall",
+ "DocumentFileChildListItemChildToolResult",
+ "DocumentFileChildListItemChildTraceMessage",
+ "DocumentFileChildParagraph",
+ "DocumentFileChildParagraphChild",
+ "DocumentFileChildParagraphChildBlob",
+ "DocumentFileChildParagraphChildCode",
+ "DocumentFileChildParagraphChildComment",
+ "DocumentFileChildParagraphChildDivider",
+ "DocumentFileChildParagraphChildImage",
+ "DocumentFileChildParagraphChildLink",
+ "DocumentFileChildParagraphChildLineBreak",
+ "DocumentFileChildParagraphChildText",
+ "DocumentFileChildParagraphChildToolCall",
+ "DocumentFileChildParagraphChildToolResult",
+ "DocumentFileChildParagraphChildTraceMessage",
+ "DocumentFileChildQuote",
+ "DocumentFileChildQuoteChild",
+ "DocumentFileChildQuoteChildBlob",
+ "DocumentFileChildQuoteChildCode",
+ "DocumentFileChildQuoteChildComment",
+ "DocumentFileChildQuoteChildDivider",
+ "DocumentFileChildQuoteChildImage",
+ "DocumentFileChildQuoteChildLink",
+ "DocumentFileChildQuoteChildLineBreak",
+ "DocumentFileChildQuoteChildText",
+ "DocumentFileChildQuoteChildToolCall",
+ "DocumentFileChildQuoteChildToolResult",
+ "DocumentFileChildQuoteChildTraceMessage",
+ "DocumentFileChildTable",
+ "DocumentFileChildTableCell",
+ "DocumentFileChildTableCellChild",
+ "DocumentFileChildTableCellChildBlob",
+ "DocumentFileChildTableCellChildCode",
+ "DocumentFileChildTableCellChildComment",
+ "DocumentFileChildTableCellChildDivider",
+ "DocumentFileChildTableCellChildImage",
+ "DocumentFileChildTableCellChildLink",
+ "DocumentFileChildTableCellChildLineBreak",
+ "DocumentFileChildTableCellChildText",
+ "DocumentFileChildTableCellChildToolCall",
+ "DocumentFileChildTableCellChildToolResult",
+ "DocumentFileChildTableCellChildTraceMessage",
+ "DocumentFileChildTableRow",
+ "DocumentFileChildText",
+ "DocumentFileChildToDo",
+ "DocumentFileChildToDoChild",
+ "DocumentFileChildToDoChildBlob",
+ "DocumentFileChildToDoChildCode",
+ "DocumentFileChildToDoChildComment",
+ "DocumentFileChildToDoChildDivider",
+ "DocumentFileChildToDoChildImage",
+ "DocumentFileChildToDoChildLink",
+ "DocumentFileChildToDoChildLineBreak",
+ "DocumentFileChildToDoChildText",
+ "DocumentFileChildToDoChildToolCall",
+ "DocumentFileChildToDoChildToolResult",
+ "DocumentFileChildToDoChildTraceMessage",
+ "DocumentFileChildToolCall",
+ "DocumentFileChildToolResult",
+ "DocumentFileChildTraceMessage",
+ "DocumentFileChildUtterance",
+ "DocumentConversation",
+ "DocumentConversationChild",
+ "DocumentConversationChildSender",
+ "DocumentConversationChildSenderChild",
+ "DocumentConversationChildSenderChildBlob",
+ "DocumentConversationChildSenderChildCode",
+ "DocumentConversationChildSenderChildComment",
+ "DocumentConversationChildSenderChildDivider",
+ "DocumentConversationChildSenderChildImage",
+ "DocumentConversationChildSenderChildLink",
+ "DocumentConversationChildSenderChildLineBreak",
+ "DocumentConversationChildSenderChildText",
+ "DocumentConversationChildSenderChildToolCall",
+ "DocumentConversationChildSenderChildToolResult",
+ "DocumentConversationChildSenderChildTraceMessage",
+ "DocumentConversationChildChild",
+ "DocumentConversationChildChildBlob",
+ "DocumentConversationChildChildCallout",
+ "DocumentConversationChildChildCalloutChild",
+ "DocumentConversationChildChildCalloutChildBlob",
+ "DocumentConversationChildChildCalloutChildCode",
+ "DocumentConversationChildChildCalloutChildComment",
+ "DocumentConversationChildChildCalloutChildDivider",
+ "DocumentConversationChildChildCalloutChildImage",
+ "DocumentConversationChildChildCalloutChildLink",
+ "DocumentConversationChildChildCalloutChildLineBreak",
+ "DocumentConversationChildChildCalloutChildText",
+ "DocumentConversationChildChildCalloutChildToolCall",
+ "DocumentConversationChildChildCalloutChildToolResult",
+ "DocumentConversationChildChildCalloutChildTraceMessage",
+ "DocumentConversationChildChildChunk",
+ "DocumentConversationChildChildChunkChild",
+ "DocumentConversationChildChildChunkChildBlob",
+ "DocumentConversationChildChildChunkChildCode",
+ "DocumentConversationChildChildChunkChildComment",
+ "DocumentConversationChildChildChunkChildDivider",
+ "DocumentConversationChildChildChunkChildImage",
+ "DocumentConversationChildChildChunkChildLink",
+ "DocumentConversationChildChildChunkChildLineBreak",
+ "DocumentConversationChildChildChunkChildText",
+ "DocumentConversationChildChildChunkChildToolCall",
+ "DocumentConversationChildChildChunkChildToolResult",
+ "DocumentConversationChildChildChunkChildTraceMessage",
+ "DocumentConversationChildChildCode",
+ "DocumentConversationChildChildComment",
+ "DocumentConversationChildChildDivider",
+ "DocumentConversationChildChildEquation",
+ "DocumentConversationChildChildEquationChild",
+ "DocumentConversationChildChildEquationChildBlob",
+ "DocumentConversationChildChildEquationChildCode",
+ "DocumentConversationChildChildEquationChildComment",
+ "DocumentConversationChildChildEquationChildDivider",
+ "DocumentConversationChildChildEquationChildImage",
+ "DocumentConversationChildChildEquationChildLink",
+ "DocumentConversationChildChildEquationChildLineBreak",
+ "DocumentConversationChildChildEquationChildText",
+ "DocumentConversationChildChildEquationChildToolCall",
+ "DocumentConversationChildChildEquationChildToolResult",
+ "DocumentConversationChildChildEquationChildTraceMessage",
+ "DocumentConversationChildChildFootnote",
+ "DocumentConversationChildChildFootnoteChild",
+ "DocumentConversationChildChildFootnoteChildBlob",
+ "DocumentConversationChildChildFootnoteChildCode",
+ "DocumentConversationChildChildFootnoteChildComment",
+ "DocumentConversationChildChildFootnoteChildDivider",
+ "DocumentConversationChildChildFootnoteChildImage",
+ "DocumentConversationChildChildFootnoteChildLink",
+ "DocumentConversationChildChildFootnoteChildLineBreak",
+ "DocumentConversationChildChildFootnoteChildText",
+ "DocumentConversationChildChildFootnoteChildToolCall",
+ "DocumentConversationChildChildFootnoteChildToolResult",
+ "DocumentConversationChildChildFootnoteChildTraceMessage",
+ "DocumentConversationChildChildHeading",
+ "DocumentConversationChildChildHeadingChild",
+ "DocumentConversationChildChildHeadingChildBlob",
+ "DocumentConversationChildChildHeadingChildCode",
+ "DocumentConversationChildChildHeadingChildComment",
+ "DocumentConversationChildChildHeadingChildDivider",
+ "DocumentConversationChildChildHeadingChildImage",
+ "DocumentConversationChildChildHeadingChildLink",
+ "DocumentConversationChildChildHeadingChildLineBreak",
+ "DocumentConversationChildChildHeadingChildText",
+ "DocumentConversationChildChildHeadingChildToolCall",
+ "DocumentConversationChildChildHeadingChildToolResult",
+ "DocumentConversationChildChildHeadingChildTraceMessage",
+ "DocumentConversationChildChildImage",
+ "DocumentConversationChildChildLink",
+ "DocumentConversationChildChildLineBreak",
+ "DocumentConversationChildChildList",
+ "DocumentConversationChildChildListItem",
+ "DocumentConversationChildChildListItemChild",
+ "DocumentConversationChildChildListItemChildBlob",
+ "DocumentConversationChildChildListItemChildCode",
+ "DocumentConversationChildChildListItemChildComment",
+ "DocumentConversationChildChildListItemChildDivider",
+ "DocumentConversationChildChildListItemChildImage",
+ "DocumentConversationChildChildListItemChildLink",
+ "DocumentConversationChildChildListItemChildLineBreak",
+ "DocumentConversationChildChildListItemChildText",
+ "DocumentConversationChildChildListItemChildToolCall",
+ "DocumentConversationChildChildListItemChildToolResult",
+ "DocumentConversationChildChildListItemChildTraceMessage",
+ "DocumentConversationChildChildParagraph",
+ "DocumentConversationChildChildParagraphChild",
+ "DocumentConversationChildChildParagraphChildBlob",
+ "DocumentConversationChildChildParagraphChildCode",
+ "DocumentConversationChildChildParagraphChildComment",
+ "DocumentConversationChildChildParagraphChildDivider",
+ "DocumentConversationChildChildParagraphChildImage",
+ "DocumentConversationChildChildParagraphChildLink",
+ "DocumentConversationChildChildParagraphChildLineBreak",
+ "DocumentConversationChildChildParagraphChildText",
+ "DocumentConversationChildChildParagraphChildToolCall",
+ "DocumentConversationChildChildParagraphChildToolResult",
+ "DocumentConversationChildChildParagraphChildTraceMessage",
+ "DocumentConversationChildChildQuote",
+ "DocumentConversationChildChildQuoteChild",
+ "DocumentConversationChildChildQuoteChildBlob",
+ "DocumentConversationChildChildQuoteChildCode",
+ "DocumentConversationChildChildQuoteChildComment",
+ "DocumentConversationChildChildQuoteChildDivider",
+ "DocumentConversationChildChildQuoteChildImage",
+ "DocumentConversationChildChildQuoteChildLink",
+ "DocumentConversationChildChildQuoteChildLineBreak",
+ "DocumentConversationChildChildQuoteChildText",
+ "DocumentConversationChildChildQuoteChildToolCall",
+ "DocumentConversationChildChildQuoteChildToolResult",
+ "DocumentConversationChildChildQuoteChildTraceMessage",
+ "DocumentConversationChildChildTable",
+ "DocumentConversationChildChildTableCell",
+ "DocumentConversationChildChildTableCellChild",
+ "DocumentConversationChildChildTableCellChildBlob",
+ "DocumentConversationChildChildTableCellChildCode",
+ "DocumentConversationChildChildTableCellChildComment",
+ "DocumentConversationChildChildTableCellChildDivider",
+ "DocumentConversationChildChildTableCellChildImage",
+ "DocumentConversationChildChildTableCellChildLink",
+ "DocumentConversationChildChildTableCellChildLineBreak",
+ "DocumentConversationChildChildTableCellChildText",
+ "DocumentConversationChildChildTableCellChildToolCall",
+ "DocumentConversationChildChildTableCellChildToolResult",
+ "DocumentConversationChildChildTableCellChildTraceMessage",
+ "DocumentConversationChildChildTableRow",
+ "DocumentConversationChildChildText",
+ "DocumentConversationChildChildToDo",
+ "DocumentConversationChildChildToDoChild",
+ "DocumentConversationChildChildToDoChildBlob",
+ "DocumentConversationChildChildToDoChildCode",
+ "DocumentConversationChildChildToDoChildComment",
+ "DocumentConversationChildChildToDoChildDivider",
+ "DocumentConversationChildChildToDoChildImage",
+ "DocumentConversationChildChildToDoChildLink",
+ "DocumentConversationChildChildToDoChildLineBreak",
+ "DocumentConversationChildChildToDoChildText",
+ "DocumentConversationChildChildToDoChildToolCall",
+ "DocumentConversationChildChildToDoChildToolResult",
+ "DocumentConversationChildChildToDoChildTraceMessage",
+ "DocumentConversationChildChildToolCall",
+ "DocumentConversationChildChildToolResult",
+ "DocumentConversationChildChildTraceMessage",
+ "DocumentConversationChildChildUtterance",
+ "DocumentConversationChildMentionedUser",
+ "DocumentConversationChildMentionedUserChild",
+ "DocumentConversationChildMentionedUserChildBlob",
+ "DocumentConversationChildMentionedUserChildCode",
+ "DocumentConversationChildMentionedUserChildComment",
+ "DocumentConversationChildMentionedUserChildDivider",
+ "DocumentConversationChildMentionedUserChildImage",
+ "DocumentConversationChildMentionedUserChildLink",
+ "DocumentConversationChildMentionedUserChildLineBreak",
+ "DocumentConversationChildMentionedUserChildText",
+ "DocumentConversationChildMentionedUserChildToolCall",
+ "DocumentConversationChildMentionedUserChildToolResult",
+ "DocumentConversationChildMentionedUserChildTraceMessage",
+ "DocumentTrace",
+ "DocumentTraceChild",
+ "DocumentTraceChildTraceMessage",
+ "DocumentTraceChildToolCall",
+ "DocumentTraceChildToolResult",
+ "DocumentTranscript",
+ "DocumentTranscriptChild",
+ "DocumentTranscriptParticipant",
+ "DocumentTranscriptParticipantChild",
+ "DocumentTranscriptParticipantChildBlob",
+ "DocumentTranscriptParticipantChildCode",
+ "DocumentTranscriptParticipantChildComment",
+ "DocumentTranscriptParticipantChildDivider",
+ "DocumentTranscriptParticipantChildImage",
+ "DocumentTranscriptParticipantChildLink",
+ "DocumentTranscriptParticipantChildLineBreak",
+ "DocumentTranscriptParticipantChildText",
+ "DocumentTranscriptParticipantChildToolCall",
+ "DocumentTranscriptParticipantChildToolResult",
+ "DocumentTranscriptParticipantChildTraceMessage",
+ "DocumentCompany",
+ "DocumentCompanyChild",
+ "DocumentCompanyChildBlob",
+ "DocumentCompanyChildCallout",
+ "DocumentCompanyChildCalloutChild",
+ "DocumentCompanyChildCalloutChildBlob",
+ "DocumentCompanyChildCalloutChildCode",
+ "DocumentCompanyChildCalloutChildComment",
+ "DocumentCompanyChildCalloutChildDivider",
+ "DocumentCompanyChildCalloutChildImage",
+ "DocumentCompanyChildCalloutChildLink",
+ "DocumentCompanyChildCalloutChildLineBreak",
+ "DocumentCompanyChildCalloutChildText",
+ "DocumentCompanyChildCalloutChildToolCall",
+ "DocumentCompanyChildCalloutChildToolResult",
+ "DocumentCompanyChildCalloutChildTraceMessage",
+ "DocumentCompanyChildChunk",
+ "DocumentCompanyChildChunkChild",
+ "DocumentCompanyChildChunkChildBlob",
+ "DocumentCompanyChildChunkChildCode",
+ "DocumentCompanyChildChunkChildComment",
+ "DocumentCompanyChildChunkChildDivider",
+ "DocumentCompanyChildChunkChildImage",
+ "DocumentCompanyChildChunkChildLink",
+ "DocumentCompanyChildChunkChildLineBreak",
+ "DocumentCompanyChildChunkChildText",
+ "DocumentCompanyChildChunkChildToolCall",
+ "DocumentCompanyChildChunkChildToolResult",
+ "DocumentCompanyChildChunkChildTraceMessage",
+ "DocumentCompanyChildCode",
+ "DocumentCompanyChildComment",
+ "DocumentCompanyChildDivider",
+ "DocumentCompanyChildEquation",
+ "DocumentCompanyChildEquationChild",
+ "DocumentCompanyChildEquationChildBlob",
+ "DocumentCompanyChildEquationChildCode",
+ "DocumentCompanyChildEquationChildComment",
+ "DocumentCompanyChildEquationChildDivider",
+ "DocumentCompanyChildEquationChildImage",
+ "DocumentCompanyChildEquationChildLink",
+ "DocumentCompanyChildEquationChildLineBreak",
+ "DocumentCompanyChildEquationChildText",
+ "DocumentCompanyChildEquationChildToolCall",
+ "DocumentCompanyChildEquationChildToolResult",
+ "DocumentCompanyChildEquationChildTraceMessage",
+ "DocumentCompanyChildFootnote",
+ "DocumentCompanyChildFootnoteChild",
+ "DocumentCompanyChildFootnoteChildBlob",
+ "DocumentCompanyChildFootnoteChildCode",
+ "DocumentCompanyChildFootnoteChildComment",
+ "DocumentCompanyChildFootnoteChildDivider",
+ "DocumentCompanyChildFootnoteChildImage",
+ "DocumentCompanyChildFootnoteChildLink",
+ "DocumentCompanyChildFootnoteChildLineBreak",
+ "DocumentCompanyChildFootnoteChildText",
+ "DocumentCompanyChildFootnoteChildToolCall",
+ "DocumentCompanyChildFootnoteChildToolResult",
+ "DocumentCompanyChildFootnoteChildTraceMessage",
+ "DocumentCompanyChildHeading",
+ "DocumentCompanyChildHeadingChild",
+ "DocumentCompanyChildHeadingChildBlob",
+ "DocumentCompanyChildHeadingChildCode",
+ "DocumentCompanyChildHeadingChildComment",
+ "DocumentCompanyChildHeadingChildDivider",
+ "DocumentCompanyChildHeadingChildImage",
+ "DocumentCompanyChildHeadingChildLink",
+ "DocumentCompanyChildHeadingChildLineBreak",
+ "DocumentCompanyChildHeadingChildText",
+ "DocumentCompanyChildHeadingChildToolCall",
+ "DocumentCompanyChildHeadingChildToolResult",
+ "DocumentCompanyChildHeadingChildTraceMessage",
+ "DocumentCompanyChildImage",
+ "DocumentCompanyChildLink",
+ "DocumentCompanyChildLineBreak",
+ "DocumentCompanyChildList",
+ "DocumentCompanyChildListItem",
+ "DocumentCompanyChildListItemChild",
+ "DocumentCompanyChildListItemChildBlob",
+ "DocumentCompanyChildListItemChildCode",
+ "DocumentCompanyChildListItemChildComment",
+ "DocumentCompanyChildListItemChildDivider",
+ "DocumentCompanyChildListItemChildImage",
+ "DocumentCompanyChildListItemChildLink",
+ "DocumentCompanyChildListItemChildLineBreak",
+ "DocumentCompanyChildListItemChildText",
+ "DocumentCompanyChildListItemChildToolCall",
+ "DocumentCompanyChildListItemChildToolResult",
+ "DocumentCompanyChildListItemChildTraceMessage",
+ "DocumentCompanyChildParagraph",
+ "DocumentCompanyChildParagraphChild",
+ "DocumentCompanyChildParagraphChildBlob",
+ "DocumentCompanyChildParagraphChildCode",
+ "DocumentCompanyChildParagraphChildComment",
+ "DocumentCompanyChildParagraphChildDivider",
+ "DocumentCompanyChildParagraphChildImage",
+ "DocumentCompanyChildParagraphChildLink",
+ "DocumentCompanyChildParagraphChildLineBreak",
+ "DocumentCompanyChildParagraphChildText",
+ "DocumentCompanyChildParagraphChildToolCall",
+ "DocumentCompanyChildParagraphChildToolResult",
+ "DocumentCompanyChildParagraphChildTraceMessage",
+ "DocumentCompanyChildQuote",
+ "DocumentCompanyChildQuoteChild",
+ "DocumentCompanyChildQuoteChildBlob",
+ "DocumentCompanyChildQuoteChildCode",
+ "DocumentCompanyChildQuoteChildComment",
+ "DocumentCompanyChildQuoteChildDivider",
+ "DocumentCompanyChildQuoteChildImage",
+ "DocumentCompanyChildQuoteChildLink",
+ "DocumentCompanyChildQuoteChildLineBreak",
+ "DocumentCompanyChildQuoteChildText",
+ "DocumentCompanyChildQuoteChildToolCall",
+ "DocumentCompanyChildQuoteChildToolResult",
+ "DocumentCompanyChildQuoteChildTraceMessage",
+ "DocumentCompanyChildTable",
+ "DocumentCompanyChildTableCell",
+ "DocumentCompanyChildTableCellChild",
+ "DocumentCompanyChildTableCellChildBlob",
+ "DocumentCompanyChildTableCellChildCode",
+ "DocumentCompanyChildTableCellChildComment",
+ "DocumentCompanyChildTableCellChildDivider",
+ "DocumentCompanyChildTableCellChildImage",
+ "DocumentCompanyChildTableCellChildLink",
+ "DocumentCompanyChildTableCellChildLineBreak",
+ "DocumentCompanyChildTableCellChildText",
+ "DocumentCompanyChildTableCellChildToolCall",
+ "DocumentCompanyChildTableCellChildToolResult",
+ "DocumentCompanyChildTableCellChildTraceMessage",
+ "DocumentCompanyChildTableRow",
+ "DocumentCompanyChildText",
+ "DocumentCompanyChildToDo",
+ "DocumentCompanyChildToDoChild",
+ "DocumentCompanyChildToDoChildBlob",
+ "DocumentCompanyChildToDoChildCode",
+ "DocumentCompanyChildToDoChildComment",
+ "DocumentCompanyChildToDoChildDivider",
+ "DocumentCompanyChildToDoChildImage",
+ "DocumentCompanyChildToDoChildLink",
+ "DocumentCompanyChildToDoChildLineBreak",
+ "DocumentCompanyChildToDoChildText",
+ "DocumentCompanyChildToDoChildToolCall",
+ "DocumentCompanyChildToDoChildToolResult",
+ "DocumentCompanyChildToDoChildTraceMessage",
+ "DocumentCompanyChildToolCall",
+ "DocumentCompanyChildToolResult",
+ "DocumentCompanyChildTraceMessage",
+ "DocumentCompanyChildUtterance",
+ "DocumentDeal",
+ "DocumentDealChild",
+ "DocumentDealChildBlob",
+ "DocumentDealChildCallout",
+ "DocumentDealChildCalloutChild",
+ "DocumentDealChildCalloutChildBlob",
+ "DocumentDealChildCalloutChildCode",
+ "DocumentDealChildCalloutChildComment",
+ "DocumentDealChildCalloutChildDivider",
+ "DocumentDealChildCalloutChildImage",
+ "DocumentDealChildCalloutChildLink",
+ "DocumentDealChildCalloutChildLineBreak",
+ "DocumentDealChildCalloutChildText",
+ "DocumentDealChildCalloutChildToolCall",
+ "DocumentDealChildCalloutChildToolResult",
+ "DocumentDealChildCalloutChildTraceMessage",
+ "DocumentDealChildChunk",
+ "DocumentDealChildChunkChild",
+ "DocumentDealChildChunkChildBlob",
+ "DocumentDealChildChunkChildCode",
+ "DocumentDealChildChunkChildComment",
+ "DocumentDealChildChunkChildDivider",
+ "DocumentDealChildChunkChildImage",
+ "DocumentDealChildChunkChildLink",
+ "DocumentDealChildChunkChildLineBreak",
+ "DocumentDealChildChunkChildText",
+ "DocumentDealChildChunkChildToolCall",
+ "DocumentDealChildChunkChildToolResult",
+ "DocumentDealChildChunkChildTraceMessage",
+ "DocumentDealChildCode",
+ "DocumentDealChildComment",
+ "DocumentDealChildDivider",
+ "DocumentDealChildEquation",
+ "DocumentDealChildEquationChild",
+ "DocumentDealChildEquationChildBlob",
+ "DocumentDealChildEquationChildCode",
+ "DocumentDealChildEquationChildComment",
+ "DocumentDealChildEquationChildDivider",
+ "DocumentDealChildEquationChildImage",
+ "DocumentDealChildEquationChildLink",
+ "DocumentDealChildEquationChildLineBreak",
+ "DocumentDealChildEquationChildText",
+ "DocumentDealChildEquationChildToolCall",
+ "DocumentDealChildEquationChildToolResult",
+ "DocumentDealChildEquationChildTraceMessage",
+ "DocumentDealChildFootnote",
+ "DocumentDealChildFootnoteChild",
+ "DocumentDealChildFootnoteChildBlob",
+ "DocumentDealChildFootnoteChildCode",
+ "DocumentDealChildFootnoteChildComment",
+ "DocumentDealChildFootnoteChildDivider",
+ "DocumentDealChildFootnoteChildImage",
+ "DocumentDealChildFootnoteChildLink",
+ "DocumentDealChildFootnoteChildLineBreak",
+ "DocumentDealChildFootnoteChildText",
+ "DocumentDealChildFootnoteChildToolCall",
+ "DocumentDealChildFootnoteChildToolResult",
+ "DocumentDealChildFootnoteChildTraceMessage",
+ "DocumentDealChildHeading",
+ "DocumentDealChildHeadingChild",
+ "DocumentDealChildHeadingChildBlob",
+ "DocumentDealChildHeadingChildCode",
+ "DocumentDealChildHeadingChildComment",
+ "DocumentDealChildHeadingChildDivider",
+ "DocumentDealChildHeadingChildImage",
+ "DocumentDealChildHeadingChildLink",
+ "DocumentDealChildHeadingChildLineBreak",
+ "DocumentDealChildHeadingChildText",
+ "DocumentDealChildHeadingChildToolCall",
+ "DocumentDealChildHeadingChildToolResult",
+ "DocumentDealChildHeadingChildTraceMessage",
+ "DocumentDealChildImage",
+ "DocumentDealChildLink",
+ "DocumentDealChildLineBreak",
+ "DocumentDealChildList",
+ "DocumentDealChildListItem",
+ "DocumentDealChildListItemChild",
+ "DocumentDealChildListItemChildBlob",
+ "DocumentDealChildListItemChildCode",
+ "DocumentDealChildListItemChildComment",
+ "DocumentDealChildListItemChildDivider",
+ "DocumentDealChildListItemChildImage",
+ "DocumentDealChildListItemChildLink",
+ "DocumentDealChildListItemChildLineBreak",
+ "DocumentDealChildListItemChildText",
+ "DocumentDealChildListItemChildToolCall",
+ "DocumentDealChildListItemChildToolResult",
+ "DocumentDealChildListItemChildTraceMessage",
+ "DocumentDealChildParagraph",
+ "DocumentDealChildParagraphChild",
+ "DocumentDealChildParagraphChildBlob",
+ "DocumentDealChildParagraphChildCode",
+ "DocumentDealChildParagraphChildComment",
+ "DocumentDealChildParagraphChildDivider",
+ "DocumentDealChildParagraphChildImage",
+ "DocumentDealChildParagraphChildLink",
+ "DocumentDealChildParagraphChildLineBreak",
+ "DocumentDealChildParagraphChildText",
+ "DocumentDealChildParagraphChildToolCall",
+ "DocumentDealChildParagraphChildToolResult",
+ "DocumentDealChildParagraphChildTraceMessage",
+ "DocumentDealChildQuote",
+ "DocumentDealChildQuoteChild",
+ "DocumentDealChildQuoteChildBlob",
+ "DocumentDealChildQuoteChildCode",
+ "DocumentDealChildQuoteChildComment",
+ "DocumentDealChildQuoteChildDivider",
+ "DocumentDealChildQuoteChildImage",
+ "DocumentDealChildQuoteChildLink",
+ "DocumentDealChildQuoteChildLineBreak",
+ "DocumentDealChildQuoteChildText",
+ "DocumentDealChildQuoteChildToolCall",
+ "DocumentDealChildQuoteChildToolResult",
+ "DocumentDealChildQuoteChildTraceMessage",
+ "DocumentDealChildTable",
+ "DocumentDealChildTableCell",
+ "DocumentDealChildTableCellChild",
+ "DocumentDealChildTableCellChildBlob",
+ "DocumentDealChildTableCellChildCode",
+ "DocumentDealChildTableCellChildComment",
+ "DocumentDealChildTableCellChildDivider",
+ "DocumentDealChildTableCellChildImage",
+ "DocumentDealChildTableCellChildLink",
+ "DocumentDealChildTableCellChildLineBreak",
+ "DocumentDealChildTableCellChildText",
+ "DocumentDealChildTableCellChildToolCall",
+ "DocumentDealChildTableCellChildToolResult",
+ "DocumentDealChildTableCellChildTraceMessage",
+ "DocumentDealChildTableRow",
+ "DocumentDealChildText",
+ "DocumentDealChildToDo",
+ "DocumentDealChildToDoChild",
+ "DocumentDealChildToDoChildBlob",
+ "DocumentDealChildToDoChildCode",
+ "DocumentDealChildToDoChildComment",
+ "DocumentDealChildToDoChildDivider",
+ "DocumentDealChildToDoChildImage",
+ "DocumentDealChildToDoChildLink",
+ "DocumentDealChildToDoChildLineBreak",
+ "DocumentDealChildToDoChildText",
+ "DocumentDealChildToDoChildToolCall",
+ "DocumentDealChildToDoChildToolResult",
+ "DocumentDealChildToDoChildTraceMessage",
+ "DocumentDealChildToolCall",
+ "DocumentDealChildToolResult",
+ "DocumentDealChildTraceMessage",
+ "DocumentDealChildUtterance",
+]
+
+
+class DocumentDocumentChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildCalloutChild: TypeAlias = Union[
+ DocumentDocumentChildCalloutChildBlob,
+ DocumentDocumentChildCalloutChildCode,
+ DocumentDocumentChildCalloutChildComment,
+ DocumentDocumentChildCalloutChildDivider,
+ DocumentDocumentChildCalloutChildImage,
+ DocumentDocumentChildCalloutChildLink,
+ DocumentDocumentChildCalloutChildLineBreak,
+ DocumentDocumentChildCalloutChildText,
+ DocumentDocumentChildCalloutChildToolCall,
+ DocumentDocumentChildCalloutChildToolResult,
+ DocumentDocumentChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentDocumentChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildChunkChild: TypeAlias = Union[
+ DocumentDocumentChildChunkChildBlob,
+ DocumentDocumentChildChunkChildCode,
+ DocumentDocumentChildChunkChildComment,
+ DocumentDocumentChildChunkChildDivider,
+ DocumentDocumentChildChunkChildImage,
+ DocumentDocumentChildChunkChildLink,
+ DocumentDocumentChildChunkChildLineBreak,
+ DocumentDocumentChildChunkChildText,
+ DocumentDocumentChildChunkChildToolCall,
+ DocumentDocumentChildChunkChildToolResult,
+ DocumentDocumentChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentDocumentChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildEquationChild: TypeAlias = Union[
+ DocumentDocumentChildEquationChildBlob,
+ DocumentDocumentChildEquationChildCode,
+ DocumentDocumentChildEquationChildComment,
+ DocumentDocumentChildEquationChildDivider,
+ DocumentDocumentChildEquationChildImage,
+ DocumentDocumentChildEquationChildLink,
+ DocumentDocumentChildEquationChildLineBreak,
+ DocumentDocumentChildEquationChildText,
+ DocumentDocumentChildEquationChildToolCall,
+ DocumentDocumentChildEquationChildToolResult,
+ DocumentDocumentChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentDocumentChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildFootnoteChild: TypeAlias = Union[
+ DocumentDocumentChildFootnoteChildBlob,
+ DocumentDocumentChildFootnoteChildCode,
+ DocumentDocumentChildFootnoteChildComment,
+ DocumentDocumentChildFootnoteChildDivider,
+ DocumentDocumentChildFootnoteChildImage,
+ DocumentDocumentChildFootnoteChildLink,
+ DocumentDocumentChildFootnoteChildLineBreak,
+ DocumentDocumentChildFootnoteChildText,
+ DocumentDocumentChildFootnoteChildToolCall,
+ DocumentDocumentChildFootnoteChildToolResult,
+ DocumentDocumentChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentDocumentChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildHeadingChild: TypeAlias = Union[
+ DocumentDocumentChildHeadingChildBlob,
+ DocumentDocumentChildHeadingChildCode,
+ DocumentDocumentChildHeadingChildComment,
+ DocumentDocumentChildHeadingChildDivider,
+ DocumentDocumentChildHeadingChildImage,
+ DocumentDocumentChildHeadingChildLink,
+ DocumentDocumentChildHeadingChildLineBreak,
+ DocumentDocumentChildHeadingChildText,
+ DocumentDocumentChildHeadingChildToolCall,
+ DocumentDocumentChildHeadingChildToolResult,
+ DocumentDocumentChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentDocumentChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentDocumentChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildListItemChild: TypeAlias = Union[
+ DocumentDocumentChildListItemChildBlob,
+ DocumentDocumentChildListItemChildCode,
+ DocumentDocumentChildListItemChildComment,
+ DocumentDocumentChildListItemChildDivider,
+ DocumentDocumentChildListItemChildImage,
+ DocumentDocumentChildListItemChildLink,
+ DocumentDocumentChildListItemChildLineBreak,
+ DocumentDocumentChildListItemChildText,
+ DocumentDocumentChildListItemChildToolCall,
+ DocumentDocumentChildListItemChildToolResult,
+ DocumentDocumentChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentDocumentChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildParagraphChild: TypeAlias = Union[
+ DocumentDocumentChildParagraphChildBlob,
+ DocumentDocumentChildParagraphChildCode,
+ DocumentDocumentChildParagraphChildComment,
+ DocumentDocumentChildParagraphChildDivider,
+ DocumentDocumentChildParagraphChildImage,
+ DocumentDocumentChildParagraphChildLink,
+ DocumentDocumentChildParagraphChildLineBreak,
+ DocumentDocumentChildParagraphChildText,
+ DocumentDocumentChildParagraphChildToolCall,
+ DocumentDocumentChildParagraphChildToolResult,
+ DocumentDocumentChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentDocumentChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildQuoteChild: TypeAlias = Union[
+ DocumentDocumentChildQuoteChildBlob,
+ DocumentDocumentChildQuoteChildCode,
+ DocumentDocumentChildQuoteChildComment,
+ DocumentDocumentChildQuoteChildDivider,
+ DocumentDocumentChildQuoteChildImage,
+ DocumentDocumentChildQuoteChildLink,
+ DocumentDocumentChildQuoteChildLineBreak,
+ DocumentDocumentChildQuoteChildText,
+ DocumentDocumentChildQuoteChildToolCall,
+ DocumentDocumentChildQuoteChildToolResult,
+ DocumentDocumentChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentDocumentChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentDocumentChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildTableCellChild: TypeAlias = Union[
+ DocumentDocumentChildTableCellChildBlob,
+ DocumentDocumentChildTableCellChildCode,
+ DocumentDocumentChildTableCellChildComment,
+ DocumentDocumentChildTableCellChildDivider,
+ DocumentDocumentChildTableCellChildImage,
+ DocumentDocumentChildTableCellChildLink,
+ DocumentDocumentChildTableCellChildLineBreak,
+ DocumentDocumentChildTableCellChildText,
+ DocumentDocumentChildTableCellChildToolCall,
+ DocumentDocumentChildTableCellChildToolResult,
+ DocumentDocumentChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentDocumentChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentDocumentChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentDocumentChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildToDoChild: TypeAlias = Union[
+ DocumentDocumentChildToDoChildBlob,
+ DocumentDocumentChildToDoChildCode,
+ DocumentDocumentChildToDoChildComment,
+ DocumentDocumentChildToDoChildDivider,
+ DocumentDocumentChildToDoChildImage,
+ DocumentDocumentChildToDoChildLink,
+ DocumentDocumentChildToDoChildLineBreak,
+ DocumentDocumentChildToDoChildText,
+ DocumentDocumentChildToDoChildToolCall,
+ DocumentDocumentChildToDoChildToolResult,
+ DocumentDocumentChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentDocumentChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentDocumentChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentDocumentChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentDocumentChild: TypeAlias = Annotated[
+ Union[
+ DocumentDocumentChildBlob,
+ DocumentDocumentChildCallout,
+ DocumentDocumentChildChunk,
+ DocumentDocumentChildCode,
+ DocumentDocumentChildComment,
+ DocumentDocumentChildDivider,
+ DocumentDocumentChildEquation,
+ DocumentDocumentChildFootnote,
+ DocumentDocumentChildHeading,
+ DocumentDocumentChildImage,
+ DocumentDocumentChildLink,
+ DocumentDocumentChildLineBreak,
+ DocumentDocumentChildList,
+ DocumentDocumentChildListItem,
+ DocumentDocumentChildParagraph,
+ DocumentDocumentChildQuote,
+ DocumentDocumentChildTable,
+ DocumentDocumentChildTableCell,
+ DocumentDocumentChildTableRow,
+ DocumentDocumentChildText,
+ DocumentDocumentChildToDo,
+ DocumentDocumentChildToolCall,
+ DocumentDocumentChildToolResult,
+ DocumentDocumentChildTraceMessage,
+ DocumentDocumentChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentDocument(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["document"]] = None
+
+
+class DocumentWebsiteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildCalloutChild: TypeAlias = Union[
+ DocumentWebsiteChildCalloutChildBlob,
+ DocumentWebsiteChildCalloutChildCode,
+ DocumentWebsiteChildCalloutChildComment,
+ DocumentWebsiteChildCalloutChildDivider,
+ DocumentWebsiteChildCalloutChildImage,
+ DocumentWebsiteChildCalloutChildLink,
+ DocumentWebsiteChildCalloutChildLineBreak,
+ DocumentWebsiteChildCalloutChildText,
+ DocumentWebsiteChildCalloutChildToolCall,
+ DocumentWebsiteChildCalloutChildToolResult,
+ DocumentWebsiteChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentWebsiteChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildChunkChild: TypeAlias = Union[
+ DocumentWebsiteChildChunkChildBlob,
+ DocumentWebsiteChildChunkChildCode,
+ DocumentWebsiteChildChunkChildComment,
+ DocumentWebsiteChildChunkChildDivider,
+ DocumentWebsiteChildChunkChildImage,
+ DocumentWebsiteChildChunkChildLink,
+ DocumentWebsiteChildChunkChildLineBreak,
+ DocumentWebsiteChildChunkChildText,
+ DocumentWebsiteChildChunkChildToolCall,
+ DocumentWebsiteChildChunkChildToolResult,
+ DocumentWebsiteChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentWebsiteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildEquationChild: TypeAlias = Union[
+ DocumentWebsiteChildEquationChildBlob,
+ DocumentWebsiteChildEquationChildCode,
+ DocumentWebsiteChildEquationChildComment,
+ DocumentWebsiteChildEquationChildDivider,
+ DocumentWebsiteChildEquationChildImage,
+ DocumentWebsiteChildEquationChildLink,
+ DocumentWebsiteChildEquationChildLineBreak,
+ DocumentWebsiteChildEquationChildText,
+ DocumentWebsiteChildEquationChildToolCall,
+ DocumentWebsiteChildEquationChildToolResult,
+ DocumentWebsiteChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildFootnoteChild: TypeAlias = Union[
+ DocumentWebsiteChildFootnoteChildBlob,
+ DocumentWebsiteChildFootnoteChildCode,
+ DocumentWebsiteChildFootnoteChildComment,
+ DocumentWebsiteChildFootnoteChildDivider,
+ DocumentWebsiteChildFootnoteChildImage,
+ DocumentWebsiteChildFootnoteChildLink,
+ DocumentWebsiteChildFootnoteChildLineBreak,
+ DocumentWebsiteChildFootnoteChildText,
+ DocumentWebsiteChildFootnoteChildToolCall,
+ DocumentWebsiteChildFootnoteChildToolResult,
+ DocumentWebsiteChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentWebsiteChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildHeadingChild: TypeAlias = Union[
+ DocumentWebsiteChildHeadingChildBlob,
+ DocumentWebsiteChildHeadingChildCode,
+ DocumentWebsiteChildHeadingChildComment,
+ DocumentWebsiteChildHeadingChildDivider,
+ DocumentWebsiteChildHeadingChildImage,
+ DocumentWebsiteChildHeadingChildLink,
+ DocumentWebsiteChildHeadingChildLineBreak,
+ DocumentWebsiteChildHeadingChildText,
+ DocumentWebsiteChildHeadingChildToolCall,
+ DocumentWebsiteChildHeadingChildToolResult,
+ DocumentWebsiteChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentWebsiteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentWebsiteChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildListItemChild: TypeAlias = Union[
+ DocumentWebsiteChildListItemChildBlob,
+ DocumentWebsiteChildListItemChildCode,
+ DocumentWebsiteChildListItemChildComment,
+ DocumentWebsiteChildListItemChildDivider,
+ DocumentWebsiteChildListItemChildImage,
+ DocumentWebsiteChildListItemChildLink,
+ DocumentWebsiteChildListItemChildLineBreak,
+ DocumentWebsiteChildListItemChildText,
+ DocumentWebsiteChildListItemChildToolCall,
+ DocumentWebsiteChildListItemChildToolResult,
+ DocumentWebsiteChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentWebsiteChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildParagraphChild: TypeAlias = Union[
+ DocumentWebsiteChildParagraphChildBlob,
+ DocumentWebsiteChildParagraphChildCode,
+ DocumentWebsiteChildParagraphChildComment,
+ DocumentWebsiteChildParagraphChildDivider,
+ DocumentWebsiteChildParagraphChildImage,
+ DocumentWebsiteChildParagraphChildLink,
+ DocumentWebsiteChildParagraphChildLineBreak,
+ DocumentWebsiteChildParagraphChildText,
+ DocumentWebsiteChildParagraphChildToolCall,
+ DocumentWebsiteChildParagraphChildToolResult,
+ DocumentWebsiteChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentWebsiteChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildQuoteChild: TypeAlias = Union[
+ DocumentWebsiteChildQuoteChildBlob,
+ DocumentWebsiteChildQuoteChildCode,
+ DocumentWebsiteChildQuoteChildComment,
+ DocumentWebsiteChildQuoteChildDivider,
+ DocumentWebsiteChildQuoteChildImage,
+ DocumentWebsiteChildQuoteChildLink,
+ DocumentWebsiteChildQuoteChildLineBreak,
+ DocumentWebsiteChildQuoteChildText,
+ DocumentWebsiteChildQuoteChildToolCall,
+ DocumentWebsiteChildQuoteChildToolResult,
+ DocumentWebsiteChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentWebsiteChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentWebsiteChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildTableCellChild: TypeAlias = Union[
+ DocumentWebsiteChildTableCellChildBlob,
+ DocumentWebsiteChildTableCellChildCode,
+ DocumentWebsiteChildTableCellChildComment,
+ DocumentWebsiteChildTableCellChildDivider,
+ DocumentWebsiteChildTableCellChildImage,
+ DocumentWebsiteChildTableCellChildLink,
+ DocumentWebsiteChildTableCellChildLineBreak,
+ DocumentWebsiteChildTableCellChildText,
+ DocumentWebsiteChildTableCellChildToolCall,
+ DocumentWebsiteChildTableCellChildToolResult,
+ DocumentWebsiteChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentWebsiteChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentWebsiteChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentWebsiteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentWebsiteChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentWebsiteChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentWebsiteChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentWebsiteChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentWebsiteChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentWebsiteChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentWebsiteChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentWebsiteChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentWebsiteChildToDoChild: TypeAlias = Union[
+ DocumentWebsiteChildToDoChildBlob,
+ DocumentWebsiteChildToDoChildCode,
+ DocumentWebsiteChildToDoChildComment,
+ DocumentWebsiteChildToDoChildDivider,
+ DocumentWebsiteChildToDoChildImage,
+ DocumentWebsiteChildToDoChildLink,
+ DocumentWebsiteChildToDoChildLineBreak,
+ DocumentWebsiteChildToDoChildText,
+ DocumentWebsiteChildToDoChildToolCall,
+ DocumentWebsiteChildToDoChildToolResult,
+ DocumentWebsiteChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentWebsiteChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentWebsiteChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentWebsiteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentWebsiteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentWebsiteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentWebsiteChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentWebsiteChild: TypeAlias = Annotated[
+ Union[
+ DocumentWebsiteChildBlob,
+ DocumentWebsiteChildCallout,
+ DocumentWebsiteChildChunk,
+ DocumentWebsiteChildCode,
+ DocumentWebsiteChildComment,
+ DocumentWebsiteChildDivider,
+ DocumentWebsiteChildEquation,
+ DocumentWebsiteChildFootnote,
+ DocumentWebsiteChildHeading,
+ DocumentWebsiteChildImage,
+ DocumentWebsiteChildLink,
+ DocumentWebsiteChildLineBreak,
+ DocumentWebsiteChildList,
+ DocumentWebsiteChildListItem,
+ DocumentWebsiteChildParagraph,
+ DocumentWebsiteChildQuote,
+ DocumentWebsiteChildTable,
+ DocumentWebsiteChildTableCell,
+ DocumentWebsiteChildTableRow,
+ DocumentWebsiteChildText,
+ DocumentWebsiteChildToDo,
+ DocumentWebsiteChildToolCall,
+ DocumentWebsiteChildToolResult,
+ DocumentWebsiteChildTraceMessage,
+ DocumentWebsiteChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentWebsite(BaseModel):
+ url: str
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentWebsiteChild]] = None
+
+ description: Optional[str] = None
+
+ favicon: Optional[str] = None
+
+ image_url: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["website"]] = None
+
+
+class DocumentTaskChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildCalloutChild: TypeAlias = Union[
+ DocumentTaskChildCalloutChildBlob,
+ DocumentTaskChildCalloutChildCode,
+ DocumentTaskChildCalloutChildComment,
+ DocumentTaskChildCalloutChildDivider,
+ DocumentTaskChildCalloutChildImage,
+ DocumentTaskChildCalloutChildLink,
+ DocumentTaskChildCalloutChildLineBreak,
+ DocumentTaskChildCalloutChildText,
+ DocumentTaskChildCalloutChildToolCall,
+ DocumentTaskChildCalloutChildToolResult,
+ DocumentTaskChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentTaskChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildChunkChild: TypeAlias = Union[
+ DocumentTaskChildChunkChildBlob,
+ DocumentTaskChildChunkChildCode,
+ DocumentTaskChildChunkChildComment,
+ DocumentTaskChildChunkChildDivider,
+ DocumentTaskChildChunkChildImage,
+ DocumentTaskChildChunkChildLink,
+ DocumentTaskChildChunkChildLineBreak,
+ DocumentTaskChildChunkChildText,
+ DocumentTaskChildChunkChildToolCall,
+ DocumentTaskChildChunkChildToolResult,
+ DocumentTaskChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentTaskChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildEquationChild: TypeAlias = Union[
+ DocumentTaskChildEquationChildBlob,
+ DocumentTaskChildEquationChildCode,
+ DocumentTaskChildEquationChildComment,
+ DocumentTaskChildEquationChildDivider,
+ DocumentTaskChildEquationChildImage,
+ DocumentTaskChildEquationChildLink,
+ DocumentTaskChildEquationChildLineBreak,
+ DocumentTaskChildEquationChildText,
+ DocumentTaskChildEquationChildToolCall,
+ DocumentTaskChildEquationChildToolResult,
+ DocumentTaskChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentTaskChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildFootnoteChild: TypeAlias = Union[
+ DocumentTaskChildFootnoteChildBlob,
+ DocumentTaskChildFootnoteChildCode,
+ DocumentTaskChildFootnoteChildComment,
+ DocumentTaskChildFootnoteChildDivider,
+ DocumentTaskChildFootnoteChildImage,
+ DocumentTaskChildFootnoteChildLink,
+ DocumentTaskChildFootnoteChildLineBreak,
+ DocumentTaskChildFootnoteChildText,
+ DocumentTaskChildFootnoteChildToolCall,
+ DocumentTaskChildFootnoteChildToolResult,
+ DocumentTaskChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentTaskChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildHeadingChild: TypeAlias = Union[
+ DocumentTaskChildHeadingChildBlob,
+ DocumentTaskChildHeadingChildCode,
+ DocumentTaskChildHeadingChildComment,
+ DocumentTaskChildHeadingChildDivider,
+ DocumentTaskChildHeadingChildImage,
+ DocumentTaskChildHeadingChildLink,
+ DocumentTaskChildHeadingChildLineBreak,
+ DocumentTaskChildHeadingChildText,
+ DocumentTaskChildHeadingChildToolCall,
+ DocumentTaskChildHeadingChildToolResult,
+ DocumentTaskChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentTaskChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentTaskChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildListItemChild: TypeAlias = Union[
+ DocumentTaskChildListItemChildBlob,
+ DocumentTaskChildListItemChildCode,
+ DocumentTaskChildListItemChildComment,
+ DocumentTaskChildListItemChildDivider,
+ DocumentTaskChildListItemChildImage,
+ DocumentTaskChildListItemChildLink,
+ DocumentTaskChildListItemChildLineBreak,
+ DocumentTaskChildListItemChildText,
+ DocumentTaskChildListItemChildToolCall,
+ DocumentTaskChildListItemChildToolResult,
+ DocumentTaskChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentTaskChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildParagraphChild: TypeAlias = Union[
+ DocumentTaskChildParagraphChildBlob,
+ DocumentTaskChildParagraphChildCode,
+ DocumentTaskChildParagraphChildComment,
+ DocumentTaskChildParagraphChildDivider,
+ DocumentTaskChildParagraphChildImage,
+ DocumentTaskChildParagraphChildLink,
+ DocumentTaskChildParagraphChildLineBreak,
+ DocumentTaskChildParagraphChildText,
+ DocumentTaskChildParagraphChildToolCall,
+ DocumentTaskChildParagraphChildToolResult,
+ DocumentTaskChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentTaskChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildQuoteChild: TypeAlias = Union[
+ DocumentTaskChildQuoteChildBlob,
+ DocumentTaskChildQuoteChildCode,
+ DocumentTaskChildQuoteChildComment,
+ DocumentTaskChildQuoteChildDivider,
+ DocumentTaskChildQuoteChildImage,
+ DocumentTaskChildQuoteChildLink,
+ DocumentTaskChildQuoteChildLineBreak,
+ DocumentTaskChildQuoteChildText,
+ DocumentTaskChildQuoteChildToolCall,
+ DocumentTaskChildQuoteChildToolResult,
+ DocumentTaskChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentTaskChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentTaskChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildTableCellChild: TypeAlias = Union[
+ DocumentTaskChildTableCellChildBlob,
+ DocumentTaskChildTableCellChildCode,
+ DocumentTaskChildTableCellChildComment,
+ DocumentTaskChildTableCellChildDivider,
+ DocumentTaskChildTableCellChildImage,
+ DocumentTaskChildTableCellChildLink,
+ DocumentTaskChildTableCellChildLineBreak,
+ DocumentTaskChildTableCellChildText,
+ DocumentTaskChildTableCellChildToolCall,
+ DocumentTaskChildTableCellChildToolResult,
+ DocumentTaskChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentTaskChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentTaskChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentTaskChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskChildToDoChild: TypeAlias = Union[
+ DocumentTaskChildToDoChildBlob,
+ DocumentTaskChildToDoChildCode,
+ DocumentTaskChildToDoChildComment,
+ DocumentTaskChildToDoChildDivider,
+ DocumentTaskChildToDoChildImage,
+ DocumentTaskChildToDoChildLink,
+ DocumentTaskChildToDoChildLineBreak,
+ DocumentTaskChildToDoChildText,
+ DocumentTaskChildToDoChildToolCall,
+ DocumentTaskChildToDoChildToolResult,
+ DocumentTaskChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentTaskChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentTaskChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentTaskChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentTaskChild: TypeAlias = Annotated[
+ Union[
+ DocumentTaskChildBlob,
+ DocumentTaskChildCallout,
+ DocumentTaskChildChunk,
+ DocumentTaskChildCode,
+ DocumentTaskChildComment,
+ DocumentTaskChildDivider,
+ DocumentTaskChildEquation,
+ DocumentTaskChildFootnote,
+ DocumentTaskChildHeading,
+ DocumentTaskChildImage,
+ DocumentTaskChildLink,
+ DocumentTaskChildLineBreak,
+ DocumentTaskChildList,
+ DocumentTaskChildListItem,
+ DocumentTaskChildParagraph,
+ DocumentTaskChildQuote,
+ DocumentTaskChildTable,
+ DocumentTaskChildTableCell,
+ DocumentTaskChildTableRow,
+ DocumentTaskChildText,
+ DocumentTaskChildToDo,
+ DocumentTaskChildToolCall,
+ DocumentTaskChildToolResult,
+ DocumentTaskChildTraceMessage,
+ DocumentTaskChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentTaskCommentSenderChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentSenderChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentSenderChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentSenderChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentSenderChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentSenderChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentSenderChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentSenderChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentSenderChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentSenderChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentSenderChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentSenderChild: TypeAlias = Union[
+ DocumentTaskCommentSenderChildBlob,
+ DocumentTaskCommentSenderChildCode,
+ DocumentTaskCommentSenderChildComment,
+ DocumentTaskCommentSenderChildDivider,
+ DocumentTaskCommentSenderChildImage,
+ DocumentTaskCommentSenderChildLink,
+ DocumentTaskCommentSenderChildLineBreak,
+ DocumentTaskCommentSenderChildText,
+ DocumentTaskCommentSenderChildToolCall,
+ DocumentTaskCommentSenderChildToolResult,
+ DocumentTaskCommentSenderChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentSender(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentTaskCommentSenderChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentTaskCommentChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildCalloutChild: TypeAlias = Union[
+ DocumentTaskCommentChildCalloutChildBlob,
+ DocumentTaskCommentChildCalloutChildCode,
+ DocumentTaskCommentChildCalloutChildComment,
+ DocumentTaskCommentChildCalloutChildDivider,
+ DocumentTaskCommentChildCalloutChildImage,
+ DocumentTaskCommentChildCalloutChildLink,
+ DocumentTaskCommentChildCalloutChildLineBreak,
+ DocumentTaskCommentChildCalloutChildText,
+ DocumentTaskCommentChildCalloutChildToolCall,
+ DocumentTaskCommentChildCalloutChildToolResult,
+ DocumentTaskCommentChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentTaskCommentChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildChunkChild: TypeAlias = Union[
+ DocumentTaskCommentChildChunkChildBlob,
+ DocumentTaskCommentChildChunkChildCode,
+ DocumentTaskCommentChildChunkChildComment,
+ DocumentTaskCommentChildChunkChildDivider,
+ DocumentTaskCommentChildChunkChildImage,
+ DocumentTaskCommentChildChunkChildLink,
+ DocumentTaskCommentChildChunkChildLineBreak,
+ DocumentTaskCommentChildChunkChildText,
+ DocumentTaskCommentChildChunkChildToolCall,
+ DocumentTaskCommentChildChunkChildToolResult,
+ DocumentTaskCommentChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentTaskCommentChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildEquationChild: TypeAlias = Union[
+ DocumentTaskCommentChildEquationChildBlob,
+ DocumentTaskCommentChildEquationChildCode,
+ DocumentTaskCommentChildEquationChildComment,
+ DocumentTaskCommentChildEquationChildDivider,
+ DocumentTaskCommentChildEquationChildImage,
+ DocumentTaskCommentChildEquationChildLink,
+ DocumentTaskCommentChildEquationChildLineBreak,
+ DocumentTaskCommentChildEquationChildText,
+ DocumentTaskCommentChildEquationChildToolCall,
+ DocumentTaskCommentChildEquationChildToolResult,
+ DocumentTaskCommentChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildFootnoteChild: TypeAlias = Union[
+ DocumentTaskCommentChildFootnoteChildBlob,
+ DocumentTaskCommentChildFootnoteChildCode,
+ DocumentTaskCommentChildFootnoteChildComment,
+ DocumentTaskCommentChildFootnoteChildDivider,
+ DocumentTaskCommentChildFootnoteChildImage,
+ DocumentTaskCommentChildFootnoteChildLink,
+ DocumentTaskCommentChildFootnoteChildLineBreak,
+ DocumentTaskCommentChildFootnoteChildText,
+ DocumentTaskCommentChildFootnoteChildToolCall,
+ DocumentTaskCommentChildFootnoteChildToolResult,
+ DocumentTaskCommentChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildHeadingChild: TypeAlias = Union[
+ DocumentTaskCommentChildHeadingChildBlob,
+ DocumentTaskCommentChildHeadingChildCode,
+ DocumentTaskCommentChildHeadingChildComment,
+ DocumentTaskCommentChildHeadingChildDivider,
+ DocumentTaskCommentChildHeadingChildImage,
+ DocumentTaskCommentChildHeadingChildLink,
+ DocumentTaskCommentChildHeadingChildLineBreak,
+ DocumentTaskCommentChildHeadingChildText,
+ DocumentTaskCommentChildHeadingChildToolCall,
+ DocumentTaskCommentChildHeadingChildToolResult,
+ DocumentTaskCommentChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentTaskCommentChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentTaskCommentChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildListItemChild: TypeAlias = Union[
+ DocumentTaskCommentChildListItemChildBlob,
+ DocumentTaskCommentChildListItemChildCode,
+ DocumentTaskCommentChildListItemChildComment,
+ DocumentTaskCommentChildListItemChildDivider,
+ DocumentTaskCommentChildListItemChildImage,
+ DocumentTaskCommentChildListItemChildLink,
+ DocumentTaskCommentChildListItemChildLineBreak,
+ DocumentTaskCommentChildListItemChildText,
+ DocumentTaskCommentChildListItemChildToolCall,
+ DocumentTaskCommentChildListItemChildToolResult,
+ DocumentTaskCommentChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildParagraphChild: TypeAlias = Union[
+ DocumentTaskCommentChildParagraphChildBlob,
+ DocumentTaskCommentChildParagraphChildCode,
+ DocumentTaskCommentChildParagraphChildComment,
+ DocumentTaskCommentChildParagraphChildDivider,
+ DocumentTaskCommentChildParagraphChildImage,
+ DocumentTaskCommentChildParagraphChildLink,
+ DocumentTaskCommentChildParagraphChildLineBreak,
+ DocumentTaskCommentChildParagraphChildText,
+ DocumentTaskCommentChildParagraphChildToolCall,
+ DocumentTaskCommentChildParagraphChildToolResult,
+ DocumentTaskCommentChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildQuoteChild: TypeAlias = Union[
+ DocumentTaskCommentChildQuoteChildBlob,
+ DocumentTaskCommentChildQuoteChildCode,
+ DocumentTaskCommentChildQuoteChildComment,
+ DocumentTaskCommentChildQuoteChildDivider,
+ DocumentTaskCommentChildQuoteChildImage,
+ DocumentTaskCommentChildQuoteChildLink,
+ DocumentTaskCommentChildQuoteChildLineBreak,
+ DocumentTaskCommentChildQuoteChildText,
+ DocumentTaskCommentChildQuoteChildToolCall,
+ DocumentTaskCommentChildQuoteChildToolResult,
+ DocumentTaskCommentChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskCommentChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentTaskCommentChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildTableCellChild: TypeAlias = Union[
+ DocumentTaskCommentChildTableCellChildBlob,
+ DocumentTaskCommentChildTableCellChildCode,
+ DocumentTaskCommentChildTableCellChildComment,
+ DocumentTaskCommentChildTableCellChildDivider,
+ DocumentTaskCommentChildTableCellChildImage,
+ DocumentTaskCommentChildTableCellChildLink,
+ DocumentTaskCommentChildTableCellChildLineBreak,
+ DocumentTaskCommentChildTableCellChildText,
+ DocumentTaskCommentChildTableCellChildToolCall,
+ DocumentTaskCommentChildTableCellChildToolResult,
+ DocumentTaskCommentChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentTaskCommentChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentTaskCommentChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentTaskCommentChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentChildToDoChild: TypeAlias = Union[
+ DocumentTaskCommentChildToDoChildBlob,
+ DocumentTaskCommentChildToDoChildCode,
+ DocumentTaskCommentChildToDoChildComment,
+ DocumentTaskCommentChildToDoChildDivider,
+ DocumentTaskCommentChildToDoChildImage,
+ DocumentTaskCommentChildToDoChildLink,
+ DocumentTaskCommentChildToDoChildLineBreak,
+ DocumentTaskCommentChildToDoChildText,
+ DocumentTaskCommentChildToDoChildToolCall,
+ DocumentTaskCommentChildToDoChildToolResult,
+ DocumentTaskCommentChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentTaskCommentChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentTaskCommentChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentTaskCommentChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentTaskCommentChild: TypeAlias = Annotated[
+ Union[
+ DocumentTaskCommentChildBlob,
+ DocumentTaskCommentChildCallout,
+ DocumentTaskCommentChildChunk,
+ DocumentTaskCommentChildCode,
+ DocumentTaskCommentChildComment,
+ DocumentTaskCommentChildDivider,
+ DocumentTaskCommentChildEquation,
+ DocumentTaskCommentChildFootnote,
+ DocumentTaskCommentChildHeading,
+ DocumentTaskCommentChildImage,
+ DocumentTaskCommentChildLink,
+ DocumentTaskCommentChildLineBreak,
+ DocumentTaskCommentChildList,
+ DocumentTaskCommentChildListItem,
+ DocumentTaskCommentChildParagraph,
+ DocumentTaskCommentChildQuote,
+ DocumentTaskCommentChildTable,
+ DocumentTaskCommentChildTableCell,
+ DocumentTaskCommentChildTableRow,
+ DocumentTaskCommentChildText,
+ DocumentTaskCommentChildToDo,
+ DocumentTaskCommentChildToolCall,
+ DocumentTaskCommentChildToolResult,
+ DocumentTaskCommentChildTraceMessage,
+ DocumentTaskCommentChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentTaskCommentMentionedUserChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTaskCommentMentionedUserChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTaskCommentMentionedUserChild: TypeAlias = Union[
+ DocumentTaskCommentMentionedUserChildBlob,
+ DocumentTaskCommentMentionedUserChildCode,
+ DocumentTaskCommentMentionedUserChildComment,
+ DocumentTaskCommentMentionedUserChildDivider,
+ DocumentTaskCommentMentionedUserChildImage,
+ DocumentTaskCommentMentionedUserChildLink,
+ DocumentTaskCommentMentionedUserChildLineBreak,
+ DocumentTaskCommentMentionedUserChildText,
+ DocumentTaskCommentMentionedUserChildToolCall,
+ DocumentTaskCommentMentionedUserChildToolResult,
+ DocumentTaskCommentMentionedUserChildTraceMessage,
+ object,
+]
+
+
+class DocumentTaskCommentMentionedUser(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentTaskCommentMentionedUserChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentTaskComment(BaseModel):
+ date: datetime
+
+ sender: DocumentTaskCommentSender
+
+ id: Optional[str] = None
+
+ channel: Optional[str] = None
+ """
+ The channel or platform where the message was posted, if this Message is not
+ explicitly part of a conversation
+ """
+
+ children: Optional[List[DocumentTaskCommentChild]] = None
+
+ external_id: Optional[str] = None
+ """Provider message id (e.g. Slack ts, Gmail message id) — merge-dedup key"""
+
+ is_self: Optional[bool] = None
+
+ mentioned_users: Optional[List[DocumentTaskCommentMentionedUser]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ num_replies: Optional[int] = None
+
+ replies: Optional[List[object]] = None
+ """The replies or comments to the message"""
+
+ text: Optional[str] = None
+
+ thread_id: Optional[str] = None
+
+ title: Optional[str] = None
+ """The subject or title of the message"""
+
+ type: Optional[Literal["message"]] = None
+
+ updated_at: Optional[datetime] = None
+
+ upvotes: Optional[int] = None
+ """The number of upvotes, likes, or reactions on the message"""
+
+
+class DocumentTask(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTaskChild]] = None
+
+ comments: Optional[List[DocumentTaskComment]] = None
+
+ due_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ priority: Optional[Literal["urgent", "high", "medium", "low"]] = None
+
+ status: Optional[Literal["completed", "not_started", "in_progress", "cancelled"]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["task"]] = None
+
+
+class DocumentPersonChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentPersonChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentPersonChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentPersonChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentPersonChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentPersonChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentPersonChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentPersonChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentPersonChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentPersonChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentPersonChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentPersonChild: TypeAlias = Union[
+ DocumentPersonChildBlob,
+ DocumentPersonChildCode,
+ DocumentPersonChildComment,
+ DocumentPersonChildDivider,
+ DocumentPersonChildImage,
+ DocumentPersonChildLink,
+ DocumentPersonChildLineBreak,
+ DocumentPersonChildText,
+ DocumentPersonChildToolCall,
+ DocumentPersonChildToolResult,
+ DocumentPersonChildTraceMessage,
+ object,
+]
+
+
+class DocumentPerson(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentPersonChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentMessageSenderChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageSenderChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageSenderChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageSenderChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageSenderChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageSenderChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageSenderChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageSenderChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageSenderChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageSenderChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageSenderChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageSenderChild: TypeAlias = Union[
+ DocumentMessageSenderChildBlob,
+ DocumentMessageSenderChildCode,
+ DocumentMessageSenderChildComment,
+ DocumentMessageSenderChildDivider,
+ DocumentMessageSenderChildImage,
+ DocumentMessageSenderChildLink,
+ DocumentMessageSenderChildLineBreak,
+ DocumentMessageSenderChildText,
+ DocumentMessageSenderChildToolCall,
+ DocumentMessageSenderChildToolResult,
+ DocumentMessageSenderChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageSender(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentMessageSenderChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentMessageChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildCalloutChild: TypeAlias = Union[
+ DocumentMessageChildCalloutChildBlob,
+ DocumentMessageChildCalloutChildCode,
+ DocumentMessageChildCalloutChildComment,
+ DocumentMessageChildCalloutChildDivider,
+ DocumentMessageChildCalloutChildImage,
+ DocumentMessageChildCalloutChildLink,
+ DocumentMessageChildCalloutChildLineBreak,
+ DocumentMessageChildCalloutChildText,
+ DocumentMessageChildCalloutChildToolCall,
+ DocumentMessageChildCalloutChildToolResult,
+ DocumentMessageChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentMessageChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildChunkChild: TypeAlias = Union[
+ DocumentMessageChildChunkChildBlob,
+ DocumentMessageChildChunkChildCode,
+ DocumentMessageChildChunkChildComment,
+ DocumentMessageChildChunkChildDivider,
+ DocumentMessageChildChunkChildImage,
+ DocumentMessageChildChunkChildLink,
+ DocumentMessageChildChunkChildLineBreak,
+ DocumentMessageChildChunkChildText,
+ DocumentMessageChildChunkChildToolCall,
+ DocumentMessageChildChunkChildToolResult,
+ DocumentMessageChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentMessageChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildEquationChild: TypeAlias = Union[
+ DocumentMessageChildEquationChildBlob,
+ DocumentMessageChildEquationChildCode,
+ DocumentMessageChildEquationChildComment,
+ DocumentMessageChildEquationChildDivider,
+ DocumentMessageChildEquationChildImage,
+ DocumentMessageChildEquationChildLink,
+ DocumentMessageChildEquationChildLineBreak,
+ DocumentMessageChildEquationChildText,
+ DocumentMessageChildEquationChildToolCall,
+ DocumentMessageChildEquationChildToolResult,
+ DocumentMessageChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentMessageChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildFootnoteChild: TypeAlias = Union[
+ DocumentMessageChildFootnoteChildBlob,
+ DocumentMessageChildFootnoteChildCode,
+ DocumentMessageChildFootnoteChildComment,
+ DocumentMessageChildFootnoteChildDivider,
+ DocumentMessageChildFootnoteChildImage,
+ DocumentMessageChildFootnoteChildLink,
+ DocumentMessageChildFootnoteChildLineBreak,
+ DocumentMessageChildFootnoteChildText,
+ DocumentMessageChildFootnoteChildToolCall,
+ DocumentMessageChildFootnoteChildToolResult,
+ DocumentMessageChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentMessageChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildHeadingChild: TypeAlias = Union[
+ DocumentMessageChildHeadingChildBlob,
+ DocumentMessageChildHeadingChildCode,
+ DocumentMessageChildHeadingChildComment,
+ DocumentMessageChildHeadingChildDivider,
+ DocumentMessageChildHeadingChildImage,
+ DocumentMessageChildHeadingChildLink,
+ DocumentMessageChildHeadingChildLineBreak,
+ DocumentMessageChildHeadingChildText,
+ DocumentMessageChildHeadingChildToolCall,
+ DocumentMessageChildHeadingChildToolResult,
+ DocumentMessageChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentMessageChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentMessageChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildListItemChild: TypeAlias = Union[
+ DocumentMessageChildListItemChildBlob,
+ DocumentMessageChildListItemChildCode,
+ DocumentMessageChildListItemChildComment,
+ DocumentMessageChildListItemChildDivider,
+ DocumentMessageChildListItemChildImage,
+ DocumentMessageChildListItemChildLink,
+ DocumentMessageChildListItemChildLineBreak,
+ DocumentMessageChildListItemChildText,
+ DocumentMessageChildListItemChildToolCall,
+ DocumentMessageChildListItemChildToolResult,
+ DocumentMessageChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentMessageChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildParagraphChild: TypeAlias = Union[
+ DocumentMessageChildParagraphChildBlob,
+ DocumentMessageChildParagraphChildCode,
+ DocumentMessageChildParagraphChildComment,
+ DocumentMessageChildParagraphChildDivider,
+ DocumentMessageChildParagraphChildImage,
+ DocumentMessageChildParagraphChildLink,
+ DocumentMessageChildParagraphChildLineBreak,
+ DocumentMessageChildParagraphChildText,
+ DocumentMessageChildParagraphChildToolCall,
+ DocumentMessageChildParagraphChildToolResult,
+ DocumentMessageChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentMessageChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildQuoteChild: TypeAlias = Union[
+ DocumentMessageChildQuoteChildBlob,
+ DocumentMessageChildQuoteChildCode,
+ DocumentMessageChildQuoteChildComment,
+ DocumentMessageChildQuoteChildDivider,
+ DocumentMessageChildQuoteChildImage,
+ DocumentMessageChildQuoteChildLink,
+ DocumentMessageChildQuoteChildLineBreak,
+ DocumentMessageChildQuoteChildText,
+ DocumentMessageChildQuoteChildToolCall,
+ DocumentMessageChildQuoteChildToolResult,
+ DocumentMessageChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentMessageChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentMessageChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentMessageChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildTableCellChild: TypeAlias = Union[
+ DocumentMessageChildTableCellChildBlob,
+ DocumentMessageChildTableCellChildCode,
+ DocumentMessageChildTableCellChildComment,
+ DocumentMessageChildTableCellChildDivider,
+ DocumentMessageChildTableCellChildImage,
+ DocumentMessageChildTableCellChildLink,
+ DocumentMessageChildTableCellChildLineBreak,
+ DocumentMessageChildTableCellChildText,
+ DocumentMessageChildTableCellChildToolCall,
+ DocumentMessageChildTableCellChildToolResult,
+ DocumentMessageChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentMessageChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentMessageChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentMessageChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageChildToDoChild: TypeAlias = Union[
+ DocumentMessageChildToDoChildBlob,
+ DocumentMessageChildToDoChildCode,
+ DocumentMessageChildToDoChildComment,
+ DocumentMessageChildToDoChildDivider,
+ DocumentMessageChildToDoChildImage,
+ DocumentMessageChildToDoChildLink,
+ DocumentMessageChildToDoChildLineBreak,
+ DocumentMessageChildToDoChildText,
+ DocumentMessageChildToDoChildToolCall,
+ DocumentMessageChildToDoChildToolResult,
+ DocumentMessageChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentMessageChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentMessageChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentMessageChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentMessageChild: TypeAlias = Annotated[
+ Union[
+ DocumentMessageChildBlob,
+ DocumentMessageChildCallout,
+ DocumentMessageChildChunk,
+ DocumentMessageChildCode,
+ DocumentMessageChildComment,
+ DocumentMessageChildDivider,
+ DocumentMessageChildEquation,
+ DocumentMessageChildFootnote,
+ DocumentMessageChildHeading,
+ DocumentMessageChildImage,
+ DocumentMessageChildLink,
+ DocumentMessageChildLineBreak,
+ DocumentMessageChildList,
+ DocumentMessageChildListItem,
+ DocumentMessageChildParagraph,
+ DocumentMessageChildQuote,
+ DocumentMessageChildTable,
+ DocumentMessageChildTableCell,
+ DocumentMessageChildTableRow,
+ DocumentMessageChildText,
+ DocumentMessageChildToDo,
+ DocumentMessageChildToolCall,
+ DocumentMessageChildToolResult,
+ DocumentMessageChildTraceMessage,
+ DocumentMessageChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentMessageMentionedUserChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentMessageMentionedUserChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentMessageMentionedUserChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentMessageMentionedUserChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentMessageMentionedUserChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentMessageMentionedUserChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentMessageMentionedUserChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentMessageMentionedUserChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentMessageMentionedUserChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentMessageMentionedUserChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentMessageMentionedUserChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentMessageMentionedUserChild: TypeAlias = Union[
+ DocumentMessageMentionedUserChildBlob,
+ DocumentMessageMentionedUserChildCode,
+ DocumentMessageMentionedUserChildComment,
+ DocumentMessageMentionedUserChildDivider,
+ DocumentMessageMentionedUserChildImage,
+ DocumentMessageMentionedUserChildLink,
+ DocumentMessageMentionedUserChildLineBreak,
+ DocumentMessageMentionedUserChildText,
+ DocumentMessageMentionedUserChildToolCall,
+ DocumentMessageMentionedUserChildToolResult,
+ DocumentMessageMentionedUserChildTraceMessage,
+ object,
+]
+
+
+class DocumentMessageMentionedUser(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentMessageMentionedUserChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentMessage(BaseModel):
+ date: datetime
+
+ sender: DocumentMessageSender
+
+ id: Optional[str] = None
+
+ channel: Optional[str] = None
+ """
+ The channel or platform where the message was posted, if this Message is not
+ explicitly part of a conversation
+ """
+
+ children: Optional[List[DocumentMessageChild]] = None
+
+ external_id: Optional[str] = None
+ """Provider message id (e.g. Slack ts, Gmail message id) — merge-dedup key"""
+
+ is_self: Optional[bool] = None
+
+ mentioned_users: Optional[List[DocumentMessageMentionedUser]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ num_replies: Optional[int] = None
+
+ replies: Optional[List[object]] = None
+ """The replies or comments to the message"""
+
+ text: Optional[str] = None
+
+ thread_id: Optional[str] = None
+
+ title: Optional[str] = None
+ """The subject or title of the message"""
+
+ type: Optional[Literal["message"]] = None
+
+ updated_at: Optional[datetime] = None
+
+ upvotes: Optional[int] = None
+ """The number of upvotes, likes, or reactions on the message"""
+
+
+class DocumentEventAttendeeChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventAttendeeChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventAttendeeChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventAttendeeChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventAttendeeChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventAttendeeChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventAttendeeChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventAttendeeChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventAttendeeChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventAttendeeChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventAttendeeChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventAttendeeChild: TypeAlias = Union[
+ DocumentEventAttendeeChildBlob,
+ DocumentEventAttendeeChildCode,
+ DocumentEventAttendeeChildComment,
+ DocumentEventAttendeeChildDivider,
+ DocumentEventAttendeeChildImage,
+ DocumentEventAttendeeChildLink,
+ DocumentEventAttendeeChildLineBreak,
+ DocumentEventAttendeeChildText,
+ DocumentEventAttendeeChildToolCall,
+ DocumentEventAttendeeChildToolResult,
+ DocumentEventAttendeeChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventAttendee(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentEventAttendeeChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentEventChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildCalloutChild: TypeAlias = Union[
+ DocumentEventChildCalloutChildBlob,
+ DocumentEventChildCalloutChildCode,
+ DocumentEventChildCalloutChildComment,
+ DocumentEventChildCalloutChildDivider,
+ DocumentEventChildCalloutChildImage,
+ DocumentEventChildCalloutChildLink,
+ DocumentEventChildCalloutChildLineBreak,
+ DocumentEventChildCalloutChildText,
+ DocumentEventChildCalloutChildToolCall,
+ DocumentEventChildCalloutChildToolResult,
+ DocumentEventChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentEventChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildChunkChild: TypeAlias = Union[
+ DocumentEventChildChunkChildBlob,
+ DocumentEventChildChunkChildCode,
+ DocumentEventChildChunkChildComment,
+ DocumentEventChildChunkChildDivider,
+ DocumentEventChildChunkChildImage,
+ DocumentEventChildChunkChildLink,
+ DocumentEventChildChunkChildLineBreak,
+ DocumentEventChildChunkChildText,
+ DocumentEventChildChunkChildToolCall,
+ DocumentEventChildChunkChildToolResult,
+ DocumentEventChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentEventChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildEquationChild: TypeAlias = Union[
+ DocumentEventChildEquationChildBlob,
+ DocumentEventChildEquationChildCode,
+ DocumentEventChildEquationChildComment,
+ DocumentEventChildEquationChildDivider,
+ DocumentEventChildEquationChildImage,
+ DocumentEventChildEquationChildLink,
+ DocumentEventChildEquationChildLineBreak,
+ DocumentEventChildEquationChildText,
+ DocumentEventChildEquationChildToolCall,
+ DocumentEventChildEquationChildToolResult,
+ DocumentEventChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentEventChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildFootnoteChild: TypeAlias = Union[
+ DocumentEventChildFootnoteChildBlob,
+ DocumentEventChildFootnoteChildCode,
+ DocumentEventChildFootnoteChildComment,
+ DocumentEventChildFootnoteChildDivider,
+ DocumentEventChildFootnoteChildImage,
+ DocumentEventChildFootnoteChildLink,
+ DocumentEventChildFootnoteChildLineBreak,
+ DocumentEventChildFootnoteChildText,
+ DocumentEventChildFootnoteChildToolCall,
+ DocumentEventChildFootnoteChildToolResult,
+ DocumentEventChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentEventChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildHeadingChild: TypeAlias = Union[
+ DocumentEventChildHeadingChildBlob,
+ DocumentEventChildHeadingChildCode,
+ DocumentEventChildHeadingChildComment,
+ DocumentEventChildHeadingChildDivider,
+ DocumentEventChildHeadingChildImage,
+ DocumentEventChildHeadingChildLink,
+ DocumentEventChildHeadingChildLineBreak,
+ DocumentEventChildHeadingChildText,
+ DocumentEventChildHeadingChildToolCall,
+ DocumentEventChildHeadingChildToolResult,
+ DocumentEventChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentEventChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentEventChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildListItemChild: TypeAlias = Union[
+ DocumentEventChildListItemChildBlob,
+ DocumentEventChildListItemChildCode,
+ DocumentEventChildListItemChildComment,
+ DocumentEventChildListItemChildDivider,
+ DocumentEventChildListItemChildImage,
+ DocumentEventChildListItemChildLink,
+ DocumentEventChildListItemChildLineBreak,
+ DocumentEventChildListItemChildText,
+ DocumentEventChildListItemChildToolCall,
+ DocumentEventChildListItemChildToolResult,
+ DocumentEventChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentEventChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildParagraphChild: TypeAlias = Union[
+ DocumentEventChildParagraphChildBlob,
+ DocumentEventChildParagraphChildCode,
+ DocumentEventChildParagraphChildComment,
+ DocumentEventChildParagraphChildDivider,
+ DocumentEventChildParagraphChildImage,
+ DocumentEventChildParagraphChildLink,
+ DocumentEventChildParagraphChildLineBreak,
+ DocumentEventChildParagraphChildText,
+ DocumentEventChildParagraphChildToolCall,
+ DocumentEventChildParagraphChildToolResult,
+ DocumentEventChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentEventChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildQuoteChild: TypeAlias = Union[
+ DocumentEventChildQuoteChildBlob,
+ DocumentEventChildQuoteChildCode,
+ DocumentEventChildQuoteChildComment,
+ DocumentEventChildQuoteChildDivider,
+ DocumentEventChildQuoteChildImage,
+ DocumentEventChildQuoteChildLink,
+ DocumentEventChildQuoteChildLineBreak,
+ DocumentEventChildQuoteChildText,
+ DocumentEventChildQuoteChildToolCall,
+ DocumentEventChildQuoteChildToolResult,
+ DocumentEventChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentEventChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentEventChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentEventChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildTableCellChild: TypeAlias = Union[
+ DocumentEventChildTableCellChildBlob,
+ DocumentEventChildTableCellChildCode,
+ DocumentEventChildTableCellChildComment,
+ DocumentEventChildTableCellChildDivider,
+ DocumentEventChildTableCellChildImage,
+ DocumentEventChildTableCellChildLink,
+ DocumentEventChildTableCellChildLineBreak,
+ DocumentEventChildTableCellChildText,
+ DocumentEventChildTableCellChildToolCall,
+ DocumentEventChildTableCellChildToolResult,
+ DocumentEventChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentEventChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentEventChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentEventChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentEventChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentEventChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentEventChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentEventChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentEventChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentEventChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentEventChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentEventChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentEventChildToDoChild: TypeAlias = Union[
+ DocumentEventChildToDoChildBlob,
+ DocumentEventChildToDoChildCode,
+ DocumentEventChildToDoChildComment,
+ DocumentEventChildToDoChildDivider,
+ DocumentEventChildToDoChildImage,
+ DocumentEventChildToDoChildLink,
+ DocumentEventChildToDoChildLineBreak,
+ DocumentEventChildToDoChildText,
+ DocumentEventChildToDoChildToolCall,
+ DocumentEventChildToDoChildToolResult,
+ DocumentEventChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentEventChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentEventChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentEventChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentEventChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentEventChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentEventChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentEventChild: TypeAlias = Annotated[
+ Union[
+ DocumentEventChildBlob,
+ DocumentEventChildCallout,
+ DocumentEventChildChunk,
+ DocumentEventChildCode,
+ DocumentEventChildComment,
+ DocumentEventChildDivider,
+ DocumentEventChildEquation,
+ DocumentEventChildFootnote,
+ DocumentEventChildHeading,
+ DocumentEventChildImage,
+ DocumentEventChildLink,
+ DocumentEventChildLineBreak,
+ DocumentEventChildList,
+ DocumentEventChildListItem,
+ DocumentEventChildParagraph,
+ DocumentEventChildQuote,
+ DocumentEventChildTable,
+ DocumentEventChildTableCell,
+ DocumentEventChildTableRow,
+ DocumentEventChildText,
+ DocumentEventChildToDo,
+ DocumentEventChildToolCall,
+ DocumentEventChildToolResult,
+ DocumentEventChildTraceMessage,
+ DocumentEventChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentEvent(BaseModel):
+ id: Optional[str] = None
+
+ attendees: Optional[List[DocumentEventAttendee]] = None
+
+ children: Optional[List[DocumentEventChild]] = None
+
+ end_at: Optional[datetime] = None
+
+ location: Optional[str] = None
+
+ meeting_url: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ start_at: Optional[datetime] = None
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["event"]] = None
+
+
+class DocumentFileChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildCalloutChild: TypeAlias = Union[
+ DocumentFileChildCalloutChildBlob,
+ DocumentFileChildCalloutChildCode,
+ DocumentFileChildCalloutChildComment,
+ DocumentFileChildCalloutChildDivider,
+ DocumentFileChildCalloutChildImage,
+ DocumentFileChildCalloutChildLink,
+ DocumentFileChildCalloutChildLineBreak,
+ DocumentFileChildCalloutChildText,
+ DocumentFileChildCalloutChildToolCall,
+ DocumentFileChildCalloutChildToolResult,
+ DocumentFileChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentFileChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildChunkChild: TypeAlias = Union[
+ DocumentFileChildChunkChildBlob,
+ DocumentFileChildChunkChildCode,
+ DocumentFileChildChunkChildComment,
+ DocumentFileChildChunkChildDivider,
+ DocumentFileChildChunkChildImage,
+ DocumentFileChildChunkChildLink,
+ DocumentFileChildChunkChildLineBreak,
+ DocumentFileChildChunkChildText,
+ DocumentFileChildChunkChildToolCall,
+ DocumentFileChildChunkChildToolResult,
+ DocumentFileChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentFileChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildEquationChild: TypeAlias = Union[
+ DocumentFileChildEquationChildBlob,
+ DocumentFileChildEquationChildCode,
+ DocumentFileChildEquationChildComment,
+ DocumentFileChildEquationChildDivider,
+ DocumentFileChildEquationChildImage,
+ DocumentFileChildEquationChildLink,
+ DocumentFileChildEquationChildLineBreak,
+ DocumentFileChildEquationChildText,
+ DocumentFileChildEquationChildToolCall,
+ DocumentFileChildEquationChildToolResult,
+ DocumentFileChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentFileChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildFootnoteChild: TypeAlias = Union[
+ DocumentFileChildFootnoteChildBlob,
+ DocumentFileChildFootnoteChildCode,
+ DocumentFileChildFootnoteChildComment,
+ DocumentFileChildFootnoteChildDivider,
+ DocumentFileChildFootnoteChildImage,
+ DocumentFileChildFootnoteChildLink,
+ DocumentFileChildFootnoteChildLineBreak,
+ DocumentFileChildFootnoteChildText,
+ DocumentFileChildFootnoteChildToolCall,
+ DocumentFileChildFootnoteChildToolResult,
+ DocumentFileChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentFileChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildHeadingChild: TypeAlias = Union[
+ DocumentFileChildHeadingChildBlob,
+ DocumentFileChildHeadingChildCode,
+ DocumentFileChildHeadingChildComment,
+ DocumentFileChildHeadingChildDivider,
+ DocumentFileChildHeadingChildImage,
+ DocumentFileChildHeadingChildLink,
+ DocumentFileChildHeadingChildLineBreak,
+ DocumentFileChildHeadingChildText,
+ DocumentFileChildHeadingChildToolCall,
+ DocumentFileChildHeadingChildToolResult,
+ DocumentFileChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentFileChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentFileChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildListItemChild: TypeAlias = Union[
+ DocumentFileChildListItemChildBlob,
+ DocumentFileChildListItemChildCode,
+ DocumentFileChildListItemChildComment,
+ DocumentFileChildListItemChildDivider,
+ DocumentFileChildListItemChildImage,
+ DocumentFileChildListItemChildLink,
+ DocumentFileChildListItemChildLineBreak,
+ DocumentFileChildListItemChildText,
+ DocumentFileChildListItemChildToolCall,
+ DocumentFileChildListItemChildToolResult,
+ DocumentFileChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentFileChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildParagraphChild: TypeAlias = Union[
+ DocumentFileChildParagraphChildBlob,
+ DocumentFileChildParagraphChildCode,
+ DocumentFileChildParagraphChildComment,
+ DocumentFileChildParagraphChildDivider,
+ DocumentFileChildParagraphChildImage,
+ DocumentFileChildParagraphChildLink,
+ DocumentFileChildParagraphChildLineBreak,
+ DocumentFileChildParagraphChildText,
+ DocumentFileChildParagraphChildToolCall,
+ DocumentFileChildParagraphChildToolResult,
+ DocumentFileChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentFileChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildQuoteChild: TypeAlias = Union[
+ DocumentFileChildQuoteChildBlob,
+ DocumentFileChildQuoteChildCode,
+ DocumentFileChildQuoteChildComment,
+ DocumentFileChildQuoteChildDivider,
+ DocumentFileChildQuoteChildImage,
+ DocumentFileChildQuoteChildLink,
+ DocumentFileChildQuoteChildLineBreak,
+ DocumentFileChildQuoteChildText,
+ DocumentFileChildQuoteChildToolCall,
+ DocumentFileChildQuoteChildToolResult,
+ DocumentFileChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentFileChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentFileChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildTableCellChild: TypeAlias = Union[
+ DocumentFileChildTableCellChildBlob,
+ DocumentFileChildTableCellChildCode,
+ DocumentFileChildTableCellChildComment,
+ DocumentFileChildTableCellChildDivider,
+ DocumentFileChildTableCellChildImage,
+ DocumentFileChildTableCellChildLink,
+ DocumentFileChildTableCellChildLineBreak,
+ DocumentFileChildTableCellChildText,
+ DocumentFileChildTableCellChildToolCall,
+ DocumentFileChildTableCellChildToolResult,
+ DocumentFileChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentFileChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentFileChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentFileChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentFileChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentFileChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentFileChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentFileChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentFileChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentFileChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentFileChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentFileChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentFileChildToDoChild: TypeAlias = Union[
+ DocumentFileChildToDoChildBlob,
+ DocumentFileChildToDoChildCode,
+ DocumentFileChildToDoChildComment,
+ DocumentFileChildToDoChildDivider,
+ DocumentFileChildToDoChildImage,
+ DocumentFileChildToDoChildLink,
+ DocumentFileChildToDoChildLineBreak,
+ DocumentFileChildToDoChildText,
+ DocumentFileChildToDoChildToolCall,
+ DocumentFileChildToDoChildToolResult,
+ DocumentFileChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentFileChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentFileChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentFileChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentFileChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentFileChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentFileChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentFileChild: TypeAlias = Annotated[
+ Union[
+ DocumentFileChildBlob,
+ DocumentFileChildCallout,
+ DocumentFileChildChunk,
+ DocumentFileChildCode,
+ DocumentFileChildComment,
+ DocumentFileChildDivider,
+ DocumentFileChildEquation,
+ DocumentFileChildFootnote,
+ DocumentFileChildHeading,
+ DocumentFileChildImage,
+ DocumentFileChildLink,
+ DocumentFileChildLineBreak,
+ DocumentFileChildList,
+ DocumentFileChildListItem,
+ DocumentFileChildParagraph,
+ DocumentFileChildQuote,
+ DocumentFileChildTable,
+ DocumentFileChildTableCell,
+ DocumentFileChildTableRow,
+ DocumentFileChildText,
+ DocumentFileChildToDo,
+ DocumentFileChildToolCall,
+ DocumentFileChildToolResult,
+ DocumentFileChildTraceMessage,
+ DocumentFileChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentFile(BaseModel):
+ content_type: str
+
+ filename: str
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentFileChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ path: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["file"]] = None
+
+
+class DocumentConversationChildSenderChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildSenderChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildSenderChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildSenderChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildSenderChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildSenderChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildSenderChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildSenderChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildSenderChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildSenderChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildSenderChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildSenderChild: TypeAlias = Union[
+ DocumentConversationChildSenderChildBlob,
+ DocumentConversationChildSenderChildCode,
+ DocumentConversationChildSenderChildComment,
+ DocumentConversationChildSenderChildDivider,
+ DocumentConversationChildSenderChildImage,
+ DocumentConversationChildSenderChildLink,
+ DocumentConversationChildSenderChildLineBreak,
+ DocumentConversationChildSenderChildText,
+ DocumentConversationChildSenderChildToolCall,
+ DocumentConversationChildSenderChildToolResult,
+ DocumentConversationChildSenderChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildSender(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentConversationChildSenderChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentConversationChildChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildCalloutChild: TypeAlias = Union[
+ DocumentConversationChildChildCalloutChildBlob,
+ DocumentConversationChildChildCalloutChildCode,
+ DocumentConversationChildChildCalloutChildComment,
+ DocumentConversationChildChildCalloutChildDivider,
+ DocumentConversationChildChildCalloutChildImage,
+ DocumentConversationChildChildCalloutChildLink,
+ DocumentConversationChildChildCalloutChildLineBreak,
+ DocumentConversationChildChildCalloutChildText,
+ DocumentConversationChildChildCalloutChildToolCall,
+ DocumentConversationChildChildCalloutChildToolResult,
+ DocumentConversationChildChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentConversationChildChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildChunkChild: TypeAlias = Union[
+ DocumentConversationChildChildChunkChildBlob,
+ DocumentConversationChildChildChunkChildCode,
+ DocumentConversationChildChildChunkChildComment,
+ DocumentConversationChildChildChunkChildDivider,
+ DocumentConversationChildChildChunkChildImage,
+ DocumentConversationChildChildChunkChildLink,
+ DocumentConversationChildChildChunkChildLineBreak,
+ DocumentConversationChildChildChunkChildText,
+ DocumentConversationChildChildChunkChildToolCall,
+ DocumentConversationChildChildChunkChildToolResult,
+ DocumentConversationChildChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentConversationChildChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildEquationChild: TypeAlias = Union[
+ DocumentConversationChildChildEquationChildBlob,
+ DocumentConversationChildChildEquationChildCode,
+ DocumentConversationChildChildEquationChildComment,
+ DocumentConversationChildChildEquationChildDivider,
+ DocumentConversationChildChildEquationChildImage,
+ DocumentConversationChildChildEquationChildLink,
+ DocumentConversationChildChildEquationChildLineBreak,
+ DocumentConversationChildChildEquationChildText,
+ DocumentConversationChildChildEquationChildToolCall,
+ DocumentConversationChildChildEquationChildToolResult,
+ DocumentConversationChildChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildFootnoteChild: TypeAlias = Union[
+ DocumentConversationChildChildFootnoteChildBlob,
+ DocumentConversationChildChildFootnoteChildCode,
+ DocumentConversationChildChildFootnoteChildComment,
+ DocumentConversationChildChildFootnoteChildDivider,
+ DocumentConversationChildChildFootnoteChildImage,
+ DocumentConversationChildChildFootnoteChildLink,
+ DocumentConversationChildChildFootnoteChildLineBreak,
+ DocumentConversationChildChildFootnoteChildText,
+ DocumentConversationChildChildFootnoteChildToolCall,
+ DocumentConversationChildChildFootnoteChildToolResult,
+ DocumentConversationChildChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentConversationChildChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildHeadingChild: TypeAlias = Union[
+ DocumentConversationChildChildHeadingChildBlob,
+ DocumentConversationChildChildHeadingChildCode,
+ DocumentConversationChildChildHeadingChildComment,
+ DocumentConversationChildChildHeadingChildDivider,
+ DocumentConversationChildChildHeadingChildImage,
+ DocumentConversationChildChildHeadingChildLink,
+ DocumentConversationChildChildHeadingChildLineBreak,
+ DocumentConversationChildChildHeadingChildText,
+ DocumentConversationChildChildHeadingChildToolCall,
+ DocumentConversationChildChildHeadingChildToolResult,
+ DocumentConversationChildChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentConversationChildChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentConversationChildChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildListItemChild: TypeAlias = Union[
+ DocumentConversationChildChildListItemChildBlob,
+ DocumentConversationChildChildListItemChildCode,
+ DocumentConversationChildChildListItemChildComment,
+ DocumentConversationChildChildListItemChildDivider,
+ DocumentConversationChildChildListItemChildImage,
+ DocumentConversationChildChildListItemChildLink,
+ DocumentConversationChildChildListItemChildLineBreak,
+ DocumentConversationChildChildListItemChildText,
+ DocumentConversationChildChildListItemChildToolCall,
+ DocumentConversationChildChildListItemChildToolResult,
+ DocumentConversationChildChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentConversationChildChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildParagraphChild: TypeAlias = Union[
+ DocumentConversationChildChildParagraphChildBlob,
+ DocumentConversationChildChildParagraphChildCode,
+ DocumentConversationChildChildParagraphChildComment,
+ DocumentConversationChildChildParagraphChildDivider,
+ DocumentConversationChildChildParagraphChildImage,
+ DocumentConversationChildChildParagraphChildLink,
+ DocumentConversationChildChildParagraphChildLineBreak,
+ DocumentConversationChildChildParagraphChildText,
+ DocumentConversationChildChildParagraphChildToolCall,
+ DocumentConversationChildChildParagraphChildToolResult,
+ DocumentConversationChildChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentConversationChildChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildQuoteChild: TypeAlias = Union[
+ DocumentConversationChildChildQuoteChildBlob,
+ DocumentConversationChildChildQuoteChildCode,
+ DocumentConversationChildChildQuoteChildComment,
+ DocumentConversationChildChildQuoteChildDivider,
+ DocumentConversationChildChildQuoteChildImage,
+ DocumentConversationChildChildQuoteChildLink,
+ DocumentConversationChildChildQuoteChildLineBreak,
+ DocumentConversationChildChildQuoteChildText,
+ DocumentConversationChildChildQuoteChildToolCall,
+ DocumentConversationChildChildQuoteChildToolResult,
+ DocumentConversationChildChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChildChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentConversationChildChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentConversationChildChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildTableCellChild: TypeAlias = Union[
+ DocumentConversationChildChildTableCellChildBlob,
+ DocumentConversationChildChildTableCellChildCode,
+ DocumentConversationChildChildTableCellChildComment,
+ DocumentConversationChildChildTableCellChildDivider,
+ DocumentConversationChildChildTableCellChildImage,
+ DocumentConversationChildChildTableCellChildLink,
+ DocumentConversationChildChildTableCellChildLineBreak,
+ DocumentConversationChildChildTableCellChildText,
+ DocumentConversationChildChildTableCellChildToolCall,
+ DocumentConversationChildChildTableCellChildToolResult,
+ DocumentConversationChildChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentConversationChildChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentConversationChildChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentConversationChildChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildChildToDoChild: TypeAlias = Union[
+ DocumentConversationChildChildToDoChildBlob,
+ DocumentConversationChildChildToDoChildCode,
+ DocumentConversationChildChildToDoChildComment,
+ DocumentConversationChildChildToDoChildDivider,
+ DocumentConversationChildChildToDoChildImage,
+ DocumentConversationChildChildToDoChildLink,
+ DocumentConversationChildChildToDoChildLineBreak,
+ DocumentConversationChildChildToDoChildText,
+ DocumentConversationChildChildToDoChildToolCall,
+ DocumentConversationChildChildToDoChildToolResult,
+ DocumentConversationChildChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentConversationChildChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentConversationChildChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentConversationChildChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentConversationChildChild: TypeAlias = Annotated[
+ Union[
+ DocumentConversationChildChildBlob,
+ DocumentConversationChildChildCallout,
+ DocumentConversationChildChildChunk,
+ DocumentConversationChildChildCode,
+ DocumentConversationChildChildComment,
+ DocumentConversationChildChildDivider,
+ DocumentConversationChildChildEquation,
+ DocumentConversationChildChildFootnote,
+ DocumentConversationChildChildHeading,
+ DocumentConversationChildChildImage,
+ DocumentConversationChildChildLink,
+ DocumentConversationChildChildLineBreak,
+ DocumentConversationChildChildList,
+ DocumentConversationChildChildListItem,
+ DocumentConversationChildChildParagraph,
+ DocumentConversationChildChildQuote,
+ DocumentConversationChildChildTable,
+ DocumentConversationChildChildTableCell,
+ DocumentConversationChildChildTableRow,
+ DocumentConversationChildChildText,
+ DocumentConversationChildChildToDo,
+ DocumentConversationChildChildToolCall,
+ DocumentConversationChildChildToolResult,
+ DocumentConversationChildChildTraceMessage,
+ DocumentConversationChildChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentConversationChildMentionedUserChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentConversationChildMentionedUserChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentConversationChildMentionedUserChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentConversationChildMentionedUserChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentConversationChildMentionedUserChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentConversationChildMentionedUserChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentConversationChildMentionedUserChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentConversationChildMentionedUserChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentConversationChildMentionedUserChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentConversationChildMentionedUserChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentConversationChildMentionedUserChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentConversationChildMentionedUserChild: TypeAlias = Union[
+ DocumentConversationChildMentionedUserChildBlob,
+ DocumentConversationChildMentionedUserChildCode,
+ DocumentConversationChildMentionedUserChildComment,
+ DocumentConversationChildMentionedUserChildDivider,
+ DocumentConversationChildMentionedUserChildImage,
+ DocumentConversationChildMentionedUserChildLink,
+ DocumentConversationChildMentionedUserChildLineBreak,
+ DocumentConversationChildMentionedUserChildText,
+ DocumentConversationChildMentionedUserChildToolCall,
+ DocumentConversationChildMentionedUserChildToolResult,
+ DocumentConversationChildMentionedUserChildTraceMessage,
+ object,
+]
+
+
+class DocumentConversationChildMentionedUser(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentConversationChildMentionedUserChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentConversationChild(BaseModel):
+ date: datetime
+
+ sender: DocumentConversationChildSender
+
+ id: Optional[str] = None
+
+ channel: Optional[str] = None
+ """
+ The channel or platform where the message was posted, if this Message is not
+ explicitly part of a conversation
+ """
+
+ children: Optional[List[DocumentConversationChildChild]] = None
+
+ external_id: Optional[str] = None
+ """Provider message id (e.g. Slack ts, Gmail message id) — merge-dedup key"""
+
+ is_self: Optional[bool] = None
+
+ mentioned_users: Optional[List[DocumentConversationChildMentionedUser]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ num_replies: Optional[int] = None
+
+ replies: Optional[List[object]] = None
+ """The replies or comments to the message"""
+
+ text: Optional[str] = None
+
+ thread_id: Optional[str] = None
+
+ title: Optional[str] = None
+ """The subject or title of the message"""
+
+ type: Optional[Literal["message"]] = None
+
+ updated_at: Optional[datetime] = None
+
+ upvotes: Optional[int] = None
+ """The number of upvotes, likes, or reactions on the message"""
+
+
+class DocumentConversation(BaseModel):
+ id: Optional[str] = None
+
+ channel: Optional[str] = None
+
+ children: Optional[List[DocumentConversationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["conversation"]] = None
+
+
+class DocumentTraceChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentTraceChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTraceChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+DocumentTraceChild: TypeAlias = Annotated[
+ Union[DocumentTraceChildTraceMessage, DocumentTraceChildToolCall, DocumentTraceChildToolResult],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentTrace(BaseModel):
+ """An agent trace/transcript containing a sequence of steps.
+
+ Steps can be TraceMessage (user/assistant messages or thinking),
+ ToolCall (function calls), or ToolResult (tool responses).
+ """
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTraceChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["trace"]] = None
+
+
+class DocumentTranscriptChild(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+class DocumentTranscriptParticipantChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentTranscriptParticipantChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentTranscriptParticipantChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentTranscriptParticipantChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentTranscriptParticipantChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentTranscriptParticipantChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentTranscriptParticipantChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentTranscriptParticipantChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentTranscriptParticipantChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentTranscriptParticipantChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentTranscriptParticipantChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentTranscriptParticipantChild: TypeAlias = Union[
+ DocumentTranscriptParticipantChildBlob,
+ DocumentTranscriptParticipantChildCode,
+ DocumentTranscriptParticipantChildComment,
+ DocumentTranscriptParticipantChildDivider,
+ DocumentTranscriptParticipantChildImage,
+ DocumentTranscriptParticipantChildLink,
+ DocumentTranscriptParticipantChildLineBreak,
+ DocumentTranscriptParticipantChildText,
+ DocumentTranscriptParticipantChildToolCall,
+ DocumentTranscriptParticipantChildToolResult,
+ DocumentTranscriptParticipantChildTraceMessage,
+ object,
+]
+
+
+class DocumentTranscriptParticipant(BaseModel):
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ alt_names: Optional[List[str]] = None
+
+ children: Optional[List[DocumentTranscriptParticipantChild]] = None
+
+ company: Optional[str] = None
+
+ company_ids: Optional[List[str]] = None
+
+ date_of_birth: Optional[date] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ email: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+ """All known email addresses; `email` holds the primary one"""
+
+ image_url: Optional[str] = None
+
+ job_title: Optional[str] = None
+
+ link_urls: Optional[List[str]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["person"]] = None
+
+ username: Optional[str] = None
+
+
+class DocumentTranscript(BaseModel):
+ """
+ A time-anchored, speaker-attributed transcript — meetings, calls
+ (ENG-2476/D10; mirrors the Trace+TraceStep precedent).
+
+ Utterance timestamps are relative offsets from `started_at`, which is the
+ absolute wall-clock anchor.
+ """
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentTranscriptChild]] = None
+
+ ended_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ participants: Optional[List[DocumentTranscriptParticipant]] = None
+
+ started_at: Optional[datetime] = None
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["transcript"]] = None
+
+
+class DocumentCompanyChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildCalloutChild: TypeAlias = Union[
+ DocumentCompanyChildCalloutChildBlob,
+ DocumentCompanyChildCalloutChildCode,
+ DocumentCompanyChildCalloutChildComment,
+ DocumentCompanyChildCalloutChildDivider,
+ DocumentCompanyChildCalloutChildImage,
+ DocumentCompanyChildCalloutChildLink,
+ DocumentCompanyChildCalloutChildLineBreak,
+ DocumentCompanyChildCalloutChildText,
+ DocumentCompanyChildCalloutChildToolCall,
+ DocumentCompanyChildCalloutChildToolResult,
+ DocumentCompanyChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentCompanyChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildChunkChild: TypeAlias = Union[
+ DocumentCompanyChildChunkChildBlob,
+ DocumentCompanyChildChunkChildCode,
+ DocumentCompanyChildChunkChildComment,
+ DocumentCompanyChildChunkChildDivider,
+ DocumentCompanyChildChunkChildImage,
+ DocumentCompanyChildChunkChildLink,
+ DocumentCompanyChildChunkChildLineBreak,
+ DocumentCompanyChildChunkChildText,
+ DocumentCompanyChildChunkChildToolCall,
+ DocumentCompanyChildChunkChildToolResult,
+ DocumentCompanyChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentCompanyChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildEquationChild: TypeAlias = Union[
+ DocumentCompanyChildEquationChildBlob,
+ DocumentCompanyChildEquationChildCode,
+ DocumentCompanyChildEquationChildComment,
+ DocumentCompanyChildEquationChildDivider,
+ DocumentCompanyChildEquationChildImage,
+ DocumentCompanyChildEquationChildLink,
+ DocumentCompanyChildEquationChildLineBreak,
+ DocumentCompanyChildEquationChildText,
+ DocumentCompanyChildEquationChildToolCall,
+ DocumentCompanyChildEquationChildToolResult,
+ DocumentCompanyChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentCompanyChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildFootnoteChild: TypeAlias = Union[
+ DocumentCompanyChildFootnoteChildBlob,
+ DocumentCompanyChildFootnoteChildCode,
+ DocumentCompanyChildFootnoteChildComment,
+ DocumentCompanyChildFootnoteChildDivider,
+ DocumentCompanyChildFootnoteChildImage,
+ DocumentCompanyChildFootnoteChildLink,
+ DocumentCompanyChildFootnoteChildLineBreak,
+ DocumentCompanyChildFootnoteChildText,
+ DocumentCompanyChildFootnoteChildToolCall,
+ DocumentCompanyChildFootnoteChildToolResult,
+ DocumentCompanyChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentCompanyChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildHeadingChild: TypeAlias = Union[
+ DocumentCompanyChildHeadingChildBlob,
+ DocumentCompanyChildHeadingChildCode,
+ DocumentCompanyChildHeadingChildComment,
+ DocumentCompanyChildHeadingChildDivider,
+ DocumentCompanyChildHeadingChildImage,
+ DocumentCompanyChildHeadingChildLink,
+ DocumentCompanyChildHeadingChildLineBreak,
+ DocumentCompanyChildHeadingChildText,
+ DocumentCompanyChildHeadingChildToolCall,
+ DocumentCompanyChildHeadingChildToolResult,
+ DocumentCompanyChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentCompanyChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentCompanyChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildListItemChild: TypeAlias = Union[
+ DocumentCompanyChildListItemChildBlob,
+ DocumentCompanyChildListItemChildCode,
+ DocumentCompanyChildListItemChildComment,
+ DocumentCompanyChildListItemChildDivider,
+ DocumentCompanyChildListItemChildImage,
+ DocumentCompanyChildListItemChildLink,
+ DocumentCompanyChildListItemChildLineBreak,
+ DocumentCompanyChildListItemChildText,
+ DocumentCompanyChildListItemChildToolCall,
+ DocumentCompanyChildListItemChildToolResult,
+ DocumentCompanyChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentCompanyChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildParagraphChild: TypeAlias = Union[
+ DocumentCompanyChildParagraphChildBlob,
+ DocumentCompanyChildParagraphChildCode,
+ DocumentCompanyChildParagraphChildComment,
+ DocumentCompanyChildParagraphChildDivider,
+ DocumentCompanyChildParagraphChildImage,
+ DocumentCompanyChildParagraphChildLink,
+ DocumentCompanyChildParagraphChildLineBreak,
+ DocumentCompanyChildParagraphChildText,
+ DocumentCompanyChildParagraphChildToolCall,
+ DocumentCompanyChildParagraphChildToolResult,
+ DocumentCompanyChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentCompanyChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildQuoteChild: TypeAlias = Union[
+ DocumentCompanyChildQuoteChildBlob,
+ DocumentCompanyChildQuoteChildCode,
+ DocumentCompanyChildQuoteChildComment,
+ DocumentCompanyChildQuoteChildDivider,
+ DocumentCompanyChildQuoteChildImage,
+ DocumentCompanyChildQuoteChildLink,
+ DocumentCompanyChildQuoteChildLineBreak,
+ DocumentCompanyChildQuoteChildText,
+ DocumentCompanyChildQuoteChildToolCall,
+ DocumentCompanyChildQuoteChildToolResult,
+ DocumentCompanyChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentCompanyChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentCompanyChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildTableCellChild: TypeAlias = Union[
+ DocumentCompanyChildTableCellChildBlob,
+ DocumentCompanyChildTableCellChildCode,
+ DocumentCompanyChildTableCellChildComment,
+ DocumentCompanyChildTableCellChildDivider,
+ DocumentCompanyChildTableCellChildImage,
+ DocumentCompanyChildTableCellChildLink,
+ DocumentCompanyChildTableCellChildLineBreak,
+ DocumentCompanyChildTableCellChildText,
+ DocumentCompanyChildTableCellChildToolCall,
+ DocumentCompanyChildTableCellChildToolResult,
+ DocumentCompanyChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentCompanyChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentCompanyChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentCompanyChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentCompanyChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentCompanyChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentCompanyChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentCompanyChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentCompanyChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentCompanyChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentCompanyChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentCompanyChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentCompanyChildToDoChild: TypeAlias = Union[
+ DocumentCompanyChildToDoChildBlob,
+ DocumentCompanyChildToDoChildCode,
+ DocumentCompanyChildToDoChildComment,
+ DocumentCompanyChildToDoChildDivider,
+ DocumentCompanyChildToDoChildImage,
+ DocumentCompanyChildToDoChildLink,
+ DocumentCompanyChildToDoChildLineBreak,
+ DocumentCompanyChildToDoChildText,
+ DocumentCompanyChildToDoChildToolCall,
+ DocumentCompanyChildToDoChildToolResult,
+ DocumentCompanyChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentCompanyChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentCompanyChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentCompanyChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentCompanyChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentCompanyChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentCompanyChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentCompanyChild: TypeAlias = Annotated[
+ Union[
+ DocumentCompanyChildBlob,
+ DocumentCompanyChildCallout,
+ DocumentCompanyChildChunk,
+ DocumentCompanyChildCode,
+ DocumentCompanyChildComment,
+ DocumentCompanyChildDivider,
+ DocumentCompanyChildEquation,
+ DocumentCompanyChildFootnote,
+ DocumentCompanyChildHeading,
+ DocumentCompanyChildImage,
+ DocumentCompanyChildLink,
+ DocumentCompanyChildLineBreak,
+ DocumentCompanyChildList,
+ DocumentCompanyChildListItem,
+ DocumentCompanyChildParagraph,
+ DocumentCompanyChildQuote,
+ DocumentCompanyChildTable,
+ DocumentCompanyChildTableCell,
+ DocumentCompanyChildTableRow,
+ DocumentCompanyChildText,
+ DocumentCompanyChildToDo,
+ DocumentCompanyChildToolCall,
+ DocumentCompanyChildToolResult,
+ DocumentCompanyChildTraceMessage,
+ DocumentCompanyChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentCompany(BaseModel):
+ """A CRM company/account record (ENG-2476/D10)."""
+
+ id: Optional[str] = None
+
+ address: Optional[str] = None
+
+ children: Optional[List[DocumentCompanyChild]] = None
+
+ contact_ids: Optional[List[str]] = None
+
+ deal_ids: Optional[List[str]] = None
+
+ description: Optional[str] = None
+
+ emails: Optional[List[str]] = None
+
+ employees: Optional[int] = None
+
+ image_url: Optional[str] = None
+
+ industry: Optional[str] = None
+
+ is_active: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ phone_numbers: Optional[List[str]] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ timezone: Optional[str] = None
+
+ type: Optional[Literal["company"]] = None
+
+ websites: Optional[List[str]] = None
+
+
+class DocumentDealChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildCalloutChild: TypeAlias = Union[
+ DocumentDealChildCalloutChildBlob,
+ DocumentDealChildCalloutChildCode,
+ DocumentDealChildCalloutChildComment,
+ DocumentDealChildCalloutChildDivider,
+ DocumentDealChildCalloutChildImage,
+ DocumentDealChildCalloutChildLink,
+ DocumentDealChildCalloutChildLineBreak,
+ DocumentDealChildCalloutChildText,
+ DocumentDealChildCalloutChildToolCall,
+ DocumentDealChildCalloutChildToolResult,
+ DocumentDealChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentDealChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildChunkChild: TypeAlias = Union[
+ DocumentDealChildChunkChildBlob,
+ DocumentDealChildChunkChildCode,
+ DocumentDealChildChunkChildComment,
+ DocumentDealChildChunkChildDivider,
+ DocumentDealChildChunkChildImage,
+ DocumentDealChildChunkChildLink,
+ DocumentDealChildChunkChildLineBreak,
+ DocumentDealChildChunkChildText,
+ DocumentDealChildChunkChildToolCall,
+ DocumentDealChildChunkChildToolResult,
+ DocumentDealChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentDealChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildEquationChild: TypeAlias = Union[
+ DocumentDealChildEquationChildBlob,
+ DocumentDealChildEquationChildCode,
+ DocumentDealChildEquationChildComment,
+ DocumentDealChildEquationChildDivider,
+ DocumentDealChildEquationChildImage,
+ DocumentDealChildEquationChildLink,
+ DocumentDealChildEquationChildLineBreak,
+ DocumentDealChildEquationChildText,
+ DocumentDealChildEquationChildToolCall,
+ DocumentDealChildEquationChildToolResult,
+ DocumentDealChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentDealChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildFootnoteChild: TypeAlias = Union[
+ DocumentDealChildFootnoteChildBlob,
+ DocumentDealChildFootnoteChildCode,
+ DocumentDealChildFootnoteChildComment,
+ DocumentDealChildFootnoteChildDivider,
+ DocumentDealChildFootnoteChildImage,
+ DocumentDealChildFootnoteChildLink,
+ DocumentDealChildFootnoteChildLineBreak,
+ DocumentDealChildFootnoteChildText,
+ DocumentDealChildFootnoteChildToolCall,
+ DocumentDealChildFootnoteChildToolResult,
+ DocumentDealChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentDealChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildHeadingChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildHeadingChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildHeadingChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildHeadingChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildHeadingChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildHeadingChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildHeadingChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildHeadingChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildHeadingChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildHeadingChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildHeadingChild: TypeAlias = Union[
+ DocumentDealChildHeadingChildBlob,
+ DocumentDealChildHeadingChildCode,
+ DocumentDealChildHeadingChildComment,
+ DocumentDealChildHeadingChildDivider,
+ DocumentDealChildHeadingChildImage,
+ DocumentDealChildHeadingChildLink,
+ DocumentDealChildHeadingChildLineBreak,
+ DocumentDealChildHeadingChildText,
+ DocumentDealChildHeadingChildToolCall,
+ DocumentDealChildHeadingChildToolResult,
+ DocumentDealChildHeadingChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildHeading(BaseModel):
+ level: int
+
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildHeadingChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["heading"]] = None
+
+
+class DocumentDealChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildList(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ ordered: Optional[bool] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list"]] = None
+
+
+class DocumentDealChildListItemChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildListItemChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildListItemChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildListItemChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildListItemChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildListItemChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildListItemChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildListItemChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildListItemChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildListItemChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildListItemChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildListItemChild: TypeAlias = Union[
+ DocumentDealChildListItemChildBlob,
+ DocumentDealChildListItemChildCode,
+ DocumentDealChildListItemChildComment,
+ DocumentDealChildListItemChildDivider,
+ DocumentDealChildListItemChildImage,
+ DocumentDealChildListItemChildLink,
+ DocumentDealChildListItemChildLineBreak,
+ DocumentDealChildListItemChildText,
+ DocumentDealChildListItemChildToolCall,
+ DocumentDealChildListItemChildToolResult,
+ DocumentDealChildListItemChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildListItem(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildListItemChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["list_item"]] = None
+
+
+class DocumentDealChildParagraphChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildParagraphChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildParagraphChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildParagraphChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildParagraphChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildParagraphChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildParagraphChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildParagraphChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildParagraphChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildParagraphChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildParagraphChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildParagraphChild: TypeAlias = Union[
+ DocumentDealChildParagraphChildBlob,
+ DocumentDealChildParagraphChildCode,
+ DocumentDealChildParagraphChildComment,
+ DocumentDealChildParagraphChildDivider,
+ DocumentDealChildParagraphChildImage,
+ DocumentDealChildParagraphChildLink,
+ DocumentDealChildParagraphChildLineBreak,
+ DocumentDealChildParagraphChildText,
+ DocumentDealChildParagraphChildToolCall,
+ DocumentDealChildParagraphChildToolResult,
+ DocumentDealChildParagraphChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildParagraph(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildParagraphChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["paragraph"]] = None
+
+
+class DocumentDealChildQuoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildQuoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildQuoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildQuoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildQuoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildQuoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildQuoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildQuoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildQuoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildQuoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildQuoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildQuoteChild: TypeAlias = Union[
+ DocumentDealChildQuoteChildBlob,
+ DocumentDealChildQuoteChildCode,
+ DocumentDealChildQuoteChildComment,
+ DocumentDealChildQuoteChildDivider,
+ DocumentDealChildQuoteChildImage,
+ DocumentDealChildQuoteChildLink,
+ DocumentDealChildQuoteChildLineBreak,
+ DocumentDealChildQuoteChildText,
+ DocumentDealChildQuoteChildToolCall,
+ DocumentDealChildQuoteChildToolResult,
+ DocumentDealChildQuoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildQuote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDealChildQuoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["quote"]] = None
+
+
+class DocumentDealChildTable(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ has_header: Optional[bool] = None
+ """Whether the first row should be treated as a header"""
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table"]] = None
+
+
+class DocumentDealChildTableCellChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildTableCellChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildTableCellChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildTableCellChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildTableCellChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildTableCellChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildTableCellChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildTableCellChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildTableCellChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildTableCellChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildTableCellChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildTableCellChild: TypeAlias = Union[
+ DocumentDealChildTableCellChildBlob,
+ DocumentDealChildTableCellChildCode,
+ DocumentDealChildTableCellChildComment,
+ DocumentDealChildTableCellChildDivider,
+ DocumentDealChildTableCellChildImage,
+ DocumentDealChildTableCellChildLink,
+ DocumentDealChildTableCellChildLineBreak,
+ DocumentDealChildTableCellChildText,
+ DocumentDealChildTableCellChildToolCall,
+ DocumentDealChildTableCellChildToolResult,
+ DocumentDealChildTableCellChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildTableCell(BaseModel):
+ id: Optional[str] = None
+
+ align: Optional[Literal["left", "center", "right"]] = None
+
+ children: Optional[List[DocumentDealChildTableCellChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_cell"]] = None
+
+
+class DocumentDealChildTableRow(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["table_row"]] = None
+
+
+class DocumentDealChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildToDoChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDealChildToDoChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDealChildToDoChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDealChildToDoChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDealChildToDoChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDealChildToDoChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDealChildToDoChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDealChildToDoChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDealChildToDoChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildToDoChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildToDoChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDealChildToDoChild: TypeAlias = Union[
+ DocumentDealChildToDoChildBlob,
+ DocumentDealChildToDoChildCode,
+ DocumentDealChildToDoChildComment,
+ DocumentDealChildToDoChildDivider,
+ DocumentDealChildToDoChildImage,
+ DocumentDealChildToDoChildLink,
+ DocumentDealChildToDoChildLineBreak,
+ DocumentDealChildToDoChildText,
+ DocumentDealChildToDoChildToolCall,
+ DocumentDealChildToDoChildToolResult,
+ DocumentDealChildToDoChildTraceMessage,
+ object,
+]
+
+
+class DocumentDealChildToDo(BaseModel):
+ id: Optional[str] = None
+
+ checked: Optional[bool] = None
+
+ children: Optional[List[DocumentDealChildToDoChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["todo"]] = None
+
+
+class DocumentDealChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDealChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDealChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+class DocumentDealChildUtterance(BaseModel):
+ """A speaker-attributed segment of a transcript (ENG-2476/D10).
+
+ "Utterance" is the standard name for this across transcription providers
+ (AssemblyAI, Deepgram, Rev). Timestamps are relative offsets in seconds —
+ provider-native; absolute times derive from `Transcript.started_at`.
+ """
+
+ text: str
+
+ id: Optional[str] = None
+
+ end: Optional[float] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ speaker: Optional[object] = None
+
+ start: Optional[float] = None
+
+ type: Optional[Literal["utterance"]] = None
+
+
+DocumentDealChild: TypeAlias = Annotated[
+ Union[
+ DocumentDealChildBlob,
+ DocumentDealChildCallout,
+ DocumentDealChildChunk,
+ DocumentDealChildCode,
+ DocumentDealChildComment,
+ DocumentDealChildDivider,
+ DocumentDealChildEquation,
+ DocumentDealChildFootnote,
+ DocumentDealChildHeading,
+ DocumentDealChildImage,
+ DocumentDealChildLink,
+ DocumentDealChildLineBreak,
+ DocumentDealChildList,
+ DocumentDealChildListItem,
+ DocumentDealChildParagraph,
+ DocumentDealChildQuote,
+ DocumentDealChildTable,
+ DocumentDealChildTableCell,
+ DocumentDealChildTableRow,
+ DocumentDealChildText,
+ DocumentDealChildToDo,
+ DocumentDealChildToolCall,
+ DocumentDealChildToolResult,
+ DocumentDealChildTraceMessage,
+ DocumentDealChildUtterance,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class DocumentDeal(BaseModel):
+ """A CRM deal/opportunity record (ENG-2476/D10)."""
+
+ id: Optional[str] = None
+
+ amount: Optional[float] = None
+
+ children: Optional[List[DocumentDealChild]] = None
+
+ closed_at: Optional[datetime] = None
+
+ company_ids: Optional[List[str]] = None
+
+ contact_ids: Optional[List[str]] = None
+
+ currency: Optional[str] = None
+
+ deal_source: Optional[str] = None
+
+ lost_reason: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ name: Optional[str] = None
+
+ pipeline: Optional[str] = None
+
+ probability: Optional[float] = None
+
+ stage: Optional[str] = None
+
+ tags: Optional[List[str]] = None
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["deal"]] = None
+
+ won_reason: Optional[str] = None
+
+
+Document: TypeAlias = Annotated[
+ Union[
+ DocumentDocument,
+ DocumentWebsite,
+ DocumentTask,
+ DocumentPerson,
+ DocumentMessage,
+ DocumentEvent,
+ DocumentFile,
+ DocumentConversation,
+ DocumentTrace,
+ DocumentTranscript,
+ DocumentCompany,
+ DocumentDeal,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class MemoryGetResponse(BaseModel):
+ """A document-shaped API response carrying the hyperdoc tree (ENG-2479/D12)."""
+
+ document: Document
+ """The full hyperdoc tree.
+
+ Switch on `type` for the document frame and recurse `children` for the body —
+ see the `` renderer.
+ """
+
+ resource_id: str
+
+ source: Literal[
+ "reddit",
+ "notion",
+ "slack",
+ "google_calendar",
+ "google_mail",
+ "box",
+ "dropbox",
+ "github",
+ "google_drive",
+ "vault",
+ "web_crawler",
+ "trace",
+ "microsoft_teams",
+ "gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
+ ]
+
+ type: str
+ """Hyperdoc document type discriminator (document, message, file, event, ...)."""
+
+ collection: Optional[str] = None
+ """The document's collection, if any."""
+
+ document_date: Optional[datetime] = None
+ """The document's own date (e.g. email sent date, event date)."""
+
+ ingested_at: Optional[datetime] = None
+ """When Hyperspell first indexed the document."""
+
+ last_modified_at: Optional[datetime] = None
+ """When the source document was last modified."""
+
+ metadata: Optional[Dict[str, object]] = None
+ """Filterable custom metadata attached to the document."""
+
+ status: Optional[Literal["pending", "processing", "completed", "failed", "pending_review", "skipped"]] = None
+ """Indexing status of the document."""
+
+ title: Optional[str] = None
+ """Human-readable document title."""
diff --git a/src/hyperspell/types/memory_list_params.py b/src/hyperspell/types/memory_list_params.py
index 319f2917..9c12ba88 100644
--- a/src/hyperspell/types/memory_list_params.py
+++ b/src/hyperspell/types/memory_list_params.py
@@ -38,6 +38,14 @@ class MemoryListParams(TypedDict, total=False):
"trace",
"microsoft_teams",
"gmail_actions",
+ "granola",
+ "fathom",
+ "fireflies",
+ "linear",
+ "hubspot",
+ "salesforce",
+ "coda",
+ "lightfield",
]
]
"""Filter documents by source."""
diff --git a/src/hyperspell/types/memory_list_response.py b/src/hyperspell/types/memory_list_response.py
new file mode 100644
index 00000000..3b85e70b
--- /dev/null
+++ b/src/hyperspell/types/memory_list_response.py
@@ -0,0 +1,38644 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, List, Union, Optional
+from datetime import date, datetime
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from .._utils import PropertyInfo
+from .._models import BaseModel
+from .shared.metadata import Metadata
+
+__all__ = [
+ "MemoryListResponse",
+ "Document",
+ "DocumentDocument",
+ "DocumentDocumentChild",
+ "DocumentDocumentChildBlob",
+ "DocumentDocumentChildCallout",
+ "DocumentDocumentChildCalloutChild",
+ "DocumentDocumentChildCalloutChildBlob",
+ "DocumentDocumentChildCalloutChildCode",
+ "DocumentDocumentChildCalloutChildComment",
+ "DocumentDocumentChildCalloutChildDivider",
+ "DocumentDocumentChildCalloutChildImage",
+ "DocumentDocumentChildCalloutChildLink",
+ "DocumentDocumentChildCalloutChildLineBreak",
+ "DocumentDocumentChildCalloutChildText",
+ "DocumentDocumentChildCalloutChildToolCall",
+ "DocumentDocumentChildCalloutChildToolResult",
+ "DocumentDocumentChildCalloutChildTraceMessage",
+ "DocumentDocumentChildChunk",
+ "DocumentDocumentChildChunkChild",
+ "DocumentDocumentChildChunkChildBlob",
+ "DocumentDocumentChildChunkChildCode",
+ "DocumentDocumentChildChunkChildComment",
+ "DocumentDocumentChildChunkChildDivider",
+ "DocumentDocumentChildChunkChildImage",
+ "DocumentDocumentChildChunkChildLink",
+ "DocumentDocumentChildChunkChildLineBreak",
+ "DocumentDocumentChildChunkChildText",
+ "DocumentDocumentChildChunkChildToolCall",
+ "DocumentDocumentChildChunkChildToolResult",
+ "DocumentDocumentChildChunkChildTraceMessage",
+ "DocumentDocumentChildCode",
+ "DocumentDocumentChildComment",
+ "DocumentDocumentChildDivider",
+ "DocumentDocumentChildEquation",
+ "DocumentDocumentChildEquationChild",
+ "DocumentDocumentChildEquationChildBlob",
+ "DocumentDocumentChildEquationChildCode",
+ "DocumentDocumentChildEquationChildComment",
+ "DocumentDocumentChildEquationChildDivider",
+ "DocumentDocumentChildEquationChildImage",
+ "DocumentDocumentChildEquationChildLink",
+ "DocumentDocumentChildEquationChildLineBreak",
+ "DocumentDocumentChildEquationChildText",
+ "DocumentDocumentChildEquationChildToolCall",
+ "DocumentDocumentChildEquationChildToolResult",
+ "DocumentDocumentChildEquationChildTraceMessage",
+ "DocumentDocumentChildFootnote",
+ "DocumentDocumentChildFootnoteChild",
+ "DocumentDocumentChildFootnoteChildBlob",
+ "DocumentDocumentChildFootnoteChildCode",
+ "DocumentDocumentChildFootnoteChildComment",
+ "DocumentDocumentChildFootnoteChildDivider",
+ "DocumentDocumentChildFootnoteChildImage",
+ "DocumentDocumentChildFootnoteChildLink",
+ "DocumentDocumentChildFootnoteChildLineBreak",
+ "DocumentDocumentChildFootnoteChildText",
+ "DocumentDocumentChildFootnoteChildToolCall",
+ "DocumentDocumentChildFootnoteChildToolResult",
+ "DocumentDocumentChildFootnoteChildTraceMessage",
+ "DocumentDocumentChildHeading",
+ "DocumentDocumentChildHeadingChild",
+ "DocumentDocumentChildHeadingChildBlob",
+ "DocumentDocumentChildHeadingChildCode",
+ "DocumentDocumentChildHeadingChildComment",
+ "DocumentDocumentChildHeadingChildDivider",
+ "DocumentDocumentChildHeadingChildImage",
+ "DocumentDocumentChildHeadingChildLink",
+ "DocumentDocumentChildHeadingChildLineBreak",
+ "DocumentDocumentChildHeadingChildText",
+ "DocumentDocumentChildHeadingChildToolCall",
+ "DocumentDocumentChildHeadingChildToolResult",
+ "DocumentDocumentChildHeadingChildTraceMessage",
+ "DocumentDocumentChildImage",
+ "DocumentDocumentChildLink",
+ "DocumentDocumentChildLineBreak",
+ "DocumentDocumentChildList",
+ "DocumentDocumentChildListItem",
+ "DocumentDocumentChildListItemChild",
+ "DocumentDocumentChildListItemChildBlob",
+ "DocumentDocumentChildListItemChildCode",
+ "DocumentDocumentChildListItemChildComment",
+ "DocumentDocumentChildListItemChildDivider",
+ "DocumentDocumentChildListItemChildImage",
+ "DocumentDocumentChildListItemChildLink",
+ "DocumentDocumentChildListItemChildLineBreak",
+ "DocumentDocumentChildListItemChildText",
+ "DocumentDocumentChildListItemChildToolCall",
+ "DocumentDocumentChildListItemChildToolResult",
+ "DocumentDocumentChildListItemChildTraceMessage",
+ "DocumentDocumentChildParagraph",
+ "DocumentDocumentChildParagraphChild",
+ "DocumentDocumentChildParagraphChildBlob",
+ "DocumentDocumentChildParagraphChildCode",
+ "DocumentDocumentChildParagraphChildComment",
+ "DocumentDocumentChildParagraphChildDivider",
+ "DocumentDocumentChildParagraphChildImage",
+ "DocumentDocumentChildParagraphChildLink",
+ "DocumentDocumentChildParagraphChildLineBreak",
+ "DocumentDocumentChildParagraphChildText",
+ "DocumentDocumentChildParagraphChildToolCall",
+ "DocumentDocumentChildParagraphChildToolResult",
+ "DocumentDocumentChildParagraphChildTraceMessage",
+ "DocumentDocumentChildQuote",
+ "DocumentDocumentChildQuoteChild",
+ "DocumentDocumentChildQuoteChildBlob",
+ "DocumentDocumentChildQuoteChildCode",
+ "DocumentDocumentChildQuoteChildComment",
+ "DocumentDocumentChildQuoteChildDivider",
+ "DocumentDocumentChildQuoteChildImage",
+ "DocumentDocumentChildQuoteChildLink",
+ "DocumentDocumentChildQuoteChildLineBreak",
+ "DocumentDocumentChildQuoteChildText",
+ "DocumentDocumentChildQuoteChildToolCall",
+ "DocumentDocumentChildQuoteChildToolResult",
+ "DocumentDocumentChildQuoteChildTraceMessage",
+ "DocumentDocumentChildTable",
+ "DocumentDocumentChildTableCell",
+ "DocumentDocumentChildTableCellChild",
+ "DocumentDocumentChildTableCellChildBlob",
+ "DocumentDocumentChildTableCellChildCode",
+ "DocumentDocumentChildTableCellChildComment",
+ "DocumentDocumentChildTableCellChildDivider",
+ "DocumentDocumentChildTableCellChildImage",
+ "DocumentDocumentChildTableCellChildLink",
+ "DocumentDocumentChildTableCellChildLineBreak",
+ "DocumentDocumentChildTableCellChildText",
+ "DocumentDocumentChildTableCellChildToolCall",
+ "DocumentDocumentChildTableCellChildToolResult",
+ "DocumentDocumentChildTableCellChildTraceMessage",
+ "DocumentDocumentChildTableRow",
+ "DocumentDocumentChildText",
+ "DocumentDocumentChildToDo",
+ "DocumentDocumentChildToDoChild",
+ "DocumentDocumentChildToDoChildBlob",
+ "DocumentDocumentChildToDoChildCode",
+ "DocumentDocumentChildToDoChildComment",
+ "DocumentDocumentChildToDoChildDivider",
+ "DocumentDocumentChildToDoChildImage",
+ "DocumentDocumentChildToDoChildLink",
+ "DocumentDocumentChildToDoChildLineBreak",
+ "DocumentDocumentChildToDoChildText",
+ "DocumentDocumentChildToDoChildToolCall",
+ "DocumentDocumentChildToDoChildToolResult",
+ "DocumentDocumentChildToDoChildTraceMessage",
+ "DocumentDocumentChildToolCall",
+ "DocumentDocumentChildToolResult",
+ "DocumentDocumentChildTraceMessage",
+ "DocumentDocumentChildUtterance",
+ "DocumentWebsite",
+ "DocumentWebsiteChild",
+ "DocumentWebsiteChildBlob",
+ "DocumentWebsiteChildCallout",
+ "DocumentWebsiteChildCalloutChild",
+ "DocumentWebsiteChildCalloutChildBlob",
+ "DocumentWebsiteChildCalloutChildCode",
+ "DocumentWebsiteChildCalloutChildComment",
+ "DocumentWebsiteChildCalloutChildDivider",
+ "DocumentWebsiteChildCalloutChildImage",
+ "DocumentWebsiteChildCalloutChildLink",
+ "DocumentWebsiteChildCalloutChildLineBreak",
+ "DocumentWebsiteChildCalloutChildText",
+ "DocumentWebsiteChildCalloutChildToolCall",
+ "DocumentWebsiteChildCalloutChildToolResult",
+ "DocumentWebsiteChildCalloutChildTraceMessage",
+ "DocumentWebsiteChildChunk",
+ "DocumentWebsiteChildChunkChild",
+ "DocumentWebsiteChildChunkChildBlob",
+ "DocumentWebsiteChildChunkChildCode",
+ "DocumentWebsiteChildChunkChildComment",
+ "DocumentWebsiteChildChunkChildDivider",
+ "DocumentWebsiteChildChunkChildImage",
+ "DocumentWebsiteChildChunkChildLink",
+ "DocumentWebsiteChildChunkChildLineBreak",
+ "DocumentWebsiteChildChunkChildText",
+ "DocumentWebsiteChildChunkChildToolCall",
+ "DocumentWebsiteChildChunkChildToolResult",
+ "DocumentWebsiteChildChunkChildTraceMessage",
+ "DocumentWebsiteChildCode",
+ "DocumentWebsiteChildComment",
+ "DocumentWebsiteChildDivider",
+ "DocumentWebsiteChildEquation",
+ "DocumentWebsiteChildEquationChild",
+ "DocumentWebsiteChildEquationChildBlob",
+ "DocumentWebsiteChildEquationChildCode",
+ "DocumentWebsiteChildEquationChildComment",
+ "DocumentWebsiteChildEquationChildDivider",
+ "DocumentWebsiteChildEquationChildImage",
+ "DocumentWebsiteChildEquationChildLink",
+ "DocumentWebsiteChildEquationChildLineBreak",
+ "DocumentWebsiteChildEquationChildText",
+ "DocumentWebsiteChildEquationChildToolCall",
+ "DocumentWebsiteChildEquationChildToolResult",
+ "DocumentWebsiteChildEquationChildTraceMessage",
+ "DocumentWebsiteChildFootnote",
+ "DocumentWebsiteChildFootnoteChild",
+ "DocumentWebsiteChildFootnoteChildBlob",
+ "DocumentWebsiteChildFootnoteChildCode",
+ "DocumentWebsiteChildFootnoteChildComment",
+ "DocumentWebsiteChildFootnoteChildDivider",
+ "DocumentWebsiteChildFootnoteChildImage",
+ "DocumentWebsiteChildFootnoteChildLink",
+ "DocumentWebsiteChildFootnoteChildLineBreak",
+ "DocumentWebsiteChildFootnoteChildText",
+ "DocumentWebsiteChildFootnoteChildToolCall",
+ "DocumentWebsiteChildFootnoteChildToolResult",
+ "DocumentWebsiteChildFootnoteChildTraceMessage",
+ "DocumentWebsiteChildHeading",
+ "DocumentWebsiteChildHeadingChild",
+ "DocumentWebsiteChildHeadingChildBlob",
+ "DocumentWebsiteChildHeadingChildCode",
+ "DocumentWebsiteChildHeadingChildComment",
+ "DocumentWebsiteChildHeadingChildDivider",
+ "DocumentWebsiteChildHeadingChildImage",
+ "DocumentWebsiteChildHeadingChildLink",
+ "DocumentWebsiteChildHeadingChildLineBreak",
+ "DocumentWebsiteChildHeadingChildText",
+ "DocumentWebsiteChildHeadingChildToolCall",
+ "DocumentWebsiteChildHeadingChildToolResult",
+ "DocumentWebsiteChildHeadingChildTraceMessage",
+ "DocumentWebsiteChildImage",
+ "DocumentWebsiteChildLink",
+ "DocumentWebsiteChildLineBreak",
+ "DocumentWebsiteChildList",
+ "DocumentWebsiteChildListItem",
+ "DocumentWebsiteChildListItemChild",
+ "DocumentWebsiteChildListItemChildBlob",
+ "DocumentWebsiteChildListItemChildCode",
+ "DocumentWebsiteChildListItemChildComment",
+ "DocumentWebsiteChildListItemChildDivider",
+ "DocumentWebsiteChildListItemChildImage",
+ "DocumentWebsiteChildListItemChildLink",
+ "DocumentWebsiteChildListItemChildLineBreak",
+ "DocumentWebsiteChildListItemChildText",
+ "DocumentWebsiteChildListItemChildToolCall",
+ "DocumentWebsiteChildListItemChildToolResult",
+ "DocumentWebsiteChildListItemChildTraceMessage",
+ "DocumentWebsiteChildParagraph",
+ "DocumentWebsiteChildParagraphChild",
+ "DocumentWebsiteChildParagraphChildBlob",
+ "DocumentWebsiteChildParagraphChildCode",
+ "DocumentWebsiteChildParagraphChildComment",
+ "DocumentWebsiteChildParagraphChildDivider",
+ "DocumentWebsiteChildParagraphChildImage",
+ "DocumentWebsiteChildParagraphChildLink",
+ "DocumentWebsiteChildParagraphChildLineBreak",
+ "DocumentWebsiteChildParagraphChildText",
+ "DocumentWebsiteChildParagraphChildToolCall",
+ "DocumentWebsiteChildParagraphChildToolResult",
+ "DocumentWebsiteChildParagraphChildTraceMessage",
+ "DocumentWebsiteChildQuote",
+ "DocumentWebsiteChildQuoteChild",
+ "DocumentWebsiteChildQuoteChildBlob",
+ "DocumentWebsiteChildQuoteChildCode",
+ "DocumentWebsiteChildQuoteChildComment",
+ "DocumentWebsiteChildQuoteChildDivider",
+ "DocumentWebsiteChildQuoteChildImage",
+ "DocumentWebsiteChildQuoteChildLink",
+ "DocumentWebsiteChildQuoteChildLineBreak",
+ "DocumentWebsiteChildQuoteChildText",
+ "DocumentWebsiteChildQuoteChildToolCall",
+ "DocumentWebsiteChildQuoteChildToolResult",
+ "DocumentWebsiteChildQuoteChildTraceMessage",
+ "DocumentWebsiteChildTable",
+ "DocumentWebsiteChildTableCell",
+ "DocumentWebsiteChildTableCellChild",
+ "DocumentWebsiteChildTableCellChildBlob",
+ "DocumentWebsiteChildTableCellChildCode",
+ "DocumentWebsiteChildTableCellChildComment",
+ "DocumentWebsiteChildTableCellChildDivider",
+ "DocumentWebsiteChildTableCellChildImage",
+ "DocumentWebsiteChildTableCellChildLink",
+ "DocumentWebsiteChildTableCellChildLineBreak",
+ "DocumentWebsiteChildTableCellChildText",
+ "DocumentWebsiteChildTableCellChildToolCall",
+ "DocumentWebsiteChildTableCellChildToolResult",
+ "DocumentWebsiteChildTableCellChildTraceMessage",
+ "DocumentWebsiteChildTableRow",
+ "DocumentWebsiteChildText",
+ "DocumentWebsiteChildToDo",
+ "DocumentWebsiteChildToDoChild",
+ "DocumentWebsiteChildToDoChildBlob",
+ "DocumentWebsiteChildToDoChildCode",
+ "DocumentWebsiteChildToDoChildComment",
+ "DocumentWebsiteChildToDoChildDivider",
+ "DocumentWebsiteChildToDoChildImage",
+ "DocumentWebsiteChildToDoChildLink",
+ "DocumentWebsiteChildToDoChildLineBreak",
+ "DocumentWebsiteChildToDoChildText",
+ "DocumentWebsiteChildToDoChildToolCall",
+ "DocumentWebsiteChildToDoChildToolResult",
+ "DocumentWebsiteChildToDoChildTraceMessage",
+ "DocumentWebsiteChildToolCall",
+ "DocumentWebsiteChildToolResult",
+ "DocumentWebsiteChildTraceMessage",
+ "DocumentWebsiteChildUtterance",
+ "DocumentTask",
+ "DocumentTaskChild",
+ "DocumentTaskChildBlob",
+ "DocumentTaskChildCallout",
+ "DocumentTaskChildCalloutChild",
+ "DocumentTaskChildCalloutChildBlob",
+ "DocumentTaskChildCalloutChildCode",
+ "DocumentTaskChildCalloutChildComment",
+ "DocumentTaskChildCalloutChildDivider",
+ "DocumentTaskChildCalloutChildImage",
+ "DocumentTaskChildCalloutChildLink",
+ "DocumentTaskChildCalloutChildLineBreak",
+ "DocumentTaskChildCalloutChildText",
+ "DocumentTaskChildCalloutChildToolCall",
+ "DocumentTaskChildCalloutChildToolResult",
+ "DocumentTaskChildCalloutChildTraceMessage",
+ "DocumentTaskChildChunk",
+ "DocumentTaskChildChunkChild",
+ "DocumentTaskChildChunkChildBlob",
+ "DocumentTaskChildChunkChildCode",
+ "DocumentTaskChildChunkChildComment",
+ "DocumentTaskChildChunkChildDivider",
+ "DocumentTaskChildChunkChildImage",
+ "DocumentTaskChildChunkChildLink",
+ "DocumentTaskChildChunkChildLineBreak",
+ "DocumentTaskChildChunkChildText",
+ "DocumentTaskChildChunkChildToolCall",
+ "DocumentTaskChildChunkChildToolResult",
+ "DocumentTaskChildChunkChildTraceMessage",
+ "DocumentTaskChildCode",
+ "DocumentTaskChildComment",
+ "DocumentTaskChildDivider",
+ "DocumentTaskChildEquation",
+ "DocumentTaskChildEquationChild",
+ "DocumentTaskChildEquationChildBlob",
+ "DocumentTaskChildEquationChildCode",
+ "DocumentTaskChildEquationChildComment",
+ "DocumentTaskChildEquationChildDivider",
+ "DocumentTaskChildEquationChildImage",
+ "DocumentTaskChildEquationChildLink",
+ "DocumentTaskChildEquationChildLineBreak",
+ "DocumentTaskChildEquationChildText",
+ "DocumentTaskChildEquationChildToolCall",
+ "DocumentTaskChildEquationChildToolResult",
+ "DocumentTaskChildEquationChildTraceMessage",
+ "DocumentTaskChildFootnote",
+ "DocumentTaskChildFootnoteChild",
+ "DocumentTaskChildFootnoteChildBlob",
+ "DocumentTaskChildFootnoteChildCode",
+ "DocumentTaskChildFootnoteChildComment",
+ "DocumentTaskChildFootnoteChildDivider",
+ "DocumentTaskChildFootnoteChildImage",
+ "DocumentTaskChildFootnoteChildLink",
+ "DocumentTaskChildFootnoteChildLineBreak",
+ "DocumentTaskChildFootnoteChildText",
+ "DocumentTaskChildFootnoteChildToolCall",
+ "DocumentTaskChildFootnoteChildToolResult",
+ "DocumentTaskChildFootnoteChildTraceMessage",
+ "DocumentTaskChildHeading",
+ "DocumentTaskChildHeadingChild",
+ "DocumentTaskChildHeadingChildBlob",
+ "DocumentTaskChildHeadingChildCode",
+ "DocumentTaskChildHeadingChildComment",
+ "DocumentTaskChildHeadingChildDivider",
+ "DocumentTaskChildHeadingChildImage",
+ "DocumentTaskChildHeadingChildLink",
+ "DocumentTaskChildHeadingChildLineBreak",
+ "DocumentTaskChildHeadingChildText",
+ "DocumentTaskChildHeadingChildToolCall",
+ "DocumentTaskChildHeadingChildToolResult",
+ "DocumentTaskChildHeadingChildTraceMessage",
+ "DocumentTaskChildImage",
+ "DocumentTaskChildLink",
+ "DocumentTaskChildLineBreak",
+ "DocumentTaskChildList",
+ "DocumentTaskChildListItem",
+ "DocumentTaskChildListItemChild",
+ "DocumentTaskChildListItemChildBlob",
+ "DocumentTaskChildListItemChildCode",
+ "DocumentTaskChildListItemChildComment",
+ "DocumentTaskChildListItemChildDivider",
+ "DocumentTaskChildListItemChildImage",
+ "DocumentTaskChildListItemChildLink",
+ "DocumentTaskChildListItemChildLineBreak",
+ "DocumentTaskChildListItemChildText",
+ "DocumentTaskChildListItemChildToolCall",
+ "DocumentTaskChildListItemChildToolResult",
+ "DocumentTaskChildListItemChildTraceMessage",
+ "DocumentTaskChildParagraph",
+ "DocumentTaskChildParagraphChild",
+ "DocumentTaskChildParagraphChildBlob",
+ "DocumentTaskChildParagraphChildCode",
+ "DocumentTaskChildParagraphChildComment",
+ "DocumentTaskChildParagraphChildDivider",
+ "DocumentTaskChildParagraphChildImage",
+ "DocumentTaskChildParagraphChildLink",
+ "DocumentTaskChildParagraphChildLineBreak",
+ "DocumentTaskChildParagraphChildText",
+ "DocumentTaskChildParagraphChildToolCall",
+ "DocumentTaskChildParagraphChildToolResult",
+ "DocumentTaskChildParagraphChildTraceMessage",
+ "DocumentTaskChildQuote",
+ "DocumentTaskChildQuoteChild",
+ "DocumentTaskChildQuoteChildBlob",
+ "DocumentTaskChildQuoteChildCode",
+ "DocumentTaskChildQuoteChildComment",
+ "DocumentTaskChildQuoteChildDivider",
+ "DocumentTaskChildQuoteChildImage",
+ "DocumentTaskChildQuoteChildLink",
+ "DocumentTaskChildQuoteChildLineBreak",
+ "DocumentTaskChildQuoteChildText",
+ "DocumentTaskChildQuoteChildToolCall",
+ "DocumentTaskChildQuoteChildToolResult",
+ "DocumentTaskChildQuoteChildTraceMessage",
+ "DocumentTaskChildTable",
+ "DocumentTaskChildTableCell",
+ "DocumentTaskChildTableCellChild",
+ "DocumentTaskChildTableCellChildBlob",
+ "DocumentTaskChildTableCellChildCode",
+ "DocumentTaskChildTableCellChildComment",
+ "DocumentTaskChildTableCellChildDivider",
+ "DocumentTaskChildTableCellChildImage",
+ "DocumentTaskChildTableCellChildLink",
+ "DocumentTaskChildTableCellChildLineBreak",
+ "DocumentTaskChildTableCellChildText",
+ "DocumentTaskChildTableCellChildToolCall",
+ "DocumentTaskChildTableCellChildToolResult",
+ "DocumentTaskChildTableCellChildTraceMessage",
+ "DocumentTaskChildTableRow",
+ "DocumentTaskChildText",
+ "DocumentTaskChildToDo",
+ "DocumentTaskChildToDoChild",
+ "DocumentTaskChildToDoChildBlob",
+ "DocumentTaskChildToDoChildCode",
+ "DocumentTaskChildToDoChildComment",
+ "DocumentTaskChildToDoChildDivider",
+ "DocumentTaskChildToDoChildImage",
+ "DocumentTaskChildToDoChildLink",
+ "DocumentTaskChildToDoChildLineBreak",
+ "DocumentTaskChildToDoChildText",
+ "DocumentTaskChildToDoChildToolCall",
+ "DocumentTaskChildToDoChildToolResult",
+ "DocumentTaskChildToDoChildTraceMessage",
+ "DocumentTaskChildToolCall",
+ "DocumentTaskChildToolResult",
+ "DocumentTaskChildTraceMessage",
+ "DocumentTaskChildUtterance",
+ "DocumentTaskComment",
+ "DocumentTaskCommentSender",
+ "DocumentTaskCommentSenderChild",
+ "DocumentTaskCommentSenderChildBlob",
+ "DocumentTaskCommentSenderChildCode",
+ "DocumentTaskCommentSenderChildComment",
+ "DocumentTaskCommentSenderChildDivider",
+ "DocumentTaskCommentSenderChildImage",
+ "DocumentTaskCommentSenderChildLink",
+ "DocumentTaskCommentSenderChildLineBreak",
+ "DocumentTaskCommentSenderChildText",
+ "DocumentTaskCommentSenderChildToolCall",
+ "DocumentTaskCommentSenderChildToolResult",
+ "DocumentTaskCommentSenderChildTraceMessage",
+ "DocumentTaskCommentChild",
+ "DocumentTaskCommentChildBlob",
+ "DocumentTaskCommentChildCallout",
+ "DocumentTaskCommentChildCalloutChild",
+ "DocumentTaskCommentChildCalloutChildBlob",
+ "DocumentTaskCommentChildCalloutChildCode",
+ "DocumentTaskCommentChildCalloutChildComment",
+ "DocumentTaskCommentChildCalloutChildDivider",
+ "DocumentTaskCommentChildCalloutChildImage",
+ "DocumentTaskCommentChildCalloutChildLink",
+ "DocumentTaskCommentChildCalloutChildLineBreak",
+ "DocumentTaskCommentChildCalloutChildText",
+ "DocumentTaskCommentChildCalloutChildToolCall",
+ "DocumentTaskCommentChildCalloutChildToolResult",
+ "DocumentTaskCommentChildCalloutChildTraceMessage",
+ "DocumentTaskCommentChildChunk",
+ "DocumentTaskCommentChildChunkChild",
+ "DocumentTaskCommentChildChunkChildBlob",
+ "DocumentTaskCommentChildChunkChildCode",
+ "DocumentTaskCommentChildChunkChildComment",
+ "DocumentTaskCommentChildChunkChildDivider",
+ "DocumentTaskCommentChildChunkChildImage",
+ "DocumentTaskCommentChildChunkChildLink",
+ "DocumentTaskCommentChildChunkChildLineBreak",
+ "DocumentTaskCommentChildChunkChildText",
+ "DocumentTaskCommentChildChunkChildToolCall",
+ "DocumentTaskCommentChildChunkChildToolResult",
+ "DocumentTaskCommentChildChunkChildTraceMessage",
+ "DocumentTaskCommentChildCode",
+ "DocumentTaskCommentChildComment",
+ "DocumentTaskCommentChildDivider",
+ "DocumentTaskCommentChildEquation",
+ "DocumentTaskCommentChildEquationChild",
+ "DocumentTaskCommentChildEquationChildBlob",
+ "DocumentTaskCommentChildEquationChildCode",
+ "DocumentTaskCommentChildEquationChildComment",
+ "DocumentTaskCommentChildEquationChildDivider",
+ "DocumentTaskCommentChildEquationChildImage",
+ "DocumentTaskCommentChildEquationChildLink",
+ "DocumentTaskCommentChildEquationChildLineBreak",
+ "DocumentTaskCommentChildEquationChildText",
+ "DocumentTaskCommentChildEquationChildToolCall",
+ "DocumentTaskCommentChildEquationChildToolResult",
+ "DocumentTaskCommentChildEquationChildTraceMessage",
+ "DocumentTaskCommentChildFootnote",
+ "DocumentTaskCommentChildFootnoteChild",
+ "DocumentTaskCommentChildFootnoteChildBlob",
+ "DocumentTaskCommentChildFootnoteChildCode",
+ "DocumentTaskCommentChildFootnoteChildComment",
+ "DocumentTaskCommentChildFootnoteChildDivider",
+ "DocumentTaskCommentChildFootnoteChildImage",
+ "DocumentTaskCommentChildFootnoteChildLink",
+ "DocumentTaskCommentChildFootnoteChildLineBreak",
+ "DocumentTaskCommentChildFootnoteChildText",
+ "DocumentTaskCommentChildFootnoteChildToolCall",
+ "DocumentTaskCommentChildFootnoteChildToolResult",
+ "DocumentTaskCommentChildFootnoteChildTraceMessage",
+ "DocumentTaskCommentChildHeading",
+ "DocumentTaskCommentChildHeadingChild",
+ "DocumentTaskCommentChildHeadingChildBlob",
+ "DocumentTaskCommentChildHeadingChildCode",
+ "DocumentTaskCommentChildHeadingChildComment",
+ "DocumentTaskCommentChildHeadingChildDivider",
+ "DocumentTaskCommentChildHeadingChildImage",
+ "DocumentTaskCommentChildHeadingChildLink",
+ "DocumentTaskCommentChildHeadingChildLineBreak",
+ "DocumentTaskCommentChildHeadingChildText",
+ "DocumentTaskCommentChildHeadingChildToolCall",
+ "DocumentTaskCommentChildHeadingChildToolResult",
+ "DocumentTaskCommentChildHeadingChildTraceMessage",
+ "DocumentTaskCommentChildImage",
+ "DocumentTaskCommentChildLink",
+ "DocumentTaskCommentChildLineBreak",
+ "DocumentTaskCommentChildList",
+ "DocumentTaskCommentChildListItem",
+ "DocumentTaskCommentChildListItemChild",
+ "DocumentTaskCommentChildListItemChildBlob",
+ "DocumentTaskCommentChildListItemChildCode",
+ "DocumentTaskCommentChildListItemChildComment",
+ "DocumentTaskCommentChildListItemChildDivider",
+ "DocumentTaskCommentChildListItemChildImage",
+ "DocumentTaskCommentChildListItemChildLink",
+ "DocumentTaskCommentChildListItemChildLineBreak",
+ "DocumentTaskCommentChildListItemChildText",
+ "DocumentTaskCommentChildListItemChildToolCall",
+ "DocumentTaskCommentChildListItemChildToolResult",
+ "DocumentTaskCommentChildListItemChildTraceMessage",
+ "DocumentTaskCommentChildParagraph",
+ "DocumentTaskCommentChildParagraphChild",
+ "DocumentTaskCommentChildParagraphChildBlob",
+ "DocumentTaskCommentChildParagraphChildCode",
+ "DocumentTaskCommentChildParagraphChildComment",
+ "DocumentTaskCommentChildParagraphChildDivider",
+ "DocumentTaskCommentChildParagraphChildImage",
+ "DocumentTaskCommentChildParagraphChildLink",
+ "DocumentTaskCommentChildParagraphChildLineBreak",
+ "DocumentTaskCommentChildParagraphChildText",
+ "DocumentTaskCommentChildParagraphChildToolCall",
+ "DocumentTaskCommentChildParagraphChildToolResult",
+ "DocumentTaskCommentChildParagraphChildTraceMessage",
+ "DocumentTaskCommentChildQuote",
+ "DocumentTaskCommentChildQuoteChild",
+ "DocumentTaskCommentChildQuoteChildBlob",
+ "DocumentTaskCommentChildQuoteChildCode",
+ "DocumentTaskCommentChildQuoteChildComment",
+ "DocumentTaskCommentChildQuoteChildDivider",
+ "DocumentTaskCommentChildQuoteChildImage",
+ "DocumentTaskCommentChildQuoteChildLink",
+ "DocumentTaskCommentChildQuoteChildLineBreak",
+ "DocumentTaskCommentChildQuoteChildText",
+ "DocumentTaskCommentChildQuoteChildToolCall",
+ "DocumentTaskCommentChildQuoteChildToolResult",
+ "DocumentTaskCommentChildQuoteChildTraceMessage",
+ "DocumentTaskCommentChildTable",
+ "DocumentTaskCommentChildTableCell",
+ "DocumentTaskCommentChildTableCellChild",
+ "DocumentTaskCommentChildTableCellChildBlob",
+ "DocumentTaskCommentChildTableCellChildCode",
+ "DocumentTaskCommentChildTableCellChildComment",
+ "DocumentTaskCommentChildTableCellChildDivider",
+ "DocumentTaskCommentChildTableCellChildImage",
+ "DocumentTaskCommentChildTableCellChildLink",
+ "DocumentTaskCommentChildTableCellChildLineBreak",
+ "DocumentTaskCommentChildTableCellChildText",
+ "DocumentTaskCommentChildTableCellChildToolCall",
+ "DocumentTaskCommentChildTableCellChildToolResult",
+ "DocumentTaskCommentChildTableCellChildTraceMessage",
+ "DocumentTaskCommentChildTableRow",
+ "DocumentTaskCommentChildText",
+ "DocumentTaskCommentChildToDo",
+ "DocumentTaskCommentChildToDoChild",
+ "DocumentTaskCommentChildToDoChildBlob",
+ "DocumentTaskCommentChildToDoChildCode",
+ "DocumentTaskCommentChildToDoChildComment",
+ "DocumentTaskCommentChildToDoChildDivider",
+ "DocumentTaskCommentChildToDoChildImage",
+ "DocumentTaskCommentChildToDoChildLink",
+ "DocumentTaskCommentChildToDoChildLineBreak",
+ "DocumentTaskCommentChildToDoChildText",
+ "DocumentTaskCommentChildToDoChildToolCall",
+ "DocumentTaskCommentChildToDoChildToolResult",
+ "DocumentTaskCommentChildToDoChildTraceMessage",
+ "DocumentTaskCommentChildToolCall",
+ "DocumentTaskCommentChildToolResult",
+ "DocumentTaskCommentChildTraceMessage",
+ "DocumentTaskCommentChildUtterance",
+ "DocumentTaskCommentMentionedUser",
+ "DocumentTaskCommentMentionedUserChild",
+ "DocumentTaskCommentMentionedUserChildBlob",
+ "DocumentTaskCommentMentionedUserChildCode",
+ "DocumentTaskCommentMentionedUserChildComment",
+ "DocumentTaskCommentMentionedUserChildDivider",
+ "DocumentTaskCommentMentionedUserChildImage",
+ "DocumentTaskCommentMentionedUserChildLink",
+ "DocumentTaskCommentMentionedUserChildLineBreak",
+ "DocumentTaskCommentMentionedUserChildText",
+ "DocumentTaskCommentMentionedUserChildToolCall",
+ "DocumentTaskCommentMentionedUserChildToolResult",
+ "DocumentTaskCommentMentionedUserChildTraceMessage",
+ "DocumentPerson",
+ "DocumentPersonChild",
+ "DocumentPersonChildBlob",
+ "DocumentPersonChildCode",
+ "DocumentPersonChildComment",
+ "DocumentPersonChildDivider",
+ "DocumentPersonChildImage",
+ "DocumentPersonChildLink",
+ "DocumentPersonChildLineBreak",
+ "DocumentPersonChildText",
+ "DocumentPersonChildToolCall",
+ "DocumentPersonChildToolResult",
+ "DocumentPersonChildTraceMessage",
+ "DocumentMessage",
+ "DocumentMessageSender",
+ "DocumentMessageSenderChild",
+ "DocumentMessageSenderChildBlob",
+ "DocumentMessageSenderChildCode",
+ "DocumentMessageSenderChildComment",
+ "DocumentMessageSenderChildDivider",
+ "DocumentMessageSenderChildImage",
+ "DocumentMessageSenderChildLink",
+ "DocumentMessageSenderChildLineBreak",
+ "DocumentMessageSenderChildText",
+ "DocumentMessageSenderChildToolCall",
+ "DocumentMessageSenderChildToolResult",
+ "DocumentMessageSenderChildTraceMessage",
+ "DocumentMessageChild",
+ "DocumentMessageChildBlob",
+ "DocumentMessageChildCallout",
+ "DocumentMessageChildCalloutChild",
+ "DocumentMessageChildCalloutChildBlob",
+ "DocumentMessageChildCalloutChildCode",
+ "DocumentMessageChildCalloutChildComment",
+ "DocumentMessageChildCalloutChildDivider",
+ "DocumentMessageChildCalloutChildImage",
+ "DocumentMessageChildCalloutChildLink",
+ "DocumentMessageChildCalloutChildLineBreak",
+ "DocumentMessageChildCalloutChildText",
+ "DocumentMessageChildCalloutChildToolCall",
+ "DocumentMessageChildCalloutChildToolResult",
+ "DocumentMessageChildCalloutChildTraceMessage",
+ "DocumentMessageChildChunk",
+ "DocumentMessageChildChunkChild",
+ "DocumentMessageChildChunkChildBlob",
+ "DocumentMessageChildChunkChildCode",
+ "DocumentMessageChildChunkChildComment",
+ "DocumentMessageChildChunkChildDivider",
+ "DocumentMessageChildChunkChildImage",
+ "DocumentMessageChildChunkChildLink",
+ "DocumentMessageChildChunkChildLineBreak",
+ "DocumentMessageChildChunkChildText",
+ "DocumentMessageChildChunkChildToolCall",
+ "DocumentMessageChildChunkChildToolResult",
+ "DocumentMessageChildChunkChildTraceMessage",
+ "DocumentMessageChildCode",
+ "DocumentMessageChildComment",
+ "DocumentMessageChildDivider",
+ "DocumentMessageChildEquation",
+ "DocumentMessageChildEquationChild",
+ "DocumentMessageChildEquationChildBlob",
+ "DocumentMessageChildEquationChildCode",
+ "DocumentMessageChildEquationChildComment",
+ "DocumentMessageChildEquationChildDivider",
+ "DocumentMessageChildEquationChildImage",
+ "DocumentMessageChildEquationChildLink",
+ "DocumentMessageChildEquationChildLineBreak",
+ "DocumentMessageChildEquationChildText",
+ "DocumentMessageChildEquationChildToolCall",
+ "DocumentMessageChildEquationChildToolResult",
+ "DocumentMessageChildEquationChildTraceMessage",
+ "DocumentMessageChildFootnote",
+ "DocumentMessageChildFootnoteChild",
+ "DocumentMessageChildFootnoteChildBlob",
+ "DocumentMessageChildFootnoteChildCode",
+ "DocumentMessageChildFootnoteChildComment",
+ "DocumentMessageChildFootnoteChildDivider",
+ "DocumentMessageChildFootnoteChildImage",
+ "DocumentMessageChildFootnoteChildLink",
+ "DocumentMessageChildFootnoteChildLineBreak",
+ "DocumentMessageChildFootnoteChildText",
+ "DocumentMessageChildFootnoteChildToolCall",
+ "DocumentMessageChildFootnoteChildToolResult",
+ "DocumentMessageChildFootnoteChildTraceMessage",
+ "DocumentMessageChildHeading",
+ "DocumentMessageChildHeadingChild",
+ "DocumentMessageChildHeadingChildBlob",
+ "DocumentMessageChildHeadingChildCode",
+ "DocumentMessageChildHeadingChildComment",
+ "DocumentMessageChildHeadingChildDivider",
+ "DocumentMessageChildHeadingChildImage",
+ "DocumentMessageChildHeadingChildLink",
+ "DocumentMessageChildHeadingChildLineBreak",
+ "DocumentMessageChildHeadingChildText",
+ "DocumentMessageChildHeadingChildToolCall",
+ "DocumentMessageChildHeadingChildToolResult",
+ "DocumentMessageChildHeadingChildTraceMessage",
+ "DocumentMessageChildImage",
+ "DocumentMessageChildLink",
+ "DocumentMessageChildLineBreak",
+ "DocumentMessageChildList",
+ "DocumentMessageChildListItem",
+ "DocumentMessageChildListItemChild",
+ "DocumentMessageChildListItemChildBlob",
+ "DocumentMessageChildListItemChildCode",
+ "DocumentMessageChildListItemChildComment",
+ "DocumentMessageChildListItemChildDivider",
+ "DocumentMessageChildListItemChildImage",
+ "DocumentMessageChildListItemChildLink",
+ "DocumentMessageChildListItemChildLineBreak",
+ "DocumentMessageChildListItemChildText",
+ "DocumentMessageChildListItemChildToolCall",
+ "DocumentMessageChildListItemChildToolResult",
+ "DocumentMessageChildListItemChildTraceMessage",
+ "DocumentMessageChildParagraph",
+ "DocumentMessageChildParagraphChild",
+ "DocumentMessageChildParagraphChildBlob",
+ "DocumentMessageChildParagraphChildCode",
+ "DocumentMessageChildParagraphChildComment",
+ "DocumentMessageChildParagraphChildDivider",
+ "DocumentMessageChildParagraphChildImage",
+ "DocumentMessageChildParagraphChildLink",
+ "DocumentMessageChildParagraphChildLineBreak",
+ "DocumentMessageChildParagraphChildText",
+ "DocumentMessageChildParagraphChildToolCall",
+ "DocumentMessageChildParagraphChildToolResult",
+ "DocumentMessageChildParagraphChildTraceMessage",
+ "DocumentMessageChildQuote",
+ "DocumentMessageChildQuoteChild",
+ "DocumentMessageChildQuoteChildBlob",
+ "DocumentMessageChildQuoteChildCode",
+ "DocumentMessageChildQuoteChildComment",
+ "DocumentMessageChildQuoteChildDivider",
+ "DocumentMessageChildQuoteChildImage",
+ "DocumentMessageChildQuoteChildLink",
+ "DocumentMessageChildQuoteChildLineBreak",
+ "DocumentMessageChildQuoteChildText",
+ "DocumentMessageChildQuoteChildToolCall",
+ "DocumentMessageChildQuoteChildToolResult",
+ "DocumentMessageChildQuoteChildTraceMessage",
+ "DocumentMessageChildTable",
+ "DocumentMessageChildTableCell",
+ "DocumentMessageChildTableCellChild",
+ "DocumentMessageChildTableCellChildBlob",
+ "DocumentMessageChildTableCellChildCode",
+ "DocumentMessageChildTableCellChildComment",
+ "DocumentMessageChildTableCellChildDivider",
+ "DocumentMessageChildTableCellChildImage",
+ "DocumentMessageChildTableCellChildLink",
+ "DocumentMessageChildTableCellChildLineBreak",
+ "DocumentMessageChildTableCellChildText",
+ "DocumentMessageChildTableCellChildToolCall",
+ "DocumentMessageChildTableCellChildToolResult",
+ "DocumentMessageChildTableCellChildTraceMessage",
+ "DocumentMessageChildTableRow",
+ "DocumentMessageChildText",
+ "DocumentMessageChildToDo",
+ "DocumentMessageChildToDoChild",
+ "DocumentMessageChildToDoChildBlob",
+ "DocumentMessageChildToDoChildCode",
+ "DocumentMessageChildToDoChildComment",
+ "DocumentMessageChildToDoChildDivider",
+ "DocumentMessageChildToDoChildImage",
+ "DocumentMessageChildToDoChildLink",
+ "DocumentMessageChildToDoChildLineBreak",
+ "DocumentMessageChildToDoChildText",
+ "DocumentMessageChildToDoChildToolCall",
+ "DocumentMessageChildToDoChildToolResult",
+ "DocumentMessageChildToDoChildTraceMessage",
+ "DocumentMessageChildToolCall",
+ "DocumentMessageChildToolResult",
+ "DocumentMessageChildTraceMessage",
+ "DocumentMessageChildUtterance",
+ "DocumentMessageMentionedUser",
+ "DocumentMessageMentionedUserChild",
+ "DocumentMessageMentionedUserChildBlob",
+ "DocumentMessageMentionedUserChildCode",
+ "DocumentMessageMentionedUserChildComment",
+ "DocumentMessageMentionedUserChildDivider",
+ "DocumentMessageMentionedUserChildImage",
+ "DocumentMessageMentionedUserChildLink",
+ "DocumentMessageMentionedUserChildLineBreak",
+ "DocumentMessageMentionedUserChildText",
+ "DocumentMessageMentionedUserChildToolCall",
+ "DocumentMessageMentionedUserChildToolResult",
+ "DocumentMessageMentionedUserChildTraceMessage",
+ "DocumentEvent",
+ "DocumentEventAttendee",
+ "DocumentEventAttendeeChild",
+ "DocumentEventAttendeeChildBlob",
+ "DocumentEventAttendeeChildCode",
+ "DocumentEventAttendeeChildComment",
+ "DocumentEventAttendeeChildDivider",
+ "DocumentEventAttendeeChildImage",
+ "DocumentEventAttendeeChildLink",
+ "DocumentEventAttendeeChildLineBreak",
+ "DocumentEventAttendeeChildText",
+ "DocumentEventAttendeeChildToolCall",
+ "DocumentEventAttendeeChildToolResult",
+ "DocumentEventAttendeeChildTraceMessage",
+ "DocumentEventChild",
+ "DocumentEventChildBlob",
+ "DocumentEventChildCallout",
+ "DocumentEventChildCalloutChild",
+ "DocumentEventChildCalloutChildBlob",
+ "DocumentEventChildCalloutChildCode",
+ "DocumentEventChildCalloutChildComment",
+ "DocumentEventChildCalloutChildDivider",
+ "DocumentEventChildCalloutChildImage",
+ "DocumentEventChildCalloutChildLink",
+ "DocumentEventChildCalloutChildLineBreak",
+ "DocumentEventChildCalloutChildText",
+ "DocumentEventChildCalloutChildToolCall",
+ "DocumentEventChildCalloutChildToolResult",
+ "DocumentEventChildCalloutChildTraceMessage",
+ "DocumentEventChildChunk",
+ "DocumentEventChildChunkChild",
+ "DocumentEventChildChunkChildBlob",
+ "DocumentEventChildChunkChildCode",
+ "DocumentEventChildChunkChildComment",
+ "DocumentEventChildChunkChildDivider",
+ "DocumentEventChildChunkChildImage",
+ "DocumentEventChildChunkChildLink",
+ "DocumentEventChildChunkChildLineBreak",
+ "DocumentEventChildChunkChildText",
+ "DocumentEventChildChunkChildToolCall",
+ "DocumentEventChildChunkChildToolResult",
+ "DocumentEventChildChunkChildTraceMessage",
+ "DocumentEventChildCode",
+ "DocumentEventChildComment",
+ "DocumentEventChildDivider",
+ "DocumentEventChildEquation",
+ "DocumentEventChildEquationChild",
+ "DocumentEventChildEquationChildBlob",
+ "DocumentEventChildEquationChildCode",
+ "DocumentEventChildEquationChildComment",
+ "DocumentEventChildEquationChildDivider",
+ "DocumentEventChildEquationChildImage",
+ "DocumentEventChildEquationChildLink",
+ "DocumentEventChildEquationChildLineBreak",
+ "DocumentEventChildEquationChildText",
+ "DocumentEventChildEquationChildToolCall",
+ "DocumentEventChildEquationChildToolResult",
+ "DocumentEventChildEquationChildTraceMessage",
+ "DocumentEventChildFootnote",
+ "DocumentEventChildFootnoteChild",
+ "DocumentEventChildFootnoteChildBlob",
+ "DocumentEventChildFootnoteChildCode",
+ "DocumentEventChildFootnoteChildComment",
+ "DocumentEventChildFootnoteChildDivider",
+ "DocumentEventChildFootnoteChildImage",
+ "DocumentEventChildFootnoteChildLink",
+ "DocumentEventChildFootnoteChildLineBreak",
+ "DocumentEventChildFootnoteChildText",
+ "DocumentEventChildFootnoteChildToolCall",
+ "DocumentEventChildFootnoteChildToolResult",
+ "DocumentEventChildFootnoteChildTraceMessage",
+ "DocumentEventChildHeading",
+ "DocumentEventChildHeadingChild",
+ "DocumentEventChildHeadingChildBlob",
+ "DocumentEventChildHeadingChildCode",
+ "DocumentEventChildHeadingChildComment",
+ "DocumentEventChildHeadingChildDivider",
+ "DocumentEventChildHeadingChildImage",
+ "DocumentEventChildHeadingChildLink",
+ "DocumentEventChildHeadingChildLineBreak",
+ "DocumentEventChildHeadingChildText",
+ "DocumentEventChildHeadingChildToolCall",
+ "DocumentEventChildHeadingChildToolResult",
+ "DocumentEventChildHeadingChildTraceMessage",
+ "DocumentEventChildImage",
+ "DocumentEventChildLink",
+ "DocumentEventChildLineBreak",
+ "DocumentEventChildList",
+ "DocumentEventChildListItem",
+ "DocumentEventChildListItemChild",
+ "DocumentEventChildListItemChildBlob",
+ "DocumentEventChildListItemChildCode",
+ "DocumentEventChildListItemChildComment",
+ "DocumentEventChildListItemChildDivider",
+ "DocumentEventChildListItemChildImage",
+ "DocumentEventChildListItemChildLink",
+ "DocumentEventChildListItemChildLineBreak",
+ "DocumentEventChildListItemChildText",
+ "DocumentEventChildListItemChildToolCall",
+ "DocumentEventChildListItemChildToolResult",
+ "DocumentEventChildListItemChildTraceMessage",
+ "DocumentEventChildParagraph",
+ "DocumentEventChildParagraphChild",
+ "DocumentEventChildParagraphChildBlob",
+ "DocumentEventChildParagraphChildCode",
+ "DocumentEventChildParagraphChildComment",
+ "DocumentEventChildParagraphChildDivider",
+ "DocumentEventChildParagraphChildImage",
+ "DocumentEventChildParagraphChildLink",
+ "DocumentEventChildParagraphChildLineBreak",
+ "DocumentEventChildParagraphChildText",
+ "DocumentEventChildParagraphChildToolCall",
+ "DocumentEventChildParagraphChildToolResult",
+ "DocumentEventChildParagraphChildTraceMessage",
+ "DocumentEventChildQuote",
+ "DocumentEventChildQuoteChild",
+ "DocumentEventChildQuoteChildBlob",
+ "DocumentEventChildQuoteChildCode",
+ "DocumentEventChildQuoteChildComment",
+ "DocumentEventChildQuoteChildDivider",
+ "DocumentEventChildQuoteChildImage",
+ "DocumentEventChildQuoteChildLink",
+ "DocumentEventChildQuoteChildLineBreak",
+ "DocumentEventChildQuoteChildText",
+ "DocumentEventChildQuoteChildToolCall",
+ "DocumentEventChildQuoteChildToolResult",
+ "DocumentEventChildQuoteChildTraceMessage",
+ "DocumentEventChildTable",
+ "DocumentEventChildTableCell",
+ "DocumentEventChildTableCellChild",
+ "DocumentEventChildTableCellChildBlob",
+ "DocumentEventChildTableCellChildCode",
+ "DocumentEventChildTableCellChildComment",
+ "DocumentEventChildTableCellChildDivider",
+ "DocumentEventChildTableCellChildImage",
+ "DocumentEventChildTableCellChildLink",
+ "DocumentEventChildTableCellChildLineBreak",
+ "DocumentEventChildTableCellChildText",
+ "DocumentEventChildTableCellChildToolCall",
+ "DocumentEventChildTableCellChildToolResult",
+ "DocumentEventChildTableCellChildTraceMessage",
+ "DocumentEventChildTableRow",
+ "DocumentEventChildText",
+ "DocumentEventChildToDo",
+ "DocumentEventChildToDoChild",
+ "DocumentEventChildToDoChildBlob",
+ "DocumentEventChildToDoChildCode",
+ "DocumentEventChildToDoChildComment",
+ "DocumentEventChildToDoChildDivider",
+ "DocumentEventChildToDoChildImage",
+ "DocumentEventChildToDoChildLink",
+ "DocumentEventChildToDoChildLineBreak",
+ "DocumentEventChildToDoChildText",
+ "DocumentEventChildToDoChildToolCall",
+ "DocumentEventChildToDoChildToolResult",
+ "DocumentEventChildToDoChildTraceMessage",
+ "DocumentEventChildToolCall",
+ "DocumentEventChildToolResult",
+ "DocumentEventChildTraceMessage",
+ "DocumentEventChildUtterance",
+ "DocumentFile",
+ "DocumentFileChild",
+ "DocumentFileChildBlob",
+ "DocumentFileChildCallout",
+ "DocumentFileChildCalloutChild",
+ "DocumentFileChildCalloutChildBlob",
+ "DocumentFileChildCalloutChildCode",
+ "DocumentFileChildCalloutChildComment",
+ "DocumentFileChildCalloutChildDivider",
+ "DocumentFileChildCalloutChildImage",
+ "DocumentFileChildCalloutChildLink",
+ "DocumentFileChildCalloutChildLineBreak",
+ "DocumentFileChildCalloutChildText",
+ "DocumentFileChildCalloutChildToolCall",
+ "DocumentFileChildCalloutChildToolResult",
+ "DocumentFileChildCalloutChildTraceMessage",
+ "DocumentFileChildChunk",
+ "DocumentFileChildChunkChild",
+ "DocumentFileChildChunkChildBlob",
+ "DocumentFileChildChunkChildCode",
+ "DocumentFileChildChunkChildComment",
+ "DocumentFileChildChunkChildDivider",
+ "DocumentFileChildChunkChildImage",
+ "DocumentFileChildChunkChildLink",
+ "DocumentFileChildChunkChildLineBreak",
+ "DocumentFileChildChunkChildText",
+ "DocumentFileChildChunkChildToolCall",
+ "DocumentFileChildChunkChildToolResult",
+ "DocumentFileChildChunkChildTraceMessage",
+ "DocumentFileChildCode",
+ "DocumentFileChildComment",
+ "DocumentFileChildDivider",
+ "DocumentFileChildEquation",
+ "DocumentFileChildEquationChild",
+ "DocumentFileChildEquationChildBlob",
+ "DocumentFileChildEquationChildCode",
+ "DocumentFileChildEquationChildComment",
+ "DocumentFileChildEquationChildDivider",
+ "DocumentFileChildEquationChildImage",
+ "DocumentFileChildEquationChildLink",
+ "DocumentFileChildEquationChildLineBreak",
+ "DocumentFileChildEquationChildText",
+ "DocumentFileChildEquationChildToolCall",
+ "DocumentFileChildEquationChildToolResult",
+ "DocumentFileChildEquationChildTraceMessage",
+ "DocumentFileChildFootnote",
+ "DocumentFileChildFootnoteChild",
+ "DocumentFileChildFootnoteChildBlob",
+ "DocumentFileChildFootnoteChildCode",
+ "DocumentFileChildFootnoteChildComment",
+ "DocumentFileChildFootnoteChildDivider",
+ "DocumentFileChildFootnoteChildImage",
+ "DocumentFileChildFootnoteChildLink",
+ "DocumentFileChildFootnoteChildLineBreak",
+ "DocumentFileChildFootnoteChildText",
+ "DocumentFileChildFootnoteChildToolCall",
+ "DocumentFileChildFootnoteChildToolResult",
+ "DocumentFileChildFootnoteChildTraceMessage",
+ "DocumentFileChildHeading",
+ "DocumentFileChildHeadingChild",
+ "DocumentFileChildHeadingChildBlob",
+ "DocumentFileChildHeadingChildCode",
+ "DocumentFileChildHeadingChildComment",
+ "DocumentFileChildHeadingChildDivider",
+ "DocumentFileChildHeadingChildImage",
+ "DocumentFileChildHeadingChildLink",
+ "DocumentFileChildHeadingChildLineBreak",
+ "DocumentFileChildHeadingChildText",
+ "DocumentFileChildHeadingChildToolCall",
+ "DocumentFileChildHeadingChildToolResult",
+ "DocumentFileChildHeadingChildTraceMessage",
+ "DocumentFileChildImage",
+ "DocumentFileChildLink",
+ "DocumentFileChildLineBreak",
+ "DocumentFileChildList",
+ "DocumentFileChildListItem",
+ "DocumentFileChildListItemChild",
+ "DocumentFileChildListItemChildBlob",
+ "DocumentFileChildListItemChildCode",
+ "DocumentFileChildListItemChildComment",
+ "DocumentFileChildListItemChildDivider",
+ "DocumentFileChildListItemChildImage",
+ "DocumentFileChildListItemChildLink",
+ "DocumentFileChildListItemChildLineBreak",
+ "DocumentFileChildListItemChildText",
+ "DocumentFileChildListItemChildToolCall",
+ "DocumentFileChildListItemChildToolResult",
+ "DocumentFileChildListItemChildTraceMessage",
+ "DocumentFileChildParagraph",
+ "DocumentFileChildParagraphChild",
+ "DocumentFileChildParagraphChildBlob",
+ "DocumentFileChildParagraphChildCode",
+ "DocumentFileChildParagraphChildComment",
+ "DocumentFileChildParagraphChildDivider",
+ "DocumentFileChildParagraphChildImage",
+ "DocumentFileChildParagraphChildLink",
+ "DocumentFileChildParagraphChildLineBreak",
+ "DocumentFileChildParagraphChildText",
+ "DocumentFileChildParagraphChildToolCall",
+ "DocumentFileChildParagraphChildToolResult",
+ "DocumentFileChildParagraphChildTraceMessage",
+ "DocumentFileChildQuote",
+ "DocumentFileChildQuoteChild",
+ "DocumentFileChildQuoteChildBlob",
+ "DocumentFileChildQuoteChildCode",
+ "DocumentFileChildQuoteChildComment",
+ "DocumentFileChildQuoteChildDivider",
+ "DocumentFileChildQuoteChildImage",
+ "DocumentFileChildQuoteChildLink",
+ "DocumentFileChildQuoteChildLineBreak",
+ "DocumentFileChildQuoteChildText",
+ "DocumentFileChildQuoteChildToolCall",
+ "DocumentFileChildQuoteChildToolResult",
+ "DocumentFileChildQuoteChildTraceMessage",
+ "DocumentFileChildTable",
+ "DocumentFileChildTableCell",
+ "DocumentFileChildTableCellChild",
+ "DocumentFileChildTableCellChildBlob",
+ "DocumentFileChildTableCellChildCode",
+ "DocumentFileChildTableCellChildComment",
+ "DocumentFileChildTableCellChildDivider",
+ "DocumentFileChildTableCellChildImage",
+ "DocumentFileChildTableCellChildLink",
+ "DocumentFileChildTableCellChildLineBreak",
+ "DocumentFileChildTableCellChildText",
+ "DocumentFileChildTableCellChildToolCall",
+ "DocumentFileChildTableCellChildToolResult",
+ "DocumentFileChildTableCellChildTraceMessage",
+ "DocumentFileChildTableRow",
+ "DocumentFileChildText",
+ "DocumentFileChildToDo",
+ "DocumentFileChildToDoChild",
+ "DocumentFileChildToDoChildBlob",
+ "DocumentFileChildToDoChildCode",
+ "DocumentFileChildToDoChildComment",
+ "DocumentFileChildToDoChildDivider",
+ "DocumentFileChildToDoChildImage",
+ "DocumentFileChildToDoChildLink",
+ "DocumentFileChildToDoChildLineBreak",
+ "DocumentFileChildToDoChildText",
+ "DocumentFileChildToDoChildToolCall",
+ "DocumentFileChildToDoChildToolResult",
+ "DocumentFileChildToDoChildTraceMessage",
+ "DocumentFileChildToolCall",
+ "DocumentFileChildToolResult",
+ "DocumentFileChildTraceMessage",
+ "DocumentFileChildUtterance",
+ "DocumentConversation",
+ "DocumentConversationChild",
+ "DocumentConversationChildSender",
+ "DocumentConversationChildSenderChild",
+ "DocumentConversationChildSenderChildBlob",
+ "DocumentConversationChildSenderChildCode",
+ "DocumentConversationChildSenderChildComment",
+ "DocumentConversationChildSenderChildDivider",
+ "DocumentConversationChildSenderChildImage",
+ "DocumentConversationChildSenderChildLink",
+ "DocumentConversationChildSenderChildLineBreak",
+ "DocumentConversationChildSenderChildText",
+ "DocumentConversationChildSenderChildToolCall",
+ "DocumentConversationChildSenderChildToolResult",
+ "DocumentConversationChildSenderChildTraceMessage",
+ "DocumentConversationChildChild",
+ "DocumentConversationChildChildBlob",
+ "DocumentConversationChildChildCallout",
+ "DocumentConversationChildChildCalloutChild",
+ "DocumentConversationChildChildCalloutChildBlob",
+ "DocumentConversationChildChildCalloutChildCode",
+ "DocumentConversationChildChildCalloutChildComment",
+ "DocumentConversationChildChildCalloutChildDivider",
+ "DocumentConversationChildChildCalloutChildImage",
+ "DocumentConversationChildChildCalloutChildLink",
+ "DocumentConversationChildChildCalloutChildLineBreak",
+ "DocumentConversationChildChildCalloutChildText",
+ "DocumentConversationChildChildCalloutChildToolCall",
+ "DocumentConversationChildChildCalloutChildToolResult",
+ "DocumentConversationChildChildCalloutChildTraceMessage",
+ "DocumentConversationChildChildChunk",
+ "DocumentConversationChildChildChunkChild",
+ "DocumentConversationChildChildChunkChildBlob",
+ "DocumentConversationChildChildChunkChildCode",
+ "DocumentConversationChildChildChunkChildComment",
+ "DocumentConversationChildChildChunkChildDivider",
+ "DocumentConversationChildChildChunkChildImage",
+ "DocumentConversationChildChildChunkChildLink",
+ "DocumentConversationChildChildChunkChildLineBreak",
+ "DocumentConversationChildChildChunkChildText",
+ "DocumentConversationChildChildChunkChildToolCall",
+ "DocumentConversationChildChildChunkChildToolResult",
+ "DocumentConversationChildChildChunkChildTraceMessage",
+ "DocumentConversationChildChildCode",
+ "DocumentConversationChildChildComment",
+ "DocumentConversationChildChildDivider",
+ "DocumentConversationChildChildEquation",
+ "DocumentConversationChildChildEquationChild",
+ "DocumentConversationChildChildEquationChildBlob",
+ "DocumentConversationChildChildEquationChildCode",
+ "DocumentConversationChildChildEquationChildComment",
+ "DocumentConversationChildChildEquationChildDivider",
+ "DocumentConversationChildChildEquationChildImage",
+ "DocumentConversationChildChildEquationChildLink",
+ "DocumentConversationChildChildEquationChildLineBreak",
+ "DocumentConversationChildChildEquationChildText",
+ "DocumentConversationChildChildEquationChildToolCall",
+ "DocumentConversationChildChildEquationChildToolResult",
+ "DocumentConversationChildChildEquationChildTraceMessage",
+ "DocumentConversationChildChildFootnote",
+ "DocumentConversationChildChildFootnoteChild",
+ "DocumentConversationChildChildFootnoteChildBlob",
+ "DocumentConversationChildChildFootnoteChildCode",
+ "DocumentConversationChildChildFootnoteChildComment",
+ "DocumentConversationChildChildFootnoteChildDivider",
+ "DocumentConversationChildChildFootnoteChildImage",
+ "DocumentConversationChildChildFootnoteChildLink",
+ "DocumentConversationChildChildFootnoteChildLineBreak",
+ "DocumentConversationChildChildFootnoteChildText",
+ "DocumentConversationChildChildFootnoteChildToolCall",
+ "DocumentConversationChildChildFootnoteChildToolResult",
+ "DocumentConversationChildChildFootnoteChildTraceMessage",
+ "DocumentConversationChildChildHeading",
+ "DocumentConversationChildChildHeadingChild",
+ "DocumentConversationChildChildHeadingChildBlob",
+ "DocumentConversationChildChildHeadingChildCode",
+ "DocumentConversationChildChildHeadingChildComment",
+ "DocumentConversationChildChildHeadingChildDivider",
+ "DocumentConversationChildChildHeadingChildImage",
+ "DocumentConversationChildChildHeadingChildLink",
+ "DocumentConversationChildChildHeadingChildLineBreak",
+ "DocumentConversationChildChildHeadingChildText",
+ "DocumentConversationChildChildHeadingChildToolCall",
+ "DocumentConversationChildChildHeadingChildToolResult",
+ "DocumentConversationChildChildHeadingChildTraceMessage",
+ "DocumentConversationChildChildImage",
+ "DocumentConversationChildChildLink",
+ "DocumentConversationChildChildLineBreak",
+ "DocumentConversationChildChildList",
+ "DocumentConversationChildChildListItem",
+ "DocumentConversationChildChildListItemChild",
+ "DocumentConversationChildChildListItemChildBlob",
+ "DocumentConversationChildChildListItemChildCode",
+ "DocumentConversationChildChildListItemChildComment",
+ "DocumentConversationChildChildListItemChildDivider",
+ "DocumentConversationChildChildListItemChildImage",
+ "DocumentConversationChildChildListItemChildLink",
+ "DocumentConversationChildChildListItemChildLineBreak",
+ "DocumentConversationChildChildListItemChildText",
+ "DocumentConversationChildChildListItemChildToolCall",
+ "DocumentConversationChildChildListItemChildToolResult",
+ "DocumentConversationChildChildListItemChildTraceMessage",
+ "DocumentConversationChildChildParagraph",
+ "DocumentConversationChildChildParagraphChild",
+ "DocumentConversationChildChildParagraphChildBlob",
+ "DocumentConversationChildChildParagraphChildCode",
+ "DocumentConversationChildChildParagraphChildComment",
+ "DocumentConversationChildChildParagraphChildDivider",
+ "DocumentConversationChildChildParagraphChildImage",
+ "DocumentConversationChildChildParagraphChildLink",
+ "DocumentConversationChildChildParagraphChildLineBreak",
+ "DocumentConversationChildChildParagraphChildText",
+ "DocumentConversationChildChildParagraphChildToolCall",
+ "DocumentConversationChildChildParagraphChildToolResult",
+ "DocumentConversationChildChildParagraphChildTraceMessage",
+ "DocumentConversationChildChildQuote",
+ "DocumentConversationChildChildQuoteChild",
+ "DocumentConversationChildChildQuoteChildBlob",
+ "DocumentConversationChildChildQuoteChildCode",
+ "DocumentConversationChildChildQuoteChildComment",
+ "DocumentConversationChildChildQuoteChildDivider",
+ "DocumentConversationChildChildQuoteChildImage",
+ "DocumentConversationChildChildQuoteChildLink",
+ "DocumentConversationChildChildQuoteChildLineBreak",
+ "DocumentConversationChildChildQuoteChildText",
+ "DocumentConversationChildChildQuoteChildToolCall",
+ "DocumentConversationChildChildQuoteChildToolResult",
+ "DocumentConversationChildChildQuoteChildTraceMessage",
+ "DocumentConversationChildChildTable",
+ "DocumentConversationChildChildTableCell",
+ "DocumentConversationChildChildTableCellChild",
+ "DocumentConversationChildChildTableCellChildBlob",
+ "DocumentConversationChildChildTableCellChildCode",
+ "DocumentConversationChildChildTableCellChildComment",
+ "DocumentConversationChildChildTableCellChildDivider",
+ "DocumentConversationChildChildTableCellChildImage",
+ "DocumentConversationChildChildTableCellChildLink",
+ "DocumentConversationChildChildTableCellChildLineBreak",
+ "DocumentConversationChildChildTableCellChildText",
+ "DocumentConversationChildChildTableCellChildToolCall",
+ "DocumentConversationChildChildTableCellChildToolResult",
+ "DocumentConversationChildChildTableCellChildTraceMessage",
+ "DocumentConversationChildChildTableRow",
+ "DocumentConversationChildChildText",
+ "DocumentConversationChildChildToDo",
+ "DocumentConversationChildChildToDoChild",
+ "DocumentConversationChildChildToDoChildBlob",
+ "DocumentConversationChildChildToDoChildCode",
+ "DocumentConversationChildChildToDoChildComment",
+ "DocumentConversationChildChildToDoChildDivider",
+ "DocumentConversationChildChildToDoChildImage",
+ "DocumentConversationChildChildToDoChildLink",
+ "DocumentConversationChildChildToDoChildLineBreak",
+ "DocumentConversationChildChildToDoChildText",
+ "DocumentConversationChildChildToDoChildToolCall",
+ "DocumentConversationChildChildToDoChildToolResult",
+ "DocumentConversationChildChildToDoChildTraceMessage",
+ "DocumentConversationChildChildToolCall",
+ "DocumentConversationChildChildToolResult",
+ "DocumentConversationChildChildTraceMessage",
+ "DocumentConversationChildChildUtterance",
+ "DocumentConversationChildMentionedUser",
+ "DocumentConversationChildMentionedUserChild",
+ "DocumentConversationChildMentionedUserChildBlob",
+ "DocumentConversationChildMentionedUserChildCode",
+ "DocumentConversationChildMentionedUserChildComment",
+ "DocumentConversationChildMentionedUserChildDivider",
+ "DocumentConversationChildMentionedUserChildImage",
+ "DocumentConversationChildMentionedUserChildLink",
+ "DocumentConversationChildMentionedUserChildLineBreak",
+ "DocumentConversationChildMentionedUserChildText",
+ "DocumentConversationChildMentionedUserChildToolCall",
+ "DocumentConversationChildMentionedUserChildToolResult",
+ "DocumentConversationChildMentionedUserChildTraceMessage",
+ "DocumentTrace",
+ "DocumentTraceChild",
+ "DocumentTraceChildTraceMessage",
+ "DocumentTraceChildToolCall",
+ "DocumentTraceChildToolResult",
+ "DocumentTranscript",
+ "DocumentTranscriptChild",
+ "DocumentTranscriptParticipant",
+ "DocumentTranscriptParticipantChild",
+ "DocumentTranscriptParticipantChildBlob",
+ "DocumentTranscriptParticipantChildCode",
+ "DocumentTranscriptParticipantChildComment",
+ "DocumentTranscriptParticipantChildDivider",
+ "DocumentTranscriptParticipantChildImage",
+ "DocumentTranscriptParticipantChildLink",
+ "DocumentTranscriptParticipantChildLineBreak",
+ "DocumentTranscriptParticipantChildText",
+ "DocumentTranscriptParticipantChildToolCall",
+ "DocumentTranscriptParticipantChildToolResult",
+ "DocumentTranscriptParticipantChildTraceMessage",
+ "DocumentCompany",
+ "DocumentCompanyChild",
+ "DocumentCompanyChildBlob",
+ "DocumentCompanyChildCallout",
+ "DocumentCompanyChildCalloutChild",
+ "DocumentCompanyChildCalloutChildBlob",
+ "DocumentCompanyChildCalloutChildCode",
+ "DocumentCompanyChildCalloutChildComment",
+ "DocumentCompanyChildCalloutChildDivider",
+ "DocumentCompanyChildCalloutChildImage",
+ "DocumentCompanyChildCalloutChildLink",
+ "DocumentCompanyChildCalloutChildLineBreak",
+ "DocumentCompanyChildCalloutChildText",
+ "DocumentCompanyChildCalloutChildToolCall",
+ "DocumentCompanyChildCalloutChildToolResult",
+ "DocumentCompanyChildCalloutChildTraceMessage",
+ "DocumentCompanyChildChunk",
+ "DocumentCompanyChildChunkChild",
+ "DocumentCompanyChildChunkChildBlob",
+ "DocumentCompanyChildChunkChildCode",
+ "DocumentCompanyChildChunkChildComment",
+ "DocumentCompanyChildChunkChildDivider",
+ "DocumentCompanyChildChunkChildImage",
+ "DocumentCompanyChildChunkChildLink",
+ "DocumentCompanyChildChunkChildLineBreak",
+ "DocumentCompanyChildChunkChildText",
+ "DocumentCompanyChildChunkChildToolCall",
+ "DocumentCompanyChildChunkChildToolResult",
+ "DocumentCompanyChildChunkChildTraceMessage",
+ "DocumentCompanyChildCode",
+ "DocumentCompanyChildComment",
+ "DocumentCompanyChildDivider",
+ "DocumentCompanyChildEquation",
+ "DocumentCompanyChildEquationChild",
+ "DocumentCompanyChildEquationChildBlob",
+ "DocumentCompanyChildEquationChildCode",
+ "DocumentCompanyChildEquationChildComment",
+ "DocumentCompanyChildEquationChildDivider",
+ "DocumentCompanyChildEquationChildImage",
+ "DocumentCompanyChildEquationChildLink",
+ "DocumentCompanyChildEquationChildLineBreak",
+ "DocumentCompanyChildEquationChildText",
+ "DocumentCompanyChildEquationChildToolCall",
+ "DocumentCompanyChildEquationChildToolResult",
+ "DocumentCompanyChildEquationChildTraceMessage",
+ "DocumentCompanyChildFootnote",
+ "DocumentCompanyChildFootnoteChild",
+ "DocumentCompanyChildFootnoteChildBlob",
+ "DocumentCompanyChildFootnoteChildCode",
+ "DocumentCompanyChildFootnoteChildComment",
+ "DocumentCompanyChildFootnoteChildDivider",
+ "DocumentCompanyChildFootnoteChildImage",
+ "DocumentCompanyChildFootnoteChildLink",
+ "DocumentCompanyChildFootnoteChildLineBreak",
+ "DocumentCompanyChildFootnoteChildText",
+ "DocumentCompanyChildFootnoteChildToolCall",
+ "DocumentCompanyChildFootnoteChildToolResult",
+ "DocumentCompanyChildFootnoteChildTraceMessage",
+ "DocumentCompanyChildHeading",
+ "DocumentCompanyChildHeadingChild",
+ "DocumentCompanyChildHeadingChildBlob",
+ "DocumentCompanyChildHeadingChildCode",
+ "DocumentCompanyChildHeadingChildComment",
+ "DocumentCompanyChildHeadingChildDivider",
+ "DocumentCompanyChildHeadingChildImage",
+ "DocumentCompanyChildHeadingChildLink",
+ "DocumentCompanyChildHeadingChildLineBreak",
+ "DocumentCompanyChildHeadingChildText",
+ "DocumentCompanyChildHeadingChildToolCall",
+ "DocumentCompanyChildHeadingChildToolResult",
+ "DocumentCompanyChildHeadingChildTraceMessage",
+ "DocumentCompanyChildImage",
+ "DocumentCompanyChildLink",
+ "DocumentCompanyChildLineBreak",
+ "DocumentCompanyChildList",
+ "DocumentCompanyChildListItem",
+ "DocumentCompanyChildListItemChild",
+ "DocumentCompanyChildListItemChildBlob",
+ "DocumentCompanyChildListItemChildCode",
+ "DocumentCompanyChildListItemChildComment",
+ "DocumentCompanyChildListItemChildDivider",
+ "DocumentCompanyChildListItemChildImage",
+ "DocumentCompanyChildListItemChildLink",
+ "DocumentCompanyChildListItemChildLineBreak",
+ "DocumentCompanyChildListItemChildText",
+ "DocumentCompanyChildListItemChildToolCall",
+ "DocumentCompanyChildListItemChildToolResult",
+ "DocumentCompanyChildListItemChildTraceMessage",
+ "DocumentCompanyChildParagraph",
+ "DocumentCompanyChildParagraphChild",
+ "DocumentCompanyChildParagraphChildBlob",
+ "DocumentCompanyChildParagraphChildCode",
+ "DocumentCompanyChildParagraphChildComment",
+ "DocumentCompanyChildParagraphChildDivider",
+ "DocumentCompanyChildParagraphChildImage",
+ "DocumentCompanyChildParagraphChildLink",
+ "DocumentCompanyChildParagraphChildLineBreak",
+ "DocumentCompanyChildParagraphChildText",
+ "DocumentCompanyChildParagraphChildToolCall",
+ "DocumentCompanyChildParagraphChildToolResult",
+ "DocumentCompanyChildParagraphChildTraceMessage",
+ "DocumentCompanyChildQuote",
+ "DocumentCompanyChildQuoteChild",
+ "DocumentCompanyChildQuoteChildBlob",
+ "DocumentCompanyChildQuoteChildCode",
+ "DocumentCompanyChildQuoteChildComment",
+ "DocumentCompanyChildQuoteChildDivider",
+ "DocumentCompanyChildQuoteChildImage",
+ "DocumentCompanyChildQuoteChildLink",
+ "DocumentCompanyChildQuoteChildLineBreak",
+ "DocumentCompanyChildQuoteChildText",
+ "DocumentCompanyChildQuoteChildToolCall",
+ "DocumentCompanyChildQuoteChildToolResult",
+ "DocumentCompanyChildQuoteChildTraceMessage",
+ "DocumentCompanyChildTable",
+ "DocumentCompanyChildTableCell",
+ "DocumentCompanyChildTableCellChild",
+ "DocumentCompanyChildTableCellChildBlob",
+ "DocumentCompanyChildTableCellChildCode",
+ "DocumentCompanyChildTableCellChildComment",
+ "DocumentCompanyChildTableCellChildDivider",
+ "DocumentCompanyChildTableCellChildImage",
+ "DocumentCompanyChildTableCellChildLink",
+ "DocumentCompanyChildTableCellChildLineBreak",
+ "DocumentCompanyChildTableCellChildText",
+ "DocumentCompanyChildTableCellChildToolCall",
+ "DocumentCompanyChildTableCellChildToolResult",
+ "DocumentCompanyChildTableCellChildTraceMessage",
+ "DocumentCompanyChildTableRow",
+ "DocumentCompanyChildText",
+ "DocumentCompanyChildToDo",
+ "DocumentCompanyChildToDoChild",
+ "DocumentCompanyChildToDoChildBlob",
+ "DocumentCompanyChildToDoChildCode",
+ "DocumentCompanyChildToDoChildComment",
+ "DocumentCompanyChildToDoChildDivider",
+ "DocumentCompanyChildToDoChildImage",
+ "DocumentCompanyChildToDoChildLink",
+ "DocumentCompanyChildToDoChildLineBreak",
+ "DocumentCompanyChildToDoChildText",
+ "DocumentCompanyChildToDoChildToolCall",
+ "DocumentCompanyChildToDoChildToolResult",
+ "DocumentCompanyChildToDoChildTraceMessage",
+ "DocumentCompanyChildToolCall",
+ "DocumentCompanyChildToolResult",
+ "DocumentCompanyChildTraceMessage",
+ "DocumentCompanyChildUtterance",
+ "DocumentDeal",
+ "DocumentDealChild",
+ "DocumentDealChildBlob",
+ "DocumentDealChildCallout",
+ "DocumentDealChildCalloutChild",
+ "DocumentDealChildCalloutChildBlob",
+ "DocumentDealChildCalloutChildCode",
+ "DocumentDealChildCalloutChildComment",
+ "DocumentDealChildCalloutChildDivider",
+ "DocumentDealChildCalloutChildImage",
+ "DocumentDealChildCalloutChildLink",
+ "DocumentDealChildCalloutChildLineBreak",
+ "DocumentDealChildCalloutChildText",
+ "DocumentDealChildCalloutChildToolCall",
+ "DocumentDealChildCalloutChildToolResult",
+ "DocumentDealChildCalloutChildTraceMessage",
+ "DocumentDealChildChunk",
+ "DocumentDealChildChunkChild",
+ "DocumentDealChildChunkChildBlob",
+ "DocumentDealChildChunkChildCode",
+ "DocumentDealChildChunkChildComment",
+ "DocumentDealChildChunkChildDivider",
+ "DocumentDealChildChunkChildImage",
+ "DocumentDealChildChunkChildLink",
+ "DocumentDealChildChunkChildLineBreak",
+ "DocumentDealChildChunkChildText",
+ "DocumentDealChildChunkChildToolCall",
+ "DocumentDealChildChunkChildToolResult",
+ "DocumentDealChildChunkChildTraceMessage",
+ "DocumentDealChildCode",
+ "DocumentDealChildComment",
+ "DocumentDealChildDivider",
+ "DocumentDealChildEquation",
+ "DocumentDealChildEquationChild",
+ "DocumentDealChildEquationChildBlob",
+ "DocumentDealChildEquationChildCode",
+ "DocumentDealChildEquationChildComment",
+ "DocumentDealChildEquationChildDivider",
+ "DocumentDealChildEquationChildImage",
+ "DocumentDealChildEquationChildLink",
+ "DocumentDealChildEquationChildLineBreak",
+ "DocumentDealChildEquationChildText",
+ "DocumentDealChildEquationChildToolCall",
+ "DocumentDealChildEquationChildToolResult",
+ "DocumentDealChildEquationChildTraceMessage",
+ "DocumentDealChildFootnote",
+ "DocumentDealChildFootnoteChild",
+ "DocumentDealChildFootnoteChildBlob",
+ "DocumentDealChildFootnoteChildCode",
+ "DocumentDealChildFootnoteChildComment",
+ "DocumentDealChildFootnoteChildDivider",
+ "DocumentDealChildFootnoteChildImage",
+ "DocumentDealChildFootnoteChildLink",
+ "DocumentDealChildFootnoteChildLineBreak",
+ "DocumentDealChildFootnoteChildText",
+ "DocumentDealChildFootnoteChildToolCall",
+ "DocumentDealChildFootnoteChildToolResult",
+ "DocumentDealChildFootnoteChildTraceMessage",
+ "DocumentDealChildHeading",
+ "DocumentDealChildHeadingChild",
+ "DocumentDealChildHeadingChildBlob",
+ "DocumentDealChildHeadingChildCode",
+ "DocumentDealChildHeadingChildComment",
+ "DocumentDealChildHeadingChildDivider",
+ "DocumentDealChildHeadingChildImage",
+ "DocumentDealChildHeadingChildLink",
+ "DocumentDealChildHeadingChildLineBreak",
+ "DocumentDealChildHeadingChildText",
+ "DocumentDealChildHeadingChildToolCall",
+ "DocumentDealChildHeadingChildToolResult",
+ "DocumentDealChildHeadingChildTraceMessage",
+ "DocumentDealChildImage",
+ "DocumentDealChildLink",
+ "DocumentDealChildLineBreak",
+ "DocumentDealChildList",
+ "DocumentDealChildListItem",
+ "DocumentDealChildListItemChild",
+ "DocumentDealChildListItemChildBlob",
+ "DocumentDealChildListItemChildCode",
+ "DocumentDealChildListItemChildComment",
+ "DocumentDealChildListItemChildDivider",
+ "DocumentDealChildListItemChildImage",
+ "DocumentDealChildListItemChildLink",
+ "DocumentDealChildListItemChildLineBreak",
+ "DocumentDealChildListItemChildText",
+ "DocumentDealChildListItemChildToolCall",
+ "DocumentDealChildListItemChildToolResult",
+ "DocumentDealChildListItemChildTraceMessage",
+ "DocumentDealChildParagraph",
+ "DocumentDealChildParagraphChild",
+ "DocumentDealChildParagraphChildBlob",
+ "DocumentDealChildParagraphChildCode",
+ "DocumentDealChildParagraphChildComment",
+ "DocumentDealChildParagraphChildDivider",
+ "DocumentDealChildParagraphChildImage",
+ "DocumentDealChildParagraphChildLink",
+ "DocumentDealChildParagraphChildLineBreak",
+ "DocumentDealChildParagraphChildText",
+ "DocumentDealChildParagraphChildToolCall",
+ "DocumentDealChildParagraphChildToolResult",
+ "DocumentDealChildParagraphChildTraceMessage",
+ "DocumentDealChildQuote",
+ "DocumentDealChildQuoteChild",
+ "DocumentDealChildQuoteChildBlob",
+ "DocumentDealChildQuoteChildCode",
+ "DocumentDealChildQuoteChildComment",
+ "DocumentDealChildQuoteChildDivider",
+ "DocumentDealChildQuoteChildImage",
+ "DocumentDealChildQuoteChildLink",
+ "DocumentDealChildQuoteChildLineBreak",
+ "DocumentDealChildQuoteChildText",
+ "DocumentDealChildQuoteChildToolCall",
+ "DocumentDealChildQuoteChildToolResult",
+ "DocumentDealChildQuoteChildTraceMessage",
+ "DocumentDealChildTable",
+ "DocumentDealChildTableCell",
+ "DocumentDealChildTableCellChild",
+ "DocumentDealChildTableCellChildBlob",
+ "DocumentDealChildTableCellChildCode",
+ "DocumentDealChildTableCellChildComment",
+ "DocumentDealChildTableCellChildDivider",
+ "DocumentDealChildTableCellChildImage",
+ "DocumentDealChildTableCellChildLink",
+ "DocumentDealChildTableCellChildLineBreak",
+ "DocumentDealChildTableCellChildText",
+ "DocumentDealChildTableCellChildToolCall",
+ "DocumentDealChildTableCellChildToolResult",
+ "DocumentDealChildTableCellChildTraceMessage",
+ "DocumentDealChildTableRow",
+ "DocumentDealChildText",
+ "DocumentDealChildToDo",
+ "DocumentDealChildToDoChild",
+ "DocumentDealChildToDoChildBlob",
+ "DocumentDealChildToDoChildCode",
+ "DocumentDealChildToDoChildComment",
+ "DocumentDealChildToDoChildDivider",
+ "DocumentDealChildToDoChildImage",
+ "DocumentDealChildToDoChildLink",
+ "DocumentDealChildToDoChildLineBreak",
+ "DocumentDealChildToDoChildText",
+ "DocumentDealChildToDoChildToolCall",
+ "DocumentDealChildToDoChildToolResult",
+ "DocumentDealChildToDoChildTraceMessage",
+ "DocumentDealChildToolCall",
+ "DocumentDealChildToolResult",
+ "DocumentDealChildTraceMessage",
+ "DocumentDealChildUtterance",
+]
+
+
+class DocumentDocumentChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildCalloutChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildCalloutChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildCalloutChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildCalloutChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildCalloutChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildCalloutChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildCalloutChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildCalloutChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildCalloutChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildCalloutChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildCalloutChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildCalloutChild: TypeAlias = Union[
+ DocumentDocumentChildCalloutChildBlob,
+ DocumentDocumentChildCalloutChildCode,
+ DocumentDocumentChildCalloutChildComment,
+ DocumentDocumentChildCalloutChildDivider,
+ DocumentDocumentChildCalloutChildImage,
+ DocumentDocumentChildCalloutChildLink,
+ DocumentDocumentChildCalloutChildLineBreak,
+ DocumentDocumentChildCalloutChildText,
+ DocumentDocumentChildCalloutChildToolCall,
+ DocumentDocumentChildCalloutChildToolResult,
+ DocumentDocumentChildCalloutChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildCallout(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildCalloutChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ title: Optional[str] = None
+
+ type: Optional[Literal["callout"]] = None
+
+
+class DocumentDocumentChildChunkChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildChunkChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildChunkChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildChunkChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildChunkChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildChunkChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildChunkChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildChunkChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildChunkChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildChunkChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildChunkChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildChunkChild: TypeAlias = Union[
+ DocumentDocumentChildChunkChildBlob,
+ DocumentDocumentChildChunkChildCode,
+ DocumentDocumentChildChunkChildComment,
+ DocumentDocumentChildChunkChildDivider,
+ DocumentDocumentChildChunkChildImage,
+ DocumentDocumentChildChunkChildLink,
+ DocumentDocumentChildChunkChildLineBreak,
+ DocumentDocumentChildChunkChildText,
+ DocumentDocumentChildChunkChildToolCall,
+ DocumentDocumentChildChunkChildToolResult,
+ DocumentDocumentChildChunkChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildChunk(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildChunkChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["chunk"]] = None
+
+
+class DocumentDocumentChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildEquationChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildEquationChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildEquationChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildEquationChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildEquationChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildEquationChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildEquationChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildEquationChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildEquationChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildEquationChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildEquationChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildEquationChild: TypeAlias = Union[
+ DocumentDocumentChildEquationChildBlob,
+ DocumentDocumentChildEquationChildCode,
+ DocumentDocumentChildEquationChildComment,
+ DocumentDocumentChildEquationChildDivider,
+ DocumentDocumentChildEquationChildImage,
+ DocumentDocumentChildEquationChildLink,
+ DocumentDocumentChildEquationChildLineBreak,
+ DocumentDocumentChildEquationChildText,
+ DocumentDocumentChildEquationChildToolCall,
+ DocumentDocumentChildEquationChildToolResult,
+ DocumentDocumentChildEquationChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildEquation(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildEquationChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["equation"]] = None
+
+
+class DocumentDocumentChildFootnoteChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],
+ Example: data:text/html;base64,PGh0bWw+...
+ """
+
+ data: str
+
+ mimetype: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["blob"]] = None
+
+
+class DocumentDocumentChildFootnoteChildCode(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ language: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["code"]] = None
+
+
+class DocumentDocumentChildFootnoteChildComment(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["comment"]] = None
+
+
+class DocumentDocumentChildFootnoteChildDivider(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["divider"]] = None
+
+
+class DocumentDocumentChildFootnoteChildImage(BaseModel):
+ src: str
+
+ text: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["image"]] = None
+
+
+class DocumentDocumentChildFootnoteChildLink(BaseModel):
+ text: str
+
+ url: str
+
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["link"]] = None
+
+
+class DocumentDocumentChildFootnoteChildLineBreak(BaseModel):
+ id: Optional[str] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["line_break"]] = None
+
+
+class DocumentDocumentChildFootnoteChildText(BaseModel):
+ text: str
+
+ id: Optional[str] = None
+
+ marks: Optional[List[Literal["bold", "italic", "underline", "strikethrough", "code", "math"]]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["text"]] = None
+
+
+class DocumentDocumentChildFootnoteChildToolCall(BaseModel):
+ """A tool/function call made by the assistant."""
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ args: Optional[Dict[str, object]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_call"]] = None
+
+
+class DocumentDocumentChildFootnoteChildToolResult(BaseModel):
+ """The result of a tool call."""
+
+ output: Union[str, Dict[str, object], List[object]]
+
+ tool_call_id: str
+
+ tool_name: str
+
+ id: Optional[str] = None
+
+ is_error: Optional[bool] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ type: Optional[Literal["tool_result"]] = None
+
+
+class DocumentDocumentChildFootnoteChildTraceMessage(BaseModel):
+ """A message in an agent trace (user message, assistant message, or thinking)."""
+
+ text: str
+
+ id: Optional[str] = None
+
+ message_type: Optional[Literal["message", "thinking"]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ role: Optional[Literal["user", "assistant"]] = None
+
+ timestamp: Optional[datetime] = None
+
+ type: Optional[Literal["trace_message"]] = None
+
+
+DocumentDocumentChildFootnoteChild: TypeAlias = Union[
+ DocumentDocumentChildFootnoteChildBlob,
+ DocumentDocumentChildFootnoteChildCode,
+ DocumentDocumentChildFootnoteChildComment,
+ DocumentDocumentChildFootnoteChildDivider,
+ DocumentDocumentChildFootnoteChildImage,
+ DocumentDocumentChildFootnoteChildLink,
+ DocumentDocumentChildFootnoteChildLineBreak,
+ DocumentDocumentChildFootnoteChildText,
+ DocumentDocumentChildFootnoteChildToolCall,
+ DocumentDocumentChildFootnoteChildToolResult,
+ DocumentDocumentChildFootnoteChildTraceMessage,
+ object,
+]
+
+
+class DocumentDocumentChildFootnote(BaseModel):
+ id: Optional[str] = None
+
+ children: Optional[List[DocumentDocumentChildFootnoteChild]] = None
+
+ metadata: Optional[Metadata] = None
+ """Per-block annotations carried by any Hyperdoc node (ENG-1390).
+
+ Out-of-band annotations that travel with a block but aren't part of its content:
+ provenance (`sources`) and human edit attribution (`edited_by`). New annotation
+ types get added here as typed fields as the need arises.
+
+ Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset
+ `metadata` (None) is dropped from serialization entirely, and within a populated
+ `Metadata` only the set keys survive.
+ """
+
+ text: Optional[str] = None
+
+ type: Optional[Literal["footnote"]] = None
+
+
+class DocumentDocumentChildHeadingChildBlob(BaseModel):
+ """Represents embedded binary data using data URI scheme.
+
+ Format: data:[][;base64],