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. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=hyperspell-mcp&config=eyJuYW1lIjoiaHlwZXJzcGVsbC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9oeXBlcnNwZWxsLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtaHlwZXJzcGVsbC1hcGkta2V5IjoiTXkgQVBJIEtleSIsIlgtQXMtVXNlciI6Ik15IFVzZXIgSUQifX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](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) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40hyperspell%2Fhyperspell-mcp&config=eyJuYW1lIjoiQGh5cGVyc3BlbGwvaHlwZXJzcGVsbC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9oeXBlcnNwZWxsLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtaHlwZXJzcGVsbC1hcGkta2V5IjoiTXkgQVBJIEtleSIsIlgtQXMtVXNlciI6Ik15IFVzZXIgSUQifX0) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](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], + 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 MemoryListResponse(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_search_params.py b/src/hyperspell/types/memory_search_params.py index 5719262c..00fd8039 100644 --- a/src/hyperspell/types/memory_search_params.py +++ b/src/hyperspell/types/memory_search_params.py @@ -31,11 +31,15 @@ class MemorySearchParams(TypedDict, total=False): answer: bool """If true, the query will be answered along with matching source documents.""" - effort: int - """Effort level. - - 0 = pass query through verbatim. 1 = LLM rewrites the query for better retrieval - and extracts date filters. + effort: Literal["minimal", "low", "medium", "high", "very_high"] + """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: int @@ -44,6 +48,14 @@ class MemorySearchParams(TypedDict, total=False): options: Options """Search options for the query.""" + provenance: bool + """ + 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: List[ Literal[ "reddit", @@ -60,6 +72,14 @@ class MemorySearchParams(TypedDict, total=False): "trace", "microsoft_teams", "gmail_actions", + "granola", + "fathom", + "fireflies", + "linear", + "hubspot", + "salesforce", + "coda", + "lightfield", ] ] """Only query documents from these sources.""" @@ -275,6 +295,15 @@ class Options(TypedDict, total=False): notion: OptionsNotion """Search options for Notion""" + recency_half_life_days: Optional[float] + """ + When set, multiplies each result's score by an exponential-decay factor based on + the document's most recent activity timestamp (source-reported last_modified, + falling back to document_date). A document one half-life old gets its score + halved. Resources with no recency timestamp are passed through unchanged. Leave + unset to disable. + """ + reddit: OptionsReddit """Search options for Reddit""" diff --git a/src/hyperspell/types/memory_status.py b/src/hyperspell/types/memory_status.py index f30b7c73..440cbbda 100644 --- a/src/hyperspell/types/memory_status.py +++ b/src/hyperspell/types/memory_status.py @@ -25,6 +25,14 @@ class MemoryStatus(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_update_params.py b/src/hyperspell/types/memory_update_params.py index d8859d62..d899f850 100644 --- a/src/hyperspell/types/memory_update_params.py +++ b/src/hyperspell/types/memory_update_params.py @@ -3,7 +3,10 @@ from __future__ import annotations from typing import Dict, Union -from typing_extensions import Literal, Required, TypedDict +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["MemoryUpdateParams"] @@ -25,6 +28,14 @@ class MemoryUpdateParams(TypedDict, total=False): "trace", "microsoft_teams", "gmail_actions", + "granola", + "fathom", + "fireflies", + "linear", + "hubspot", + "salesforce", + "coda", + "lightfield", ] ] @@ -34,6 +45,9 @@ class MemoryUpdateParams(TypedDict, total=False): metadata instead. """ + date: Annotated[Union[Union[str, datetime], object, None], PropertyInfo(format="iso8601")] + """Date of the document for ranking and filtering.""" + metadata: Union[Dict[str, Union[str, float, bool, None]], object, None] """Custom metadata for filtering. diff --git a/src/hyperspell/types/shared/__init__.py b/src/hyperspell/types/shared/__init__.py index ffb125a3..df0cf4bf 100644 --- a/src/hyperspell/types/shared/__init__.py +++ b/src/hyperspell/types/shared/__init__.py @@ -1,6 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .metadata import Metadata as Metadata -from .resource import Resource as Resource -from .notification import Notification as Notification from .query_result import QueryResult as QueryResult diff --git a/src/hyperspell/types/shared/metadata.py b/src/hyperspell/types/shared/metadata.py index d433c051..42aea64c 100644 --- a/src/hyperspell/types/shared/metadata.py +++ b/src/hyperspell/types/shared/metadata.py @@ -1,38 +1,43 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, List, Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo +from typing import List, Optional from ..._models import BaseModel -from .notification import Notification -__all__ = ["Metadata"] +__all__ = ["Metadata", "Source"] -class Metadata(BaseModel): - created_at: Optional[datetime] = None +class Source(BaseModel): + """A reference to a memory/chunk that a block's content is grounded in (ENG-1390). + + Chunks are the unit persisted to the DB — extracted memories become chunks when + indexed — so `chunk_id` is the stable pointer back to the source. `resource_id` + and `source` locate the originating document; `score` carries optional retrieval + relevance. Kept deliberately self-contained (plain `str` for `source` rather than + the `DocumentProviders` enum) so the hyperdoc format stays free of app-layer imports. + """ + + chunk_id: str - events: Optional[List[Notification]] = None + resource_id: Optional[str] = None - indexed_at: Optional[datetime] = None + score: Optional[float] = None - last_modified: Optional[datetime] = None + source: Optional[str] = None + + +class Metadata(BaseModel): + """Per-block annotations carried by any Hyperdoc node (ENG-1390). - status: Optional[Literal["pending", "processing", "completed", "failed", "pending_review", "skipped"]] = None + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. - url: Optional[str] = None + Empty by default. Because `Node.model_dump` forces `exclude_none=True`, an unset + `metadata` (None) is dropped from serialization entirely, and within a populated + `Metadata` only the set keys survive. + """ - 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] + edited_by: Optional[str] = None - # 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] + sources: Optional[List[Source]] = None diff --git a/src/hyperspell/types/shared/notification.py b/src/hyperspell/types/shared/notification.py deleted file mode 100644 index a78f858d..00000000 --- a/src/hyperspell/types/shared/notification.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["Notification"] - - -class Notification(BaseModel): - message: str - - type: Literal["error", "warning", "info", "success"] - - time: Optional[datetime] = None diff --git a/src/hyperspell/types/shared/query_result.py b/src/hyperspell/types/shared/query_result.py index 99efa3d0..a955df82 100644 --- a/src/hyperspell/types/shared/query_result.py +++ b/src/hyperspell/types/shared/query_result.py @@ -1,19 +1,38757 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Annotated, TypeAlias -from .resource import Resource +from ..._utils import PropertyInfo +from .metadata import Metadata from ..._models import BaseModel -__all__ = ["QueryResult"] +__all__ = [ + "QueryResult", + "Document", + "DocumentDocument", + "DocumentDocumentDocument", + "DocumentDocumentDocumentChild", + "DocumentDocumentDocumentChildBlob", + "DocumentDocumentDocumentChildCallout", + "DocumentDocumentDocumentChildCalloutChild", + "DocumentDocumentDocumentChildCalloutChildBlob", + "DocumentDocumentDocumentChildCalloutChildCode", + "DocumentDocumentDocumentChildCalloutChildComment", + "DocumentDocumentDocumentChildCalloutChildDivider", + "DocumentDocumentDocumentChildCalloutChildImage", + "DocumentDocumentDocumentChildCalloutChildLink", + "DocumentDocumentDocumentChildCalloutChildLineBreak", + "DocumentDocumentDocumentChildCalloutChildText", + "DocumentDocumentDocumentChildCalloutChildToolCall", + "DocumentDocumentDocumentChildCalloutChildToolResult", + "DocumentDocumentDocumentChildCalloutChildTraceMessage", + "DocumentDocumentDocumentChildChunk", + "DocumentDocumentDocumentChildChunkChild", + "DocumentDocumentDocumentChildChunkChildBlob", + "DocumentDocumentDocumentChildChunkChildCode", + "DocumentDocumentDocumentChildChunkChildComment", + "DocumentDocumentDocumentChildChunkChildDivider", + "DocumentDocumentDocumentChildChunkChildImage", + "DocumentDocumentDocumentChildChunkChildLink", + "DocumentDocumentDocumentChildChunkChildLineBreak", + "DocumentDocumentDocumentChildChunkChildText", + "DocumentDocumentDocumentChildChunkChildToolCall", + "DocumentDocumentDocumentChildChunkChildToolResult", + "DocumentDocumentDocumentChildChunkChildTraceMessage", + "DocumentDocumentDocumentChildCode", + "DocumentDocumentDocumentChildComment", + "DocumentDocumentDocumentChildDivider", + "DocumentDocumentDocumentChildEquation", + "DocumentDocumentDocumentChildEquationChild", + "DocumentDocumentDocumentChildEquationChildBlob", + "DocumentDocumentDocumentChildEquationChildCode", + "DocumentDocumentDocumentChildEquationChildComment", + "DocumentDocumentDocumentChildEquationChildDivider", + "DocumentDocumentDocumentChildEquationChildImage", + "DocumentDocumentDocumentChildEquationChildLink", + "DocumentDocumentDocumentChildEquationChildLineBreak", + "DocumentDocumentDocumentChildEquationChildText", + "DocumentDocumentDocumentChildEquationChildToolCall", + "DocumentDocumentDocumentChildEquationChildToolResult", + "DocumentDocumentDocumentChildEquationChildTraceMessage", + "DocumentDocumentDocumentChildFootnote", + "DocumentDocumentDocumentChildFootnoteChild", + "DocumentDocumentDocumentChildFootnoteChildBlob", + "DocumentDocumentDocumentChildFootnoteChildCode", + "DocumentDocumentDocumentChildFootnoteChildComment", + "DocumentDocumentDocumentChildFootnoteChildDivider", + "DocumentDocumentDocumentChildFootnoteChildImage", + "DocumentDocumentDocumentChildFootnoteChildLink", + "DocumentDocumentDocumentChildFootnoteChildLineBreak", + "DocumentDocumentDocumentChildFootnoteChildText", + "DocumentDocumentDocumentChildFootnoteChildToolCall", + "DocumentDocumentDocumentChildFootnoteChildToolResult", + "DocumentDocumentDocumentChildFootnoteChildTraceMessage", + "DocumentDocumentDocumentChildHeading", + "DocumentDocumentDocumentChildHeadingChild", + "DocumentDocumentDocumentChildHeadingChildBlob", + "DocumentDocumentDocumentChildHeadingChildCode", + "DocumentDocumentDocumentChildHeadingChildComment", + "DocumentDocumentDocumentChildHeadingChildDivider", + "DocumentDocumentDocumentChildHeadingChildImage", + "DocumentDocumentDocumentChildHeadingChildLink", + "DocumentDocumentDocumentChildHeadingChildLineBreak", + "DocumentDocumentDocumentChildHeadingChildText", + "DocumentDocumentDocumentChildHeadingChildToolCall", + "DocumentDocumentDocumentChildHeadingChildToolResult", + "DocumentDocumentDocumentChildHeadingChildTraceMessage", + "DocumentDocumentDocumentChildImage", + "DocumentDocumentDocumentChildLink", + "DocumentDocumentDocumentChildLineBreak", + "DocumentDocumentDocumentChildList", + "DocumentDocumentDocumentChildListItem", + "DocumentDocumentDocumentChildListItemChild", + "DocumentDocumentDocumentChildListItemChildBlob", + "DocumentDocumentDocumentChildListItemChildCode", + "DocumentDocumentDocumentChildListItemChildComment", + "DocumentDocumentDocumentChildListItemChildDivider", + "DocumentDocumentDocumentChildListItemChildImage", + "DocumentDocumentDocumentChildListItemChildLink", + "DocumentDocumentDocumentChildListItemChildLineBreak", + "DocumentDocumentDocumentChildListItemChildText", + "DocumentDocumentDocumentChildListItemChildToolCall", + "DocumentDocumentDocumentChildListItemChildToolResult", + "DocumentDocumentDocumentChildListItemChildTraceMessage", + "DocumentDocumentDocumentChildParagraph", + "DocumentDocumentDocumentChildParagraphChild", + "DocumentDocumentDocumentChildParagraphChildBlob", + "DocumentDocumentDocumentChildParagraphChildCode", + "DocumentDocumentDocumentChildParagraphChildComment", + "DocumentDocumentDocumentChildParagraphChildDivider", + "DocumentDocumentDocumentChildParagraphChildImage", + "DocumentDocumentDocumentChildParagraphChildLink", + "DocumentDocumentDocumentChildParagraphChildLineBreak", + "DocumentDocumentDocumentChildParagraphChildText", + "DocumentDocumentDocumentChildParagraphChildToolCall", + "DocumentDocumentDocumentChildParagraphChildToolResult", + "DocumentDocumentDocumentChildParagraphChildTraceMessage", + "DocumentDocumentDocumentChildQuote", + "DocumentDocumentDocumentChildQuoteChild", + "DocumentDocumentDocumentChildQuoteChildBlob", + "DocumentDocumentDocumentChildQuoteChildCode", + "DocumentDocumentDocumentChildQuoteChildComment", + "DocumentDocumentDocumentChildQuoteChildDivider", + "DocumentDocumentDocumentChildQuoteChildImage", + "DocumentDocumentDocumentChildQuoteChildLink", + "DocumentDocumentDocumentChildQuoteChildLineBreak", + "DocumentDocumentDocumentChildQuoteChildText", + "DocumentDocumentDocumentChildQuoteChildToolCall", + "DocumentDocumentDocumentChildQuoteChildToolResult", + "DocumentDocumentDocumentChildQuoteChildTraceMessage", + "DocumentDocumentDocumentChildTable", + "DocumentDocumentDocumentChildTableCell", + "DocumentDocumentDocumentChildTableCellChild", + "DocumentDocumentDocumentChildTableCellChildBlob", + "DocumentDocumentDocumentChildTableCellChildCode", + "DocumentDocumentDocumentChildTableCellChildComment", + "DocumentDocumentDocumentChildTableCellChildDivider", + "DocumentDocumentDocumentChildTableCellChildImage", + "DocumentDocumentDocumentChildTableCellChildLink", + "DocumentDocumentDocumentChildTableCellChildLineBreak", + "DocumentDocumentDocumentChildTableCellChildText", + "DocumentDocumentDocumentChildTableCellChildToolCall", + "DocumentDocumentDocumentChildTableCellChildToolResult", + "DocumentDocumentDocumentChildTableCellChildTraceMessage", + "DocumentDocumentDocumentChildTableRow", + "DocumentDocumentDocumentChildText", + "DocumentDocumentDocumentChildToDo", + "DocumentDocumentDocumentChildToDoChild", + "DocumentDocumentDocumentChildToDoChildBlob", + "DocumentDocumentDocumentChildToDoChildCode", + "DocumentDocumentDocumentChildToDoChildComment", + "DocumentDocumentDocumentChildToDoChildDivider", + "DocumentDocumentDocumentChildToDoChildImage", + "DocumentDocumentDocumentChildToDoChildLink", + "DocumentDocumentDocumentChildToDoChildLineBreak", + "DocumentDocumentDocumentChildToDoChildText", + "DocumentDocumentDocumentChildToDoChildToolCall", + "DocumentDocumentDocumentChildToDoChildToolResult", + "DocumentDocumentDocumentChildToDoChildTraceMessage", + "DocumentDocumentDocumentChildToolCall", + "DocumentDocumentDocumentChildToolResult", + "DocumentDocumentDocumentChildTraceMessage", + "DocumentDocumentDocumentChildUtterance", + "DocumentDocumentWebsite", + "DocumentDocumentWebsiteChild", + "DocumentDocumentWebsiteChildBlob", + "DocumentDocumentWebsiteChildCallout", + "DocumentDocumentWebsiteChildCalloutChild", + "DocumentDocumentWebsiteChildCalloutChildBlob", + "DocumentDocumentWebsiteChildCalloutChildCode", + "DocumentDocumentWebsiteChildCalloutChildComment", + "DocumentDocumentWebsiteChildCalloutChildDivider", + "DocumentDocumentWebsiteChildCalloutChildImage", + "DocumentDocumentWebsiteChildCalloutChildLink", + "DocumentDocumentWebsiteChildCalloutChildLineBreak", + "DocumentDocumentWebsiteChildCalloutChildText", + "DocumentDocumentWebsiteChildCalloutChildToolCall", + "DocumentDocumentWebsiteChildCalloutChildToolResult", + "DocumentDocumentWebsiteChildCalloutChildTraceMessage", + "DocumentDocumentWebsiteChildChunk", + "DocumentDocumentWebsiteChildChunkChild", + "DocumentDocumentWebsiteChildChunkChildBlob", + "DocumentDocumentWebsiteChildChunkChildCode", + "DocumentDocumentWebsiteChildChunkChildComment", + "DocumentDocumentWebsiteChildChunkChildDivider", + "DocumentDocumentWebsiteChildChunkChildImage", + "DocumentDocumentWebsiteChildChunkChildLink", + "DocumentDocumentWebsiteChildChunkChildLineBreak", + "DocumentDocumentWebsiteChildChunkChildText", + "DocumentDocumentWebsiteChildChunkChildToolCall", + "DocumentDocumentWebsiteChildChunkChildToolResult", + "DocumentDocumentWebsiteChildChunkChildTraceMessage", + "DocumentDocumentWebsiteChildCode", + "DocumentDocumentWebsiteChildComment", + "DocumentDocumentWebsiteChildDivider", + "DocumentDocumentWebsiteChildEquation", + "DocumentDocumentWebsiteChildEquationChild", + "DocumentDocumentWebsiteChildEquationChildBlob", + "DocumentDocumentWebsiteChildEquationChildCode", + "DocumentDocumentWebsiteChildEquationChildComment", + "DocumentDocumentWebsiteChildEquationChildDivider", + "DocumentDocumentWebsiteChildEquationChildImage", + "DocumentDocumentWebsiteChildEquationChildLink", + "DocumentDocumentWebsiteChildEquationChildLineBreak", + "DocumentDocumentWebsiteChildEquationChildText", + "DocumentDocumentWebsiteChildEquationChildToolCall", + "DocumentDocumentWebsiteChildEquationChildToolResult", + "DocumentDocumentWebsiteChildEquationChildTraceMessage", + "DocumentDocumentWebsiteChildFootnote", + "DocumentDocumentWebsiteChildFootnoteChild", + "DocumentDocumentWebsiteChildFootnoteChildBlob", + "DocumentDocumentWebsiteChildFootnoteChildCode", + "DocumentDocumentWebsiteChildFootnoteChildComment", + "DocumentDocumentWebsiteChildFootnoteChildDivider", + "DocumentDocumentWebsiteChildFootnoteChildImage", + "DocumentDocumentWebsiteChildFootnoteChildLink", + "DocumentDocumentWebsiteChildFootnoteChildLineBreak", + "DocumentDocumentWebsiteChildFootnoteChildText", + "DocumentDocumentWebsiteChildFootnoteChildToolCall", + "DocumentDocumentWebsiteChildFootnoteChildToolResult", + "DocumentDocumentWebsiteChildFootnoteChildTraceMessage", + "DocumentDocumentWebsiteChildHeading", + "DocumentDocumentWebsiteChildHeadingChild", + "DocumentDocumentWebsiteChildHeadingChildBlob", + "DocumentDocumentWebsiteChildHeadingChildCode", + "DocumentDocumentWebsiteChildHeadingChildComment", + "DocumentDocumentWebsiteChildHeadingChildDivider", + "DocumentDocumentWebsiteChildHeadingChildImage", + "DocumentDocumentWebsiteChildHeadingChildLink", + "DocumentDocumentWebsiteChildHeadingChildLineBreak", + "DocumentDocumentWebsiteChildHeadingChildText", + "DocumentDocumentWebsiteChildHeadingChildToolCall", + "DocumentDocumentWebsiteChildHeadingChildToolResult", + "DocumentDocumentWebsiteChildHeadingChildTraceMessage", + "DocumentDocumentWebsiteChildImage", + "DocumentDocumentWebsiteChildLink", + "DocumentDocumentWebsiteChildLineBreak", + "DocumentDocumentWebsiteChildList", + "DocumentDocumentWebsiteChildListItem", + "DocumentDocumentWebsiteChildListItemChild", + "DocumentDocumentWebsiteChildListItemChildBlob", + "DocumentDocumentWebsiteChildListItemChildCode", + "DocumentDocumentWebsiteChildListItemChildComment", + "DocumentDocumentWebsiteChildListItemChildDivider", + "DocumentDocumentWebsiteChildListItemChildImage", + "DocumentDocumentWebsiteChildListItemChildLink", + "DocumentDocumentWebsiteChildListItemChildLineBreak", + "DocumentDocumentWebsiteChildListItemChildText", + "DocumentDocumentWebsiteChildListItemChildToolCall", + "DocumentDocumentWebsiteChildListItemChildToolResult", + "DocumentDocumentWebsiteChildListItemChildTraceMessage", + "DocumentDocumentWebsiteChildParagraph", + "DocumentDocumentWebsiteChildParagraphChild", + "DocumentDocumentWebsiteChildParagraphChildBlob", + "DocumentDocumentWebsiteChildParagraphChildCode", + "DocumentDocumentWebsiteChildParagraphChildComment", + "DocumentDocumentWebsiteChildParagraphChildDivider", + "DocumentDocumentWebsiteChildParagraphChildImage", + "DocumentDocumentWebsiteChildParagraphChildLink", + "DocumentDocumentWebsiteChildParagraphChildLineBreak", + "DocumentDocumentWebsiteChildParagraphChildText", + "DocumentDocumentWebsiteChildParagraphChildToolCall", + "DocumentDocumentWebsiteChildParagraphChildToolResult", + "DocumentDocumentWebsiteChildParagraphChildTraceMessage", + "DocumentDocumentWebsiteChildQuote", + "DocumentDocumentWebsiteChildQuoteChild", + "DocumentDocumentWebsiteChildQuoteChildBlob", + "DocumentDocumentWebsiteChildQuoteChildCode", + "DocumentDocumentWebsiteChildQuoteChildComment", + "DocumentDocumentWebsiteChildQuoteChildDivider", + "DocumentDocumentWebsiteChildQuoteChildImage", + "DocumentDocumentWebsiteChildQuoteChildLink", + "DocumentDocumentWebsiteChildQuoteChildLineBreak", + "DocumentDocumentWebsiteChildQuoteChildText", + "DocumentDocumentWebsiteChildQuoteChildToolCall", + "DocumentDocumentWebsiteChildQuoteChildToolResult", + "DocumentDocumentWebsiteChildQuoteChildTraceMessage", + "DocumentDocumentWebsiteChildTable", + "DocumentDocumentWebsiteChildTableCell", + "DocumentDocumentWebsiteChildTableCellChild", + "DocumentDocumentWebsiteChildTableCellChildBlob", + "DocumentDocumentWebsiteChildTableCellChildCode", + "DocumentDocumentWebsiteChildTableCellChildComment", + "DocumentDocumentWebsiteChildTableCellChildDivider", + "DocumentDocumentWebsiteChildTableCellChildImage", + "DocumentDocumentWebsiteChildTableCellChildLink", + "DocumentDocumentWebsiteChildTableCellChildLineBreak", + "DocumentDocumentWebsiteChildTableCellChildText", + "DocumentDocumentWebsiteChildTableCellChildToolCall", + "DocumentDocumentWebsiteChildTableCellChildToolResult", + "DocumentDocumentWebsiteChildTableCellChildTraceMessage", + "DocumentDocumentWebsiteChildTableRow", + "DocumentDocumentWebsiteChildText", + "DocumentDocumentWebsiteChildToDo", + "DocumentDocumentWebsiteChildToDoChild", + "DocumentDocumentWebsiteChildToDoChildBlob", + "DocumentDocumentWebsiteChildToDoChildCode", + "DocumentDocumentWebsiteChildToDoChildComment", + "DocumentDocumentWebsiteChildToDoChildDivider", + "DocumentDocumentWebsiteChildToDoChildImage", + "DocumentDocumentWebsiteChildToDoChildLink", + "DocumentDocumentWebsiteChildToDoChildLineBreak", + "DocumentDocumentWebsiteChildToDoChildText", + "DocumentDocumentWebsiteChildToDoChildToolCall", + "DocumentDocumentWebsiteChildToDoChildToolResult", + "DocumentDocumentWebsiteChildToDoChildTraceMessage", + "DocumentDocumentWebsiteChildToolCall", + "DocumentDocumentWebsiteChildToolResult", + "DocumentDocumentWebsiteChildTraceMessage", + "DocumentDocumentWebsiteChildUtterance", + "DocumentDocumentTask", + "DocumentDocumentTaskChild", + "DocumentDocumentTaskChildBlob", + "DocumentDocumentTaskChildCallout", + "DocumentDocumentTaskChildCalloutChild", + "DocumentDocumentTaskChildCalloutChildBlob", + "DocumentDocumentTaskChildCalloutChildCode", + "DocumentDocumentTaskChildCalloutChildComment", + "DocumentDocumentTaskChildCalloutChildDivider", + "DocumentDocumentTaskChildCalloutChildImage", + "DocumentDocumentTaskChildCalloutChildLink", + "DocumentDocumentTaskChildCalloutChildLineBreak", + "DocumentDocumentTaskChildCalloutChildText", + "DocumentDocumentTaskChildCalloutChildToolCall", + "DocumentDocumentTaskChildCalloutChildToolResult", + "DocumentDocumentTaskChildCalloutChildTraceMessage", + "DocumentDocumentTaskChildChunk", + "DocumentDocumentTaskChildChunkChild", + "DocumentDocumentTaskChildChunkChildBlob", + "DocumentDocumentTaskChildChunkChildCode", + "DocumentDocumentTaskChildChunkChildComment", + "DocumentDocumentTaskChildChunkChildDivider", + "DocumentDocumentTaskChildChunkChildImage", + "DocumentDocumentTaskChildChunkChildLink", + "DocumentDocumentTaskChildChunkChildLineBreak", + "DocumentDocumentTaskChildChunkChildText", + "DocumentDocumentTaskChildChunkChildToolCall", + "DocumentDocumentTaskChildChunkChildToolResult", + "DocumentDocumentTaskChildChunkChildTraceMessage", + "DocumentDocumentTaskChildCode", + "DocumentDocumentTaskChildComment", + "DocumentDocumentTaskChildDivider", + "DocumentDocumentTaskChildEquation", + "DocumentDocumentTaskChildEquationChild", + "DocumentDocumentTaskChildEquationChildBlob", + "DocumentDocumentTaskChildEquationChildCode", + "DocumentDocumentTaskChildEquationChildComment", + "DocumentDocumentTaskChildEquationChildDivider", + "DocumentDocumentTaskChildEquationChildImage", + "DocumentDocumentTaskChildEquationChildLink", + "DocumentDocumentTaskChildEquationChildLineBreak", + "DocumentDocumentTaskChildEquationChildText", + "DocumentDocumentTaskChildEquationChildToolCall", + "DocumentDocumentTaskChildEquationChildToolResult", + "DocumentDocumentTaskChildEquationChildTraceMessage", + "DocumentDocumentTaskChildFootnote", + "DocumentDocumentTaskChildFootnoteChild", + "DocumentDocumentTaskChildFootnoteChildBlob", + "DocumentDocumentTaskChildFootnoteChildCode", + "DocumentDocumentTaskChildFootnoteChildComment", + "DocumentDocumentTaskChildFootnoteChildDivider", + "DocumentDocumentTaskChildFootnoteChildImage", + "DocumentDocumentTaskChildFootnoteChildLink", + "DocumentDocumentTaskChildFootnoteChildLineBreak", + "DocumentDocumentTaskChildFootnoteChildText", + "DocumentDocumentTaskChildFootnoteChildToolCall", + "DocumentDocumentTaskChildFootnoteChildToolResult", + "DocumentDocumentTaskChildFootnoteChildTraceMessage", + "DocumentDocumentTaskChildHeading", + "DocumentDocumentTaskChildHeadingChild", + "DocumentDocumentTaskChildHeadingChildBlob", + "DocumentDocumentTaskChildHeadingChildCode", + "DocumentDocumentTaskChildHeadingChildComment", + "DocumentDocumentTaskChildHeadingChildDivider", + "DocumentDocumentTaskChildHeadingChildImage", + "DocumentDocumentTaskChildHeadingChildLink", + "DocumentDocumentTaskChildHeadingChildLineBreak", + "DocumentDocumentTaskChildHeadingChildText", + "DocumentDocumentTaskChildHeadingChildToolCall", + "DocumentDocumentTaskChildHeadingChildToolResult", + "DocumentDocumentTaskChildHeadingChildTraceMessage", + "DocumentDocumentTaskChildImage", + "DocumentDocumentTaskChildLink", + "DocumentDocumentTaskChildLineBreak", + "DocumentDocumentTaskChildList", + "DocumentDocumentTaskChildListItem", + "DocumentDocumentTaskChildListItemChild", + "DocumentDocumentTaskChildListItemChildBlob", + "DocumentDocumentTaskChildListItemChildCode", + "DocumentDocumentTaskChildListItemChildComment", + "DocumentDocumentTaskChildListItemChildDivider", + "DocumentDocumentTaskChildListItemChildImage", + "DocumentDocumentTaskChildListItemChildLink", + "DocumentDocumentTaskChildListItemChildLineBreak", + "DocumentDocumentTaskChildListItemChildText", + "DocumentDocumentTaskChildListItemChildToolCall", + "DocumentDocumentTaskChildListItemChildToolResult", + "DocumentDocumentTaskChildListItemChildTraceMessage", + "DocumentDocumentTaskChildParagraph", + "DocumentDocumentTaskChildParagraphChild", + "DocumentDocumentTaskChildParagraphChildBlob", + "DocumentDocumentTaskChildParagraphChildCode", + "DocumentDocumentTaskChildParagraphChildComment", + "DocumentDocumentTaskChildParagraphChildDivider", + "DocumentDocumentTaskChildParagraphChildImage", + "DocumentDocumentTaskChildParagraphChildLink", + "DocumentDocumentTaskChildParagraphChildLineBreak", + "DocumentDocumentTaskChildParagraphChildText", + "DocumentDocumentTaskChildParagraphChildToolCall", + "DocumentDocumentTaskChildParagraphChildToolResult", + "DocumentDocumentTaskChildParagraphChildTraceMessage", + "DocumentDocumentTaskChildQuote", + "DocumentDocumentTaskChildQuoteChild", + "DocumentDocumentTaskChildQuoteChildBlob", + "DocumentDocumentTaskChildQuoteChildCode", + "DocumentDocumentTaskChildQuoteChildComment", + "DocumentDocumentTaskChildQuoteChildDivider", + "DocumentDocumentTaskChildQuoteChildImage", + "DocumentDocumentTaskChildQuoteChildLink", + "DocumentDocumentTaskChildQuoteChildLineBreak", + "DocumentDocumentTaskChildQuoteChildText", + "DocumentDocumentTaskChildQuoteChildToolCall", + "DocumentDocumentTaskChildQuoteChildToolResult", + "DocumentDocumentTaskChildQuoteChildTraceMessage", + "DocumentDocumentTaskChildTable", + "DocumentDocumentTaskChildTableCell", + "DocumentDocumentTaskChildTableCellChild", + "DocumentDocumentTaskChildTableCellChildBlob", + "DocumentDocumentTaskChildTableCellChildCode", + "DocumentDocumentTaskChildTableCellChildComment", + "DocumentDocumentTaskChildTableCellChildDivider", + "DocumentDocumentTaskChildTableCellChildImage", + "DocumentDocumentTaskChildTableCellChildLink", + "DocumentDocumentTaskChildTableCellChildLineBreak", + "DocumentDocumentTaskChildTableCellChildText", + "DocumentDocumentTaskChildTableCellChildToolCall", + "DocumentDocumentTaskChildTableCellChildToolResult", + "DocumentDocumentTaskChildTableCellChildTraceMessage", + "DocumentDocumentTaskChildTableRow", + "DocumentDocumentTaskChildText", + "DocumentDocumentTaskChildToDo", + "DocumentDocumentTaskChildToDoChild", + "DocumentDocumentTaskChildToDoChildBlob", + "DocumentDocumentTaskChildToDoChildCode", + "DocumentDocumentTaskChildToDoChildComment", + "DocumentDocumentTaskChildToDoChildDivider", + "DocumentDocumentTaskChildToDoChildImage", + "DocumentDocumentTaskChildToDoChildLink", + "DocumentDocumentTaskChildToDoChildLineBreak", + "DocumentDocumentTaskChildToDoChildText", + "DocumentDocumentTaskChildToDoChildToolCall", + "DocumentDocumentTaskChildToDoChildToolResult", + "DocumentDocumentTaskChildToDoChildTraceMessage", + "DocumentDocumentTaskChildToolCall", + "DocumentDocumentTaskChildToolResult", + "DocumentDocumentTaskChildTraceMessage", + "DocumentDocumentTaskChildUtterance", + "DocumentDocumentTaskComment", + "DocumentDocumentTaskCommentSender", + "DocumentDocumentTaskCommentSenderChild", + "DocumentDocumentTaskCommentSenderChildBlob", + "DocumentDocumentTaskCommentSenderChildCode", + "DocumentDocumentTaskCommentSenderChildComment", + "DocumentDocumentTaskCommentSenderChildDivider", + "DocumentDocumentTaskCommentSenderChildImage", + "DocumentDocumentTaskCommentSenderChildLink", + "DocumentDocumentTaskCommentSenderChildLineBreak", + "DocumentDocumentTaskCommentSenderChildText", + "DocumentDocumentTaskCommentSenderChildToolCall", + "DocumentDocumentTaskCommentSenderChildToolResult", + "DocumentDocumentTaskCommentSenderChildTraceMessage", + "DocumentDocumentTaskCommentChild", + "DocumentDocumentTaskCommentChildBlob", + "DocumentDocumentTaskCommentChildCallout", + "DocumentDocumentTaskCommentChildCalloutChild", + "DocumentDocumentTaskCommentChildCalloutChildBlob", + "DocumentDocumentTaskCommentChildCalloutChildCode", + "DocumentDocumentTaskCommentChildCalloutChildComment", + "DocumentDocumentTaskCommentChildCalloutChildDivider", + "DocumentDocumentTaskCommentChildCalloutChildImage", + "DocumentDocumentTaskCommentChildCalloutChildLink", + "DocumentDocumentTaskCommentChildCalloutChildLineBreak", + "DocumentDocumentTaskCommentChildCalloutChildText", + "DocumentDocumentTaskCommentChildCalloutChildToolCall", + "DocumentDocumentTaskCommentChildCalloutChildToolResult", + "DocumentDocumentTaskCommentChildCalloutChildTraceMessage", + "DocumentDocumentTaskCommentChildChunk", + "DocumentDocumentTaskCommentChildChunkChild", + "DocumentDocumentTaskCommentChildChunkChildBlob", + "DocumentDocumentTaskCommentChildChunkChildCode", + "DocumentDocumentTaskCommentChildChunkChildComment", + "DocumentDocumentTaskCommentChildChunkChildDivider", + "DocumentDocumentTaskCommentChildChunkChildImage", + "DocumentDocumentTaskCommentChildChunkChildLink", + "DocumentDocumentTaskCommentChildChunkChildLineBreak", + "DocumentDocumentTaskCommentChildChunkChildText", + "DocumentDocumentTaskCommentChildChunkChildToolCall", + "DocumentDocumentTaskCommentChildChunkChildToolResult", + "DocumentDocumentTaskCommentChildChunkChildTraceMessage", + "DocumentDocumentTaskCommentChildCode", + "DocumentDocumentTaskCommentChildComment", + "DocumentDocumentTaskCommentChildDivider", + "DocumentDocumentTaskCommentChildEquation", + "DocumentDocumentTaskCommentChildEquationChild", + "DocumentDocumentTaskCommentChildEquationChildBlob", + "DocumentDocumentTaskCommentChildEquationChildCode", + "DocumentDocumentTaskCommentChildEquationChildComment", + "DocumentDocumentTaskCommentChildEquationChildDivider", + "DocumentDocumentTaskCommentChildEquationChildImage", + "DocumentDocumentTaskCommentChildEquationChildLink", + "DocumentDocumentTaskCommentChildEquationChildLineBreak", + "DocumentDocumentTaskCommentChildEquationChildText", + "DocumentDocumentTaskCommentChildEquationChildToolCall", + "DocumentDocumentTaskCommentChildEquationChildToolResult", + "DocumentDocumentTaskCommentChildEquationChildTraceMessage", + "DocumentDocumentTaskCommentChildFootnote", + "DocumentDocumentTaskCommentChildFootnoteChild", + "DocumentDocumentTaskCommentChildFootnoteChildBlob", + "DocumentDocumentTaskCommentChildFootnoteChildCode", + "DocumentDocumentTaskCommentChildFootnoteChildComment", + "DocumentDocumentTaskCommentChildFootnoteChildDivider", + "DocumentDocumentTaskCommentChildFootnoteChildImage", + "DocumentDocumentTaskCommentChildFootnoteChildLink", + "DocumentDocumentTaskCommentChildFootnoteChildLineBreak", + "DocumentDocumentTaskCommentChildFootnoteChildText", + "DocumentDocumentTaskCommentChildFootnoteChildToolCall", + "DocumentDocumentTaskCommentChildFootnoteChildToolResult", + "DocumentDocumentTaskCommentChildFootnoteChildTraceMessage", + "DocumentDocumentTaskCommentChildHeading", + "DocumentDocumentTaskCommentChildHeadingChild", + "DocumentDocumentTaskCommentChildHeadingChildBlob", + "DocumentDocumentTaskCommentChildHeadingChildCode", + "DocumentDocumentTaskCommentChildHeadingChildComment", + "DocumentDocumentTaskCommentChildHeadingChildDivider", + "DocumentDocumentTaskCommentChildHeadingChildImage", + "DocumentDocumentTaskCommentChildHeadingChildLink", + "DocumentDocumentTaskCommentChildHeadingChildLineBreak", + "DocumentDocumentTaskCommentChildHeadingChildText", + "DocumentDocumentTaskCommentChildHeadingChildToolCall", + "DocumentDocumentTaskCommentChildHeadingChildToolResult", + "DocumentDocumentTaskCommentChildHeadingChildTraceMessage", + "DocumentDocumentTaskCommentChildImage", + "DocumentDocumentTaskCommentChildLink", + "DocumentDocumentTaskCommentChildLineBreak", + "DocumentDocumentTaskCommentChildList", + "DocumentDocumentTaskCommentChildListItem", + "DocumentDocumentTaskCommentChildListItemChild", + "DocumentDocumentTaskCommentChildListItemChildBlob", + "DocumentDocumentTaskCommentChildListItemChildCode", + "DocumentDocumentTaskCommentChildListItemChildComment", + "DocumentDocumentTaskCommentChildListItemChildDivider", + "DocumentDocumentTaskCommentChildListItemChildImage", + "DocumentDocumentTaskCommentChildListItemChildLink", + "DocumentDocumentTaskCommentChildListItemChildLineBreak", + "DocumentDocumentTaskCommentChildListItemChildText", + "DocumentDocumentTaskCommentChildListItemChildToolCall", + "DocumentDocumentTaskCommentChildListItemChildToolResult", + "DocumentDocumentTaskCommentChildListItemChildTraceMessage", + "DocumentDocumentTaskCommentChildParagraph", + "DocumentDocumentTaskCommentChildParagraphChild", + "DocumentDocumentTaskCommentChildParagraphChildBlob", + "DocumentDocumentTaskCommentChildParagraphChildCode", + "DocumentDocumentTaskCommentChildParagraphChildComment", + "DocumentDocumentTaskCommentChildParagraphChildDivider", + "DocumentDocumentTaskCommentChildParagraphChildImage", + "DocumentDocumentTaskCommentChildParagraphChildLink", + "DocumentDocumentTaskCommentChildParagraphChildLineBreak", + "DocumentDocumentTaskCommentChildParagraphChildText", + "DocumentDocumentTaskCommentChildParagraphChildToolCall", + "DocumentDocumentTaskCommentChildParagraphChildToolResult", + "DocumentDocumentTaskCommentChildParagraphChildTraceMessage", + "DocumentDocumentTaskCommentChildQuote", + "DocumentDocumentTaskCommentChildQuoteChild", + "DocumentDocumentTaskCommentChildQuoteChildBlob", + "DocumentDocumentTaskCommentChildQuoteChildCode", + "DocumentDocumentTaskCommentChildQuoteChildComment", + "DocumentDocumentTaskCommentChildQuoteChildDivider", + "DocumentDocumentTaskCommentChildQuoteChildImage", + "DocumentDocumentTaskCommentChildQuoteChildLink", + "DocumentDocumentTaskCommentChildQuoteChildLineBreak", + "DocumentDocumentTaskCommentChildQuoteChildText", + "DocumentDocumentTaskCommentChildQuoteChildToolCall", + "DocumentDocumentTaskCommentChildQuoteChildToolResult", + "DocumentDocumentTaskCommentChildQuoteChildTraceMessage", + "DocumentDocumentTaskCommentChildTable", + "DocumentDocumentTaskCommentChildTableCell", + "DocumentDocumentTaskCommentChildTableCellChild", + "DocumentDocumentTaskCommentChildTableCellChildBlob", + "DocumentDocumentTaskCommentChildTableCellChildCode", + "DocumentDocumentTaskCommentChildTableCellChildComment", + "DocumentDocumentTaskCommentChildTableCellChildDivider", + "DocumentDocumentTaskCommentChildTableCellChildImage", + "DocumentDocumentTaskCommentChildTableCellChildLink", + "DocumentDocumentTaskCommentChildTableCellChildLineBreak", + "DocumentDocumentTaskCommentChildTableCellChildText", + "DocumentDocumentTaskCommentChildTableCellChildToolCall", + "DocumentDocumentTaskCommentChildTableCellChildToolResult", + "DocumentDocumentTaskCommentChildTableCellChildTraceMessage", + "DocumentDocumentTaskCommentChildTableRow", + "DocumentDocumentTaskCommentChildText", + "DocumentDocumentTaskCommentChildToDo", + "DocumentDocumentTaskCommentChildToDoChild", + "DocumentDocumentTaskCommentChildToDoChildBlob", + "DocumentDocumentTaskCommentChildToDoChildCode", + "DocumentDocumentTaskCommentChildToDoChildComment", + "DocumentDocumentTaskCommentChildToDoChildDivider", + "DocumentDocumentTaskCommentChildToDoChildImage", + "DocumentDocumentTaskCommentChildToDoChildLink", + "DocumentDocumentTaskCommentChildToDoChildLineBreak", + "DocumentDocumentTaskCommentChildToDoChildText", + "DocumentDocumentTaskCommentChildToDoChildToolCall", + "DocumentDocumentTaskCommentChildToDoChildToolResult", + "DocumentDocumentTaskCommentChildToDoChildTraceMessage", + "DocumentDocumentTaskCommentChildToolCall", + "DocumentDocumentTaskCommentChildToolResult", + "DocumentDocumentTaskCommentChildTraceMessage", + "DocumentDocumentTaskCommentChildUtterance", + "DocumentDocumentTaskCommentMentionedUser", + "DocumentDocumentTaskCommentMentionedUserChild", + "DocumentDocumentTaskCommentMentionedUserChildBlob", + "DocumentDocumentTaskCommentMentionedUserChildCode", + "DocumentDocumentTaskCommentMentionedUserChildComment", + "DocumentDocumentTaskCommentMentionedUserChildDivider", + "DocumentDocumentTaskCommentMentionedUserChildImage", + "DocumentDocumentTaskCommentMentionedUserChildLink", + "DocumentDocumentTaskCommentMentionedUserChildLineBreak", + "DocumentDocumentTaskCommentMentionedUserChildText", + "DocumentDocumentTaskCommentMentionedUserChildToolCall", + "DocumentDocumentTaskCommentMentionedUserChildToolResult", + "DocumentDocumentTaskCommentMentionedUserChildTraceMessage", + "DocumentDocumentPerson", + "DocumentDocumentPersonChild", + "DocumentDocumentPersonChildBlob", + "DocumentDocumentPersonChildCode", + "DocumentDocumentPersonChildComment", + "DocumentDocumentPersonChildDivider", + "DocumentDocumentPersonChildImage", + "DocumentDocumentPersonChildLink", + "DocumentDocumentPersonChildLineBreak", + "DocumentDocumentPersonChildText", + "DocumentDocumentPersonChildToolCall", + "DocumentDocumentPersonChildToolResult", + "DocumentDocumentPersonChildTraceMessage", + "DocumentDocumentMessage", + "DocumentDocumentMessageSender", + "DocumentDocumentMessageSenderChild", + "DocumentDocumentMessageSenderChildBlob", + "DocumentDocumentMessageSenderChildCode", + "DocumentDocumentMessageSenderChildComment", + "DocumentDocumentMessageSenderChildDivider", + "DocumentDocumentMessageSenderChildImage", + "DocumentDocumentMessageSenderChildLink", + "DocumentDocumentMessageSenderChildLineBreak", + "DocumentDocumentMessageSenderChildText", + "DocumentDocumentMessageSenderChildToolCall", + "DocumentDocumentMessageSenderChildToolResult", + "DocumentDocumentMessageSenderChildTraceMessage", + "DocumentDocumentMessageChild", + "DocumentDocumentMessageChildBlob", + "DocumentDocumentMessageChildCallout", + "DocumentDocumentMessageChildCalloutChild", + "DocumentDocumentMessageChildCalloutChildBlob", + "DocumentDocumentMessageChildCalloutChildCode", + "DocumentDocumentMessageChildCalloutChildComment", + "DocumentDocumentMessageChildCalloutChildDivider", + "DocumentDocumentMessageChildCalloutChildImage", + "DocumentDocumentMessageChildCalloutChildLink", + "DocumentDocumentMessageChildCalloutChildLineBreak", + "DocumentDocumentMessageChildCalloutChildText", + "DocumentDocumentMessageChildCalloutChildToolCall", + "DocumentDocumentMessageChildCalloutChildToolResult", + "DocumentDocumentMessageChildCalloutChildTraceMessage", + "DocumentDocumentMessageChildChunk", + "DocumentDocumentMessageChildChunkChild", + "DocumentDocumentMessageChildChunkChildBlob", + "DocumentDocumentMessageChildChunkChildCode", + "DocumentDocumentMessageChildChunkChildComment", + "DocumentDocumentMessageChildChunkChildDivider", + "DocumentDocumentMessageChildChunkChildImage", + "DocumentDocumentMessageChildChunkChildLink", + "DocumentDocumentMessageChildChunkChildLineBreak", + "DocumentDocumentMessageChildChunkChildText", + "DocumentDocumentMessageChildChunkChildToolCall", + "DocumentDocumentMessageChildChunkChildToolResult", + "DocumentDocumentMessageChildChunkChildTraceMessage", + "DocumentDocumentMessageChildCode", + "DocumentDocumentMessageChildComment", + "DocumentDocumentMessageChildDivider", + "DocumentDocumentMessageChildEquation", + "DocumentDocumentMessageChildEquationChild", + "DocumentDocumentMessageChildEquationChildBlob", + "DocumentDocumentMessageChildEquationChildCode", + "DocumentDocumentMessageChildEquationChildComment", + "DocumentDocumentMessageChildEquationChildDivider", + "DocumentDocumentMessageChildEquationChildImage", + "DocumentDocumentMessageChildEquationChildLink", + "DocumentDocumentMessageChildEquationChildLineBreak", + "DocumentDocumentMessageChildEquationChildText", + "DocumentDocumentMessageChildEquationChildToolCall", + "DocumentDocumentMessageChildEquationChildToolResult", + "DocumentDocumentMessageChildEquationChildTraceMessage", + "DocumentDocumentMessageChildFootnote", + "DocumentDocumentMessageChildFootnoteChild", + "DocumentDocumentMessageChildFootnoteChildBlob", + "DocumentDocumentMessageChildFootnoteChildCode", + "DocumentDocumentMessageChildFootnoteChildComment", + "DocumentDocumentMessageChildFootnoteChildDivider", + "DocumentDocumentMessageChildFootnoteChildImage", + "DocumentDocumentMessageChildFootnoteChildLink", + "DocumentDocumentMessageChildFootnoteChildLineBreak", + "DocumentDocumentMessageChildFootnoteChildText", + "DocumentDocumentMessageChildFootnoteChildToolCall", + "DocumentDocumentMessageChildFootnoteChildToolResult", + "DocumentDocumentMessageChildFootnoteChildTraceMessage", + "DocumentDocumentMessageChildHeading", + "DocumentDocumentMessageChildHeadingChild", + "DocumentDocumentMessageChildHeadingChildBlob", + "DocumentDocumentMessageChildHeadingChildCode", + "DocumentDocumentMessageChildHeadingChildComment", + "DocumentDocumentMessageChildHeadingChildDivider", + "DocumentDocumentMessageChildHeadingChildImage", + "DocumentDocumentMessageChildHeadingChildLink", + "DocumentDocumentMessageChildHeadingChildLineBreak", + "DocumentDocumentMessageChildHeadingChildText", + "DocumentDocumentMessageChildHeadingChildToolCall", + "DocumentDocumentMessageChildHeadingChildToolResult", + "DocumentDocumentMessageChildHeadingChildTraceMessage", + "DocumentDocumentMessageChildImage", + "DocumentDocumentMessageChildLink", + "DocumentDocumentMessageChildLineBreak", + "DocumentDocumentMessageChildList", + "DocumentDocumentMessageChildListItem", + "DocumentDocumentMessageChildListItemChild", + "DocumentDocumentMessageChildListItemChildBlob", + "DocumentDocumentMessageChildListItemChildCode", + "DocumentDocumentMessageChildListItemChildComment", + "DocumentDocumentMessageChildListItemChildDivider", + "DocumentDocumentMessageChildListItemChildImage", + "DocumentDocumentMessageChildListItemChildLink", + "DocumentDocumentMessageChildListItemChildLineBreak", + "DocumentDocumentMessageChildListItemChildText", + "DocumentDocumentMessageChildListItemChildToolCall", + "DocumentDocumentMessageChildListItemChildToolResult", + "DocumentDocumentMessageChildListItemChildTraceMessage", + "DocumentDocumentMessageChildParagraph", + "DocumentDocumentMessageChildParagraphChild", + "DocumentDocumentMessageChildParagraphChildBlob", + "DocumentDocumentMessageChildParagraphChildCode", + "DocumentDocumentMessageChildParagraphChildComment", + "DocumentDocumentMessageChildParagraphChildDivider", + "DocumentDocumentMessageChildParagraphChildImage", + "DocumentDocumentMessageChildParagraphChildLink", + "DocumentDocumentMessageChildParagraphChildLineBreak", + "DocumentDocumentMessageChildParagraphChildText", + "DocumentDocumentMessageChildParagraphChildToolCall", + "DocumentDocumentMessageChildParagraphChildToolResult", + "DocumentDocumentMessageChildParagraphChildTraceMessage", + "DocumentDocumentMessageChildQuote", + "DocumentDocumentMessageChildQuoteChild", + "DocumentDocumentMessageChildQuoteChildBlob", + "DocumentDocumentMessageChildQuoteChildCode", + "DocumentDocumentMessageChildQuoteChildComment", + "DocumentDocumentMessageChildQuoteChildDivider", + "DocumentDocumentMessageChildQuoteChildImage", + "DocumentDocumentMessageChildQuoteChildLink", + "DocumentDocumentMessageChildQuoteChildLineBreak", + "DocumentDocumentMessageChildQuoteChildText", + "DocumentDocumentMessageChildQuoteChildToolCall", + "DocumentDocumentMessageChildQuoteChildToolResult", + "DocumentDocumentMessageChildQuoteChildTraceMessage", + "DocumentDocumentMessageChildTable", + "DocumentDocumentMessageChildTableCell", + "DocumentDocumentMessageChildTableCellChild", + "DocumentDocumentMessageChildTableCellChildBlob", + "DocumentDocumentMessageChildTableCellChildCode", + "DocumentDocumentMessageChildTableCellChildComment", + "DocumentDocumentMessageChildTableCellChildDivider", + "DocumentDocumentMessageChildTableCellChildImage", + "DocumentDocumentMessageChildTableCellChildLink", + "DocumentDocumentMessageChildTableCellChildLineBreak", + "DocumentDocumentMessageChildTableCellChildText", + "DocumentDocumentMessageChildTableCellChildToolCall", + "DocumentDocumentMessageChildTableCellChildToolResult", + "DocumentDocumentMessageChildTableCellChildTraceMessage", + "DocumentDocumentMessageChildTableRow", + "DocumentDocumentMessageChildText", + "DocumentDocumentMessageChildToDo", + "DocumentDocumentMessageChildToDoChild", + "DocumentDocumentMessageChildToDoChildBlob", + "DocumentDocumentMessageChildToDoChildCode", + "DocumentDocumentMessageChildToDoChildComment", + "DocumentDocumentMessageChildToDoChildDivider", + "DocumentDocumentMessageChildToDoChildImage", + "DocumentDocumentMessageChildToDoChildLink", + "DocumentDocumentMessageChildToDoChildLineBreak", + "DocumentDocumentMessageChildToDoChildText", + "DocumentDocumentMessageChildToDoChildToolCall", + "DocumentDocumentMessageChildToDoChildToolResult", + "DocumentDocumentMessageChildToDoChildTraceMessage", + "DocumentDocumentMessageChildToolCall", + "DocumentDocumentMessageChildToolResult", + "DocumentDocumentMessageChildTraceMessage", + "DocumentDocumentMessageChildUtterance", + "DocumentDocumentMessageMentionedUser", + "DocumentDocumentMessageMentionedUserChild", + "DocumentDocumentMessageMentionedUserChildBlob", + "DocumentDocumentMessageMentionedUserChildCode", + "DocumentDocumentMessageMentionedUserChildComment", + "DocumentDocumentMessageMentionedUserChildDivider", + "DocumentDocumentMessageMentionedUserChildImage", + "DocumentDocumentMessageMentionedUserChildLink", + "DocumentDocumentMessageMentionedUserChildLineBreak", + "DocumentDocumentMessageMentionedUserChildText", + "DocumentDocumentMessageMentionedUserChildToolCall", + "DocumentDocumentMessageMentionedUserChildToolResult", + "DocumentDocumentMessageMentionedUserChildTraceMessage", + "DocumentDocumentEvent", + "DocumentDocumentEventAttendee", + "DocumentDocumentEventAttendeeChild", + "DocumentDocumentEventAttendeeChildBlob", + "DocumentDocumentEventAttendeeChildCode", + "DocumentDocumentEventAttendeeChildComment", + "DocumentDocumentEventAttendeeChildDivider", + "DocumentDocumentEventAttendeeChildImage", + "DocumentDocumentEventAttendeeChildLink", + "DocumentDocumentEventAttendeeChildLineBreak", + "DocumentDocumentEventAttendeeChildText", + "DocumentDocumentEventAttendeeChildToolCall", + "DocumentDocumentEventAttendeeChildToolResult", + "DocumentDocumentEventAttendeeChildTraceMessage", + "DocumentDocumentEventChild", + "DocumentDocumentEventChildBlob", + "DocumentDocumentEventChildCallout", + "DocumentDocumentEventChildCalloutChild", + "DocumentDocumentEventChildCalloutChildBlob", + "DocumentDocumentEventChildCalloutChildCode", + "DocumentDocumentEventChildCalloutChildComment", + "DocumentDocumentEventChildCalloutChildDivider", + "DocumentDocumentEventChildCalloutChildImage", + "DocumentDocumentEventChildCalloutChildLink", + "DocumentDocumentEventChildCalloutChildLineBreak", + "DocumentDocumentEventChildCalloutChildText", + "DocumentDocumentEventChildCalloutChildToolCall", + "DocumentDocumentEventChildCalloutChildToolResult", + "DocumentDocumentEventChildCalloutChildTraceMessage", + "DocumentDocumentEventChildChunk", + "DocumentDocumentEventChildChunkChild", + "DocumentDocumentEventChildChunkChildBlob", + "DocumentDocumentEventChildChunkChildCode", + "DocumentDocumentEventChildChunkChildComment", + "DocumentDocumentEventChildChunkChildDivider", + "DocumentDocumentEventChildChunkChildImage", + "DocumentDocumentEventChildChunkChildLink", + "DocumentDocumentEventChildChunkChildLineBreak", + "DocumentDocumentEventChildChunkChildText", + "DocumentDocumentEventChildChunkChildToolCall", + "DocumentDocumentEventChildChunkChildToolResult", + "DocumentDocumentEventChildChunkChildTraceMessage", + "DocumentDocumentEventChildCode", + "DocumentDocumentEventChildComment", + "DocumentDocumentEventChildDivider", + "DocumentDocumentEventChildEquation", + "DocumentDocumentEventChildEquationChild", + "DocumentDocumentEventChildEquationChildBlob", + "DocumentDocumentEventChildEquationChildCode", + "DocumentDocumentEventChildEquationChildComment", + "DocumentDocumentEventChildEquationChildDivider", + "DocumentDocumentEventChildEquationChildImage", + "DocumentDocumentEventChildEquationChildLink", + "DocumentDocumentEventChildEquationChildLineBreak", + "DocumentDocumentEventChildEquationChildText", + "DocumentDocumentEventChildEquationChildToolCall", + "DocumentDocumentEventChildEquationChildToolResult", + "DocumentDocumentEventChildEquationChildTraceMessage", + "DocumentDocumentEventChildFootnote", + "DocumentDocumentEventChildFootnoteChild", + "DocumentDocumentEventChildFootnoteChildBlob", + "DocumentDocumentEventChildFootnoteChildCode", + "DocumentDocumentEventChildFootnoteChildComment", + "DocumentDocumentEventChildFootnoteChildDivider", + "DocumentDocumentEventChildFootnoteChildImage", + "DocumentDocumentEventChildFootnoteChildLink", + "DocumentDocumentEventChildFootnoteChildLineBreak", + "DocumentDocumentEventChildFootnoteChildText", + "DocumentDocumentEventChildFootnoteChildToolCall", + "DocumentDocumentEventChildFootnoteChildToolResult", + "DocumentDocumentEventChildFootnoteChildTraceMessage", + "DocumentDocumentEventChildHeading", + "DocumentDocumentEventChildHeadingChild", + "DocumentDocumentEventChildHeadingChildBlob", + "DocumentDocumentEventChildHeadingChildCode", + "DocumentDocumentEventChildHeadingChildComment", + "DocumentDocumentEventChildHeadingChildDivider", + "DocumentDocumentEventChildHeadingChildImage", + "DocumentDocumentEventChildHeadingChildLink", + "DocumentDocumentEventChildHeadingChildLineBreak", + "DocumentDocumentEventChildHeadingChildText", + "DocumentDocumentEventChildHeadingChildToolCall", + "DocumentDocumentEventChildHeadingChildToolResult", + "DocumentDocumentEventChildHeadingChildTraceMessage", + "DocumentDocumentEventChildImage", + "DocumentDocumentEventChildLink", + "DocumentDocumentEventChildLineBreak", + "DocumentDocumentEventChildList", + "DocumentDocumentEventChildListItem", + "DocumentDocumentEventChildListItemChild", + "DocumentDocumentEventChildListItemChildBlob", + "DocumentDocumentEventChildListItemChildCode", + "DocumentDocumentEventChildListItemChildComment", + "DocumentDocumentEventChildListItemChildDivider", + "DocumentDocumentEventChildListItemChildImage", + "DocumentDocumentEventChildListItemChildLink", + "DocumentDocumentEventChildListItemChildLineBreak", + "DocumentDocumentEventChildListItemChildText", + "DocumentDocumentEventChildListItemChildToolCall", + "DocumentDocumentEventChildListItemChildToolResult", + "DocumentDocumentEventChildListItemChildTraceMessage", + "DocumentDocumentEventChildParagraph", + "DocumentDocumentEventChildParagraphChild", + "DocumentDocumentEventChildParagraphChildBlob", + "DocumentDocumentEventChildParagraphChildCode", + "DocumentDocumentEventChildParagraphChildComment", + "DocumentDocumentEventChildParagraphChildDivider", + "DocumentDocumentEventChildParagraphChildImage", + "DocumentDocumentEventChildParagraphChildLink", + "DocumentDocumentEventChildParagraphChildLineBreak", + "DocumentDocumentEventChildParagraphChildText", + "DocumentDocumentEventChildParagraphChildToolCall", + "DocumentDocumentEventChildParagraphChildToolResult", + "DocumentDocumentEventChildParagraphChildTraceMessage", + "DocumentDocumentEventChildQuote", + "DocumentDocumentEventChildQuoteChild", + "DocumentDocumentEventChildQuoteChildBlob", + "DocumentDocumentEventChildQuoteChildCode", + "DocumentDocumentEventChildQuoteChildComment", + "DocumentDocumentEventChildQuoteChildDivider", + "DocumentDocumentEventChildQuoteChildImage", + "DocumentDocumentEventChildQuoteChildLink", + "DocumentDocumentEventChildQuoteChildLineBreak", + "DocumentDocumentEventChildQuoteChildText", + "DocumentDocumentEventChildQuoteChildToolCall", + "DocumentDocumentEventChildQuoteChildToolResult", + "DocumentDocumentEventChildQuoteChildTraceMessage", + "DocumentDocumentEventChildTable", + "DocumentDocumentEventChildTableCell", + "DocumentDocumentEventChildTableCellChild", + "DocumentDocumentEventChildTableCellChildBlob", + "DocumentDocumentEventChildTableCellChildCode", + "DocumentDocumentEventChildTableCellChildComment", + "DocumentDocumentEventChildTableCellChildDivider", + "DocumentDocumentEventChildTableCellChildImage", + "DocumentDocumentEventChildTableCellChildLink", + "DocumentDocumentEventChildTableCellChildLineBreak", + "DocumentDocumentEventChildTableCellChildText", + "DocumentDocumentEventChildTableCellChildToolCall", + "DocumentDocumentEventChildTableCellChildToolResult", + "DocumentDocumentEventChildTableCellChildTraceMessage", + "DocumentDocumentEventChildTableRow", + "DocumentDocumentEventChildText", + "DocumentDocumentEventChildToDo", + "DocumentDocumentEventChildToDoChild", + "DocumentDocumentEventChildToDoChildBlob", + "DocumentDocumentEventChildToDoChildCode", + "DocumentDocumentEventChildToDoChildComment", + "DocumentDocumentEventChildToDoChildDivider", + "DocumentDocumentEventChildToDoChildImage", + "DocumentDocumentEventChildToDoChildLink", + "DocumentDocumentEventChildToDoChildLineBreak", + "DocumentDocumentEventChildToDoChildText", + "DocumentDocumentEventChildToDoChildToolCall", + "DocumentDocumentEventChildToDoChildToolResult", + "DocumentDocumentEventChildToDoChildTraceMessage", + "DocumentDocumentEventChildToolCall", + "DocumentDocumentEventChildToolResult", + "DocumentDocumentEventChildTraceMessage", + "DocumentDocumentEventChildUtterance", + "DocumentDocumentFile", + "DocumentDocumentFileChild", + "DocumentDocumentFileChildBlob", + "DocumentDocumentFileChildCallout", + "DocumentDocumentFileChildCalloutChild", + "DocumentDocumentFileChildCalloutChildBlob", + "DocumentDocumentFileChildCalloutChildCode", + "DocumentDocumentFileChildCalloutChildComment", + "DocumentDocumentFileChildCalloutChildDivider", + "DocumentDocumentFileChildCalloutChildImage", + "DocumentDocumentFileChildCalloutChildLink", + "DocumentDocumentFileChildCalloutChildLineBreak", + "DocumentDocumentFileChildCalloutChildText", + "DocumentDocumentFileChildCalloutChildToolCall", + "DocumentDocumentFileChildCalloutChildToolResult", + "DocumentDocumentFileChildCalloutChildTraceMessage", + "DocumentDocumentFileChildChunk", + "DocumentDocumentFileChildChunkChild", + "DocumentDocumentFileChildChunkChildBlob", + "DocumentDocumentFileChildChunkChildCode", + "DocumentDocumentFileChildChunkChildComment", + "DocumentDocumentFileChildChunkChildDivider", + "DocumentDocumentFileChildChunkChildImage", + "DocumentDocumentFileChildChunkChildLink", + "DocumentDocumentFileChildChunkChildLineBreak", + "DocumentDocumentFileChildChunkChildText", + "DocumentDocumentFileChildChunkChildToolCall", + "DocumentDocumentFileChildChunkChildToolResult", + "DocumentDocumentFileChildChunkChildTraceMessage", + "DocumentDocumentFileChildCode", + "DocumentDocumentFileChildComment", + "DocumentDocumentFileChildDivider", + "DocumentDocumentFileChildEquation", + "DocumentDocumentFileChildEquationChild", + "DocumentDocumentFileChildEquationChildBlob", + "DocumentDocumentFileChildEquationChildCode", + "DocumentDocumentFileChildEquationChildComment", + "DocumentDocumentFileChildEquationChildDivider", + "DocumentDocumentFileChildEquationChildImage", + "DocumentDocumentFileChildEquationChildLink", + "DocumentDocumentFileChildEquationChildLineBreak", + "DocumentDocumentFileChildEquationChildText", + "DocumentDocumentFileChildEquationChildToolCall", + "DocumentDocumentFileChildEquationChildToolResult", + "DocumentDocumentFileChildEquationChildTraceMessage", + "DocumentDocumentFileChildFootnote", + "DocumentDocumentFileChildFootnoteChild", + "DocumentDocumentFileChildFootnoteChildBlob", + "DocumentDocumentFileChildFootnoteChildCode", + "DocumentDocumentFileChildFootnoteChildComment", + "DocumentDocumentFileChildFootnoteChildDivider", + "DocumentDocumentFileChildFootnoteChildImage", + "DocumentDocumentFileChildFootnoteChildLink", + "DocumentDocumentFileChildFootnoteChildLineBreak", + "DocumentDocumentFileChildFootnoteChildText", + "DocumentDocumentFileChildFootnoteChildToolCall", + "DocumentDocumentFileChildFootnoteChildToolResult", + "DocumentDocumentFileChildFootnoteChildTraceMessage", + "DocumentDocumentFileChildHeading", + "DocumentDocumentFileChildHeadingChild", + "DocumentDocumentFileChildHeadingChildBlob", + "DocumentDocumentFileChildHeadingChildCode", + "DocumentDocumentFileChildHeadingChildComment", + "DocumentDocumentFileChildHeadingChildDivider", + "DocumentDocumentFileChildHeadingChildImage", + "DocumentDocumentFileChildHeadingChildLink", + "DocumentDocumentFileChildHeadingChildLineBreak", + "DocumentDocumentFileChildHeadingChildText", + "DocumentDocumentFileChildHeadingChildToolCall", + "DocumentDocumentFileChildHeadingChildToolResult", + "DocumentDocumentFileChildHeadingChildTraceMessage", + "DocumentDocumentFileChildImage", + "DocumentDocumentFileChildLink", + "DocumentDocumentFileChildLineBreak", + "DocumentDocumentFileChildList", + "DocumentDocumentFileChildListItem", + "DocumentDocumentFileChildListItemChild", + "DocumentDocumentFileChildListItemChildBlob", + "DocumentDocumentFileChildListItemChildCode", + "DocumentDocumentFileChildListItemChildComment", + "DocumentDocumentFileChildListItemChildDivider", + "DocumentDocumentFileChildListItemChildImage", + "DocumentDocumentFileChildListItemChildLink", + "DocumentDocumentFileChildListItemChildLineBreak", + "DocumentDocumentFileChildListItemChildText", + "DocumentDocumentFileChildListItemChildToolCall", + "DocumentDocumentFileChildListItemChildToolResult", + "DocumentDocumentFileChildListItemChildTraceMessage", + "DocumentDocumentFileChildParagraph", + "DocumentDocumentFileChildParagraphChild", + "DocumentDocumentFileChildParagraphChildBlob", + "DocumentDocumentFileChildParagraphChildCode", + "DocumentDocumentFileChildParagraphChildComment", + "DocumentDocumentFileChildParagraphChildDivider", + "DocumentDocumentFileChildParagraphChildImage", + "DocumentDocumentFileChildParagraphChildLink", + "DocumentDocumentFileChildParagraphChildLineBreak", + "DocumentDocumentFileChildParagraphChildText", + "DocumentDocumentFileChildParagraphChildToolCall", + "DocumentDocumentFileChildParagraphChildToolResult", + "DocumentDocumentFileChildParagraphChildTraceMessage", + "DocumentDocumentFileChildQuote", + "DocumentDocumentFileChildQuoteChild", + "DocumentDocumentFileChildQuoteChildBlob", + "DocumentDocumentFileChildQuoteChildCode", + "DocumentDocumentFileChildQuoteChildComment", + "DocumentDocumentFileChildQuoteChildDivider", + "DocumentDocumentFileChildQuoteChildImage", + "DocumentDocumentFileChildQuoteChildLink", + "DocumentDocumentFileChildQuoteChildLineBreak", + "DocumentDocumentFileChildQuoteChildText", + "DocumentDocumentFileChildQuoteChildToolCall", + "DocumentDocumentFileChildQuoteChildToolResult", + "DocumentDocumentFileChildQuoteChildTraceMessage", + "DocumentDocumentFileChildTable", + "DocumentDocumentFileChildTableCell", + "DocumentDocumentFileChildTableCellChild", + "DocumentDocumentFileChildTableCellChildBlob", + "DocumentDocumentFileChildTableCellChildCode", + "DocumentDocumentFileChildTableCellChildComment", + "DocumentDocumentFileChildTableCellChildDivider", + "DocumentDocumentFileChildTableCellChildImage", + "DocumentDocumentFileChildTableCellChildLink", + "DocumentDocumentFileChildTableCellChildLineBreak", + "DocumentDocumentFileChildTableCellChildText", + "DocumentDocumentFileChildTableCellChildToolCall", + "DocumentDocumentFileChildTableCellChildToolResult", + "DocumentDocumentFileChildTableCellChildTraceMessage", + "DocumentDocumentFileChildTableRow", + "DocumentDocumentFileChildText", + "DocumentDocumentFileChildToDo", + "DocumentDocumentFileChildToDoChild", + "DocumentDocumentFileChildToDoChildBlob", + "DocumentDocumentFileChildToDoChildCode", + "DocumentDocumentFileChildToDoChildComment", + "DocumentDocumentFileChildToDoChildDivider", + "DocumentDocumentFileChildToDoChildImage", + "DocumentDocumentFileChildToDoChildLink", + "DocumentDocumentFileChildToDoChildLineBreak", + "DocumentDocumentFileChildToDoChildText", + "DocumentDocumentFileChildToDoChildToolCall", + "DocumentDocumentFileChildToDoChildToolResult", + "DocumentDocumentFileChildToDoChildTraceMessage", + "DocumentDocumentFileChildToolCall", + "DocumentDocumentFileChildToolResult", + "DocumentDocumentFileChildTraceMessage", + "DocumentDocumentFileChildUtterance", + "DocumentDocumentConversation", + "DocumentDocumentConversationChild", + "DocumentDocumentConversationChildSender", + "DocumentDocumentConversationChildSenderChild", + "DocumentDocumentConversationChildSenderChildBlob", + "DocumentDocumentConversationChildSenderChildCode", + "DocumentDocumentConversationChildSenderChildComment", + "DocumentDocumentConversationChildSenderChildDivider", + "DocumentDocumentConversationChildSenderChildImage", + "DocumentDocumentConversationChildSenderChildLink", + "DocumentDocumentConversationChildSenderChildLineBreak", + "DocumentDocumentConversationChildSenderChildText", + "DocumentDocumentConversationChildSenderChildToolCall", + "DocumentDocumentConversationChildSenderChildToolResult", + "DocumentDocumentConversationChildSenderChildTraceMessage", + "DocumentDocumentConversationChildChild", + "DocumentDocumentConversationChildChildBlob", + "DocumentDocumentConversationChildChildCallout", + "DocumentDocumentConversationChildChildCalloutChild", + "DocumentDocumentConversationChildChildCalloutChildBlob", + "DocumentDocumentConversationChildChildCalloutChildCode", + "DocumentDocumentConversationChildChildCalloutChildComment", + "DocumentDocumentConversationChildChildCalloutChildDivider", + "DocumentDocumentConversationChildChildCalloutChildImage", + "DocumentDocumentConversationChildChildCalloutChildLink", + "DocumentDocumentConversationChildChildCalloutChildLineBreak", + "DocumentDocumentConversationChildChildCalloutChildText", + "DocumentDocumentConversationChildChildCalloutChildToolCall", + "DocumentDocumentConversationChildChildCalloutChildToolResult", + "DocumentDocumentConversationChildChildCalloutChildTraceMessage", + "DocumentDocumentConversationChildChildChunk", + "DocumentDocumentConversationChildChildChunkChild", + "DocumentDocumentConversationChildChildChunkChildBlob", + "DocumentDocumentConversationChildChildChunkChildCode", + "DocumentDocumentConversationChildChildChunkChildComment", + "DocumentDocumentConversationChildChildChunkChildDivider", + "DocumentDocumentConversationChildChildChunkChildImage", + "DocumentDocumentConversationChildChildChunkChildLink", + "DocumentDocumentConversationChildChildChunkChildLineBreak", + "DocumentDocumentConversationChildChildChunkChildText", + "DocumentDocumentConversationChildChildChunkChildToolCall", + "DocumentDocumentConversationChildChildChunkChildToolResult", + "DocumentDocumentConversationChildChildChunkChildTraceMessage", + "DocumentDocumentConversationChildChildCode", + "DocumentDocumentConversationChildChildComment", + "DocumentDocumentConversationChildChildDivider", + "DocumentDocumentConversationChildChildEquation", + "DocumentDocumentConversationChildChildEquationChild", + "DocumentDocumentConversationChildChildEquationChildBlob", + "DocumentDocumentConversationChildChildEquationChildCode", + "DocumentDocumentConversationChildChildEquationChildComment", + "DocumentDocumentConversationChildChildEquationChildDivider", + "DocumentDocumentConversationChildChildEquationChildImage", + "DocumentDocumentConversationChildChildEquationChildLink", + "DocumentDocumentConversationChildChildEquationChildLineBreak", + "DocumentDocumentConversationChildChildEquationChildText", + "DocumentDocumentConversationChildChildEquationChildToolCall", + "DocumentDocumentConversationChildChildEquationChildToolResult", + "DocumentDocumentConversationChildChildEquationChildTraceMessage", + "DocumentDocumentConversationChildChildFootnote", + "DocumentDocumentConversationChildChildFootnoteChild", + "DocumentDocumentConversationChildChildFootnoteChildBlob", + "DocumentDocumentConversationChildChildFootnoteChildCode", + "DocumentDocumentConversationChildChildFootnoteChildComment", + "DocumentDocumentConversationChildChildFootnoteChildDivider", + "DocumentDocumentConversationChildChildFootnoteChildImage", + "DocumentDocumentConversationChildChildFootnoteChildLink", + "DocumentDocumentConversationChildChildFootnoteChildLineBreak", + "DocumentDocumentConversationChildChildFootnoteChildText", + "DocumentDocumentConversationChildChildFootnoteChildToolCall", + "DocumentDocumentConversationChildChildFootnoteChildToolResult", + "DocumentDocumentConversationChildChildFootnoteChildTraceMessage", + "DocumentDocumentConversationChildChildHeading", + "DocumentDocumentConversationChildChildHeadingChild", + "DocumentDocumentConversationChildChildHeadingChildBlob", + "DocumentDocumentConversationChildChildHeadingChildCode", + "DocumentDocumentConversationChildChildHeadingChildComment", + "DocumentDocumentConversationChildChildHeadingChildDivider", + "DocumentDocumentConversationChildChildHeadingChildImage", + "DocumentDocumentConversationChildChildHeadingChildLink", + "DocumentDocumentConversationChildChildHeadingChildLineBreak", + "DocumentDocumentConversationChildChildHeadingChildText", + "DocumentDocumentConversationChildChildHeadingChildToolCall", + "DocumentDocumentConversationChildChildHeadingChildToolResult", + "DocumentDocumentConversationChildChildHeadingChildTraceMessage", + "DocumentDocumentConversationChildChildImage", + "DocumentDocumentConversationChildChildLink", + "DocumentDocumentConversationChildChildLineBreak", + "DocumentDocumentConversationChildChildList", + "DocumentDocumentConversationChildChildListItem", + "DocumentDocumentConversationChildChildListItemChild", + "DocumentDocumentConversationChildChildListItemChildBlob", + "DocumentDocumentConversationChildChildListItemChildCode", + "DocumentDocumentConversationChildChildListItemChildComment", + "DocumentDocumentConversationChildChildListItemChildDivider", + "DocumentDocumentConversationChildChildListItemChildImage", + "DocumentDocumentConversationChildChildListItemChildLink", + "DocumentDocumentConversationChildChildListItemChildLineBreak", + "DocumentDocumentConversationChildChildListItemChildText", + "DocumentDocumentConversationChildChildListItemChildToolCall", + "DocumentDocumentConversationChildChildListItemChildToolResult", + "DocumentDocumentConversationChildChildListItemChildTraceMessage", + "DocumentDocumentConversationChildChildParagraph", + "DocumentDocumentConversationChildChildParagraphChild", + "DocumentDocumentConversationChildChildParagraphChildBlob", + "DocumentDocumentConversationChildChildParagraphChildCode", + "DocumentDocumentConversationChildChildParagraphChildComment", + "DocumentDocumentConversationChildChildParagraphChildDivider", + "DocumentDocumentConversationChildChildParagraphChildImage", + "DocumentDocumentConversationChildChildParagraphChildLink", + "DocumentDocumentConversationChildChildParagraphChildLineBreak", + "DocumentDocumentConversationChildChildParagraphChildText", + "DocumentDocumentConversationChildChildParagraphChildToolCall", + "DocumentDocumentConversationChildChildParagraphChildToolResult", + "DocumentDocumentConversationChildChildParagraphChildTraceMessage", + "DocumentDocumentConversationChildChildQuote", + "DocumentDocumentConversationChildChildQuoteChild", + "DocumentDocumentConversationChildChildQuoteChildBlob", + "DocumentDocumentConversationChildChildQuoteChildCode", + "DocumentDocumentConversationChildChildQuoteChildComment", + "DocumentDocumentConversationChildChildQuoteChildDivider", + "DocumentDocumentConversationChildChildQuoteChildImage", + "DocumentDocumentConversationChildChildQuoteChildLink", + "DocumentDocumentConversationChildChildQuoteChildLineBreak", + "DocumentDocumentConversationChildChildQuoteChildText", + "DocumentDocumentConversationChildChildQuoteChildToolCall", + "DocumentDocumentConversationChildChildQuoteChildToolResult", + "DocumentDocumentConversationChildChildQuoteChildTraceMessage", + "DocumentDocumentConversationChildChildTable", + "DocumentDocumentConversationChildChildTableCell", + "DocumentDocumentConversationChildChildTableCellChild", + "DocumentDocumentConversationChildChildTableCellChildBlob", + "DocumentDocumentConversationChildChildTableCellChildCode", + "DocumentDocumentConversationChildChildTableCellChildComment", + "DocumentDocumentConversationChildChildTableCellChildDivider", + "DocumentDocumentConversationChildChildTableCellChildImage", + "DocumentDocumentConversationChildChildTableCellChildLink", + "DocumentDocumentConversationChildChildTableCellChildLineBreak", + "DocumentDocumentConversationChildChildTableCellChildText", + "DocumentDocumentConversationChildChildTableCellChildToolCall", + "DocumentDocumentConversationChildChildTableCellChildToolResult", + "DocumentDocumentConversationChildChildTableCellChildTraceMessage", + "DocumentDocumentConversationChildChildTableRow", + "DocumentDocumentConversationChildChildText", + "DocumentDocumentConversationChildChildToDo", + "DocumentDocumentConversationChildChildToDoChild", + "DocumentDocumentConversationChildChildToDoChildBlob", + "DocumentDocumentConversationChildChildToDoChildCode", + "DocumentDocumentConversationChildChildToDoChildComment", + "DocumentDocumentConversationChildChildToDoChildDivider", + "DocumentDocumentConversationChildChildToDoChildImage", + "DocumentDocumentConversationChildChildToDoChildLink", + "DocumentDocumentConversationChildChildToDoChildLineBreak", + "DocumentDocumentConversationChildChildToDoChildText", + "DocumentDocumentConversationChildChildToDoChildToolCall", + "DocumentDocumentConversationChildChildToDoChildToolResult", + "DocumentDocumentConversationChildChildToDoChildTraceMessage", + "DocumentDocumentConversationChildChildToolCall", + "DocumentDocumentConversationChildChildToolResult", + "DocumentDocumentConversationChildChildTraceMessage", + "DocumentDocumentConversationChildChildUtterance", + "DocumentDocumentConversationChildMentionedUser", + "DocumentDocumentConversationChildMentionedUserChild", + "DocumentDocumentConversationChildMentionedUserChildBlob", + "DocumentDocumentConversationChildMentionedUserChildCode", + "DocumentDocumentConversationChildMentionedUserChildComment", + "DocumentDocumentConversationChildMentionedUserChildDivider", + "DocumentDocumentConversationChildMentionedUserChildImage", + "DocumentDocumentConversationChildMentionedUserChildLink", + "DocumentDocumentConversationChildMentionedUserChildLineBreak", + "DocumentDocumentConversationChildMentionedUserChildText", + "DocumentDocumentConversationChildMentionedUserChildToolCall", + "DocumentDocumentConversationChildMentionedUserChildToolResult", + "DocumentDocumentConversationChildMentionedUserChildTraceMessage", + "DocumentDocumentTrace", + "DocumentDocumentTraceChild", + "DocumentDocumentTraceChildTraceMessage", + "DocumentDocumentTraceChildToolCall", + "DocumentDocumentTraceChildToolResult", + "DocumentDocumentTranscript", + "DocumentDocumentTranscriptChild", + "DocumentDocumentTranscriptParticipant", + "DocumentDocumentTranscriptParticipantChild", + "DocumentDocumentTranscriptParticipantChildBlob", + "DocumentDocumentTranscriptParticipantChildCode", + "DocumentDocumentTranscriptParticipantChildComment", + "DocumentDocumentTranscriptParticipantChildDivider", + "DocumentDocumentTranscriptParticipantChildImage", + "DocumentDocumentTranscriptParticipantChildLink", + "DocumentDocumentTranscriptParticipantChildLineBreak", + "DocumentDocumentTranscriptParticipantChildText", + "DocumentDocumentTranscriptParticipantChildToolCall", + "DocumentDocumentTranscriptParticipantChildToolResult", + "DocumentDocumentTranscriptParticipantChildTraceMessage", + "DocumentDocumentCompany", + "DocumentDocumentCompanyChild", + "DocumentDocumentCompanyChildBlob", + "DocumentDocumentCompanyChildCallout", + "DocumentDocumentCompanyChildCalloutChild", + "DocumentDocumentCompanyChildCalloutChildBlob", + "DocumentDocumentCompanyChildCalloutChildCode", + "DocumentDocumentCompanyChildCalloutChildComment", + "DocumentDocumentCompanyChildCalloutChildDivider", + "DocumentDocumentCompanyChildCalloutChildImage", + "DocumentDocumentCompanyChildCalloutChildLink", + "DocumentDocumentCompanyChildCalloutChildLineBreak", + "DocumentDocumentCompanyChildCalloutChildText", + "DocumentDocumentCompanyChildCalloutChildToolCall", + "DocumentDocumentCompanyChildCalloutChildToolResult", + "DocumentDocumentCompanyChildCalloutChildTraceMessage", + "DocumentDocumentCompanyChildChunk", + "DocumentDocumentCompanyChildChunkChild", + "DocumentDocumentCompanyChildChunkChildBlob", + "DocumentDocumentCompanyChildChunkChildCode", + "DocumentDocumentCompanyChildChunkChildComment", + "DocumentDocumentCompanyChildChunkChildDivider", + "DocumentDocumentCompanyChildChunkChildImage", + "DocumentDocumentCompanyChildChunkChildLink", + "DocumentDocumentCompanyChildChunkChildLineBreak", + "DocumentDocumentCompanyChildChunkChildText", + "DocumentDocumentCompanyChildChunkChildToolCall", + "DocumentDocumentCompanyChildChunkChildToolResult", + "DocumentDocumentCompanyChildChunkChildTraceMessage", + "DocumentDocumentCompanyChildCode", + "DocumentDocumentCompanyChildComment", + "DocumentDocumentCompanyChildDivider", + "DocumentDocumentCompanyChildEquation", + "DocumentDocumentCompanyChildEquationChild", + "DocumentDocumentCompanyChildEquationChildBlob", + "DocumentDocumentCompanyChildEquationChildCode", + "DocumentDocumentCompanyChildEquationChildComment", + "DocumentDocumentCompanyChildEquationChildDivider", + "DocumentDocumentCompanyChildEquationChildImage", + "DocumentDocumentCompanyChildEquationChildLink", + "DocumentDocumentCompanyChildEquationChildLineBreak", + "DocumentDocumentCompanyChildEquationChildText", + "DocumentDocumentCompanyChildEquationChildToolCall", + "DocumentDocumentCompanyChildEquationChildToolResult", + "DocumentDocumentCompanyChildEquationChildTraceMessage", + "DocumentDocumentCompanyChildFootnote", + "DocumentDocumentCompanyChildFootnoteChild", + "DocumentDocumentCompanyChildFootnoteChildBlob", + "DocumentDocumentCompanyChildFootnoteChildCode", + "DocumentDocumentCompanyChildFootnoteChildComment", + "DocumentDocumentCompanyChildFootnoteChildDivider", + "DocumentDocumentCompanyChildFootnoteChildImage", + "DocumentDocumentCompanyChildFootnoteChildLink", + "DocumentDocumentCompanyChildFootnoteChildLineBreak", + "DocumentDocumentCompanyChildFootnoteChildText", + "DocumentDocumentCompanyChildFootnoteChildToolCall", + "DocumentDocumentCompanyChildFootnoteChildToolResult", + "DocumentDocumentCompanyChildFootnoteChildTraceMessage", + "DocumentDocumentCompanyChildHeading", + "DocumentDocumentCompanyChildHeadingChild", + "DocumentDocumentCompanyChildHeadingChildBlob", + "DocumentDocumentCompanyChildHeadingChildCode", + "DocumentDocumentCompanyChildHeadingChildComment", + "DocumentDocumentCompanyChildHeadingChildDivider", + "DocumentDocumentCompanyChildHeadingChildImage", + "DocumentDocumentCompanyChildHeadingChildLink", + "DocumentDocumentCompanyChildHeadingChildLineBreak", + "DocumentDocumentCompanyChildHeadingChildText", + "DocumentDocumentCompanyChildHeadingChildToolCall", + "DocumentDocumentCompanyChildHeadingChildToolResult", + "DocumentDocumentCompanyChildHeadingChildTraceMessage", + "DocumentDocumentCompanyChildImage", + "DocumentDocumentCompanyChildLink", + "DocumentDocumentCompanyChildLineBreak", + "DocumentDocumentCompanyChildList", + "DocumentDocumentCompanyChildListItem", + "DocumentDocumentCompanyChildListItemChild", + "DocumentDocumentCompanyChildListItemChildBlob", + "DocumentDocumentCompanyChildListItemChildCode", + "DocumentDocumentCompanyChildListItemChildComment", + "DocumentDocumentCompanyChildListItemChildDivider", + "DocumentDocumentCompanyChildListItemChildImage", + "DocumentDocumentCompanyChildListItemChildLink", + "DocumentDocumentCompanyChildListItemChildLineBreak", + "DocumentDocumentCompanyChildListItemChildText", + "DocumentDocumentCompanyChildListItemChildToolCall", + "DocumentDocumentCompanyChildListItemChildToolResult", + "DocumentDocumentCompanyChildListItemChildTraceMessage", + "DocumentDocumentCompanyChildParagraph", + "DocumentDocumentCompanyChildParagraphChild", + "DocumentDocumentCompanyChildParagraphChildBlob", + "DocumentDocumentCompanyChildParagraphChildCode", + "DocumentDocumentCompanyChildParagraphChildComment", + "DocumentDocumentCompanyChildParagraphChildDivider", + "DocumentDocumentCompanyChildParagraphChildImage", + "DocumentDocumentCompanyChildParagraphChildLink", + "DocumentDocumentCompanyChildParagraphChildLineBreak", + "DocumentDocumentCompanyChildParagraphChildText", + "DocumentDocumentCompanyChildParagraphChildToolCall", + "DocumentDocumentCompanyChildParagraphChildToolResult", + "DocumentDocumentCompanyChildParagraphChildTraceMessage", + "DocumentDocumentCompanyChildQuote", + "DocumentDocumentCompanyChildQuoteChild", + "DocumentDocumentCompanyChildQuoteChildBlob", + "DocumentDocumentCompanyChildQuoteChildCode", + "DocumentDocumentCompanyChildQuoteChildComment", + "DocumentDocumentCompanyChildQuoteChildDivider", + "DocumentDocumentCompanyChildQuoteChildImage", + "DocumentDocumentCompanyChildQuoteChildLink", + "DocumentDocumentCompanyChildQuoteChildLineBreak", + "DocumentDocumentCompanyChildQuoteChildText", + "DocumentDocumentCompanyChildQuoteChildToolCall", + "DocumentDocumentCompanyChildQuoteChildToolResult", + "DocumentDocumentCompanyChildQuoteChildTraceMessage", + "DocumentDocumentCompanyChildTable", + "DocumentDocumentCompanyChildTableCell", + "DocumentDocumentCompanyChildTableCellChild", + "DocumentDocumentCompanyChildTableCellChildBlob", + "DocumentDocumentCompanyChildTableCellChildCode", + "DocumentDocumentCompanyChildTableCellChildComment", + "DocumentDocumentCompanyChildTableCellChildDivider", + "DocumentDocumentCompanyChildTableCellChildImage", + "DocumentDocumentCompanyChildTableCellChildLink", + "DocumentDocumentCompanyChildTableCellChildLineBreak", + "DocumentDocumentCompanyChildTableCellChildText", + "DocumentDocumentCompanyChildTableCellChildToolCall", + "DocumentDocumentCompanyChildTableCellChildToolResult", + "DocumentDocumentCompanyChildTableCellChildTraceMessage", + "DocumentDocumentCompanyChildTableRow", + "DocumentDocumentCompanyChildText", + "DocumentDocumentCompanyChildToDo", + "DocumentDocumentCompanyChildToDoChild", + "DocumentDocumentCompanyChildToDoChildBlob", + "DocumentDocumentCompanyChildToDoChildCode", + "DocumentDocumentCompanyChildToDoChildComment", + "DocumentDocumentCompanyChildToDoChildDivider", + "DocumentDocumentCompanyChildToDoChildImage", + "DocumentDocumentCompanyChildToDoChildLink", + "DocumentDocumentCompanyChildToDoChildLineBreak", + "DocumentDocumentCompanyChildToDoChildText", + "DocumentDocumentCompanyChildToDoChildToolCall", + "DocumentDocumentCompanyChildToDoChildToolResult", + "DocumentDocumentCompanyChildToDoChildTraceMessage", + "DocumentDocumentCompanyChildToolCall", + "DocumentDocumentCompanyChildToolResult", + "DocumentDocumentCompanyChildTraceMessage", + "DocumentDocumentCompanyChildUtterance", + "DocumentDocumentDeal", + "DocumentDocumentDealChild", + "DocumentDocumentDealChildBlob", + "DocumentDocumentDealChildCallout", + "DocumentDocumentDealChildCalloutChild", + "DocumentDocumentDealChildCalloutChildBlob", + "DocumentDocumentDealChildCalloutChildCode", + "DocumentDocumentDealChildCalloutChildComment", + "DocumentDocumentDealChildCalloutChildDivider", + "DocumentDocumentDealChildCalloutChildImage", + "DocumentDocumentDealChildCalloutChildLink", + "DocumentDocumentDealChildCalloutChildLineBreak", + "DocumentDocumentDealChildCalloutChildText", + "DocumentDocumentDealChildCalloutChildToolCall", + "DocumentDocumentDealChildCalloutChildToolResult", + "DocumentDocumentDealChildCalloutChildTraceMessage", + "DocumentDocumentDealChildChunk", + "DocumentDocumentDealChildChunkChild", + "DocumentDocumentDealChildChunkChildBlob", + "DocumentDocumentDealChildChunkChildCode", + "DocumentDocumentDealChildChunkChildComment", + "DocumentDocumentDealChildChunkChildDivider", + "DocumentDocumentDealChildChunkChildImage", + "DocumentDocumentDealChildChunkChildLink", + "DocumentDocumentDealChildChunkChildLineBreak", + "DocumentDocumentDealChildChunkChildText", + "DocumentDocumentDealChildChunkChildToolCall", + "DocumentDocumentDealChildChunkChildToolResult", + "DocumentDocumentDealChildChunkChildTraceMessage", + "DocumentDocumentDealChildCode", + "DocumentDocumentDealChildComment", + "DocumentDocumentDealChildDivider", + "DocumentDocumentDealChildEquation", + "DocumentDocumentDealChildEquationChild", + "DocumentDocumentDealChildEquationChildBlob", + "DocumentDocumentDealChildEquationChildCode", + "DocumentDocumentDealChildEquationChildComment", + "DocumentDocumentDealChildEquationChildDivider", + "DocumentDocumentDealChildEquationChildImage", + "DocumentDocumentDealChildEquationChildLink", + "DocumentDocumentDealChildEquationChildLineBreak", + "DocumentDocumentDealChildEquationChildText", + "DocumentDocumentDealChildEquationChildToolCall", + "DocumentDocumentDealChildEquationChildToolResult", + "DocumentDocumentDealChildEquationChildTraceMessage", + "DocumentDocumentDealChildFootnote", + "DocumentDocumentDealChildFootnoteChild", + "DocumentDocumentDealChildFootnoteChildBlob", + "DocumentDocumentDealChildFootnoteChildCode", + "DocumentDocumentDealChildFootnoteChildComment", + "DocumentDocumentDealChildFootnoteChildDivider", + "DocumentDocumentDealChildFootnoteChildImage", + "DocumentDocumentDealChildFootnoteChildLink", + "DocumentDocumentDealChildFootnoteChildLineBreak", + "DocumentDocumentDealChildFootnoteChildText", + "DocumentDocumentDealChildFootnoteChildToolCall", + "DocumentDocumentDealChildFootnoteChildToolResult", + "DocumentDocumentDealChildFootnoteChildTraceMessage", + "DocumentDocumentDealChildHeading", + "DocumentDocumentDealChildHeadingChild", + "DocumentDocumentDealChildHeadingChildBlob", + "DocumentDocumentDealChildHeadingChildCode", + "DocumentDocumentDealChildHeadingChildComment", + "DocumentDocumentDealChildHeadingChildDivider", + "DocumentDocumentDealChildHeadingChildImage", + "DocumentDocumentDealChildHeadingChildLink", + "DocumentDocumentDealChildHeadingChildLineBreak", + "DocumentDocumentDealChildHeadingChildText", + "DocumentDocumentDealChildHeadingChildToolCall", + "DocumentDocumentDealChildHeadingChildToolResult", + "DocumentDocumentDealChildHeadingChildTraceMessage", + "DocumentDocumentDealChildImage", + "DocumentDocumentDealChildLink", + "DocumentDocumentDealChildLineBreak", + "DocumentDocumentDealChildList", + "DocumentDocumentDealChildListItem", + "DocumentDocumentDealChildListItemChild", + "DocumentDocumentDealChildListItemChildBlob", + "DocumentDocumentDealChildListItemChildCode", + "DocumentDocumentDealChildListItemChildComment", + "DocumentDocumentDealChildListItemChildDivider", + "DocumentDocumentDealChildListItemChildImage", + "DocumentDocumentDealChildListItemChildLink", + "DocumentDocumentDealChildListItemChildLineBreak", + "DocumentDocumentDealChildListItemChildText", + "DocumentDocumentDealChildListItemChildToolCall", + "DocumentDocumentDealChildListItemChildToolResult", + "DocumentDocumentDealChildListItemChildTraceMessage", + "DocumentDocumentDealChildParagraph", + "DocumentDocumentDealChildParagraphChild", + "DocumentDocumentDealChildParagraphChildBlob", + "DocumentDocumentDealChildParagraphChildCode", + "DocumentDocumentDealChildParagraphChildComment", + "DocumentDocumentDealChildParagraphChildDivider", + "DocumentDocumentDealChildParagraphChildImage", + "DocumentDocumentDealChildParagraphChildLink", + "DocumentDocumentDealChildParagraphChildLineBreak", + "DocumentDocumentDealChildParagraphChildText", + "DocumentDocumentDealChildParagraphChildToolCall", + "DocumentDocumentDealChildParagraphChildToolResult", + "DocumentDocumentDealChildParagraphChildTraceMessage", + "DocumentDocumentDealChildQuote", + "DocumentDocumentDealChildQuoteChild", + "DocumentDocumentDealChildQuoteChildBlob", + "DocumentDocumentDealChildQuoteChildCode", + "DocumentDocumentDealChildQuoteChildComment", + "DocumentDocumentDealChildQuoteChildDivider", + "DocumentDocumentDealChildQuoteChildImage", + "DocumentDocumentDealChildQuoteChildLink", + "DocumentDocumentDealChildQuoteChildLineBreak", + "DocumentDocumentDealChildQuoteChildText", + "DocumentDocumentDealChildQuoteChildToolCall", + "DocumentDocumentDealChildQuoteChildToolResult", + "DocumentDocumentDealChildQuoteChildTraceMessage", + "DocumentDocumentDealChildTable", + "DocumentDocumentDealChildTableCell", + "DocumentDocumentDealChildTableCellChild", + "DocumentDocumentDealChildTableCellChildBlob", + "DocumentDocumentDealChildTableCellChildCode", + "DocumentDocumentDealChildTableCellChildComment", + "DocumentDocumentDealChildTableCellChildDivider", + "DocumentDocumentDealChildTableCellChildImage", + "DocumentDocumentDealChildTableCellChildLink", + "DocumentDocumentDealChildTableCellChildLineBreak", + "DocumentDocumentDealChildTableCellChildText", + "DocumentDocumentDealChildTableCellChildToolCall", + "DocumentDocumentDealChildTableCellChildToolResult", + "DocumentDocumentDealChildTableCellChildTraceMessage", + "DocumentDocumentDealChildTableRow", + "DocumentDocumentDealChildText", + "DocumentDocumentDealChildToDo", + "DocumentDocumentDealChildToDoChild", + "DocumentDocumentDealChildToDoChildBlob", + "DocumentDocumentDealChildToDoChildCode", + "DocumentDocumentDealChildToDoChildComment", + "DocumentDocumentDealChildToDoChildDivider", + "DocumentDocumentDealChildToDoChildImage", + "DocumentDocumentDealChildToDoChildLink", + "DocumentDocumentDealChildToDoChildLineBreak", + "DocumentDocumentDealChildToDoChildText", + "DocumentDocumentDealChildToDoChildToolCall", + "DocumentDocumentDealChildToDoChildToolResult", + "DocumentDocumentDealChildToDoChildTraceMessage", + "DocumentDocumentDealChildToolCall", + "DocumentDocumentDealChildToolResult", + "DocumentDocumentDealChildTraceMessage", + "DocumentDocumentDealChildUtterance", + "Provenance", + "ProvenanceEntity", + "ProvenanceSource", + "ProvenanceStep", +] -class QueryResult(BaseModel): - documents: List[Resource] +class DocumentDocumentDocumentChildBlob(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 DocumentDocumentDocumentChildCalloutChildBlob(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 DocumentDocumentDocumentChildCalloutChildCode(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 DocumentDocumentDocumentChildCalloutChildComment(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 DocumentDocumentDocumentChildCalloutChildDivider(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 DocumentDocumentDocumentChildCalloutChildImage(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 DocumentDocumentDocumentChildCalloutChildLink(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 DocumentDocumentDocumentChildCalloutChildLineBreak(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 DocumentDocumentDocumentChildCalloutChildText(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 DocumentDocumentDocumentChildCalloutChildToolCall(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 DocumentDocumentDocumentChildCalloutChildToolResult(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 DocumentDocumentDocumentChildCalloutChildTraceMessage(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 + + +DocumentDocumentDocumentChildCalloutChild: TypeAlias = Union[ + DocumentDocumentDocumentChildCalloutChildBlob, + DocumentDocumentDocumentChildCalloutChildCode, + DocumentDocumentDocumentChildCalloutChildComment, + DocumentDocumentDocumentChildCalloutChildDivider, + DocumentDocumentDocumentChildCalloutChildImage, + DocumentDocumentDocumentChildCalloutChildLink, + DocumentDocumentDocumentChildCalloutChildLineBreak, + DocumentDocumentDocumentChildCalloutChildText, + DocumentDocumentDocumentChildCalloutChildToolCall, + DocumentDocumentDocumentChildCalloutChildToolResult, + DocumentDocumentDocumentChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildChunkChildBlob(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 DocumentDocumentDocumentChildChunkChildCode(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 DocumentDocumentDocumentChildChunkChildComment(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 DocumentDocumentDocumentChildChunkChildDivider(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 DocumentDocumentDocumentChildChunkChildImage(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 DocumentDocumentDocumentChildChunkChildLink(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 DocumentDocumentDocumentChildChunkChildLineBreak(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 DocumentDocumentDocumentChildChunkChildText(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 DocumentDocumentDocumentChildChunkChildToolCall(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 DocumentDocumentDocumentChildChunkChildToolResult(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 DocumentDocumentDocumentChildChunkChildTraceMessage(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 + + +DocumentDocumentDocumentChildChunkChild: TypeAlias = Union[ + DocumentDocumentDocumentChildChunkChildBlob, + DocumentDocumentDocumentChildChunkChildCode, + DocumentDocumentDocumentChildChunkChildComment, + DocumentDocumentDocumentChildChunkChildDivider, + DocumentDocumentDocumentChildChunkChildImage, + DocumentDocumentDocumentChildChunkChildLink, + DocumentDocumentDocumentChildChunkChildLineBreak, + DocumentDocumentDocumentChildChunkChildText, + DocumentDocumentDocumentChildChunkChildToolCall, + DocumentDocumentDocumentChildChunkChildToolResult, + DocumentDocumentDocumentChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildCode(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 DocumentDocumentDocumentChildComment(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 DocumentDocumentDocumentChildDivider(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 DocumentDocumentDocumentChildEquationChildBlob(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 DocumentDocumentDocumentChildEquationChildCode(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 DocumentDocumentDocumentChildEquationChildComment(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 DocumentDocumentDocumentChildEquationChildDivider(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 DocumentDocumentDocumentChildEquationChildImage(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 DocumentDocumentDocumentChildEquationChildLink(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 DocumentDocumentDocumentChildEquationChildLineBreak(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 DocumentDocumentDocumentChildEquationChildText(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 DocumentDocumentDocumentChildEquationChildToolCall(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 DocumentDocumentDocumentChildEquationChildToolResult(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 DocumentDocumentDocumentChildEquationChildTraceMessage(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 + + +DocumentDocumentDocumentChildEquationChild: TypeAlias = Union[ + DocumentDocumentDocumentChildEquationChildBlob, + DocumentDocumentDocumentChildEquationChildCode, + DocumentDocumentDocumentChildEquationChildComment, + DocumentDocumentDocumentChildEquationChildDivider, + DocumentDocumentDocumentChildEquationChildImage, + DocumentDocumentDocumentChildEquationChildLink, + DocumentDocumentDocumentChildEquationChildLineBreak, + DocumentDocumentDocumentChildEquationChildText, + DocumentDocumentDocumentChildEquationChildToolCall, + DocumentDocumentDocumentChildEquationChildToolResult, + DocumentDocumentDocumentChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildFootnoteChildBlob(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 DocumentDocumentDocumentChildFootnoteChildCode(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 DocumentDocumentDocumentChildFootnoteChildComment(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 DocumentDocumentDocumentChildFootnoteChildDivider(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 DocumentDocumentDocumentChildFootnoteChildImage(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 DocumentDocumentDocumentChildFootnoteChildLink(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 DocumentDocumentDocumentChildFootnoteChildLineBreak(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 DocumentDocumentDocumentChildFootnoteChildText(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 DocumentDocumentDocumentChildFootnoteChildToolCall(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 DocumentDocumentDocumentChildFootnoteChildToolResult(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 DocumentDocumentDocumentChildFootnoteChildTraceMessage(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 + + +DocumentDocumentDocumentChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentDocumentChildFootnoteChildBlob, + DocumentDocumentDocumentChildFootnoteChildCode, + DocumentDocumentDocumentChildFootnoteChildComment, + DocumentDocumentDocumentChildFootnoteChildDivider, + DocumentDocumentDocumentChildFootnoteChildImage, + DocumentDocumentDocumentChildFootnoteChildLink, + DocumentDocumentDocumentChildFootnoteChildLineBreak, + DocumentDocumentDocumentChildFootnoteChildText, + DocumentDocumentDocumentChildFootnoteChildToolCall, + DocumentDocumentDocumentChildFootnoteChildToolResult, + DocumentDocumentDocumentChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildHeadingChildBlob(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 DocumentDocumentDocumentChildHeadingChildCode(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 DocumentDocumentDocumentChildHeadingChildComment(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 DocumentDocumentDocumentChildHeadingChildDivider(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 DocumentDocumentDocumentChildHeadingChildImage(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 DocumentDocumentDocumentChildHeadingChildLink(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 DocumentDocumentDocumentChildHeadingChildLineBreak(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 DocumentDocumentDocumentChildHeadingChildText(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 DocumentDocumentDocumentChildHeadingChildToolCall(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 DocumentDocumentDocumentChildHeadingChildToolResult(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 DocumentDocumentDocumentChildHeadingChildTraceMessage(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 + + +DocumentDocumentDocumentChildHeadingChild: TypeAlias = Union[ + DocumentDocumentDocumentChildHeadingChildBlob, + DocumentDocumentDocumentChildHeadingChildCode, + DocumentDocumentDocumentChildHeadingChildComment, + DocumentDocumentDocumentChildHeadingChildDivider, + DocumentDocumentDocumentChildHeadingChildImage, + DocumentDocumentDocumentChildHeadingChildLink, + DocumentDocumentDocumentChildHeadingChildLineBreak, + DocumentDocumentDocumentChildHeadingChildText, + DocumentDocumentDocumentChildHeadingChildToolCall, + DocumentDocumentDocumentChildHeadingChildToolResult, + DocumentDocumentDocumentChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildImage(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 DocumentDocumentDocumentChildLink(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 DocumentDocumentDocumentChildLineBreak(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 DocumentDocumentDocumentChildList(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 DocumentDocumentDocumentChildListItemChildBlob(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 DocumentDocumentDocumentChildListItemChildCode(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 DocumentDocumentDocumentChildListItemChildComment(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 DocumentDocumentDocumentChildListItemChildDivider(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 DocumentDocumentDocumentChildListItemChildImage(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 DocumentDocumentDocumentChildListItemChildLink(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 DocumentDocumentDocumentChildListItemChildLineBreak(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 DocumentDocumentDocumentChildListItemChildText(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 DocumentDocumentDocumentChildListItemChildToolCall(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 DocumentDocumentDocumentChildListItemChildToolResult(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 DocumentDocumentDocumentChildListItemChildTraceMessage(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 + + +DocumentDocumentDocumentChildListItemChild: TypeAlias = Union[ + DocumentDocumentDocumentChildListItemChildBlob, + DocumentDocumentDocumentChildListItemChildCode, + DocumentDocumentDocumentChildListItemChildComment, + DocumentDocumentDocumentChildListItemChildDivider, + DocumentDocumentDocumentChildListItemChildImage, + DocumentDocumentDocumentChildListItemChildLink, + DocumentDocumentDocumentChildListItemChildLineBreak, + DocumentDocumentDocumentChildListItemChildText, + DocumentDocumentDocumentChildListItemChildToolCall, + DocumentDocumentDocumentChildListItemChildToolResult, + DocumentDocumentDocumentChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildParagraphChildBlob(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 DocumentDocumentDocumentChildParagraphChildCode(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 DocumentDocumentDocumentChildParagraphChildComment(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 DocumentDocumentDocumentChildParagraphChildDivider(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 DocumentDocumentDocumentChildParagraphChildImage(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 DocumentDocumentDocumentChildParagraphChildLink(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 DocumentDocumentDocumentChildParagraphChildLineBreak(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 DocumentDocumentDocumentChildParagraphChildText(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 DocumentDocumentDocumentChildParagraphChildToolCall(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 DocumentDocumentDocumentChildParagraphChildToolResult(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 DocumentDocumentDocumentChildParagraphChildTraceMessage(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 + + +DocumentDocumentDocumentChildParagraphChild: TypeAlias = Union[ + DocumentDocumentDocumentChildParagraphChildBlob, + DocumentDocumentDocumentChildParagraphChildCode, + DocumentDocumentDocumentChildParagraphChildComment, + DocumentDocumentDocumentChildParagraphChildDivider, + DocumentDocumentDocumentChildParagraphChildImage, + DocumentDocumentDocumentChildParagraphChildLink, + DocumentDocumentDocumentChildParagraphChildLineBreak, + DocumentDocumentDocumentChildParagraphChildText, + DocumentDocumentDocumentChildParagraphChildToolCall, + DocumentDocumentDocumentChildParagraphChildToolResult, + DocumentDocumentDocumentChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildQuoteChildBlob(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 DocumentDocumentDocumentChildQuoteChildCode(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 DocumentDocumentDocumentChildQuoteChildComment(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 DocumentDocumentDocumentChildQuoteChildDivider(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 DocumentDocumentDocumentChildQuoteChildImage(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 DocumentDocumentDocumentChildQuoteChildLink(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 DocumentDocumentDocumentChildQuoteChildLineBreak(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 DocumentDocumentDocumentChildQuoteChildText(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 DocumentDocumentDocumentChildQuoteChildToolCall(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 DocumentDocumentDocumentChildQuoteChildToolResult(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 DocumentDocumentDocumentChildQuoteChildTraceMessage(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 + + +DocumentDocumentDocumentChildQuoteChild: TypeAlias = Union[ + DocumentDocumentDocumentChildQuoteChildBlob, + DocumentDocumentDocumentChildQuoteChildCode, + DocumentDocumentDocumentChildQuoteChildComment, + DocumentDocumentDocumentChildQuoteChildDivider, + DocumentDocumentDocumentChildQuoteChildImage, + DocumentDocumentDocumentChildQuoteChildLink, + DocumentDocumentDocumentChildQuoteChildLineBreak, + DocumentDocumentDocumentChildQuoteChildText, + DocumentDocumentDocumentChildQuoteChildToolCall, + DocumentDocumentDocumentChildQuoteChildToolResult, + DocumentDocumentDocumentChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildTable(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 DocumentDocumentDocumentChildTableCellChildBlob(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 DocumentDocumentDocumentChildTableCellChildCode(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 DocumentDocumentDocumentChildTableCellChildComment(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 DocumentDocumentDocumentChildTableCellChildDivider(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 DocumentDocumentDocumentChildTableCellChildImage(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 DocumentDocumentDocumentChildTableCellChildLink(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 DocumentDocumentDocumentChildTableCellChildLineBreak(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 DocumentDocumentDocumentChildTableCellChildText(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 DocumentDocumentDocumentChildTableCellChildToolCall(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 DocumentDocumentDocumentChildTableCellChildToolResult(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 DocumentDocumentDocumentChildTableCellChildTraceMessage(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 + + +DocumentDocumentDocumentChildTableCellChild: TypeAlias = Union[ + DocumentDocumentDocumentChildTableCellChildBlob, + DocumentDocumentDocumentChildTableCellChildCode, + DocumentDocumentDocumentChildTableCellChildComment, + DocumentDocumentDocumentChildTableCellChildDivider, + DocumentDocumentDocumentChildTableCellChildImage, + DocumentDocumentDocumentChildTableCellChildLink, + DocumentDocumentDocumentChildTableCellChildLineBreak, + DocumentDocumentDocumentChildTableCellChildText, + DocumentDocumentDocumentChildTableCellChildToolCall, + DocumentDocumentDocumentChildTableCellChildToolResult, + DocumentDocumentDocumentChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentDocumentChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildTableRow(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 DocumentDocumentDocumentChildText(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 DocumentDocumentDocumentChildToDoChildBlob(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 DocumentDocumentDocumentChildToDoChildCode(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 DocumentDocumentDocumentChildToDoChildComment(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 DocumentDocumentDocumentChildToDoChildDivider(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 DocumentDocumentDocumentChildToDoChildImage(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 DocumentDocumentDocumentChildToDoChildLink(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 DocumentDocumentDocumentChildToDoChildLineBreak(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 DocumentDocumentDocumentChildToDoChildText(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 DocumentDocumentDocumentChildToDoChildToolCall(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 DocumentDocumentDocumentChildToDoChildToolResult(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 DocumentDocumentDocumentChildToDoChildTraceMessage(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 + + +DocumentDocumentDocumentChildToDoChild: TypeAlias = Union[ + DocumentDocumentDocumentChildToDoChildBlob, + DocumentDocumentDocumentChildToDoChildCode, + DocumentDocumentDocumentChildToDoChildComment, + DocumentDocumentDocumentChildToDoChildDivider, + DocumentDocumentDocumentChildToDoChildImage, + DocumentDocumentDocumentChildToDoChildLink, + DocumentDocumentDocumentChildToDoChildLineBreak, + DocumentDocumentDocumentChildToDoChildText, + DocumentDocumentDocumentChildToDoChildToolCall, + DocumentDocumentDocumentChildToDoChildToolResult, + DocumentDocumentDocumentChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentDocumentChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentDocumentChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDocumentChildToolCall(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 DocumentDocumentDocumentChildToolResult(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 DocumentDocumentDocumentChildTraceMessage(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 DocumentDocumentDocumentChildUtterance(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 + + +DocumentDocumentDocumentChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentDocumentChildBlob, + DocumentDocumentDocumentChildCallout, + DocumentDocumentDocumentChildChunk, + DocumentDocumentDocumentChildCode, + DocumentDocumentDocumentChildComment, + DocumentDocumentDocumentChildDivider, + DocumentDocumentDocumentChildEquation, + DocumentDocumentDocumentChildFootnote, + DocumentDocumentDocumentChildHeading, + DocumentDocumentDocumentChildImage, + DocumentDocumentDocumentChildLink, + DocumentDocumentDocumentChildLineBreak, + DocumentDocumentDocumentChildList, + DocumentDocumentDocumentChildListItem, + DocumentDocumentDocumentChildParagraph, + DocumentDocumentDocumentChildQuote, + DocumentDocumentDocumentChildTable, + DocumentDocumentDocumentChildTableCell, + DocumentDocumentDocumentChildTableRow, + DocumentDocumentDocumentChildText, + DocumentDocumentDocumentChildToDo, + DocumentDocumentDocumentChildToolCall, + DocumentDocumentDocumentChildToolResult, + DocumentDocumentDocumentChildTraceMessage, + DocumentDocumentDocumentChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentDocument(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDocumentChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildBlob(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 DocumentDocumentWebsiteChildCalloutChildBlob(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 DocumentDocumentWebsiteChildCalloutChildCode(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 DocumentDocumentWebsiteChildCalloutChildComment(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 DocumentDocumentWebsiteChildCalloutChildDivider(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 DocumentDocumentWebsiteChildCalloutChildImage(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 DocumentDocumentWebsiteChildCalloutChildLink(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 DocumentDocumentWebsiteChildCalloutChildLineBreak(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 DocumentDocumentWebsiteChildCalloutChildText(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 DocumentDocumentWebsiteChildCalloutChildToolCall(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 DocumentDocumentWebsiteChildCalloutChildToolResult(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 DocumentDocumentWebsiteChildCalloutChildTraceMessage(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 + + +DocumentDocumentWebsiteChildCalloutChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildCalloutChildBlob, + DocumentDocumentWebsiteChildCalloutChildCode, + DocumentDocumentWebsiteChildCalloutChildComment, + DocumentDocumentWebsiteChildCalloutChildDivider, + DocumentDocumentWebsiteChildCalloutChildImage, + DocumentDocumentWebsiteChildCalloutChildLink, + DocumentDocumentWebsiteChildCalloutChildLineBreak, + DocumentDocumentWebsiteChildCalloutChildText, + DocumentDocumentWebsiteChildCalloutChildToolCall, + DocumentDocumentWebsiteChildCalloutChildToolResult, + DocumentDocumentWebsiteChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildChunkChildBlob(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 DocumentDocumentWebsiteChildChunkChildCode(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 DocumentDocumentWebsiteChildChunkChildComment(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 DocumentDocumentWebsiteChildChunkChildDivider(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 DocumentDocumentWebsiteChildChunkChildImage(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 DocumentDocumentWebsiteChildChunkChildLink(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 DocumentDocumentWebsiteChildChunkChildLineBreak(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 DocumentDocumentWebsiteChildChunkChildText(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 DocumentDocumentWebsiteChildChunkChildToolCall(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 DocumentDocumentWebsiteChildChunkChildToolResult(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 DocumentDocumentWebsiteChildChunkChildTraceMessage(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 + + +DocumentDocumentWebsiteChildChunkChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildChunkChildBlob, + DocumentDocumentWebsiteChildChunkChildCode, + DocumentDocumentWebsiteChildChunkChildComment, + DocumentDocumentWebsiteChildChunkChildDivider, + DocumentDocumentWebsiteChildChunkChildImage, + DocumentDocumentWebsiteChildChunkChildLink, + DocumentDocumentWebsiteChildChunkChildLineBreak, + DocumentDocumentWebsiteChildChunkChildText, + DocumentDocumentWebsiteChildChunkChildToolCall, + DocumentDocumentWebsiteChildChunkChildToolResult, + DocumentDocumentWebsiteChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildCode(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 DocumentDocumentWebsiteChildComment(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 DocumentDocumentWebsiteChildDivider(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 DocumentDocumentWebsiteChildEquationChildBlob(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 DocumentDocumentWebsiteChildEquationChildCode(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 DocumentDocumentWebsiteChildEquationChildComment(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 DocumentDocumentWebsiteChildEquationChildDivider(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 DocumentDocumentWebsiteChildEquationChildImage(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 DocumentDocumentWebsiteChildEquationChildLink(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 DocumentDocumentWebsiteChildEquationChildLineBreak(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 DocumentDocumentWebsiteChildEquationChildText(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 DocumentDocumentWebsiteChildEquationChildToolCall(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 DocumentDocumentWebsiteChildEquationChildToolResult(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 DocumentDocumentWebsiteChildEquationChildTraceMessage(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 + + +DocumentDocumentWebsiteChildEquationChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildEquationChildBlob, + DocumentDocumentWebsiteChildEquationChildCode, + DocumentDocumentWebsiteChildEquationChildComment, + DocumentDocumentWebsiteChildEquationChildDivider, + DocumentDocumentWebsiteChildEquationChildImage, + DocumentDocumentWebsiteChildEquationChildLink, + DocumentDocumentWebsiteChildEquationChildLineBreak, + DocumentDocumentWebsiteChildEquationChildText, + DocumentDocumentWebsiteChildEquationChildToolCall, + DocumentDocumentWebsiteChildEquationChildToolResult, + DocumentDocumentWebsiteChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildFootnoteChildBlob(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 DocumentDocumentWebsiteChildFootnoteChildCode(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 DocumentDocumentWebsiteChildFootnoteChildComment(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 DocumentDocumentWebsiteChildFootnoteChildDivider(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 DocumentDocumentWebsiteChildFootnoteChildImage(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 DocumentDocumentWebsiteChildFootnoteChildLink(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 DocumentDocumentWebsiteChildFootnoteChildLineBreak(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 DocumentDocumentWebsiteChildFootnoteChildText(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 DocumentDocumentWebsiteChildFootnoteChildToolCall(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 DocumentDocumentWebsiteChildFootnoteChildToolResult(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 DocumentDocumentWebsiteChildFootnoteChildTraceMessage(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 + + +DocumentDocumentWebsiteChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildFootnoteChildBlob, + DocumentDocumentWebsiteChildFootnoteChildCode, + DocumentDocumentWebsiteChildFootnoteChildComment, + DocumentDocumentWebsiteChildFootnoteChildDivider, + DocumentDocumentWebsiteChildFootnoteChildImage, + DocumentDocumentWebsiteChildFootnoteChildLink, + DocumentDocumentWebsiteChildFootnoteChildLineBreak, + DocumentDocumentWebsiteChildFootnoteChildText, + DocumentDocumentWebsiteChildFootnoteChildToolCall, + DocumentDocumentWebsiteChildFootnoteChildToolResult, + DocumentDocumentWebsiteChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildHeadingChildBlob(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 DocumentDocumentWebsiteChildHeadingChildCode(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 DocumentDocumentWebsiteChildHeadingChildComment(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 DocumentDocumentWebsiteChildHeadingChildDivider(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 DocumentDocumentWebsiteChildHeadingChildImage(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 DocumentDocumentWebsiteChildHeadingChildLink(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 DocumentDocumentWebsiteChildHeadingChildLineBreak(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 DocumentDocumentWebsiteChildHeadingChildText(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 DocumentDocumentWebsiteChildHeadingChildToolCall(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 DocumentDocumentWebsiteChildHeadingChildToolResult(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 DocumentDocumentWebsiteChildHeadingChildTraceMessage(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 + + +DocumentDocumentWebsiteChildHeadingChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildHeadingChildBlob, + DocumentDocumentWebsiteChildHeadingChildCode, + DocumentDocumentWebsiteChildHeadingChildComment, + DocumentDocumentWebsiteChildHeadingChildDivider, + DocumentDocumentWebsiteChildHeadingChildImage, + DocumentDocumentWebsiteChildHeadingChildLink, + DocumentDocumentWebsiteChildHeadingChildLineBreak, + DocumentDocumentWebsiteChildHeadingChildText, + DocumentDocumentWebsiteChildHeadingChildToolCall, + DocumentDocumentWebsiteChildHeadingChildToolResult, + DocumentDocumentWebsiteChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildImage(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 DocumentDocumentWebsiteChildLink(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 DocumentDocumentWebsiteChildLineBreak(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 DocumentDocumentWebsiteChildList(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 DocumentDocumentWebsiteChildListItemChildBlob(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 DocumentDocumentWebsiteChildListItemChildCode(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 DocumentDocumentWebsiteChildListItemChildComment(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 DocumentDocumentWebsiteChildListItemChildDivider(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 DocumentDocumentWebsiteChildListItemChildImage(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 DocumentDocumentWebsiteChildListItemChildLink(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 DocumentDocumentWebsiteChildListItemChildLineBreak(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 DocumentDocumentWebsiteChildListItemChildText(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 DocumentDocumentWebsiteChildListItemChildToolCall(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 DocumentDocumentWebsiteChildListItemChildToolResult(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 DocumentDocumentWebsiteChildListItemChildTraceMessage(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 + + +DocumentDocumentWebsiteChildListItemChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildListItemChildBlob, + DocumentDocumentWebsiteChildListItemChildCode, + DocumentDocumentWebsiteChildListItemChildComment, + DocumentDocumentWebsiteChildListItemChildDivider, + DocumentDocumentWebsiteChildListItemChildImage, + DocumentDocumentWebsiteChildListItemChildLink, + DocumentDocumentWebsiteChildListItemChildLineBreak, + DocumentDocumentWebsiteChildListItemChildText, + DocumentDocumentWebsiteChildListItemChildToolCall, + DocumentDocumentWebsiteChildListItemChildToolResult, + DocumentDocumentWebsiteChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildParagraphChildBlob(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 DocumentDocumentWebsiteChildParagraphChildCode(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 DocumentDocumentWebsiteChildParagraphChildComment(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 DocumentDocumentWebsiteChildParagraphChildDivider(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 DocumentDocumentWebsiteChildParagraphChildImage(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 DocumentDocumentWebsiteChildParagraphChildLink(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 DocumentDocumentWebsiteChildParagraphChildLineBreak(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 DocumentDocumentWebsiteChildParagraphChildText(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 DocumentDocumentWebsiteChildParagraphChildToolCall(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 DocumentDocumentWebsiteChildParagraphChildToolResult(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 DocumentDocumentWebsiteChildParagraphChildTraceMessage(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 + + +DocumentDocumentWebsiteChildParagraphChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildParagraphChildBlob, + DocumentDocumentWebsiteChildParagraphChildCode, + DocumentDocumentWebsiteChildParagraphChildComment, + DocumentDocumentWebsiteChildParagraphChildDivider, + DocumentDocumentWebsiteChildParagraphChildImage, + DocumentDocumentWebsiteChildParagraphChildLink, + DocumentDocumentWebsiteChildParagraphChildLineBreak, + DocumentDocumentWebsiteChildParagraphChildText, + DocumentDocumentWebsiteChildParagraphChildToolCall, + DocumentDocumentWebsiteChildParagraphChildToolResult, + DocumentDocumentWebsiteChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildQuoteChildBlob(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 DocumentDocumentWebsiteChildQuoteChildCode(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 DocumentDocumentWebsiteChildQuoteChildComment(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 DocumentDocumentWebsiteChildQuoteChildDivider(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 DocumentDocumentWebsiteChildQuoteChildImage(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 DocumentDocumentWebsiteChildQuoteChildLink(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 DocumentDocumentWebsiteChildQuoteChildLineBreak(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 DocumentDocumentWebsiteChildQuoteChildText(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 DocumentDocumentWebsiteChildQuoteChildToolCall(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 DocumentDocumentWebsiteChildQuoteChildToolResult(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 DocumentDocumentWebsiteChildQuoteChildTraceMessage(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 + + +DocumentDocumentWebsiteChildQuoteChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildQuoteChildBlob, + DocumentDocumentWebsiteChildQuoteChildCode, + DocumentDocumentWebsiteChildQuoteChildComment, + DocumentDocumentWebsiteChildQuoteChildDivider, + DocumentDocumentWebsiteChildQuoteChildImage, + DocumentDocumentWebsiteChildQuoteChildLink, + DocumentDocumentWebsiteChildQuoteChildLineBreak, + DocumentDocumentWebsiteChildQuoteChildText, + DocumentDocumentWebsiteChildQuoteChildToolCall, + DocumentDocumentWebsiteChildQuoteChildToolResult, + DocumentDocumentWebsiteChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildTable(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 DocumentDocumentWebsiteChildTableCellChildBlob(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 DocumentDocumentWebsiteChildTableCellChildCode(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 DocumentDocumentWebsiteChildTableCellChildComment(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 DocumentDocumentWebsiteChildTableCellChildDivider(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 DocumentDocumentWebsiteChildTableCellChildImage(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 DocumentDocumentWebsiteChildTableCellChildLink(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 DocumentDocumentWebsiteChildTableCellChildLineBreak(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 DocumentDocumentWebsiteChildTableCellChildText(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 DocumentDocumentWebsiteChildTableCellChildToolCall(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 DocumentDocumentWebsiteChildTableCellChildToolResult(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 DocumentDocumentWebsiteChildTableCellChildTraceMessage(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 + + +DocumentDocumentWebsiteChildTableCellChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildTableCellChildBlob, + DocumentDocumentWebsiteChildTableCellChildCode, + DocumentDocumentWebsiteChildTableCellChildComment, + DocumentDocumentWebsiteChildTableCellChildDivider, + DocumentDocumentWebsiteChildTableCellChildImage, + DocumentDocumentWebsiteChildTableCellChildLink, + DocumentDocumentWebsiteChildTableCellChildLineBreak, + DocumentDocumentWebsiteChildTableCellChildText, + DocumentDocumentWebsiteChildTableCellChildToolCall, + DocumentDocumentWebsiteChildTableCellChildToolResult, + DocumentDocumentWebsiteChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentWebsiteChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildTableRow(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 DocumentDocumentWebsiteChildText(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 DocumentDocumentWebsiteChildToDoChildBlob(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 DocumentDocumentWebsiteChildToDoChildCode(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 DocumentDocumentWebsiteChildToDoChildComment(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 DocumentDocumentWebsiteChildToDoChildDivider(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 DocumentDocumentWebsiteChildToDoChildImage(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 DocumentDocumentWebsiteChildToDoChildLink(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 DocumentDocumentWebsiteChildToDoChildLineBreak(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 DocumentDocumentWebsiteChildToDoChildText(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 DocumentDocumentWebsiteChildToDoChildToolCall(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 DocumentDocumentWebsiteChildToDoChildToolResult(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 DocumentDocumentWebsiteChildToDoChildTraceMessage(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 + + +DocumentDocumentWebsiteChildToDoChild: TypeAlias = Union[ + DocumentDocumentWebsiteChildToDoChildBlob, + DocumentDocumentWebsiteChildToDoChildCode, + DocumentDocumentWebsiteChildToDoChildComment, + DocumentDocumentWebsiteChildToDoChildDivider, + DocumentDocumentWebsiteChildToDoChildImage, + DocumentDocumentWebsiteChildToDoChildLink, + DocumentDocumentWebsiteChildToDoChildLineBreak, + DocumentDocumentWebsiteChildToDoChildText, + DocumentDocumentWebsiteChildToDoChildToolCall, + DocumentDocumentWebsiteChildToDoChildToolResult, + DocumentDocumentWebsiteChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentWebsiteChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentWebsiteChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentWebsiteChildToolCall(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 DocumentDocumentWebsiteChildToolResult(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 DocumentDocumentWebsiteChildTraceMessage(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 DocumentDocumentWebsiteChildUtterance(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 + + +DocumentDocumentWebsiteChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentWebsiteChildBlob, + DocumentDocumentWebsiteChildCallout, + DocumentDocumentWebsiteChildChunk, + DocumentDocumentWebsiteChildCode, + DocumentDocumentWebsiteChildComment, + DocumentDocumentWebsiteChildDivider, + DocumentDocumentWebsiteChildEquation, + DocumentDocumentWebsiteChildFootnote, + DocumentDocumentWebsiteChildHeading, + DocumentDocumentWebsiteChildImage, + DocumentDocumentWebsiteChildLink, + DocumentDocumentWebsiteChildLineBreak, + DocumentDocumentWebsiteChildList, + DocumentDocumentWebsiteChildListItem, + DocumentDocumentWebsiteChildParagraph, + DocumentDocumentWebsiteChildQuote, + DocumentDocumentWebsiteChildTable, + DocumentDocumentWebsiteChildTableCell, + DocumentDocumentWebsiteChildTableRow, + DocumentDocumentWebsiteChildText, + DocumentDocumentWebsiteChildToDo, + DocumentDocumentWebsiteChildToolCall, + DocumentDocumentWebsiteChildToolResult, + DocumentDocumentWebsiteChildTraceMessage, + DocumentDocumentWebsiteChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentWebsite(BaseModel): + url: str + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentWebsiteChild]] = 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 DocumentDocumentTaskChildBlob(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 DocumentDocumentTaskChildCalloutChildBlob(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 DocumentDocumentTaskChildCalloutChildCode(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 DocumentDocumentTaskChildCalloutChildComment(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 DocumentDocumentTaskChildCalloutChildDivider(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 DocumentDocumentTaskChildCalloutChildImage(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 DocumentDocumentTaskChildCalloutChildLink(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 DocumentDocumentTaskChildCalloutChildLineBreak(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 DocumentDocumentTaskChildCalloutChildText(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 DocumentDocumentTaskChildCalloutChildToolCall(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 DocumentDocumentTaskChildCalloutChildToolResult(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 DocumentDocumentTaskChildCalloutChildTraceMessage(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 + + +DocumentDocumentTaskChildCalloutChild: TypeAlias = Union[ + DocumentDocumentTaskChildCalloutChildBlob, + DocumentDocumentTaskChildCalloutChildCode, + DocumentDocumentTaskChildCalloutChildComment, + DocumentDocumentTaskChildCalloutChildDivider, + DocumentDocumentTaskChildCalloutChildImage, + DocumentDocumentTaskChildCalloutChildLink, + DocumentDocumentTaskChildCalloutChildLineBreak, + DocumentDocumentTaskChildCalloutChildText, + DocumentDocumentTaskChildCalloutChildToolCall, + DocumentDocumentTaskChildCalloutChildToolResult, + DocumentDocumentTaskChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildChunkChildBlob(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 DocumentDocumentTaskChildChunkChildCode(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 DocumentDocumentTaskChildChunkChildComment(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 DocumentDocumentTaskChildChunkChildDivider(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 DocumentDocumentTaskChildChunkChildImage(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 DocumentDocumentTaskChildChunkChildLink(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 DocumentDocumentTaskChildChunkChildLineBreak(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 DocumentDocumentTaskChildChunkChildText(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 DocumentDocumentTaskChildChunkChildToolCall(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 DocumentDocumentTaskChildChunkChildToolResult(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 DocumentDocumentTaskChildChunkChildTraceMessage(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 + + +DocumentDocumentTaskChildChunkChild: TypeAlias = Union[ + DocumentDocumentTaskChildChunkChildBlob, + DocumentDocumentTaskChildChunkChildCode, + DocumentDocumentTaskChildChunkChildComment, + DocumentDocumentTaskChildChunkChildDivider, + DocumentDocumentTaskChildChunkChildImage, + DocumentDocumentTaskChildChunkChildLink, + DocumentDocumentTaskChildChunkChildLineBreak, + DocumentDocumentTaskChildChunkChildText, + DocumentDocumentTaskChildChunkChildToolCall, + DocumentDocumentTaskChildChunkChildToolResult, + DocumentDocumentTaskChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildCode(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 DocumentDocumentTaskChildComment(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 DocumentDocumentTaskChildDivider(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 DocumentDocumentTaskChildEquationChildBlob(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 DocumentDocumentTaskChildEquationChildCode(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 DocumentDocumentTaskChildEquationChildComment(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 DocumentDocumentTaskChildEquationChildDivider(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 DocumentDocumentTaskChildEquationChildImage(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 DocumentDocumentTaskChildEquationChildLink(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 DocumentDocumentTaskChildEquationChildLineBreak(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 DocumentDocumentTaskChildEquationChildText(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 DocumentDocumentTaskChildEquationChildToolCall(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 DocumentDocumentTaskChildEquationChildToolResult(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 DocumentDocumentTaskChildEquationChildTraceMessage(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 + + +DocumentDocumentTaskChildEquationChild: TypeAlias = Union[ + DocumentDocumentTaskChildEquationChildBlob, + DocumentDocumentTaskChildEquationChildCode, + DocumentDocumentTaskChildEquationChildComment, + DocumentDocumentTaskChildEquationChildDivider, + DocumentDocumentTaskChildEquationChildImage, + DocumentDocumentTaskChildEquationChildLink, + DocumentDocumentTaskChildEquationChildLineBreak, + DocumentDocumentTaskChildEquationChildText, + DocumentDocumentTaskChildEquationChildToolCall, + DocumentDocumentTaskChildEquationChildToolResult, + DocumentDocumentTaskChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildFootnoteChildBlob(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 DocumentDocumentTaskChildFootnoteChildCode(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 DocumentDocumentTaskChildFootnoteChildComment(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 DocumentDocumentTaskChildFootnoteChildDivider(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 DocumentDocumentTaskChildFootnoteChildImage(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 DocumentDocumentTaskChildFootnoteChildLink(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 DocumentDocumentTaskChildFootnoteChildLineBreak(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 DocumentDocumentTaskChildFootnoteChildText(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 DocumentDocumentTaskChildFootnoteChildToolCall(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 DocumentDocumentTaskChildFootnoteChildToolResult(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 DocumentDocumentTaskChildFootnoteChildTraceMessage(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 + + +DocumentDocumentTaskChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentTaskChildFootnoteChildBlob, + DocumentDocumentTaskChildFootnoteChildCode, + DocumentDocumentTaskChildFootnoteChildComment, + DocumentDocumentTaskChildFootnoteChildDivider, + DocumentDocumentTaskChildFootnoteChildImage, + DocumentDocumentTaskChildFootnoteChildLink, + DocumentDocumentTaskChildFootnoteChildLineBreak, + DocumentDocumentTaskChildFootnoteChildText, + DocumentDocumentTaskChildFootnoteChildToolCall, + DocumentDocumentTaskChildFootnoteChildToolResult, + DocumentDocumentTaskChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildHeadingChildBlob(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 DocumentDocumentTaskChildHeadingChildCode(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 DocumentDocumentTaskChildHeadingChildComment(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 DocumentDocumentTaskChildHeadingChildDivider(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 DocumentDocumentTaskChildHeadingChildImage(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 DocumentDocumentTaskChildHeadingChildLink(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 DocumentDocumentTaskChildHeadingChildLineBreak(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 DocumentDocumentTaskChildHeadingChildText(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 DocumentDocumentTaskChildHeadingChildToolCall(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 DocumentDocumentTaskChildHeadingChildToolResult(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 DocumentDocumentTaskChildHeadingChildTraceMessage(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 + + +DocumentDocumentTaskChildHeadingChild: TypeAlias = Union[ + DocumentDocumentTaskChildHeadingChildBlob, + DocumentDocumentTaskChildHeadingChildCode, + DocumentDocumentTaskChildHeadingChildComment, + DocumentDocumentTaskChildHeadingChildDivider, + DocumentDocumentTaskChildHeadingChildImage, + DocumentDocumentTaskChildHeadingChildLink, + DocumentDocumentTaskChildHeadingChildLineBreak, + DocumentDocumentTaskChildHeadingChildText, + DocumentDocumentTaskChildHeadingChildToolCall, + DocumentDocumentTaskChildHeadingChildToolResult, + DocumentDocumentTaskChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildImage(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 DocumentDocumentTaskChildLink(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 DocumentDocumentTaskChildLineBreak(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 DocumentDocumentTaskChildList(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 DocumentDocumentTaskChildListItemChildBlob(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 DocumentDocumentTaskChildListItemChildCode(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 DocumentDocumentTaskChildListItemChildComment(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 DocumentDocumentTaskChildListItemChildDivider(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 DocumentDocumentTaskChildListItemChildImage(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 DocumentDocumentTaskChildListItemChildLink(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 DocumentDocumentTaskChildListItemChildLineBreak(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 DocumentDocumentTaskChildListItemChildText(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 DocumentDocumentTaskChildListItemChildToolCall(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 DocumentDocumentTaskChildListItemChildToolResult(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 DocumentDocumentTaskChildListItemChildTraceMessage(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 + + +DocumentDocumentTaskChildListItemChild: TypeAlias = Union[ + DocumentDocumentTaskChildListItemChildBlob, + DocumentDocumentTaskChildListItemChildCode, + DocumentDocumentTaskChildListItemChildComment, + DocumentDocumentTaskChildListItemChildDivider, + DocumentDocumentTaskChildListItemChildImage, + DocumentDocumentTaskChildListItemChildLink, + DocumentDocumentTaskChildListItemChildLineBreak, + DocumentDocumentTaskChildListItemChildText, + DocumentDocumentTaskChildListItemChildToolCall, + DocumentDocumentTaskChildListItemChildToolResult, + DocumentDocumentTaskChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildParagraphChildBlob(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 DocumentDocumentTaskChildParagraphChildCode(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 DocumentDocumentTaskChildParagraphChildComment(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 DocumentDocumentTaskChildParagraphChildDivider(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 DocumentDocumentTaskChildParagraphChildImage(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 DocumentDocumentTaskChildParagraphChildLink(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 DocumentDocumentTaskChildParagraphChildLineBreak(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 DocumentDocumentTaskChildParagraphChildText(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 DocumentDocumentTaskChildParagraphChildToolCall(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 DocumentDocumentTaskChildParagraphChildToolResult(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 DocumentDocumentTaskChildParagraphChildTraceMessage(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 + + +DocumentDocumentTaskChildParagraphChild: TypeAlias = Union[ + DocumentDocumentTaskChildParagraphChildBlob, + DocumentDocumentTaskChildParagraphChildCode, + DocumentDocumentTaskChildParagraphChildComment, + DocumentDocumentTaskChildParagraphChildDivider, + DocumentDocumentTaskChildParagraphChildImage, + DocumentDocumentTaskChildParagraphChildLink, + DocumentDocumentTaskChildParagraphChildLineBreak, + DocumentDocumentTaskChildParagraphChildText, + DocumentDocumentTaskChildParagraphChildToolCall, + DocumentDocumentTaskChildParagraphChildToolResult, + DocumentDocumentTaskChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildQuoteChildBlob(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 DocumentDocumentTaskChildQuoteChildCode(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 DocumentDocumentTaskChildQuoteChildComment(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 DocumentDocumentTaskChildQuoteChildDivider(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 DocumentDocumentTaskChildQuoteChildImage(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 DocumentDocumentTaskChildQuoteChildLink(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 DocumentDocumentTaskChildQuoteChildLineBreak(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 DocumentDocumentTaskChildQuoteChildText(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 DocumentDocumentTaskChildQuoteChildToolCall(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 DocumentDocumentTaskChildQuoteChildToolResult(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 DocumentDocumentTaskChildQuoteChildTraceMessage(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 + + +DocumentDocumentTaskChildQuoteChild: TypeAlias = Union[ + DocumentDocumentTaskChildQuoteChildBlob, + DocumentDocumentTaskChildQuoteChildCode, + DocumentDocumentTaskChildQuoteChildComment, + DocumentDocumentTaskChildQuoteChildDivider, + DocumentDocumentTaskChildQuoteChildImage, + DocumentDocumentTaskChildQuoteChildLink, + DocumentDocumentTaskChildQuoteChildLineBreak, + DocumentDocumentTaskChildQuoteChildText, + DocumentDocumentTaskChildQuoteChildToolCall, + DocumentDocumentTaskChildQuoteChildToolResult, + DocumentDocumentTaskChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildTable(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 DocumentDocumentTaskChildTableCellChildBlob(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 DocumentDocumentTaskChildTableCellChildCode(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 DocumentDocumentTaskChildTableCellChildComment(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 DocumentDocumentTaskChildTableCellChildDivider(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 DocumentDocumentTaskChildTableCellChildImage(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 DocumentDocumentTaskChildTableCellChildLink(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 DocumentDocumentTaskChildTableCellChildLineBreak(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 DocumentDocumentTaskChildTableCellChildText(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 DocumentDocumentTaskChildTableCellChildToolCall(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 DocumentDocumentTaskChildTableCellChildToolResult(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 DocumentDocumentTaskChildTableCellChildTraceMessage(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 + + +DocumentDocumentTaskChildTableCellChild: TypeAlias = Union[ + DocumentDocumentTaskChildTableCellChildBlob, + DocumentDocumentTaskChildTableCellChildCode, + DocumentDocumentTaskChildTableCellChildComment, + DocumentDocumentTaskChildTableCellChildDivider, + DocumentDocumentTaskChildTableCellChildImage, + DocumentDocumentTaskChildTableCellChildLink, + DocumentDocumentTaskChildTableCellChildLineBreak, + DocumentDocumentTaskChildTableCellChildText, + DocumentDocumentTaskChildTableCellChildToolCall, + DocumentDocumentTaskChildTableCellChildToolResult, + DocumentDocumentTaskChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentTaskChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildTableRow(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 DocumentDocumentTaskChildText(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 DocumentDocumentTaskChildToDoChildBlob(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 DocumentDocumentTaskChildToDoChildCode(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 DocumentDocumentTaskChildToDoChildComment(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 DocumentDocumentTaskChildToDoChildDivider(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 DocumentDocumentTaskChildToDoChildImage(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 DocumentDocumentTaskChildToDoChildLink(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 DocumentDocumentTaskChildToDoChildLineBreak(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 DocumentDocumentTaskChildToDoChildText(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 DocumentDocumentTaskChildToDoChildToolCall(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 DocumentDocumentTaskChildToDoChildToolResult(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 DocumentDocumentTaskChildToDoChildTraceMessage(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 + + +DocumentDocumentTaskChildToDoChild: TypeAlias = Union[ + DocumentDocumentTaskChildToDoChildBlob, + DocumentDocumentTaskChildToDoChildCode, + DocumentDocumentTaskChildToDoChildComment, + DocumentDocumentTaskChildToDoChildDivider, + DocumentDocumentTaskChildToDoChildImage, + DocumentDocumentTaskChildToDoChildLink, + DocumentDocumentTaskChildToDoChildLineBreak, + DocumentDocumentTaskChildToDoChildText, + DocumentDocumentTaskChildToDoChildToolCall, + DocumentDocumentTaskChildToDoChildToolResult, + DocumentDocumentTaskChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentTaskChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentTaskChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskChildToolCall(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 DocumentDocumentTaskChildToolResult(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 DocumentDocumentTaskChildTraceMessage(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 DocumentDocumentTaskChildUtterance(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 + + +DocumentDocumentTaskChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentTaskChildBlob, + DocumentDocumentTaskChildCallout, + DocumentDocumentTaskChildChunk, + DocumentDocumentTaskChildCode, + DocumentDocumentTaskChildComment, + DocumentDocumentTaskChildDivider, + DocumentDocumentTaskChildEquation, + DocumentDocumentTaskChildFootnote, + DocumentDocumentTaskChildHeading, + DocumentDocumentTaskChildImage, + DocumentDocumentTaskChildLink, + DocumentDocumentTaskChildLineBreak, + DocumentDocumentTaskChildList, + DocumentDocumentTaskChildListItem, + DocumentDocumentTaskChildParagraph, + DocumentDocumentTaskChildQuote, + DocumentDocumentTaskChildTable, + DocumentDocumentTaskChildTableCell, + DocumentDocumentTaskChildTableRow, + DocumentDocumentTaskChildText, + DocumentDocumentTaskChildToDo, + DocumentDocumentTaskChildToolCall, + DocumentDocumentTaskChildToolResult, + DocumentDocumentTaskChildTraceMessage, + DocumentDocumentTaskChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentTaskCommentSenderChildBlob(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 DocumentDocumentTaskCommentSenderChildCode(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 DocumentDocumentTaskCommentSenderChildComment(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 DocumentDocumentTaskCommentSenderChildDivider(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 DocumentDocumentTaskCommentSenderChildImage(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 DocumentDocumentTaskCommentSenderChildLink(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 DocumentDocumentTaskCommentSenderChildLineBreak(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 DocumentDocumentTaskCommentSenderChildText(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 DocumentDocumentTaskCommentSenderChildToolCall(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 DocumentDocumentTaskCommentSenderChildToolResult(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 DocumentDocumentTaskCommentSenderChildTraceMessage(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 + + +DocumentDocumentTaskCommentSenderChild: TypeAlias = Union[ + DocumentDocumentTaskCommentSenderChildBlob, + DocumentDocumentTaskCommentSenderChildCode, + DocumentDocumentTaskCommentSenderChildComment, + DocumentDocumentTaskCommentSenderChildDivider, + DocumentDocumentTaskCommentSenderChildImage, + DocumentDocumentTaskCommentSenderChildLink, + DocumentDocumentTaskCommentSenderChildLineBreak, + DocumentDocumentTaskCommentSenderChildText, + DocumentDocumentTaskCommentSenderChildToolCall, + DocumentDocumentTaskCommentSenderChildToolResult, + DocumentDocumentTaskCommentSenderChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentSender(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentTaskCommentSenderChild]] = 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 DocumentDocumentTaskCommentChildBlob(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 DocumentDocumentTaskCommentChildCalloutChildBlob(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 DocumentDocumentTaskCommentChildCalloutChildCode(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 DocumentDocumentTaskCommentChildCalloutChildComment(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 DocumentDocumentTaskCommentChildCalloutChildDivider(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 DocumentDocumentTaskCommentChildCalloutChildImage(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 DocumentDocumentTaskCommentChildCalloutChildLink(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 DocumentDocumentTaskCommentChildCalloutChildLineBreak(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 DocumentDocumentTaskCommentChildCalloutChildText(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 DocumentDocumentTaskCommentChildCalloutChildToolCall(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 DocumentDocumentTaskCommentChildCalloutChildToolResult(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 DocumentDocumentTaskCommentChildCalloutChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildCalloutChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildCalloutChildBlob, + DocumentDocumentTaskCommentChildCalloutChildCode, + DocumentDocumentTaskCommentChildCalloutChildComment, + DocumentDocumentTaskCommentChildCalloutChildDivider, + DocumentDocumentTaskCommentChildCalloutChildImage, + DocumentDocumentTaskCommentChildCalloutChildLink, + DocumentDocumentTaskCommentChildCalloutChildLineBreak, + DocumentDocumentTaskCommentChildCalloutChildText, + DocumentDocumentTaskCommentChildCalloutChildToolCall, + DocumentDocumentTaskCommentChildCalloutChildToolResult, + DocumentDocumentTaskCommentChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildChunkChildBlob(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 DocumentDocumentTaskCommentChildChunkChildCode(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 DocumentDocumentTaskCommentChildChunkChildComment(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 DocumentDocumentTaskCommentChildChunkChildDivider(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 DocumentDocumentTaskCommentChildChunkChildImage(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 DocumentDocumentTaskCommentChildChunkChildLink(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 DocumentDocumentTaskCommentChildChunkChildLineBreak(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 DocumentDocumentTaskCommentChildChunkChildText(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 DocumentDocumentTaskCommentChildChunkChildToolCall(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 DocumentDocumentTaskCommentChildChunkChildToolResult(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 DocumentDocumentTaskCommentChildChunkChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildChunkChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildChunkChildBlob, + DocumentDocumentTaskCommentChildChunkChildCode, + DocumentDocumentTaskCommentChildChunkChildComment, + DocumentDocumentTaskCommentChildChunkChildDivider, + DocumentDocumentTaskCommentChildChunkChildImage, + DocumentDocumentTaskCommentChildChunkChildLink, + DocumentDocumentTaskCommentChildChunkChildLineBreak, + DocumentDocumentTaskCommentChildChunkChildText, + DocumentDocumentTaskCommentChildChunkChildToolCall, + DocumentDocumentTaskCommentChildChunkChildToolResult, + DocumentDocumentTaskCommentChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildCode(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 DocumentDocumentTaskCommentChildComment(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 DocumentDocumentTaskCommentChildDivider(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 DocumentDocumentTaskCommentChildEquationChildBlob(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 DocumentDocumentTaskCommentChildEquationChildCode(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 DocumentDocumentTaskCommentChildEquationChildComment(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 DocumentDocumentTaskCommentChildEquationChildDivider(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 DocumentDocumentTaskCommentChildEquationChildImage(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 DocumentDocumentTaskCommentChildEquationChildLink(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 DocumentDocumentTaskCommentChildEquationChildLineBreak(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 DocumentDocumentTaskCommentChildEquationChildText(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 DocumentDocumentTaskCommentChildEquationChildToolCall(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 DocumentDocumentTaskCommentChildEquationChildToolResult(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 DocumentDocumentTaskCommentChildEquationChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildEquationChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildEquationChildBlob, + DocumentDocumentTaskCommentChildEquationChildCode, + DocumentDocumentTaskCommentChildEquationChildComment, + DocumentDocumentTaskCommentChildEquationChildDivider, + DocumentDocumentTaskCommentChildEquationChildImage, + DocumentDocumentTaskCommentChildEquationChildLink, + DocumentDocumentTaskCommentChildEquationChildLineBreak, + DocumentDocumentTaskCommentChildEquationChildText, + DocumentDocumentTaskCommentChildEquationChildToolCall, + DocumentDocumentTaskCommentChildEquationChildToolResult, + DocumentDocumentTaskCommentChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildFootnoteChildBlob(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 DocumentDocumentTaskCommentChildFootnoteChildCode(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 DocumentDocumentTaskCommentChildFootnoteChildComment(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 DocumentDocumentTaskCommentChildFootnoteChildDivider(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 DocumentDocumentTaskCommentChildFootnoteChildImage(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 DocumentDocumentTaskCommentChildFootnoteChildLink(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 DocumentDocumentTaskCommentChildFootnoteChildLineBreak(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 DocumentDocumentTaskCommentChildFootnoteChildText(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 DocumentDocumentTaskCommentChildFootnoteChildToolCall(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 DocumentDocumentTaskCommentChildFootnoteChildToolResult(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 DocumentDocumentTaskCommentChildFootnoteChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildFootnoteChildBlob, + DocumentDocumentTaskCommentChildFootnoteChildCode, + DocumentDocumentTaskCommentChildFootnoteChildComment, + DocumentDocumentTaskCommentChildFootnoteChildDivider, + DocumentDocumentTaskCommentChildFootnoteChildImage, + DocumentDocumentTaskCommentChildFootnoteChildLink, + DocumentDocumentTaskCommentChildFootnoteChildLineBreak, + DocumentDocumentTaskCommentChildFootnoteChildText, + DocumentDocumentTaskCommentChildFootnoteChildToolCall, + DocumentDocumentTaskCommentChildFootnoteChildToolResult, + DocumentDocumentTaskCommentChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildHeadingChildBlob(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 DocumentDocumentTaskCommentChildHeadingChildCode(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 DocumentDocumentTaskCommentChildHeadingChildComment(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 DocumentDocumentTaskCommentChildHeadingChildDivider(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 DocumentDocumentTaskCommentChildHeadingChildImage(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 DocumentDocumentTaskCommentChildHeadingChildLink(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 DocumentDocumentTaskCommentChildHeadingChildLineBreak(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 DocumentDocumentTaskCommentChildHeadingChildText(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 DocumentDocumentTaskCommentChildHeadingChildToolCall(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 DocumentDocumentTaskCommentChildHeadingChildToolResult(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 DocumentDocumentTaskCommentChildHeadingChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildHeadingChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildHeadingChildBlob, + DocumentDocumentTaskCommentChildHeadingChildCode, + DocumentDocumentTaskCommentChildHeadingChildComment, + DocumentDocumentTaskCommentChildHeadingChildDivider, + DocumentDocumentTaskCommentChildHeadingChildImage, + DocumentDocumentTaskCommentChildHeadingChildLink, + DocumentDocumentTaskCommentChildHeadingChildLineBreak, + DocumentDocumentTaskCommentChildHeadingChildText, + DocumentDocumentTaskCommentChildHeadingChildToolCall, + DocumentDocumentTaskCommentChildHeadingChildToolResult, + DocumentDocumentTaskCommentChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildImage(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 DocumentDocumentTaskCommentChildLink(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 DocumentDocumentTaskCommentChildLineBreak(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 DocumentDocumentTaskCommentChildList(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 DocumentDocumentTaskCommentChildListItemChildBlob(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 DocumentDocumentTaskCommentChildListItemChildCode(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 DocumentDocumentTaskCommentChildListItemChildComment(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 DocumentDocumentTaskCommentChildListItemChildDivider(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 DocumentDocumentTaskCommentChildListItemChildImage(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 DocumentDocumentTaskCommentChildListItemChildLink(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 DocumentDocumentTaskCommentChildListItemChildLineBreak(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 DocumentDocumentTaskCommentChildListItemChildText(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 DocumentDocumentTaskCommentChildListItemChildToolCall(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 DocumentDocumentTaskCommentChildListItemChildToolResult(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 DocumentDocumentTaskCommentChildListItemChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildListItemChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildListItemChildBlob, + DocumentDocumentTaskCommentChildListItemChildCode, + DocumentDocumentTaskCommentChildListItemChildComment, + DocumentDocumentTaskCommentChildListItemChildDivider, + DocumentDocumentTaskCommentChildListItemChildImage, + DocumentDocumentTaskCommentChildListItemChildLink, + DocumentDocumentTaskCommentChildListItemChildLineBreak, + DocumentDocumentTaskCommentChildListItemChildText, + DocumentDocumentTaskCommentChildListItemChildToolCall, + DocumentDocumentTaskCommentChildListItemChildToolResult, + DocumentDocumentTaskCommentChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildParagraphChildBlob(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 DocumentDocumentTaskCommentChildParagraphChildCode(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 DocumentDocumentTaskCommentChildParagraphChildComment(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 DocumentDocumentTaskCommentChildParagraphChildDivider(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 DocumentDocumentTaskCommentChildParagraphChildImage(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 DocumentDocumentTaskCommentChildParagraphChildLink(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 DocumentDocumentTaskCommentChildParagraphChildLineBreak(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 DocumentDocumentTaskCommentChildParagraphChildText(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 DocumentDocumentTaskCommentChildParagraphChildToolCall(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 DocumentDocumentTaskCommentChildParagraphChildToolResult(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 DocumentDocumentTaskCommentChildParagraphChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildParagraphChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildParagraphChildBlob, + DocumentDocumentTaskCommentChildParagraphChildCode, + DocumentDocumentTaskCommentChildParagraphChildComment, + DocumentDocumentTaskCommentChildParagraphChildDivider, + DocumentDocumentTaskCommentChildParagraphChildImage, + DocumentDocumentTaskCommentChildParagraphChildLink, + DocumentDocumentTaskCommentChildParagraphChildLineBreak, + DocumentDocumentTaskCommentChildParagraphChildText, + DocumentDocumentTaskCommentChildParagraphChildToolCall, + DocumentDocumentTaskCommentChildParagraphChildToolResult, + DocumentDocumentTaskCommentChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildQuoteChildBlob(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 DocumentDocumentTaskCommentChildQuoteChildCode(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 DocumentDocumentTaskCommentChildQuoteChildComment(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 DocumentDocumentTaskCommentChildQuoteChildDivider(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 DocumentDocumentTaskCommentChildQuoteChildImage(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 DocumentDocumentTaskCommentChildQuoteChildLink(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 DocumentDocumentTaskCommentChildQuoteChildLineBreak(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 DocumentDocumentTaskCommentChildQuoteChildText(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 DocumentDocumentTaskCommentChildQuoteChildToolCall(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 DocumentDocumentTaskCommentChildQuoteChildToolResult(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 DocumentDocumentTaskCommentChildQuoteChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildQuoteChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildQuoteChildBlob, + DocumentDocumentTaskCommentChildQuoteChildCode, + DocumentDocumentTaskCommentChildQuoteChildComment, + DocumentDocumentTaskCommentChildQuoteChildDivider, + DocumentDocumentTaskCommentChildQuoteChildImage, + DocumentDocumentTaskCommentChildQuoteChildLink, + DocumentDocumentTaskCommentChildQuoteChildLineBreak, + DocumentDocumentTaskCommentChildQuoteChildText, + DocumentDocumentTaskCommentChildQuoteChildToolCall, + DocumentDocumentTaskCommentChildQuoteChildToolResult, + DocumentDocumentTaskCommentChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskCommentChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildTable(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 DocumentDocumentTaskCommentChildTableCellChildBlob(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 DocumentDocumentTaskCommentChildTableCellChildCode(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 DocumentDocumentTaskCommentChildTableCellChildComment(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 DocumentDocumentTaskCommentChildTableCellChildDivider(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 DocumentDocumentTaskCommentChildTableCellChildImage(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 DocumentDocumentTaskCommentChildTableCellChildLink(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 DocumentDocumentTaskCommentChildTableCellChildLineBreak(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 DocumentDocumentTaskCommentChildTableCellChildText(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 DocumentDocumentTaskCommentChildTableCellChildToolCall(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 DocumentDocumentTaskCommentChildTableCellChildToolResult(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 DocumentDocumentTaskCommentChildTableCellChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildTableCellChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildTableCellChildBlob, + DocumentDocumentTaskCommentChildTableCellChildCode, + DocumentDocumentTaskCommentChildTableCellChildComment, + DocumentDocumentTaskCommentChildTableCellChildDivider, + DocumentDocumentTaskCommentChildTableCellChildImage, + DocumentDocumentTaskCommentChildTableCellChildLink, + DocumentDocumentTaskCommentChildTableCellChildLineBreak, + DocumentDocumentTaskCommentChildTableCellChildText, + DocumentDocumentTaskCommentChildTableCellChildToolCall, + DocumentDocumentTaskCommentChildTableCellChildToolResult, + DocumentDocumentTaskCommentChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentTaskCommentChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildTableRow(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 DocumentDocumentTaskCommentChildText(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 DocumentDocumentTaskCommentChildToDoChildBlob(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 DocumentDocumentTaskCommentChildToDoChildCode(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 DocumentDocumentTaskCommentChildToDoChildComment(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 DocumentDocumentTaskCommentChildToDoChildDivider(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 DocumentDocumentTaskCommentChildToDoChildImage(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 DocumentDocumentTaskCommentChildToDoChildLink(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 DocumentDocumentTaskCommentChildToDoChildLineBreak(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 DocumentDocumentTaskCommentChildToDoChildText(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 DocumentDocumentTaskCommentChildToDoChildToolCall(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 DocumentDocumentTaskCommentChildToDoChildToolResult(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 DocumentDocumentTaskCommentChildToDoChildTraceMessage(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 + + +DocumentDocumentTaskCommentChildToDoChild: TypeAlias = Union[ + DocumentDocumentTaskCommentChildToDoChildBlob, + DocumentDocumentTaskCommentChildToDoChildCode, + DocumentDocumentTaskCommentChildToDoChildComment, + DocumentDocumentTaskCommentChildToDoChildDivider, + DocumentDocumentTaskCommentChildToDoChildImage, + DocumentDocumentTaskCommentChildToDoChildLink, + DocumentDocumentTaskCommentChildToDoChildLineBreak, + DocumentDocumentTaskCommentChildToDoChildText, + DocumentDocumentTaskCommentChildToDoChildToolCall, + DocumentDocumentTaskCommentChildToDoChildToolResult, + DocumentDocumentTaskCommentChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentTaskCommentChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTaskCommentChildToolCall(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 DocumentDocumentTaskCommentChildToolResult(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 DocumentDocumentTaskCommentChildTraceMessage(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 DocumentDocumentTaskCommentChildUtterance(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 + + +DocumentDocumentTaskCommentChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentTaskCommentChildBlob, + DocumentDocumentTaskCommentChildCallout, + DocumentDocumentTaskCommentChildChunk, + DocumentDocumentTaskCommentChildCode, + DocumentDocumentTaskCommentChildComment, + DocumentDocumentTaskCommentChildDivider, + DocumentDocumentTaskCommentChildEquation, + DocumentDocumentTaskCommentChildFootnote, + DocumentDocumentTaskCommentChildHeading, + DocumentDocumentTaskCommentChildImage, + DocumentDocumentTaskCommentChildLink, + DocumentDocumentTaskCommentChildLineBreak, + DocumentDocumentTaskCommentChildList, + DocumentDocumentTaskCommentChildListItem, + DocumentDocumentTaskCommentChildParagraph, + DocumentDocumentTaskCommentChildQuote, + DocumentDocumentTaskCommentChildTable, + DocumentDocumentTaskCommentChildTableCell, + DocumentDocumentTaskCommentChildTableRow, + DocumentDocumentTaskCommentChildText, + DocumentDocumentTaskCommentChildToDo, + DocumentDocumentTaskCommentChildToolCall, + DocumentDocumentTaskCommentChildToolResult, + DocumentDocumentTaskCommentChildTraceMessage, + DocumentDocumentTaskCommentChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentTaskCommentMentionedUserChildBlob(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 DocumentDocumentTaskCommentMentionedUserChildCode(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 DocumentDocumentTaskCommentMentionedUserChildComment(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 DocumentDocumentTaskCommentMentionedUserChildDivider(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 DocumentDocumentTaskCommentMentionedUserChildImage(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 DocumentDocumentTaskCommentMentionedUserChildLink(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 DocumentDocumentTaskCommentMentionedUserChildLineBreak(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 DocumentDocumentTaskCommentMentionedUserChildText(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 DocumentDocumentTaskCommentMentionedUserChildToolCall(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 DocumentDocumentTaskCommentMentionedUserChildToolResult(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 DocumentDocumentTaskCommentMentionedUserChildTraceMessage(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 + + +DocumentDocumentTaskCommentMentionedUserChild: TypeAlias = Union[ + DocumentDocumentTaskCommentMentionedUserChildBlob, + DocumentDocumentTaskCommentMentionedUserChildCode, + DocumentDocumentTaskCommentMentionedUserChildComment, + DocumentDocumentTaskCommentMentionedUserChildDivider, + DocumentDocumentTaskCommentMentionedUserChildImage, + DocumentDocumentTaskCommentMentionedUserChildLink, + DocumentDocumentTaskCommentMentionedUserChildLineBreak, + DocumentDocumentTaskCommentMentionedUserChildText, + DocumentDocumentTaskCommentMentionedUserChildToolCall, + DocumentDocumentTaskCommentMentionedUserChildToolResult, + DocumentDocumentTaskCommentMentionedUserChildTraceMessage, + object, +] + + +class DocumentDocumentTaskCommentMentionedUser(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentTaskCommentMentionedUserChild]] = 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 DocumentDocumentTaskComment(BaseModel): + date: datetime + + sender: DocumentDocumentTaskCommentSender + + 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[DocumentDocumentTaskCommentChild]] = 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[DocumentDocumentTaskCommentMentionedUser]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTask(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentTaskChild]] = None + + comments: Optional[List[DocumentDocumentTaskComment]] = 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 DocumentDocumentPersonChildBlob(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 DocumentDocumentPersonChildCode(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 DocumentDocumentPersonChildComment(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 DocumentDocumentPersonChildDivider(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 DocumentDocumentPersonChildImage(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 DocumentDocumentPersonChildLink(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 DocumentDocumentPersonChildLineBreak(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 DocumentDocumentPersonChildText(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 DocumentDocumentPersonChildToolCall(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 DocumentDocumentPersonChildToolResult(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 DocumentDocumentPersonChildTraceMessage(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 + + +DocumentDocumentPersonChild: TypeAlias = Union[ + DocumentDocumentPersonChildBlob, + DocumentDocumentPersonChildCode, + DocumentDocumentPersonChildComment, + DocumentDocumentPersonChildDivider, + DocumentDocumentPersonChildImage, + DocumentDocumentPersonChildLink, + DocumentDocumentPersonChildLineBreak, + DocumentDocumentPersonChildText, + DocumentDocumentPersonChildToolCall, + DocumentDocumentPersonChildToolResult, + DocumentDocumentPersonChildTraceMessage, + object, +] + + +class DocumentDocumentPerson(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentPersonChild]] = 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 DocumentDocumentMessageSenderChildBlob(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 DocumentDocumentMessageSenderChildCode(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 DocumentDocumentMessageSenderChildComment(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 DocumentDocumentMessageSenderChildDivider(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 DocumentDocumentMessageSenderChildImage(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 DocumentDocumentMessageSenderChildLink(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 DocumentDocumentMessageSenderChildLineBreak(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 DocumentDocumentMessageSenderChildText(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 DocumentDocumentMessageSenderChildToolCall(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 DocumentDocumentMessageSenderChildToolResult(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 DocumentDocumentMessageSenderChildTraceMessage(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 + + +DocumentDocumentMessageSenderChild: TypeAlias = Union[ + DocumentDocumentMessageSenderChildBlob, + DocumentDocumentMessageSenderChildCode, + DocumentDocumentMessageSenderChildComment, + DocumentDocumentMessageSenderChildDivider, + DocumentDocumentMessageSenderChildImage, + DocumentDocumentMessageSenderChildLink, + DocumentDocumentMessageSenderChildLineBreak, + DocumentDocumentMessageSenderChildText, + DocumentDocumentMessageSenderChildToolCall, + DocumentDocumentMessageSenderChildToolResult, + DocumentDocumentMessageSenderChildTraceMessage, + object, +] + + +class DocumentDocumentMessageSender(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentMessageSenderChild]] = 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 DocumentDocumentMessageChildBlob(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 DocumentDocumentMessageChildCalloutChildBlob(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 DocumentDocumentMessageChildCalloutChildCode(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 DocumentDocumentMessageChildCalloutChildComment(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 DocumentDocumentMessageChildCalloutChildDivider(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 DocumentDocumentMessageChildCalloutChildImage(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 DocumentDocumentMessageChildCalloutChildLink(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 DocumentDocumentMessageChildCalloutChildLineBreak(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 DocumentDocumentMessageChildCalloutChildText(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 DocumentDocumentMessageChildCalloutChildToolCall(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 DocumentDocumentMessageChildCalloutChildToolResult(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 DocumentDocumentMessageChildCalloutChildTraceMessage(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 + + +DocumentDocumentMessageChildCalloutChild: TypeAlias = Union[ + DocumentDocumentMessageChildCalloutChildBlob, + DocumentDocumentMessageChildCalloutChildCode, + DocumentDocumentMessageChildCalloutChildComment, + DocumentDocumentMessageChildCalloutChildDivider, + DocumentDocumentMessageChildCalloutChildImage, + DocumentDocumentMessageChildCalloutChildLink, + DocumentDocumentMessageChildCalloutChildLineBreak, + DocumentDocumentMessageChildCalloutChildText, + DocumentDocumentMessageChildCalloutChildToolCall, + DocumentDocumentMessageChildCalloutChildToolResult, + DocumentDocumentMessageChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildChunkChildBlob(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 DocumentDocumentMessageChildChunkChildCode(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 DocumentDocumentMessageChildChunkChildComment(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 DocumentDocumentMessageChildChunkChildDivider(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 DocumentDocumentMessageChildChunkChildImage(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 DocumentDocumentMessageChildChunkChildLink(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 DocumentDocumentMessageChildChunkChildLineBreak(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 DocumentDocumentMessageChildChunkChildText(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 DocumentDocumentMessageChildChunkChildToolCall(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 DocumentDocumentMessageChildChunkChildToolResult(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 DocumentDocumentMessageChildChunkChildTraceMessage(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 + + +DocumentDocumentMessageChildChunkChild: TypeAlias = Union[ + DocumentDocumentMessageChildChunkChildBlob, + DocumentDocumentMessageChildChunkChildCode, + DocumentDocumentMessageChildChunkChildComment, + DocumentDocumentMessageChildChunkChildDivider, + DocumentDocumentMessageChildChunkChildImage, + DocumentDocumentMessageChildChunkChildLink, + DocumentDocumentMessageChildChunkChildLineBreak, + DocumentDocumentMessageChildChunkChildText, + DocumentDocumentMessageChildChunkChildToolCall, + DocumentDocumentMessageChildChunkChildToolResult, + DocumentDocumentMessageChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildCode(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 DocumentDocumentMessageChildComment(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 DocumentDocumentMessageChildDivider(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 DocumentDocumentMessageChildEquationChildBlob(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 DocumentDocumentMessageChildEquationChildCode(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 DocumentDocumentMessageChildEquationChildComment(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 DocumentDocumentMessageChildEquationChildDivider(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 DocumentDocumentMessageChildEquationChildImage(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 DocumentDocumentMessageChildEquationChildLink(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 DocumentDocumentMessageChildEquationChildLineBreak(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 DocumentDocumentMessageChildEquationChildText(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 DocumentDocumentMessageChildEquationChildToolCall(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 DocumentDocumentMessageChildEquationChildToolResult(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 DocumentDocumentMessageChildEquationChildTraceMessage(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 + + +DocumentDocumentMessageChildEquationChild: TypeAlias = Union[ + DocumentDocumentMessageChildEquationChildBlob, + DocumentDocumentMessageChildEquationChildCode, + DocumentDocumentMessageChildEquationChildComment, + DocumentDocumentMessageChildEquationChildDivider, + DocumentDocumentMessageChildEquationChildImage, + DocumentDocumentMessageChildEquationChildLink, + DocumentDocumentMessageChildEquationChildLineBreak, + DocumentDocumentMessageChildEquationChildText, + DocumentDocumentMessageChildEquationChildToolCall, + DocumentDocumentMessageChildEquationChildToolResult, + DocumentDocumentMessageChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildFootnoteChildBlob(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 DocumentDocumentMessageChildFootnoteChildCode(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 DocumentDocumentMessageChildFootnoteChildComment(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 DocumentDocumentMessageChildFootnoteChildDivider(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 DocumentDocumentMessageChildFootnoteChildImage(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 DocumentDocumentMessageChildFootnoteChildLink(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 DocumentDocumentMessageChildFootnoteChildLineBreak(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 DocumentDocumentMessageChildFootnoteChildText(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 DocumentDocumentMessageChildFootnoteChildToolCall(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 DocumentDocumentMessageChildFootnoteChildToolResult(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 DocumentDocumentMessageChildFootnoteChildTraceMessage(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 + + +DocumentDocumentMessageChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentMessageChildFootnoteChildBlob, + DocumentDocumentMessageChildFootnoteChildCode, + DocumentDocumentMessageChildFootnoteChildComment, + DocumentDocumentMessageChildFootnoteChildDivider, + DocumentDocumentMessageChildFootnoteChildImage, + DocumentDocumentMessageChildFootnoteChildLink, + DocumentDocumentMessageChildFootnoteChildLineBreak, + DocumentDocumentMessageChildFootnoteChildText, + DocumentDocumentMessageChildFootnoteChildToolCall, + DocumentDocumentMessageChildFootnoteChildToolResult, + DocumentDocumentMessageChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildHeadingChildBlob(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 DocumentDocumentMessageChildHeadingChildCode(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 DocumentDocumentMessageChildHeadingChildComment(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 DocumentDocumentMessageChildHeadingChildDivider(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 DocumentDocumentMessageChildHeadingChildImage(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 DocumentDocumentMessageChildHeadingChildLink(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 DocumentDocumentMessageChildHeadingChildLineBreak(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 DocumentDocumentMessageChildHeadingChildText(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 DocumentDocumentMessageChildHeadingChildToolCall(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 DocumentDocumentMessageChildHeadingChildToolResult(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 DocumentDocumentMessageChildHeadingChildTraceMessage(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 + + +DocumentDocumentMessageChildHeadingChild: TypeAlias = Union[ + DocumentDocumentMessageChildHeadingChildBlob, + DocumentDocumentMessageChildHeadingChildCode, + DocumentDocumentMessageChildHeadingChildComment, + DocumentDocumentMessageChildHeadingChildDivider, + DocumentDocumentMessageChildHeadingChildImage, + DocumentDocumentMessageChildHeadingChildLink, + DocumentDocumentMessageChildHeadingChildLineBreak, + DocumentDocumentMessageChildHeadingChildText, + DocumentDocumentMessageChildHeadingChildToolCall, + DocumentDocumentMessageChildHeadingChildToolResult, + DocumentDocumentMessageChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildImage(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 DocumentDocumentMessageChildLink(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 DocumentDocumentMessageChildLineBreak(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 DocumentDocumentMessageChildList(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 DocumentDocumentMessageChildListItemChildBlob(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 DocumentDocumentMessageChildListItemChildCode(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 DocumentDocumentMessageChildListItemChildComment(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 DocumentDocumentMessageChildListItemChildDivider(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 DocumentDocumentMessageChildListItemChildImage(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 DocumentDocumentMessageChildListItemChildLink(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 DocumentDocumentMessageChildListItemChildLineBreak(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 DocumentDocumentMessageChildListItemChildText(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 DocumentDocumentMessageChildListItemChildToolCall(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 DocumentDocumentMessageChildListItemChildToolResult(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 DocumentDocumentMessageChildListItemChildTraceMessage(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 + + +DocumentDocumentMessageChildListItemChild: TypeAlias = Union[ + DocumentDocumentMessageChildListItemChildBlob, + DocumentDocumentMessageChildListItemChildCode, + DocumentDocumentMessageChildListItemChildComment, + DocumentDocumentMessageChildListItemChildDivider, + DocumentDocumentMessageChildListItemChildImage, + DocumentDocumentMessageChildListItemChildLink, + DocumentDocumentMessageChildListItemChildLineBreak, + DocumentDocumentMessageChildListItemChildText, + DocumentDocumentMessageChildListItemChildToolCall, + DocumentDocumentMessageChildListItemChildToolResult, + DocumentDocumentMessageChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildParagraphChildBlob(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 DocumentDocumentMessageChildParagraphChildCode(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 DocumentDocumentMessageChildParagraphChildComment(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 DocumentDocumentMessageChildParagraphChildDivider(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 DocumentDocumentMessageChildParagraphChildImage(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 DocumentDocumentMessageChildParagraphChildLink(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 DocumentDocumentMessageChildParagraphChildLineBreak(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 DocumentDocumentMessageChildParagraphChildText(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 DocumentDocumentMessageChildParagraphChildToolCall(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 DocumentDocumentMessageChildParagraphChildToolResult(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 DocumentDocumentMessageChildParagraphChildTraceMessage(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 + + +DocumentDocumentMessageChildParagraphChild: TypeAlias = Union[ + DocumentDocumentMessageChildParagraphChildBlob, + DocumentDocumentMessageChildParagraphChildCode, + DocumentDocumentMessageChildParagraphChildComment, + DocumentDocumentMessageChildParagraphChildDivider, + DocumentDocumentMessageChildParagraphChildImage, + DocumentDocumentMessageChildParagraphChildLink, + DocumentDocumentMessageChildParagraphChildLineBreak, + DocumentDocumentMessageChildParagraphChildText, + DocumentDocumentMessageChildParagraphChildToolCall, + DocumentDocumentMessageChildParagraphChildToolResult, + DocumentDocumentMessageChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildQuoteChildBlob(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 DocumentDocumentMessageChildQuoteChildCode(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 DocumentDocumentMessageChildQuoteChildComment(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 DocumentDocumentMessageChildQuoteChildDivider(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 DocumentDocumentMessageChildQuoteChildImage(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 DocumentDocumentMessageChildQuoteChildLink(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 DocumentDocumentMessageChildQuoteChildLineBreak(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 DocumentDocumentMessageChildQuoteChildText(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 DocumentDocumentMessageChildQuoteChildToolCall(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 DocumentDocumentMessageChildQuoteChildToolResult(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 DocumentDocumentMessageChildQuoteChildTraceMessage(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 + + +DocumentDocumentMessageChildQuoteChild: TypeAlias = Union[ + DocumentDocumentMessageChildQuoteChildBlob, + DocumentDocumentMessageChildQuoteChildCode, + DocumentDocumentMessageChildQuoteChildComment, + DocumentDocumentMessageChildQuoteChildDivider, + DocumentDocumentMessageChildQuoteChildImage, + DocumentDocumentMessageChildQuoteChildLink, + DocumentDocumentMessageChildQuoteChildLineBreak, + DocumentDocumentMessageChildQuoteChildText, + DocumentDocumentMessageChildQuoteChildToolCall, + DocumentDocumentMessageChildQuoteChildToolResult, + DocumentDocumentMessageChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentMessageChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildTable(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 DocumentDocumentMessageChildTableCellChildBlob(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 DocumentDocumentMessageChildTableCellChildCode(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 DocumentDocumentMessageChildTableCellChildComment(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 DocumentDocumentMessageChildTableCellChildDivider(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 DocumentDocumentMessageChildTableCellChildImage(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 DocumentDocumentMessageChildTableCellChildLink(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 DocumentDocumentMessageChildTableCellChildLineBreak(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 DocumentDocumentMessageChildTableCellChildText(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 DocumentDocumentMessageChildTableCellChildToolCall(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 DocumentDocumentMessageChildTableCellChildToolResult(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 DocumentDocumentMessageChildTableCellChildTraceMessage(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 + + +DocumentDocumentMessageChildTableCellChild: TypeAlias = Union[ + DocumentDocumentMessageChildTableCellChildBlob, + DocumentDocumentMessageChildTableCellChildCode, + DocumentDocumentMessageChildTableCellChildComment, + DocumentDocumentMessageChildTableCellChildDivider, + DocumentDocumentMessageChildTableCellChildImage, + DocumentDocumentMessageChildTableCellChildLink, + DocumentDocumentMessageChildTableCellChildLineBreak, + DocumentDocumentMessageChildTableCellChildText, + DocumentDocumentMessageChildTableCellChildToolCall, + DocumentDocumentMessageChildTableCellChildToolResult, + DocumentDocumentMessageChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentMessageChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildTableRow(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 DocumentDocumentMessageChildText(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 DocumentDocumentMessageChildToDoChildBlob(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 DocumentDocumentMessageChildToDoChildCode(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 DocumentDocumentMessageChildToDoChildComment(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 DocumentDocumentMessageChildToDoChildDivider(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 DocumentDocumentMessageChildToDoChildImage(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 DocumentDocumentMessageChildToDoChildLink(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 DocumentDocumentMessageChildToDoChildLineBreak(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 DocumentDocumentMessageChildToDoChildText(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 DocumentDocumentMessageChildToDoChildToolCall(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 DocumentDocumentMessageChildToDoChildToolResult(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 DocumentDocumentMessageChildToDoChildTraceMessage(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 + + +DocumentDocumentMessageChildToDoChild: TypeAlias = Union[ + DocumentDocumentMessageChildToDoChildBlob, + DocumentDocumentMessageChildToDoChildCode, + DocumentDocumentMessageChildToDoChildComment, + DocumentDocumentMessageChildToDoChildDivider, + DocumentDocumentMessageChildToDoChildImage, + DocumentDocumentMessageChildToDoChildLink, + DocumentDocumentMessageChildToDoChildLineBreak, + DocumentDocumentMessageChildToDoChildText, + DocumentDocumentMessageChildToDoChildToolCall, + DocumentDocumentMessageChildToDoChildToolResult, + DocumentDocumentMessageChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentMessageChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentMessageChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentMessageChildToolCall(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 DocumentDocumentMessageChildToolResult(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 DocumentDocumentMessageChildTraceMessage(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 DocumentDocumentMessageChildUtterance(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 + + +DocumentDocumentMessageChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentMessageChildBlob, + DocumentDocumentMessageChildCallout, + DocumentDocumentMessageChildChunk, + DocumentDocumentMessageChildCode, + DocumentDocumentMessageChildComment, + DocumentDocumentMessageChildDivider, + DocumentDocumentMessageChildEquation, + DocumentDocumentMessageChildFootnote, + DocumentDocumentMessageChildHeading, + DocumentDocumentMessageChildImage, + DocumentDocumentMessageChildLink, + DocumentDocumentMessageChildLineBreak, + DocumentDocumentMessageChildList, + DocumentDocumentMessageChildListItem, + DocumentDocumentMessageChildParagraph, + DocumentDocumentMessageChildQuote, + DocumentDocumentMessageChildTable, + DocumentDocumentMessageChildTableCell, + DocumentDocumentMessageChildTableRow, + DocumentDocumentMessageChildText, + DocumentDocumentMessageChildToDo, + DocumentDocumentMessageChildToolCall, + DocumentDocumentMessageChildToolResult, + DocumentDocumentMessageChildTraceMessage, + DocumentDocumentMessageChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentMessageMentionedUserChildBlob(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 DocumentDocumentMessageMentionedUserChildCode(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 DocumentDocumentMessageMentionedUserChildComment(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 DocumentDocumentMessageMentionedUserChildDivider(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 DocumentDocumentMessageMentionedUserChildImage(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 DocumentDocumentMessageMentionedUserChildLink(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 DocumentDocumentMessageMentionedUserChildLineBreak(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 DocumentDocumentMessageMentionedUserChildText(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 DocumentDocumentMessageMentionedUserChildToolCall(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 DocumentDocumentMessageMentionedUserChildToolResult(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 DocumentDocumentMessageMentionedUserChildTraceMessage(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 + + +DocumentDocumentMessageMentionedUserChild: TypeAlias = Union[ + DocumentDocumentMessageMentionedUserChildBlob, + DocumentDocumentMessageMentionedUserChildCode, + DocumentDocumentMessageMentionedUserChildComment, + DocumentDocumentMessageMentionedUserChildDivider, + DocumentDocumentMessageMentionedUserChildImage, + DocumentDocumentMessageMentionedUserChildLink, + DocumentDocumentMessageMentionedUserChildLineBreak, + DocumentDocumentMessageMentionedUserChildText, + DocumentDocumentMessageMentionedUserChildToolCall, + DocumentDocumentMessageMentionedUserChildToolResult, + DocumentDocumentMessageMentionedUserChildTraceMessage, + object, +] + + +class DocumentDocumentMessageMentionedUser(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentMessageMentionedUserChild]] = 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 DocumentDocumentMessage(BaseModel): + date: datetime + + sender: DocumentDocumentMessageSender + + 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[DocumentDocumentMessageChild]] = 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[DocumentDocumentMessageMentionedUser]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventAttendeeChildBlob(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 DocumentDocumentEventAttendeeChildCode(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 DocumentDocumentEventAttendeeChildComment(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 DocumentDocumentEventAttendeeChildDivider(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 DocumentDocumentEventAttendeeChildImage(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 DocumentDocumentEventAttendeeChildLink(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 DocumentDocumentEventAttendeeChildLineBreak(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 DocumentDocumentEventAttendeeChildText(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 DocumentDocumentEventAttendeeChildToolCall(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 DocumentDocumentEventAttendeeChildToolResult(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 DocumentDocumentEventAttendeeChildTraceMessage(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 + + +DocumentDocumentEventAttendeeChild: TypeAlias = Union[ + DocumentDocumentEventAttendeeChildBlob, + DocumentDocumentEventAttendeeChildCode, + DocumentDocumentEventAttendeeChildComment, + DocumentDocumentEventAttendeeChildDivider, + DocumentDocumentEventAttendeeChildImage, + DocumentDocumentEventAttendeeChildLink, + DocumentDocumentEventAttendeeChildLineBreak, + DocumentDocumentEventAttendeeChildText, + DocumentDocumentEventAttendeeChildToolCall, + DocumentDocumentEventAttendeeChildToolResult, + DocumentDocumentEventAttendeeChildTraceMessage, + object, +] + + +class DocumentDocumentEventAttendee(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentEventAttendeeChild]] = 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 DocumentDocumentEventChildBlob(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 DocumentDocumentEventChildCalloutChildBlob(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 DocumentDocumentEventChildCalloutChildCode(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 DocumentDocumentEventChildCalloutChildComment(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 DocumentDocumentEventChildCalloutChildDivider(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 DocumentDocumentEventChildCalloutChildImage(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 DocumentDocumentEventChildCalloutChildLink(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 DocumentDocumentEventChildCalloutChildLineBreak(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 DocumentDocumentEventChildCalloutChildText(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 DocumentDocumentEventChildCalloutChildToolCall(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 DocumentDocumentEventChildCalloutChildToolResult(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 DocumentDocumentEventChildCalloutChildTraceMessage(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 + + +DocumentDocumentEventChildCalloutChild: TypeAlias = Union[ + DocumentDocumentEventChildCalloutChildBlob, + DocumentDocumentEventChildCalloutChildCode, + DocumentDocumentEventChildCalloutChildComment, + DocumentDocumentEventChildCalloutChildDivider, + DocumentDocumentEventChildCalloutChildImage, + DocumentDocumentEventChildCalloutChildLink, + DocumentDocumentEventChildCalloutChildLineBreak, + DocumentDocumentEventChildCalloutChildText, + DocumentDocumentEventChildCalloutChildToolCall, + DocumentDocumentEventChildCalloutChildToolResult, + DocumentDocumentEventChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildChunkChildBlob(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 DocumentDocumentEventChildChunkChildCode(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 DocumentDocumentEventChildChunkChildComment(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 DocumentDocumentEventChildChunkChildDivider(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 DocumentDocumentEventChildChunkChildImage(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 DocumentDocumentEventChildChunkChildLink(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 DocumentDocumentEventChildChunkChildLineBreak(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 DocumentDocumentEventChildChunkChildText(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 DocumentDocumentEventChildChunkChildToolCall(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 DocumentDocumentEventChildChunkChildToolResult(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 DocumentDocumentEventChildChunkChildTraceMessage(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 + + +DocumentDocumentEventChildChunkChild: TypeAlias = Union[ + DocumentDocumentEventChildChunkChildBlob, + DocumentDocumentEventChildChunkChildCode, + DocumentDocumentEventChildChunkChildComment, + DocumentDocumentEventChildChunkChildDivider, + DocumentDocumentEventChildChunkChildImage, + DocumentDocumentEventChildChunkChildLink, + DocumentDocumentEventChildChunkChildLineBreak, + DocumentDocumentEventChildChunkChildText, + DocumentDocumentEventChildChunkChildToolCall, + DocumentDocumentEventChildChunkChildToolResult, + DocumentDocumentEventChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildCode(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 DocumentDocumentEventChildComment(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 DocumentDocumentEventChildDivider(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 DocumentDocumentEventChildEquationChildBlob(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 DocumentDocumentEventChildEquationChildCode(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 DocumentDocumentEventChildEquationChildComment(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 DocumentDocumentEventChildEquationChildDivider(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 DocumentDocumentEventChildEquationChildImage(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 DocumentDocumentEventChildEquationChildLink(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 DocumentDocumentEventChildEquationChildLineBreak(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 DocumentDocumentEventChildEquationChildText(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 DocumentDocumentEventChildEquationChildToolCall(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 DocumentDocumentEventChildEquationChildToolResult(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 DocumentDocumentEventChildEquationChildTraceMessage(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 + + +DocumentDocumentEventChildEquationChild: TypeAlias = Union[ + DocumentDocumentEventChildEquationChildBlob, + DocumentDocumentEventChildEquationChildCode, + DocumentDocumentEventChildEquationChildComment, + DocumentDocumentEventChildEquationChildDivider, + DocumentDocumentEventChildEquationChildImage, + DocumentDocumentEventChildEquationChildLink, + DocumentDocumentEventChildEquationChildLineBreak, + DocumentDocumentEventChildEquationChildText, + DocumentDocumentEventChildEquationChildToolCall, + DocumentDocumentEventChildEquationChildToolResult, + DocumentDocumentEventChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildFootnoteChildBlob(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 DocumentDocumentEventChildFootnoteChildCode(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 DocumentDocumentEventChildFootnoteChildComment(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 DocumentDocumentEventChildFootnoteChildDivider(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 DocumentDocumentEventChildFootnoteChildImage(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 DocumentDocumentEventChildFootnoteChildLink(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 DocumentDocumentEventChildFootnoteChildLineBreak(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 DocumentDocumentEventChildFootnoteChildText(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 DocumentDocumentEventChildFootnoteChildToolCall(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 DocumentDocumentEventChildFootnoteChildToolResult(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 DocumentDocumentEventChildFootnoteChildTraceMessage(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 + + +DocumentDocumentEventChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentEventChildFootnoteChildBlob, + DocumentDocumentEventChildFootnoteChildCode, + DocumentDocumentEventChildFootnoteChildComment, + DocumentDocumentEventChildFootnoteChildDivider, + DocumentDocumentEventChildFootnoteChildImage, + DocumentDocumentEventChildFootnoteChildLink, + DocumentDocumentEventChildFootnoteChildLineBreak, + DocumentDocumentEventChildFootnoteChildText, + DocumentDocumentEventChildFootnoteChildToolCall, + DocumentDocumentEventChildFootnoteChildToolResult, + DocumentDocumentEventChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildHeadingChildBlob(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 DocumentDocumentEventChildHeadingChildCode(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 DocumentDocumentEventChildHeadingChildComment(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 DocumentDocumentEventChildHeadingChildDivider(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 DocumentDocumentEventChildHeadingChildImage(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 DocumentDocumentEventChildHeadingChildLink(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 DocumentDocumentEventChildHeadingChildLineBreak(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 DocumentDocumentEventChildHeadingChildText(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 DocumentDocumentEventChildHeadingChildToolCall(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 DocumentDocumentEventChildHeadingChildToolResult(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 DocumentDocumentEventChildHeadingChildTraceMessage(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 + + +DocumentDocumentEventChildHeadingChild: TypeAlias = Union[ + DocumentDocumentEventChildHeadingChildBlob, + DocumentDocumentEventChildHeadingChildCode, + DocumentDocumentEventChildHeadingChildComment, + DocumentDocumentEventChildHeadingChildDivider, + DocumentDocumentEventChildHeadingChildImage, + DocumentDocumentEventChildHeadingChildLink, + DocumentDocumentEventChildHeadingChildLineBreak, + DocumentDocumentEventChildHeadingChildText, + DocumentDocumentEventChildHeadingChildToolCall, + DocumentDocumentEventChildHeadingChildToolResult, + DocumentDocumentEventChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildImage(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 DocumentDocumentEventChildLink(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 DocumentDocumentEventChildLineBreak(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 DocumentDocumentEventChildList(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 DocumentDocumentEventChildListItemChildBlob(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 DocumentDocumentEventChildListItemChildCode(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 DocumentDocumentEventChildListItemChildComment(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 DocumentDocumentEventChildListItemChildDivider(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 DocumentDocumentEventChildListItemChildImage(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 DocumentDocumentEventChildListItemChildLink(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 DocumentDocumentEventChildListItemChildLineBreak(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 DocumentDocumentEventChildListItemChildText(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 DocumentDocumentEventChildListItemChildToolCall(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 DocumentDocumentEventChildListItemChildToolResult(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 DocumentDocumentEventChildListItemChildTraceMessage(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 + + +DocumentDocumentEventChildListItemChild: TypeAlias = Union[ + DocumentDocumentEventChildListItemChildBlob, + DocumentDocumentEventChildListItemChildCode, + DocumentDocumentEventChildListItemChildComment, + DocumentDocumentEventChildListItemChildDivider, + DocumentDocumentEventChildListItemChildImage, + DocumentDocumentEventChildListItemChildLink, + DocumentDocumentEventChildListItemChildLineBreak, + DocumentDocumentEventChildListItemChildText, + DocumentDocumentEventChildListItemChildToolCall, + DocumentDocumentEventChildListItemChildToolResult, + DocumentDocumentEventChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildParagraphChildBlob(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 DocumentDocumentEventChildParagraphChildCode(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 DocumentDocumentEventChildParagraphChildComment(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 DocumentDocumentEventChildParagraphChildDivider(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 DocumentDocumentEventChildParagraphChildImage(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 DocumentDocumentEventChildParagraphChildLink(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 DocumentDocumentEventChildParagraphChildLineBreak(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 DocumentDocumentEventChildParagraphChildText(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 DocumentDocumentEventChildParagraphChildToolCall(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 DocumentDocumentEventChildParagraphChildToolResult(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 DocumentDocumentEventChildParagraphChildTraceMessage(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 + + +DocumentDocumentEventChildParagraphChild: TypeAlias = Union[ + DocumentDocumentEventChildParagraphChildBlob, + DocumentDocumentEventChildParagraphChildCode, + DocumentDocumentEventChildParagraphChildComment, + DocumentDocumentEventChildParagraphChildDivider, + DocumentDocumentEventChildParagraphChildImage, + DocumentDocumentEventChildParagraphChildLink, + DocumentDocumentEventChildParagraphChildLineBreak, + DocumentDocumentEventChildParagraphChildText, + DocumentDocumentEventChildParagraphChildToolCall, + DocumentDocumentEventChildParagraphChildToolResult, + DocumentDocumentEventChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildQuoteChildBlob(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 DocumentDocumentEventChildQuoteChildCode(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 DocumentDocumentEventChildQuoteChildComment(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 DocumentDocumentEventChildQuoteChildDivider(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 DocumentDocumentEventChildQuoteChildImage(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 DocumentDocumentEventChildQuoteChildLink(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 DocumentDocumentEventChildQuoteChildLineBreak(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 DocumentDocumentEventChildQuoteChildText(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 DocumentDocumentEventChildQuoteChildToolCall(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 DocumentDocumentEventChildQuoteChildToolResult(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 DocumentDocumentEventChildQuoteChildTraceMessage(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 + + +DocumentDocumentEventChildQuoteChild: TypeAlias = Union[ + DocumentDocumentEventChildQuoteChildBlob, + DocumentDocumentEventChildQuoteChildCode, + DocumentDocumentEventChildQuoteChildComment, + DocumentDocumentEventChildQuoteChildDivider, + DocumentDocumentEventChildQuoteChildImage, + DocumentDocumentEventChildQuoteChildLink, + DocumentDocumentEventChildQuoteChildLineBreak, + DocumentDocumentEventChildQuoteChildText, + DocumentDocumentEventChildQuoteChildToolCall, + DocumentDocumentEventChildQuoteChildToolResult, + DocumentDocumentEventChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentEventChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildTable(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 DocumentDocumentEventChildTableCellChildBlob(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 DocumentDocumentEventChildTableCellChildCode(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 DocumentDocumentEventChildTableCellChildComment(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 DocumentDocumentEventChildTableCellChildDivider(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 DocumentDocumentEventChildTableCellChildImage(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 DocumentDocumentEventChildTableCellChildLink(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 DocumentDocumentEventChildTableCellChildLineBreak(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 DocumentDocumentEventChildTableCellChildText(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 DocumentDocumentEventChildTableCellChildToolCall(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 DocumentDocumentEventChildTableCellChildToolResult(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 DocumentDocumentEventChildTableCellChildTraceMessage(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 + + +DocumentDocumentEventChildTableCellChild: TypeAlias = Union[ + DocumentDocumentEventChildTableCellChildBlob, + DocumentDocumentEventChildTableCellChildCode, + DocumentDocumentEventChildTableCellChildComment, + DocumentDocumentEventChildTableCellChildDivider, + DocumentDocumentEventChildTableCellChildImage, + DocumentDocumentEventChildTableCellChildLink, + DocumentDocumentEventChildTableCellChildLineBreak, + DocumentDocumentEventChildTableCellChildText, + DocumentDocumentEventChildTableCellChildToolCall, + DocumentDocumentEventChildTableCellChildToolResult, + DocumentDocumentEventChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentEventChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildTableRow(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 DocumentDocumentEventChildText(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 DocumentDocumentEventChildToDoChildBlob(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 DocumentDocumentEventChildToDoChildCode(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 DocumentDocumentEventChildToDoChildComment(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 DocumentDocumentEventChildToDoChildDivider(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 DocumentDocumentEventChildToDoChildImage(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 DocumentDocumentEventChildToDoChildLink(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 DocumentDocumentEventChildToDoChildLineBreak(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 DocumentDocumentEventChildToDoChildText(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 DocumentDocumentEventChildToDoChildToolCall(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 DocumentDocumentEventChildToDoChildToolResult(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 DocumentDocumentEventChildToDoChildTraceMessage(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 + + +DocumentDocumentEventChildToDoChild: TypeAlias = Union[ + DocumentDocumentEventChildToDoChildBlob, + DocumentDocumentEventChildToDoChildCode, + DocumentDocumentEventChildToDoChildComment, + DocumentDocumentEventChildToDoChildDivider, + DocumentDocumentEventChildToDoChildImage, + DocumentDocumentEventChildToDoChildLink, + DocumentDocumentEventChildToDoChildLineBreak, + DocumentDocumentEventChildToDoChildText, + DocumentDocumentEventChildToDoChildToolCall, + DocumentDocumentEventChildToDoChildToolResult, + DocumentDocumentEventChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentEventChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentEventChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentEventChildToolCall(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 DocumentDocumentEventChildToolResult(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 DocumentDocumentEventChildTraceMessage(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 DocumentDocumentEventChildUtterance(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 + + +DocumentDocumentEventChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentEventChildBlob, + DocumentDocumentEventChildCallout, + DocumentDocumentEventChildChunk, + DocumentDocumentEventChildCode, + DocumentDocumentEventChildComment, + DocumentDocumentEventChildDivider, + DocumentDocumentEventChildEquation, + DocumentDocumentEventChildFootnote, + DocumentDocumentEventChildHeading, + DocumentDocumentEventChildImage, + DocumentDocumentEventChildLink, + DocumentDocumentEventChildLineBreak, + DocumentDocumentEventChildList, + DocumentDocumentEventChildListItem, + DocumentDocumentEventChildParagraph, + DocumentDocumentEventChildQuote, + DocumentDocumentEventChildTable, + DocumentDocumentEventChildTableCell, + DocumentDocumentEventChildTableRow, + DocumentDocumentEventChildText, + DocumentDocumentEventChildToDo, + DocumentDocumentEventChildToolCall, + DocumentDocumentEventChildToolResult, + DocumentDocumentEventChildTraceMessage, + DocumentDocumentEventChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentEvent(BaseModel): + id: Optional[str] = None + + attendees: Optional[List[DocumentDocumentEventAttendee]] = None + + children: Optional[List[DocumentDocumentEventChild]] = 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 DocumentDocumentFileChildBlob(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 DocumentDocumentFileChildCalloutChildBlob(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 DocumentDocumentFileChildCalloutChildCode(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 DocumentDocumentFileChildCalloutChildComment(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 DocumentDocumentFileChildCalloutChildDivider(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 DocumentDocumentFileChildCalloutChildImage(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 DocumentDocumentFileChildCalloutChildLink(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 DocumentDocumentFileChildCalloutChildLineBreak(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 DocumentDocumentFileChildCalloutChildText(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 DocumentDocumentFileChildCalloutChildToolCall(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 DocumentDocumentFileChildCalloutChildToolResult(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 DocumentDocumentFileChildCalloutChildTraceMessage(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 + + +DocumentDocumentFileChildCalloutChild: TypeAlias = Union[ + DocumentDocumentFileChildCalloutChildBlob, + DocumentDocumentFileChildCalloutChildCode, + DocumentDocumentFileChildCalloutChildComment, + DocumentDocumentFileChildCalloutChildDivider, + DocumentDocumentFileChildCalloutChildImage, + DocumentDocumentFileChildCalloutChildLink, + DocumentDocumentFileChildCalloutChildLineBreak, + DocumentDocumentFileChildCalloutChildText, + DocumentDocumentFileChildCalloutChildToolCall, + DocumentDocumentFileChildCalloutChildToolResult, + DocumentDocumentFileChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildChunkChildBlob(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 DocumentDocumentFileChildChunkChildCode(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 DocumentDocumentFileChildChunkChildComment(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 DocumentDocumentFileChildChunkChildDivider(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 DocumentDocumentFileChildChunkChildImage(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 DocumentDocumentFileChildChunkChildLink(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 DocumentDocumentFileChildChunkChildLineBreak(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 DocumentDocumentFileChildChunkChildText(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 DocumentDocumentFileChildChunkChildToolCall(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 DocumentDocumentFileChildChunkChildToolResult(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 DocumentDocumentFileChildChunkChildTraceMessage(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 + + +DocumentDocumentFileChildChunkChild: TypeAlias = Union[ + DocumentDocumentFileChildChunkChildBlob, + DocumentDocumentFileChildChunkChildCode, + DocumentDocumentFileChildChunkChildComment, + DocumentDocumentFileChildChunkChildDivider, + DocumentDocumentFileChildChunkChildImage, + DocumentDocumentFileChildChunkChildLink, + DocumentDocumentFileChildChunkChildLineBreak, + DocumentDocumentFileChildChunkChildText, + DocumentDocumentFileChildChunkChildToolCall, + DocumentDocumentFileChildChunkChildToolResult, + DocumentDocumentFileChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildCode(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 DocumentDocumentFileChildComment(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 DocumentDocumentFileChildDivider(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 DocumentDocumentFileChildEquationChildBlob(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 DocumentDocumentFileChildEquationChildCode(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 DocumentDocumentFileChildEquationChildComment(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 DocumentDocumentFileChildEquationChildDivider(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 DocumentDocumentFileChildEquationChildImage(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 DocumentDocumentFileChildEquationChildLink(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 DocumentDocumentFileChildEquationChildLineBreak(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 DocumentDocumentFileChildEquationChildText(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 DocumentDocumentFileChildEquationChildToolCall(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 DocumentDocumentFileChildEquationChildToolResult(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 DocumentDocumentFileChildEquationChildTraceMessage(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 + + +DocumentDocumentFileChildEquationChild: TypeAlias = Union[ + DocumentDocumentFileChildEquationChildBlob, + DocumentDocumentFileChildEquationChildCode, + DocumentDocumentFileChildEquationChildComment, + DocumentDocumentFileChildEquationChildDivider, + DocumentDocumentFileChildEquationChildImage, + DocumentDocumentFileChildEquationChildLink, + DocumentDocumentFileChildEquationChildLineBreak, + DocumentDocumentFileChildEquationChildText, + DocumentDocumentFileChildEquationChildToolCall, + DocumentDocumentFileChildEquationChildToolResult, + DocumentDocumentFileChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildFootnoteChildBlob(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 DocumentDocumentFileChildFootnoteChildCode(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 DocumentDocumentFileChildFootnoteChildComment(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 DocumentDocumentFileChildFootnoteChildDivider(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 DocumentDocumentFileChildFootnoteChildImage(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 DocumentDocumentFileChildFootnoteChildLink(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 DocumentDocumentFileChildFootnoteChildLineBreak(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 DocumentDocumentFileChildFootnoteChildText(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 DocumentDocumentFileChildFootnoteChildToolCall(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 DocumentDocumentFileChildFootnoteChildToolResult(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 DocumentDocumentFileChildFootnoteChildTraceMessage(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 + + +DocumentDocumentFileChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentFileChildFootnoteChildBlob, + DocumentDocumentFileChildFootnoteChildCode, + DocumentDocumentFileChildFootnoteChildComment, + DocumentDocumentFileChildFootnoteChildDivider, + DocumentDocumentFileChildFootnoteChildImage, + DocumentDocumentFileChildFootnoteChildLink, + DocumentDocumentFileChildFootnoteChildLineBreak, + DocumentDocumentFileChildFootnoteChildText, + DocumentDocumentFileChildFootnoteChildToolCall, + DocumentDocumentFileChildFootnoteChildToolResult, + DocumentDocumentFileChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildHeadingChildBlob(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 DocumentDocumentFileChildHeadingChildCode(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 DocumentDocumentFileChildHeadingChildComment(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 DocumentDocumentFileChildHeadingChildDivider(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 DocumentDocumentFileChildHeadingChildImage(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 DocumentDocumentFileChildHeadingChildLink(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 DocumentDocumentFileChildHeadingChildLineBreak(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 DocumentDocumentFileChildHeadingChildText(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 DocumentDocumentFileChildHeadingChildToolCall(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 DocumentDocumentFileChildHeadingChildToolResult(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 DocumentDocumentFileChildHeadingChildTraceMessage(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 + + +DocumentDocumentFileChildHeadingChild: TypeAlias = Union[ + DocumentDocumentFileChildHeadingChildBlob, + DocumentDocumentFileChildHeadingChildCode, + DocumentDocumentFileChildHeadingChildComment, + DocumentDocumentFileChildHeadingChildDivider, + DocumentDocumentFileChildHeadingChildImage, + DocumentDocumentFileChildHeadingChildLink, + DocumentDocumentFileChildHeadingChildLineBreak, + DocumentDocumentFileChildHeadingChildText, + DocumentDocumentFileChildHeadingChildToolCall, + DocumentDocumentFileChildHeadingChildToolResult, + DocumentDocumentFileChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildImage(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 DocumentDocumentFileChildLink(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 DocumentDocumentFileChildLineBreak(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 DocumentDocumentFileChildList(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 DocumentDocumentFileChildListItemChildBlob(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 DocumentDocumentFileChildListItemChildCode(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 DocumentDocumentFileChildListItemChildComment(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 DocumentDocumentFileChildListItemChildDivider(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 DocumentDocumentFileChildListItemChildImage(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 DocumentDocumentFileChildListItemChildLink(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 DocumentDocumentFileChildListItemChildLineBreak(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 DocumentDocumentFileChildListItemChildText(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 DocumentDocumentFileChildListItemChildToolCall(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 DocumentDocumentFileChildListItemChildToolResult(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 DocumentDocumentFileChildListItemChildTraceMessage(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 + + +DocumentDocumentFileChildListItemChild: TypeAlias = Union[ + DocumentDocumentFileChildListItemChildBlob, + DocumentDocumentFileChildListItemChildCode, + DocumentDocumentFileChildListItemChildComment, + DocumentDocumentFileChildListItemChildDivider, + DocumentDocumentFileChildListItemChildImage, + DocumentDocumentFileChildListItemChildLink, + DocumentDocumentFileChildListItemChildLineBreak, + DocumentDocumentFileChildListItemChildText, + DocumentDocumentFileChildListItemChildToolCall, + DocumentDocumentFileChildListItemChildToolResult, + DocumentDocumentFileChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildParagraphChildBlob(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 DocumentDocumentFileChildParagraphChildCode(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 DocumentDocumentFileChildParagraphChildComment(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 DocumentDocumentFileChildParagraphChildDivider(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 DocumentDocumentFileChildParagraphChildImage(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 DocumentDocumentFileChildParagraphChildLink(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 DocumentDocumentFileChildParagraphChildLineBreak(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 DocumentDocumentFileChildParagraphChildText(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 DocumentDocumentFileChildParagraphChildToolCall(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 DocumentDocumentFileChildParagraphChildToolResult(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 DocumentDocumentFileChildParagraphChildTraceMessage(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 + + +DocumentDocumentFileChildParagraphChild: TypeAlias = Union[ + DocumentDocumentFileChildParagraphChildBlob, + DocumentDocumentFileChildParagraphChildCode, + DocumentDocumentFileChildParagraphChildComment, + DocumentDocumentFileChildParagraphChildDivider, + DocumentDocumentFileChildParagraphChildImage, + DocumentDocumentFileChildParagraphChildLink, + DocumentDocumentFileChildParagraphChildLineBreak, + DocumentDocumentFileChildParagraphChildText, + DocumentDocumentFileChildParagraphChildToolCall, + DocumentDocumentFileChildParagraphChildToolResult, + DocumentDocumentFileChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildQuoteChildBlob(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 DocumentDocumentFileChildQuoteChildCode(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 DocumentDocumentFileChildQuoteChildComment(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 DocumentDocumentFileChildQuoteChildDivider(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 DocumentDocumentFileChildQuoteChildImage(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 DocumentDocumentFileChildQuoteChildLink(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 DocumentDocumentFileChildQuoteChildLineBreak(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 DocumentDocumentFileChildQuoteChildText(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 DocumentDocumentFileChildQuoteChildToolCall(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 DocumentDocumentFileChildQuoteChildToolResult(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 DocumentDocumentFileChildQuoteChildTraceMessage(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 + + +DocumentDocumentFileChildQuoteChild: TypeAlias = Union[ + DocumentDocumentFileChildQuoteChildBlob, + DocumentDocumentFileChildQuoteChildCode, + DocumentDocumentFileChildQuoteChildComment, + DocumentDocumentFileChildQuoteChildDivider, + DocumentDocumentFileChildQuoteChildImage, + DocumentDocumentFileChildQuoteChildLink, + DocumentDocumentFileChildQuoteChildLineBreak, + DocumentDocumentFileChildQuoteChildText, + DocumentDocumentFileChildQuoteChildToolCall, + DocumentDocumentFileChildQuoteChildToolResult, + DocumentDocumentFileChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildTable(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 DocumentDocumentFileChildTableCellChildBlob(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 DocumentDocumentFileChildTableCellChildCode(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 DocumentDocumentFileChildTableCellChildComment(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 DocumentDocumentFileChildTableCellChildDivider(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 DocumentDocumentFileChildTableCellChildImage(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 DocumentDocumentFileChildTableCellChildLink(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 DocumentDocumentFileChildTableCellChildLineBreak(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 DocumentDocumentFileChildTableCellChildText(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 DocumentDocumentFileChildTableCellChildToolCall(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 DocumentDocumentFileChildTableCellChildToolResult(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 DocumentDocumentFileChildTableCellChildTraceMessage(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 + + +DocumentDocumentFileChildTableCellChild: TypeAlias = Union[ + DocumentDocumentFileChildTableCellChildBlob, + DocumentDocumentFileChildTableCellChildCode, + DocumentDocumentFileChildTableCellChildComment, + DocumentDocumentFileChildTableCellChildDivider, + DocumentDocumentFileChildTableCellChildImage, + DocumentDocumentFileChildTableCellChildLink, + DocumentDocumentFileChildTableCellChildLineBreak, + DocumentDocumentFileChildTableCellChildText, + DocumentDocumentFileChildTableCellChildToolCall, + DocumentDocumentFileChildTableCellChildToolResult, + DocumentDocumentFileChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentFileChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildTableRow(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 DocumentDocumentFileChildText(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 DocumentDocumentFileChildToDoChildBlob(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 DocumentDocumentFileChildToDoChildCode(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 DocumentDocumentFileChildToDoChildComment(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 DocumentDocumentFileChildToDoChildDivider(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 DocumentDocumentFileChildToDoChildImage(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 DocumentDocumentFileChildToDoChildLink(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 DocumentDocumentFileChildToDoChildLineBreak(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 DocumentDocumentFileChildToDoChildText(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 DocumentDocumentFileChildToDoChildToolCall(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 DocumentDocumentFileChildToDoChildToolResult(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 DocumentDocumentFileChildToDoChildTraceMessage(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 + + +DocumentDocumentFileChildToDoChild: TypeAlias = Union[ + DocumentDocumentFileChildToDoChildBlob, + DocumentDocumentFileChildToDoChildCode, + DocumentDocumentFileChildToDoChildComment, + DocumentDocumentFileChildToDoChildDivider, + DocumentDocumentFileChildToDoChildImage, + DocumentDocumentFileChildToDoChildLink, + DocumentDocumentFileChildToDoChildLineBreak, + DocumentDocumentFileChildToDoChildText, + DocumentDocumentFileChildToDoChildToolCall, + DocumentDocumentFileChildToDoChildToolResult, + DocumentDocumentFileChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentFileChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentFileChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentFileChildToolCall(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 DocumentDocumentFileChildToolResult(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 DocumentDocumentFileChildTraceMessage(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 DocumentDocumentFileChildUtterance(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 + + +DocumentDocumentFileChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentFileChildBlob, + DocumentDocumentFileChildCallout, + DocumentDocumentFileChildChunk, + DocumentDocumentFileChildCode, + DocumentDocumentFileChildComment, + DocumentDocumentFileChildDivider, + DocumentDocumentFileChildEquation, + DocumentDocumentFileChildFootnote, + DocumentDocumentFileChildHeading, + DocumentDocumentFileChildImage, + DocumentDocumentFileChildLink, + DocumentDocumentFileChildLineBreak, + DocumentDocumentFileChildList, + DocumentDocumentFileChildListItem, + DocumentDocumentFileChildParagraph, + DocumentDocumentFileChildQuote, + DocumentDocumentFileChildTable, + DocumentDocumentFileChildTableCell, + DocumentDocumentFileChildTableRow, + DocumentDocumentFileChildText, + DocumentDocumentFileChildToDo, + DocumentDocumentFileChildToolCall, + DocumentDocumentFileChildToolResult, + DocumentDocumentFileChildTraceMessage, + DocumentDocumentFileChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentFile(BaseModel): + content_type: str + + filename: str + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentFileChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildSenderChildBlob(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 DocumentDocumentConversationChildSenderChildCode(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 DocumentDocumentConversationChildSenderChildComment(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 DocumentDocumentConversationChildSenderChildDivider(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 DocumentDocumentConversationChildSenderChildImage(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 DocumentDocumentConversationChildSenderChildLink(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 DocumentDocumentConversationChildSenderChildLineBreak(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 DocumentDocumentConversationChildSenderChildText(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 DocumentDocumentConversationChildSenderChildToolCall(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 DocumentDocumentConversationChildSenderChildToolResult(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 DocumentDocumentConversationChildSenderChildTraceMessage(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 + + +DocumentDocumentConversationChildSenderChild: TypeAlias = Union[ + DocumentDocumentConversationChildSenderChildBlob, + DocumentDocumentConversationChildSenderChildCode, + DocumentDocumentConversationChildSenderChildComment, + DocumentDocumentConversationChildSenderChildDivider, + DocumentDocumentConversationChildSenderChildImage, + DocumentDocumentConversationChildSenderChildLink, + DocumentDocumentConversationChildSenderChildLineBreak, + DocumentDocumentConversationChildSenderChildText, + DocumentDocumentConversationChildSenderChildToolCall, + DocumentDocumentConversationChildSenderChildToolResult, + DocumentDocumentConversationChildSenderChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildSender(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentConversationChildSenderChild]] = 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 DocumentDocumentConversationChildChildBlob(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 DocumentDocumentConversationChildChildCalloutChildBlob(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 DocumentDocumentConversationChildChildCalloutChildCode(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 DocumentDocumentConversationChildChildCalloutChildComment(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 DocumentDocumentConversationChildChildCalloutChildDivider(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 DocumentDocumentConversationChildChildCalloutChildImage(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 DocumentDocumentConversationChildChildCalloutChildLink(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 DocumentDocumentConversationChildChildCalloutChildLineBreak(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 DocumentDocumentConversationChildChildCalloutChildText(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 DocumentDocumentConversationChildChildCalloutChildToolCall(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 DocumentDocumentConversationChildChildCalloutChildToolResult(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 DocumentDocumentConversationChildChildCalloutChildTraceMessage(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 + + +DocumentDocumentConversationChildChildCalloutChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildCalloutChildBlob, + DocumentDocumentConversationChildChildCalloutChildCode, + DocumentDocumentConversationChildChildCalloutChildComment, + DocumentDocumentConversationChildChildCalloutChildDivider, + DocumentDocumentConversationChildChildCalloutChildImage, + DocumentDocumentConversationChildChildCalloutChildLink, + DocumentDocumentConversationChildChildCalloutChildLineBreak, + DocumentDocumentConversationChildChildCalloutChildText, + DocumentDocumentConversationChildChildCalloutChildToolCall, + DocumentDocumentConversationChildChildCalloutChildToolResult, + DocumentDocumentConversationChildChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildChunkChildBlob(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 DocumentDocumentConversationChildChildChunkChildCode(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 DocumentDocumentConversationChildChildChunkChildComment(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 DocumentDocumentConversationChildChildChunkChildDivider(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 DocumentDocumentConversationChildChildChunkChildImage(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 DocumentDocumentConversationChildChildChunkChildLink(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 DocumentDocumentConversationChildChildChunkChildLineBreak(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 DocumentDocumentConversationChildChildChunkChildText(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 DocumentDocumentConversationChildChildChunkChildToolCall(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 DocumentDocumentConversationChildChildChunkChildToolResult(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 DocumentDocumentConversationChildChildChunkChildTraceMessage(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 + + +DocumentDocumentConversationChildChildChunkChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildChunkChildBlob, + DocumentDocumentConversationChildChildChunkChildCode, + DocumentDocumentConversationChildChildChunkChildComment, + DocumentDocumentConversationChildChildChunkChildDivider, + DocumentDocumentConversationChildChildChunkChildImage, + DocumentDocumentConversationChildChildChunkChildLink, + DocumentDocumentConversationChildChildChunkChildLineBreak, + DocumentDocumentConversationChildChildChunkChildText, + DocumentDocumentConversationChildChildChunkChildToolCall, + DocumentDocumentConversationChildChildChunkChildToolResult, + DocumentDocumentConversationChildChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildCode(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 DocumentDocumentConversationChildChildComment(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 DocumentDocumentConversationChildChildDivider(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 DocumentDocumentConversationChildChildEquationChildBlob(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 DocumentDocumentConversationChildChildEquationChildCode(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 DocumentDocumentConversationChildChildEquationChildComment(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 DocumentDocumentConversationChildChildEquationChildDivider(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 DocumentDocumentConversationChildChildEquationChildImage(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 DocumentDocumentConversationChildChildEquationChildLink(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 DocumentDocumentConversationChildChildEquationChildLineBreak(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 DocumentDocumentConversationChildChildEquationChildText(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 DocumentDocumentConversationChildChildEquationChildToolCall(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 DocumentDocumentConversationChildChildEquationChildToolResult(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 DocumentDocumentConversationChildChildEquationChildTraceMessage(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 + + +DocumentDocumentConversationChildChildEquationChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildEquationChildBlob, + DocumentDocumentConversationChildChildEquationChildCode, + DocumentDocumentConversationChildChildEquationChildComment, + DocumentDocumentConversationChildChildEquationChildDivider, + DocumentDocumentConversationChildChildEquationChildImage, + DocumentDocumentConversationChildChildEquationChildLink, + DocumentDocumentConversationChildChildEquationChildLineBreak, + DocumentDocumentConversationChildChildEquationChildText, + DocumentDocumentConversationChildChildEquationChildToolCall, + DocumentDocumentConversationChildChildEquationChildToolResult, + DocumentDocumentConversationChildChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildFootnoteChildBlob(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 DocumentDocumentConversationChildChildFootnoteChildCode(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 DocumentDocumentConversationChildChildFootnoteChildComment(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 DocumentDocumentConversationChildChildFootnoteChildDivider(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 DocumentDocumentConversationChildChildFootnoteChildImage(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 DocumentDocumentConversationChildChildFootnoteChildLink(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 DocumentDocumentConversationChildChildFootnoteChildLineBreak(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 DocumentDocumentConversationChildChildFootnoteChildText(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 DocumentDocumentConversationChildChildFootnoteChildToolCall(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 DocumentDocumentConversationChildChildFootnoteChildToolResult(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 DocumentDocumentConversationChildChildFootnoteChildTraceMessage(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 + + +DocumentDocumentConversationChildChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildFootnoteChildBlob, + DocumentDocumentConversationChildChildFootnoteChildCode, + DocumentDocumentConversationChildChildFootnoteChildComment, + DocumentDocumentConversationChildChildFootnoteChildDivider, + DocumentDocumentConversationChildChildFootnoteChildImage, + DocumentDocumentConversationChildChildFootnoteChildLink, + DocumentDocumentConversationChildChildFootnoteChildLineBreak, + DocumentDocumentConversationChildChildFootnoteChildText, + DocumentDocumentConversationChildChildFootnoteChildToolCall, + DocumentDocumentConversationChildChildFootnoteChildToolResult, + DocumentDocumentConversationChildChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildHeadingChildBlob(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 DocumentDocumentConversationChildChildHeadingChildCode(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 DocumentDocumentConversationChildChildHeadingChildComment(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 DocumentDocumentConversationChildChildHeadingChildDivider(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 DocumentDocumentConversationChildChildHeadingChildImage(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 DocumentDocumentConversationChildChildHeadingChildLink(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 DocumentDocumentConversationChildChildHeadingChildLineBreak(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 DocumentDocumentConversationChildChildHeadingChildText(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 DocumentDocumentConversationChildChildHeadingChildToolCall(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 DocumentDocumentConversationChildChildHeadingChildToolResult(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 DocumentDocumentConversationChildChildHeadingChildTraceMessage(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 + + +DocumentDocumentConversationChildChildHeadingChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildHeadingChildBlob, + DocumentDocumentConversationChildChildHeadingChildCode, + DocumentDocumentConversationChildChildHeadingChildComment, + DocumentDocumentConversationChildChildHeadingChildDivider, + DocumentDocumentConversationChildChildHeadingChildImage, + DocumentDocumentConversationChildChildHeadingChildLink, + DocumentDocumentConversationChildChildHeadingChildLineBreak, + DocumentDocumentConversationChildChildHeadingChildText, + DocumentDocumentConversationChildChildHeadingChildToolCall, + DocumentDocumentConversationChildChildHeadingChildToolResult, + DocumentDocumentConversationChildChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildImage(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 DocumentDocumentConversationChildChildLink(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 DocumentDocumentConversationChildChildLineBreak(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 DocumentDocumentConversationChildChildList(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 DocumentDocumentConversationChildChildListItemChildBlob(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 DocumentDocumentConversationChildChildListItemChildCode(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 DocumentDocumentConversationChildChildListItemChildComment(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 DocumentDocumentConversationChildChildListItemChildDivider(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 DocumentDocumentConversationChildChildListItemChildImage(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 DocumentDocumentConversationChildChildListItemChildLink(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 DocumentDocumentConversationChildChildListItemChildLineBreak(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 DocumentDocumentConversationChildChildListItemChildText(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 DocumentDocumentConversationChildChildListItemChildToolCall(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 DocumentDocumentConversationChildChildListItemChildToolResult(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 DocumentDocumentConversationChildChildListItemChildTraceMessage(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 + + +DocumentDocumentConversationChildChildListItemChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildListItemChildBlob, + DocumentDocumentConversationChildChildListItemChildCode, + DocumentDocumentConversationChildChildListItemChildComment, + DocumentDocumentConversationChildChildListItemChildDivider, + DocumentDocumentConversationChildChildListItemChildImage, + DocumentDocumentConversationChildChildListItemChildLink, + DocumentDocumentConversationChildChildListItemChildLineBreak, + DocumentDocumentConversationChildChildListItemChildText, + DocumentDocumentConversationChildChildListItemChildToolCall, + DocumentDocumentConversationChildChildListItemChildToolResult, + DocumentDocumentConversationChildChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildParagraphChildBlob(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 DocumentDocumentConversationChildChildParagraphChildCode(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 DocumentDocumentConversationChildChildParagraphChildComment(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 DocumentDocumentConversationChildChildParagraphChildDivider(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 DocumentDocumentConversationChildChildParagraphChildImage(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 DocumentDocumentConversationChildChildParagraphChildLink(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 DocumentDocumentConversationChildChildParagraphChildLineBreak(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 DocumentDocumentConversationChildChildParagraphChildText(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 DocumentDocumentConversationChildChildParagraphChildToolCall(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 DocumentDocumentConversationChildChildParagraphChildToolResult(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 DocumentDocumentConversationChildChildParagraphChildTraceMessage(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 + + +DocumentDocumentConversationChildChildParagraphChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildParagraphChildBlob, + DocumentDocumentConversationChildChildParagraphChildCode, + DocumentDocumentConversationChildChildParagraphChildComment, + DocumentDocumentConversationChildChildParagraphChildDivider, + DocumentDocumentConversationChildChildParagraphChildImage, + DocumentDocumentConversationChildChildParagraphChildLink, + DocumentDocumentConversationChildChildParagraphChildLineBreak, + DocumentDocumentConversationChildChildParagraphChildText, + DocumentDocumentConversationChildChildParagraphChildToolCall, + DocumentDocumentConversationChildChildParagraphChildToolResult, + DocumentDocumentConversationChildChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildQuoteChildBlob(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 DocumentDocumentConversationChildChildQuoteChildCode(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 DocumentDocumentConversationChildChildQuoteChildComment(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 DocumentDocumentConversationChildChildQuoteChildDivider(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 DocumentDocumentConversationChildChildQuoteChildImage(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 DocumentDocumentConversationChildChildQuoteChildLink(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 DocumentDocumentConversationChildChildQuoteChildLineBreak(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 DocumentDocumentConversationChildChildQuoteChildText(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 DocumentDocumentConversationChildChildQuoteChildToolCall(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 DocumentDocumentConversationChildChildQuoteChildToolResult(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 DocumentDocumentConversationChildChildQuoteChildTraceMessage(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 + + +DocumentDocumentConversationChildChildQuoteChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildQuoteChildBlob, + DocumentDocumentConversationChildChildQuoteChildCode, + DocumentDocumentConversationChildChildQuoteChildComment, + DocumentDocumentConversationChildChildQuoteChildDivider, + DocumentDocumentConversationChildChildQuoteChildImage, + DocumentDocumentConversationChildChildQuoteChildLink, + DocumentDocumentConversationChildChildQuoteChildLineBreak, + DocumentDocumentConversationChildChildQuoteChildText, + DocumentDocumentConversationChildChildQuoteChildToolCall, + DocumentDocumentConversationChildChildQuoteChildToolResult, + DocumentDocumentConversationChildChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChildChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildTable(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 DocumentDocumentConversationChildChildTableCellChildBlob(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 DocumentDocumentConversationChildChildTableCellChildCode(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 DocumentDocumentConversationChildChildTableCellChildComment(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 DocumentDocumentConversationChildChildTableCellChildDivider(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 DocumentDocumentConversationChildChildTableCellChildImage(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 DocumentDocumentConversationChildChildTableCellChildLink(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 DocumentDocumentConversationChildChildTableCellChildLineBreak(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 DocumentDocumentConversationChildChildTableCellChildText(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 DocumentDocumentConversationChildChildTableCellChildToolCall(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 DocumentDocumentConversationChildChildTableCellChildToolResult(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 DocumentDocumentConversationChildChildTableCellChildTraceMessage(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 + + +DocumentDocumentConversationChildChildTableCellChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildTableCellChildBlob, + DocumentDocumentConversationChildChildTableCellChildCode, + DocumentDocumentConversationChildChildTableCellChildComment, + DocumentDocumentConversationChildChildTableCellChildDivider, + DocumentDocumentConversationChildChildTableCellChildImage, + DocumentDocumentConversationChildChildTableCellChildLink, + DocumentDocumentConversationChildChildTableCellChildLineBreak, + DocumentDocumentConversationChildChildTableCellChildText, + DocumentDocumentConversationChildChildTableCellChildToolCall, + DocumentDocumentConversationChildChildTableCellChildToolResult, + DocumentDocumentConversationChildChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentConversationChildChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildTableRow(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 DocumentDocumentConversationChildChildText(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 DocumentDocumentConversationChildChildToDoChildBlob(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 DocumentDocumentConversationChildChildToDoChildCode(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 DocumentDocumentConversationChildChildToDoChildComment(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 DocumentDocumentConversationChildChildToDoChildDivider(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 DocumentDocumentConversationChildChildToDoChildImage(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 DocumentDocumentConversationChildChildToDoChildLink(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 DocumentDocumentConversationChildChildToDoChildLineBreak(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 DocumentDocumentConversationChildChildToDoChildText(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 DocumentDocumentConversationChildChildToDoChildToolCall(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 DocumentDocumentConversationChildChildToDoChildToolResult(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 DocumentDocumentConversationChildChildToDoChildTraceMessage(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 + + +DocumentDocumentConversationChildChildToDoChild: TypeAlias = Union[ + DocumentDocumentConversationChildChildToDoChildBlob, + DocumentDocumentConversationChildChildToDoChildCode, + DocumentDocumentConversationChildChildToDoChildComment, + DocumentDocumentConversationChildChildToDoChildDivider, + DocumentDocumentConversationChildChildToDoChildImage, + DocumentDocumentConversationChildChildToDoChildLink, + DocumentDocumentConversationChildChildToDoChildLineBreak, + DocumentDocumentConversationChildChildToDoChildText, + DocumentDocumentConversationChildChildToDoChildToolCall, + DocumentDocumentConversationChildChildToDoChildToolResult, + DocumentDocumentConversationChildChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentConversationChildChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversationChildChildToolCall(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 DocumentDocumentConversationChildChildToolResult(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 DocumentDocumentConversationChildChildTraceMessage(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 DocumentDocumentConversationChildChildUtterance(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 + + +DocumentDocumentConversationChildChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentConversationChildChildBlob, + DocumentDocumentConversationChildChildCallout, + DocumentDocumentConversationChildChildChunk, + DocumentDocumentConversationChildChildCode, + DocumentDocumentConversationChildChildComment, + DocumentDocumentConversationChildChildDivider, + DocumentDocumentConversationChildChildEquation, + DocumentDocumentConversationChildChildFootnote, + DocumentDocumentConversationChildChildHeading, + DocumentDocumentConversationChildChildImage, + DocumentDocumentConversationChildChildLink, + DocumentDocumentConversationChildChildLineBreak, + DocumentDocumentConversationChildChildList, + DocumentDocumentConversationChildChildListItem, + DocumentDocumentConversationChildChildParagraph, + DocumentDocumentConversationChildChildQuote, + DocumentDocumentConversationChildChildTable, + DocumentDocumentConversationChildChildTableCell, + DocumentDocumentConversationChildChildTableRow, + DocumentDocumentConversationChildChildText, + DocumentDocumentConversationChildChildToDo, + DocumentDocumentConversationChildChildToolCall, + DocumentDocumentConversationChildChildToolResult, + DocumentDocumentConversationChildChildTraceMessage, + DocumentDocumentConversationChildChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentConversationChildMentionedUserChildBlob(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 DocumentDocumentConversationChildMentionedUserChildCode(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 DocumentDocumentConversationChildMentionedUserChildComment(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 DocumentDocumentConversationChildMentionedUserChildDivider(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 DocumentDocumentConversationChildMentionedUserChildImage(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 DocumentDocumentConversationChildMentionedUserChildLink(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 DocumentDocumentConversationChildMentionedUserChildLineBreak(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 DocumentDocumentConversationChildMentionedUserChildText(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 DocumentDocumentConversationChildMentionedUserChildToolCall(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 DocumentDocumentConversationChildMentionedUserChildToolResult(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 DocumentDocumentConversationChildMentionedUserChildTraceMessage(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 + + +DocumentDocumentConversationChildMentionedUserChild: TypeAlias = Union[ + DocumentDocumentConversationChildMentionedUserChildBlob, + DocumentDocumentConversationChildMentionedUserChildCode, + DocumentDocumentConversationChildMentionedUserChildComment, + DocumentDocumentConversationChildMentionedUserChildDivider, + DocumentDocumentConversationChildMentionedUserChildImage, + DocumentDocumentConversationChildMentionedUserChildLink, + DocumentDocumentConversationChildMentionedUserChildLineBreak, + DocumentDocumentConversationChildMentionedUserChildText, + DocumentDocumentConversationChildMentionedUserChildToolCall, + DocumentDocumentConversationChildMentionedUserChildToolResult, + DocumentDocumentConversationChildMentionedUserChildTraceMessage, + object, +] + + +class DocumentDocumentConversationChildMentionedUser(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentConversationChildMentionedUserChild]] = 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 DocumentDocumentConversationChild(BaseModel): + date: datetime + + sender: DocumentDocumentConversationChildSender + + 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[DocumentDocumentConversationChildChild]] = 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[DocumentDocumentConversationChildMentionedUser]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentConversation(BaseModel): + id: Optional[str] = None + + channel: Optional[str] = None + + children: Optional[List[DocumentDocumentConversationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTraceChildTraceMessage(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 DocumentDocumentTraceChildToolCall(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 DocumentDocumentTraceChildToolResult(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 + + +DocumentDocumentTraceChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentTraceChildTraceMessage, DocumentDocumentTraceChildToolCall, DocumentDocumentTraceChildToolResult + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentTrace(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[DocumentDocumentTraceChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentTranscriptChild(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 DocumentDocumentTranscriptParticipantChildBlob(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 DocumentDocumentTranscriptParticipantChildCode(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 DocumentDocumentTranscriptParticipantChildComment(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 DocumentDocumentTranscriptParticipantChildDivider(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 DocumentDocumentTranscriptParticipantChildImage(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 DocumentDocumentTranscriptParticipantChildLink(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 DocumentDocumentTranscriptParticipantChildLineBreak(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 DocumentDocumentTranscriptParticipantChildText(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 DocumentDocumentTranscriptParticipantChildToolCall(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 DocumentDocumentTranscriptParticipantChildToolResult(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 DocumentDocumentTranscriptParticipantChildTraceMessage(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 + + +DocumentDocumentTranscriptParticipantChild: TypeAlias = Union[ + DocumentDocumentTranscriptParticipantChildBlob, + DocumentDocumentTranscriptParticipantChildCode, + DocumentDocumentTranscriptParticipantChildComment, + DocumentDocumentTranscriptParticipantChildDivider, + DocumentDocumentTranscriptParticipantChildImage, + DocumentDocumentTranscriptParticipantChildLink, + DocumentDocumentTranscriptParticipantChildLineBreak, + DocumentDocumentTranscriptParticipantChildText, + DocumentDocumentTranscriptParticipantChildToolCall, + DocumentDocumentTranscriptParticipantChildToolResult, + DocumentDocumentTranscriptParticipantChildTraceMessage, + object, +] + + +class DocumentDocumentTranscriptParticipant(BaseModel): + id: Optional[str] = None + + address: Optional[str] = None + + alt_names: Optional[List[str]] = None + + children: Optional[List[DocumentDocumentTranscriptParticipantChild]] = 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 DocumentDocumentTranscript(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[DocumentDocumentTranscriptChild]] = 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[DocumentDocumentTranscriptParticipant]] = None + + started_at: Optional[datetime] = None + + text: Optional[str] = None + + title: Optional[str] = None + + type: Optional[Literal["transcript"]] = None + + +class DocumentDocumentCompanyChildBlob(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 DocumentDocumentCompanyChildCalloutChildBlob(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 DocumentDocumentCompanyChildCalloutChildCode(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 DocumentDocumentCompanyChildCalloutChildComment(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 DocumentDocumentCompanyChildCalloutChildDivider(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 DocumentDocumentCompanyChildCalloutChildImage(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 DocumentDocumentCompanyChildCalloutChildLink(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 DocumentDocumentCompanyChildCalloutChildLineBreak(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 DocumentDocumentCompanyChildCalloutChildText(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 DocumentDocumentCompanyChildCalloutChildToolCall(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 DocumentDocumentCompanyChildCalloutChildToolResult(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 DocumentDocumentCompanyChildCalloutChildTraceMessage(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 + + +DocumentDocumentCompanyChildCalloutChild: TypeAlias = Union[ + DocumentDocumentCompanyChildCalloutChildBlob, + DocumentDocumentCompanyChildCalloutChildCode, + DocumentDocumentCompanyChildCalloutChildComment, + DocumentDocumentCompanyChildCalloutChildDivider, + DocumentDocumentCompanyChildCalloutChildImage, + DocumentDocumentCompanyChildCalloutChildLink, + DocumentDocumentCompanyChildCalloutChildLineBreak, + DocumentDocumentCompanyChildCalloutChildText, + DocumentDocumentCompanyChildCalloutChildToolCall, + DocumentDocumentCompanyChildCalloutChildToolResult, + DocumentDocumentCompanyChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildChunkChildBlob(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 DocumentDocumentCompanyChildChunkChildCode(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 DocumentDocumentCompanyChildChunkChildComment(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 DocumentDocumentCompanyChildChunkChildDivider(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 DocumentDocumentCompanyChildChunkChildImage(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 DocumentDocumentCompanyChildChunkChildLink(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 DocumentDocumentCompanyChildChunkChildLineBreak(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 DocumentDocumentCompanyChildChunkChildText(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 DocumentDocumentCompanyChildChunkChildToolCall(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 DocumentDocumentCompanyChildChunkChildToolResult(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 DocumentDocumentCompanyChildChunkChildTraceMessage(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 + + +DocumentDocumentCompanyChildChunkChild: TypeAlias = Union[ + DocumentDocumentCompanyChildChunkChildBlob, + DocumentDocumentCompanyChildChunkChildCode, + DocumentDocumentCompanyChildChunkChildComment, + DocumentDocumentCompanyChildChunkChildDivider, + DocumentDocumentCompanyChildChunkChildImage, + DocumentDocumentCompanyChildChunkChildLink, + DocumentDocumentCompanyChildChunkChildLineBreak, + DocumentDocumentCompanyChildChunkChildText, + DocumentDocumentCompanyChildChunkChildToolCall, + DocumentDocumentCompanyChildChunkChildToolResult, + DocumentDocumentCompanyChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildCode(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 DocumentDocumentCompanyChildComment(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 DocumentDocumentCompanyChildDivider(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 DocumentDocumentCompanyChildEquationChildBlob(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 DocumentDocumentCompanyChildEquationChildCode(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 DocumentDocumentCompanyChildEquationChildComment(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 DocumentDocumentCompanyChildEquationChildDivider(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 DocumentDocumentCompanyChildEquationChildImage(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 DocumentDocumentCompanyChildEquationChildLink(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 DocumentDocumentCompanyChildEquationChildLineBreak(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 DocumentDocumentCompanyChildEquationChildText(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 DocumentDocumentCompanyChildEquationChildToolCall(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 DocumentDocumentCompanyChildEquationChildToolResult(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 DocumentDocumentCompanyChildEquationChildTraceMessage(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 + + +DocumentDocumentCompanyChildEquationChild: TypeAlias = Union[ + DocumentDocumentCompanyChildEquationChildBlob, + DocumentDocumentCompanyChildEquationChildCode, + DocumentDocumentCompanyChildEquationChildComment, + DocumentDocumentCompanyChildEquationChildDivider, + DocumentDocumentCompanyChildEquationChildImage, + DocumentDocumentCompanyChildEquationChildLink, + DocumentDocumentCompanyChildEquationChildLineBreak, + DocumentDocumentCompanyChildEquationChildText, + DocumentDocumentCompanyChildEquationChildToolCall, + DocumentDocumentCompanyChildEquationChildToolResult, + DocumentDocumentCompanyChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildFootnoteChildBlob(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 DocumentDocumentCompanyChildFootnoteChildCode(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 DocumentDocumentCompanyChildFootnoteChildComment(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 DocumentDocumentCompanyChildFootnoteChildDivider(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 DocumentDocumentCompanyChildFootnoteChildImage(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 DocumentDocumentCompanyChildFootnoteChildLink(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 DocumentDocumentCompanyChildFootnoteChildLineBreak(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 DocumentDocumentCompanyChildFootnoteChildText(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 DocumentDocumentCompanyChildFootnoteChildToolCall(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 DocumentDocumentCompanyChildFootnoteChildToolResult(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 DocumentDocumentCompanyChildFootnoteChildTraceMessage(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 + + +DocumentDocumentCompanyChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentCompanyChildFootnoteChildBlob, + DocumentDocumentCompanyChildFootnoteChildCode, + DocumentDocumentCompanyChildFootnoteChildComment, + DocumentDocumentCompanyChildFootnoteChildDivider, + DocumentDocumentCompanyChildFootnoteChildImage, + DocumentDocumentCompanyChildFootnoteChildLink, + DocumentDocumentCompanyChildFootnoteChildLineBreak, + DocumentDocumentCompanyChildFootnoteChildText, + DocumentDocumentCompanyChildFootnoteChildToolCall, + DocumentDocumentCompanyChildFootnoteChildToolResult, + DocumentDocumentCompanyChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildHeadingChildBlob(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 DocumentDocumentCompanyChildHeadingChildCode(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 DocumentDocumentCompanyChildHeadingChildComment(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 DocumentDocumentCompanyChildHeadingChildDivider(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 DocumentDocumentCompanyChildHeadingChildImage(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 DocumentDocumentCompanyChildHeadingChildLink(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 DocumentDocumentCompanyChildHeadingChildLineBreak(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 DocumentDocumentCompanyChildHeadingChildText(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 DocumentDocumentCompanyChildHeadingChildToolCall(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 DocumentDocumentCompanyChildHeadingChildToolResult(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 DocumentDocumentCompanyChildHeadingChildTraceMessage(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 + + +DocumentDocumentCompanyChildHeadingChild: TypeAlias = Union[ + DocumentDocumentCompanyChildHeadingChildBlob, + DocumentDocumentCompanyChildHeadingChildCode, + DocumentDocumentCompanyChildHeadingChildComment, + DocumentDocumentCompanyChildHeadingChildDivider, + DocumentDocumentCompanyChildHeadingChildImage, + DocumentDocumentCompanyChildHeadingChildLink, + DocumentDocumentCompanyChildHeadingChildLineBreak, + DocumentDocumentCompanyChildHeadingChildText, + DocumentDocumentCompanyChildHeadingChildToolCall, + DocumentDocumentCompanyChildHeadingChildToolResult, + DocumentDocumentCompanyChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildImage(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 DocumentDocumentCompanyChildLink(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 DocumentDocumentCompanyChildLineBreak(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 DocumentDocumentCompanyChildList(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 DocumentDocumentCompanyChildListItemChildBlob(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 DocumentDocumentCompanyChildListItemChildCode(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 DocumentDocumentCompanyChildListItemChildComment(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 DocumentDocumentCompanyChildListItemChildDivider(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 DocumentDocumentCompanyChildListItemChildImage(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 DocumentDocumentCompanyChildListItemChildLink(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 DocumentDocumentCompanyChildListItemChildLineBreak(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 DocumentDocumentCompanyChildListItemChildText(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 DocumentDocumentCompanyChildListItemChildToolCall(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 DocumentDocumentCompanyChildListItemChildToolResult(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 DocumentDocumentCompanyChildListItemChildTraceMessage(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 + + +DocumentDocumentCompanyChildListItemChild: TypeAlias = Union[ + DocumentDocumentCompanyChildListItemChildBlob, + DocumentDocumentCompanyChildListItemChildCode, + DocumentDocumentCompanyChildListItemChildComment, + DocumentDocumentCompanyChildListItemChildDivider, + DocumentDocumentCompanyChildListItemChildImage, + DocumentDocumentCompanyChildListItemChildLink, + DocumentDocumentCompanyChildListItemChildLineBreak, + DocumentDocumentCompanyChildListItemChildText, + DocumentDocumentCompanyChildListItemChildToolCall, + DocumentDocumentCompanyChildListItemChildToolResult, + DocumentDocumentCompanyChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildParagraphChildBlob(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 DocumentDocumentCompanyChildParagraphChildCode(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 DocumentDocumentCompanyChildParagraphChildComment(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 DocumentDocumentCompanyChildParagraphChildDivider(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 DocumentDocumentCompanyChildParagraphChildImage(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 DocumentDocumentCompanyChildParagraphChildLink(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 DocumentDocumentCompanyChildParagraphChildLineBreak(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 DocumentDocumentCompanyChildParagraphChildText(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 DocumentDocumentCompanyChildParagraphChildToolCall(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 DocumentDocumentCompanyChildParagraphChildToolResult(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 DocumentDocumentCompanyChildParagraphChildTraceMessage(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 + + +DocumentDocumentCompanyChildParagraphChild: TypeAlias = Union[ + DocumentDocumentCompanyChildParagraphChildBlob, + DocumentDocumentCompanyChildParagraphChildCode, + DocumentDocumentCompanyChildParagraphChildComment, + DocumentDocumentCompanyChildParagraphChildDivider, + DocumentDocumentCompanyChildParagraphChildImage, + DocumentDocumentCompanyChildParagraphChildLink, + DocumentDocumentCompanyChildParagraphChildLineBreak, + DocumentDocumentCompanyChildParagraphChildText, + DocumentDocumentCompanyChildParagraphChildToolCall, + DocumentDocumentCompanyChildParagraphChildToolResult, + DocumentDocumentCompanyChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildQuoteChildBlob(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 DocumentDocumentCompanyChildQuoteChildCode(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 DocumentDocumentCompanyChildQuoteChildComment(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 DocumentDocumentCompanyChildQuoteChildDivider(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 DocumentDocumentCompanyChildQuoteChildImage(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 DocumentDocumentCompanyChildQuoteChildLink(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 DocumentDocumentCompanyChildQuoteChildLineBreak(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 DocumentDocumentCompanyChildQuoteChildText(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 DocumentDocumentCompanyChildQuoteChildToolCall(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 DocumentDocumentCompanyChildQuoteChildToolResult(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 DocumentDocumentCompanyChildQuoteChildTraceMessage(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 + + +DocumentDocumentCompanyChildQuoteChild: TypeAlias = Union[ + DocumentDocumentCompanyChildQuoteChildBlob, + DocumentDocumentCompanyChildQuoteChildCode, + DocumentDocumentCompanyChildQuoteChildComment, + DocumentDocumentCompanyChildQuoteChildDivider, + DocumentDocumentCompanyChildQuoteChildImage, + DocumentDocumentCompanyChildQuoteChildLink, + DocumentDocumentCompanyChildQuoteChildLineBreak, + DocumentDocumentCompanyChildQuoteChildText, + DocumentDocumentCompanyChildQuoteChildToolCall, + DocumentDocumentCompanyChildQuoteChildToolResult, + DocumentDocumentCompanyChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildTable(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 DocumentDocumentCompanyChildTableCellChildBlob(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 DocumentDocumentCompanyChildTableCellChildCode(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 DocumentDocumentCompanyChildTableCellChildComment(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 DocumentDocumentCompanyChildTableCellChildDivider(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 DocumentDocumentCompanyChildTableCellChildImage(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 DocumentDocumentCompanyChildTableCellChildLink(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 DocumentDocumentCompanyChildTableCellChildLineBreak(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 DocumentDocumentCompanyChildTableCellChildText(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 DocumentDocumentCompanyChildTableCellChildToolCall(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 DocumentDocumentCompanyChildTableCellChildToolResult(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 DocumentDocumentCompanyChildTableCellChildTraceMessage(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 + + +DocumentDocumentCompanyChildTableCellChild: TypeAlias = Union[ + DocumentDocumentCompanyChildTableCellChildBlob, + DocumentDocumentCompanyChildTableCellChildCode, + DocumentDocumentCompanyChildTableCellChildComment, + DocumentDocumentCompanyChildTableCellChildDivider, + DocumentDocumentCompanyChildTableCellChildImage, + DocumentDocumentCompanyChildTableCellChildLink, + DocumentDocumentCompanyChildTableCellChildLineBreak, + DocumentDocumentCompanyChildTableCellChildText, + DocumentDocumentCompanyChildTableCellChildToolCall, + DocumentDocumentCompanyChildTableCellChildToolResult, + DocumentDocumentCompanyChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentCompanyChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildTableRow(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 DocumentDocumentCompanyChildText(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 DocumentDocumentCompanyChildToDoChildBlob(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 DocumentDocumentCompanyChildToDoChildCode(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 DocumentDocumentCompanyChildToDoChildComment(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 DocumentDocumentCompanyChildToDoChildDivider(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 DocumentDocumentCompanyChildToDoChildImage(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 DocumentDocumentCompanyChildToDoChildLink(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 DocumentDocumentCompanyChildToDoChildLineBreak(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 DocumentDocumentCompanyChildToDoChildText(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 DocumentDocumentCompanyChildToDoChildToolCall(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 DocumentDocumentCompanyChildToDoChildToolResult(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 DocumentDocumentCompanyChildToDoChildTraceMessage(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 + + +DocumentDocumentCompanyChildToDoChild: TypeAlias = Union[ + DocumentDocumentCompanyChildToDoChildBlob, + DocumentDocumentCompanyChildToDoChildCode, + DocumentDocumentCompanyChildToDoChildComment, + DocumentDocumentCompanyChildToDoChildDivider, + DocumentDocumentCompanyChildToDoChildImage, + DocumentDocumentCompanyChildToDoChildLink, + DocumentDocumentCompanyChildToDoChildLineBreak, + DocumentDocumentCompanyChildToDoChildText, + DocumentDocumentCompanyChildToDoChildToolCall, + DocumentDocumentCompanyChildToDoChildToolResult, + DocumentDocumentCompanyChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentCompanyChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentCompanyChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentCompanyChildToolCall(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 DocumentDocumentCompanyChildToolResult(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 DocumentDocumentCompanyChildTraceMessage(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 DocumentDocumentCompanyChildUtterance(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 + + +DocumentDocumentCompanyChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentCompanyChildBlob, + DocumentDocumentCompanyChildCallout, + DocumentDocumentCompanyChildChunk, + DocumentDocumentCompanyChildCode, + DocumentDocumentCompanyChildComment, + DocumentDocumentCompanyChildDivider, + DocumentDocumentCompanyChildEquation, + DocumentDocumentCompanyChildFootnote, + DocumentDocumentCompanyChildHeading, + DocumentDocumentCompanyChildImage, + DocumentDocumentCompanyChildLink, + DocumentDocumentCompanyChildLineBreak, + DocumentDocumentCompanyChildList, + DocumentDocumentCompanyChildListItem, + DocumentDocumentCompanyChildParagraph, + DocumentDocumentCompanyChildQuote, + DocumentDocumentCompanyChildTable, + DocumentDocumentCompanyChildTableCell, + DocumentDocumentCompanyChildTableRow, + DocumentDocumentCompanyChildText, + DocumentDocumentCompanyChildToDo, + DocumentDocumentCompanyChildToolCall, + DocumentDocumentCompanyChildToolResult, + DocumentDocumentCompanyChildTraceMessage, + DocumentDocumentCompanyChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentCompany(BaseModel): + """A CRM company/account record (ENG-2476/D10).""" + + id: Optional[str] = None + + address: Optional[str] = None + + children: Optional[List[DocumentDocumentCompanyChild]] = 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 DocumentDocumentDealChildBlob(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 DocumentDocumentDealChildCalloutChildBlob(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 DocumentDocumentDealChildCalloutChildCode(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 DocumentDocumentDealChildCalloutChildComment(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 DocumentDocumentDealChildCalloutChildDivider(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 DocumentDocumentDealChildCalloutChildImage(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 DocumentDocumentDealChildCalloutChildLink(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 DocumentDocumentDealChildCalloutChildLineBreak(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 DocumentDocumentDealChildCalloutChildText(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 DocumentDocumentDealChildCalloutChildToolCall(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 DocumentDocumentDealChildCalloutChildToolResult(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 DocumentDocumentDealChildCalloutChildTraceMessage(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 + + +DocumentDocumentDealChildCalloutChild: TypeAlias = Union[ + DocumentDocumentDealChildCalloutChildBlob, + DocumentDocumentDealChildCalloutChildCode, + DocumentDocumentDealChildCalloutChildComment, + DocumentDocumentDealChildCalloutChildDivider, + DocumentDocumentDealChildCalloutChildImage, + DocumentDocumentDealChildCalloutChildLink, + DocumentDocumentDealChildCalloutChildLineBreak, + DocumentDocumentDealChildCalloutChildText, + DocumentDocumentDealChildCalloutChildToolCall, + DocumentDocumentDealChildCalloutChildToolResult, + DocumentDocumentDealChildCalloutChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildCallout(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildCalloutChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildChunkChildBlob(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 DocumentDocumentDealChildChunkChildCode(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 DocumentDocumentDealChildChunkChildComment(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 DocumentDocumentDealChildChunkChildDivider(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 DocumentDocumentDealChildChunkChildImage(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 DocumentDocumentDealChildChunkChildLink(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 DocumentDocumentDealChildChunkChildLineBreak(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 DocumentDocumentDealChildChunkChildText(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 DocumentDocumentDealChildChunkChildToolCall(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 DocumentDocumentDealChildChunkChildToolResult(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 DocumentDocumentDealChildChunkChildTraceMessage(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 + + +DocumentDocumentDealChildChunkChild: TypeAlias = Union[ + DocumentDocumentDealChildChunkChildBlob, + DocumentDocumentDealChildChunkChildCode, + DocumentDocumentDealChildChunkChildComment, + DocumentDocumentDealChildChunkChildDivider, + DocumentDocumentDealChildChunkChildImage, + DocumentDocumentDealChildChunkChildLink, + DocumentDocumentDealChildChunkChildLineBreak, + DocumentDocumentDealChildChunkChildText, + DocumentDocumentDealChildChunkChildToolCall, + DocumentDocumentDealChildChunkChildToolResult, + DocumentDocumentDealChildChunkChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildChunk(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildChunkChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildCode(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 DocumentDocumentDealChildComment(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 DocumentDocumentDealChildDivider(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 DocumentDocumentDealChildEquationChildBlob(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 DocumentDocumentDealChildEquationChildCode(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 DocumentDocumentDealChildEquationChildComment(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 DocumentDocumentDealChildEquationChildDivider(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 DocumentDocumentDealChildEquationChildImage(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 DocumentDocumentDealChildEquationChildLink(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 DocumentDocumentDealChildEquationChildLineBreak(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 DocumentDocumentDealChildEquationChildText(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 DocumentDocumentDealChildEquationChildToolCall(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 DocumentDocumentDealChildEquationChildToolResult(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 DocumentDocumentDealChildEquationChildTraceMessage(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 + + +DocumentDocumentDealChildEquationChild: TypeAlias = Union[ + DocumentDocumentDealChildEquationChildBlob, + DocumentDocumentDealChildEquationChildCode, + DocumentDocumentDealChildEquationChildComment, + DocumentDocumentDealChildEquationChildDivider, + DocumentDocumentDealChildEquationChildImage, + DocumentDocumentDealChildEquationChildLink, + DocumentDocumentDealChildEquationChildLineBreak, + DocumentDocumentDealChildEquationChildText, + DocumentDocumentDealChildEquationChildToolCall, + DocumentDocumentDealChildEquationChildToolResult, + DocumentDocumentDealChildEquationChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildEquation(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildEquationChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildFootnoteChildBlob(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 DocumentDocumentDealChildFootnoteChildCode(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 DocumentDocumentDealChildFootnoteChildComment(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 DocumentDocumentDealChildFootnoteChildDivider(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 DocumentDocumentDealChildFootnoteChildImage(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 DocumentDocumentDealChildFootnoteChildLink(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 DocumentDocumentDealChildFootnoteChildLineBreak(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 DocumentDocumentDealChildFootnoteChildText(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 DocumentDocumentDealChildFootnoteChildToolCall(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 DocumentDocumentDealChildFootnoteChildToolResult(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 DocumentDocumentDealChildFootnoteChildTraceMessage(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 + + +DocumentDocumentDealChildFootnoteChild: TypeAlias = Union[ + DocumentDocumentDealChildFootnoteChildBlob, + DocumentDocumentDealChildFootnoteChildCode, + DocumentDocumentDealChildFootnoteChildComment, + DocumentDocumentDealChildFootnoteChildDivider, + DocumentDocumentDealChildFootnoteChildImage, + DocumentDocumentDealChildFootnoteChildLink, + DocumentDocumentDealChildFootnoteChildLineBreak, + DocumentDocumentDealChildFootnoteChildText, + DocumentDocumentDealChildFootnoteChildToolCall, + DocumentDocumentDealChildFootnoteChildToolResult, + DocumentDocumentDealChildFootnoteChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildFootnote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildFootnoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildHeadingChildBlob(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 DocumentDocumentDealChildHeadingChildCode(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 DocumentDocumentDealChildHeadingChildComment(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 DocumentDocumentDealChildHeadingChildDivider(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 DocumentDocumentDealChildHeadingChildImage(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 DocumentDocumentDealChildHeadingChildLink(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 DocumentDocumentDealChildHeadingChildLineBreak(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 DocumentDocumentDealChildHeadingChildText(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 DocumentDocumentDealChildHeadingChildToolCall(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 DocumentDocumentDealChildHeadingChildToolResult(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 DocumentDocumentDealChildHeadingChildTraceMessage(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 + + +DocumentDocumentDealChildHeadingChild: TypeAlias = Union[ + DocumentDocumentDealChildHeadingChildBlob, + DocumentDocumentDealChildHeadingChildCode, + DocumentDocumentDealChildHeadingChildComment, + DocumentDocumentDealChildHeadingChildDivider, + DocumentDocumentDealChildHeadingChildImage, + DocumentDocumentDealChildHeadingChildLink, + DocumentDocumentDealChildHeadingChildLineBreak, + DocumentDocumentDealChildHeadingChildText, + DocumentDocumentDealChildHeadingChildToolCall, + DocumentDocumentDealChildHeadingChildToolResult, + DocumentDocumentDealChildHeadingChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildHeading(BaseModel): + level: int + + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildHeadingChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildImage(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 DocumentDocumentDealChildLink(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 DocumentDocumentDealChildLineBreak(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 DocumentDocumentDealChildList(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 DocumentDocumentDealChildListItemChildBlob(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 DocumentDocumentDealChildListItemChildCode(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 DocumentDocumentDealChildListItemChildComment(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 DocumentDocumentDealChildListItemChildDivider(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 DocumentDocumentDealChildListItemChildImage(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 DocumentDocumentDealChildListItemChildLink(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 DocumentDocumentDealChildListItemChildLineBreak(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 DocumentDocumentDealChildListItemChildText(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 DocumentDocumentDealChildListItemChildToolCall(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 DocumentDocumentDealChildListItemChildToolResult(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 DocumentDocumentDealChildListItemChildTraceMessage(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 + + +DocumentDocumentDealChildListItemChild: TypeAlias = Union[ + DocumentDocumentDealChildListItemChildBlob, + DocumentDocumentDealChildListItemChildCode, + DocumentDocumentDealChildListItemChildComment, + DocumentDocumentDealChildListItemChildDivider, + DocumentDocumentDealChildListItemChildImage, + DocumentDocumentDealChildListItemChildLink, + DocumentDocumentDealChildListItemChildLineBreak, + DocumentDocumentDealChildListItemChildText, + DocumentDocumentDealChildListItemChildToolCall, + DocumentDocumentDealChildListItemChildToolResult, + DocumentDocumentDealChildListItemChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildListItem(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildListItemChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildParagraphChildBlob(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 DocumentDocumentDealChildParagraphChildCode(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 DocumentDocumentDealChildParagraphChildComment(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 DocumentDocumentDealChildParagraphChildDivider(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 DocumentDocumentDealChildParagraphChildImage(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 DocumentDocumentDealChildParagraphChildLink(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 DocumentDocumentDealChildParagraphChildLineBreak(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 DocumentDocumentDealChildParagraphChildText(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 DocumentDocumentDealChildParagraphChildToolCall(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 DocumentDocumentDealChildParagraphChildToolResult(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 DocumentDocumentDealChildParagraphChildTraceMessage(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 + + +DocumentDocumentDealChildParagraphChild: TypeAlias = Union[ + DocumentDocumentDealChildParagraphChildBlob, + DocumentDocumentDealChildParagraphChildCode, + DocumentDocumentDealChildParagraphChildComment, + DocumentDocumentDealChildParagraphChildDivider, + DocumentDocumentDealChildParagraphChildImage, + DocumentDocumentDealChildParagraphChildLink, + DocumentDocumentDealChildParagraphChildLineBreak, + DocumentDocumentDealChildParagraphChildText, + DocumentDocumentDealChildParagraphChildToolCall, + DocumentDocumentDealChildParagraphChildToolResult, + DocumentDocumentDealChildParagraphChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildParagraph(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildParagraphChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildQuoteChildBlob(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 DocumentDocumentDealChildQuoteChildCode(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 DocumentDocumentDealChildQuoteChildComment(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 DocumentDocumentDealChildQuoteChildDivider(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 DocumentDocumentDealChildQuoteChildImage(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 DocumentDocumentDealChildQuoteChildLink(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 DocumentDocumentDealChildQuoteChildLineBreak(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 DocumentDocumentDealChildQuoteChildText(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 DocumentDocumentDealChildQuoteChildToolCall(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 DocumentDocumentDealChildQuoteChildToolResult(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 DocumentDocumentDealChildQuoteChildTraceMessage(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 + + +DocumentDocumentDealChildQuoteChild: TypeAlias = Union[ + DocumentDocumentDealChildQuoteChildBlob, + DocumentDocumentDealChildQuoteChildCode, + DocumentDocumentDealChildQuoteChildComment, + DocumentDocumentDealChildQuoteChildDivider, + DocumentDocumentDealChildQuoteChildImage, + DocumentDocumentDealChildQuoteChildLink, + DocumentDocumentDealChildQuoteChildLineBreak, + DocumentDocumentDealChildQuoteChildText, + DocumentDocumentDealChildQuoteChildToolCall, + DocumentDocumentDealChildQuoteChildToolResult, + DocumentDocumentDealChildQuoteChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildQuote(BaseModel): + id: Optional[str] = None + + children: Optional[List[DocumentDocumentDealChildQuoteChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildTable(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 DocumentDocumentDealChildTableCellChildBlob(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 DocumentDocumentDealChildTableCellChildCode(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 DocumentDocumentDealChildTableCellChildComment(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 DocumentDocumentDealChildTableCellChildDivider(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 DocumentDocumentDealChildTableCellChildImage(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 DocumentDocumentDealChildTableCellChildLink(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 DocumentDocumentDealChildTableCellChildLineBreak(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 DocumentDocumentDealChildTableCellChildText(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 DocumentDocumentDealChildTableCellChildToolCall(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 DocumentDocumentDealChildTableCellChildToolResult(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 DocumentDocumentDealChildTableCellChildTraceMessage(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 + + +DocumentDocumentDealChildTableCellChild: TypeAlias = Union[ + DocumentDocumentDealChildTableCellChildBlob, + DocumentDocumentDealChildTableCellChildCode, + DocumentDocumentDealChildTableCellChildComment, + DocumentDocumentDealChildTableCellChildDivider, + DocumentDocumentDealChildTableCellChildImage, + DocumentDocumentDealChildTableCellChildLink, + DocumentDocumentDealChildTableCellChildLineBreak, + DocumentDocumentDealChildTableCellChildText, + DocumentDocumentDealChildTableCellChildToolCall, + DocumentDocumentDealChildTableCellChildToolResult, + DocumentDocumentDealChildTableCellChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildTableCell(BaseModel): + id: Optional[str] = None + + align: Optional[Literal["left", "center", "right"]] = None + + children: Optional[List[DocumentDocumentDealChildTableCellChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildTableRow(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 DocumentDocumentDealChildText(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 DocumentDocumentDealChildToDoChildBlob(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 DocumentDocumentDealChildToDoChildCode(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 DocumentDocumentDealChildToDoChildComment(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 DocumentDocumentDealChildToDoChildDivider(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 DocumentDocumentDealChildToDoChildImage(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 DocumentDocumentDealChildToDoChildLink(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 DocumentDocumentDealChildToDoChildLineBreak(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 DocumentDocumentDealChildToDoChildText(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 DocumentDocumentDealChildToDoChildToolCall(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 DocumentDocumentDealChildToDoChildToolResult(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 DocumentDocumentDealChildToDoChildTraceMessage(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 + + +DocumentDocumentDealChildToDoChild: TypeAlias = Union[ + DocumentDocumentDealChildToDoChildBlob, + DocumentDocumentDealChildToDoChildCode, + DocumentDocumentDealChildToDoChildComment, + DocumentDocumentDealChildToDoChildDivider, + DocumentDocumentDealChildToDoChildImage, + DocumentDocumentDealChildToDoChildLink, + DocumentDocumentDealChildToDoChildLineBreak, + DocumentDocumentDealChildToDoChildText, + DocumentDocumentDealChildToDoChildToolCall, + DocumentDocumentDealChildToDoChildToolResult, + DocumentDocumentDealChildToDoChildTraceMessage, + object, +] + + +class DocumentDocumentDealChildToDo(BaseModel): + id: Optional[str] = None + + checked: Optional[bool] = None + + children: Optional[List[DocumentDocumentDealChildToDoChild]] = None + + metadata: Optional[Metadata] = None + """Per-block annotations carried by any Hyperdoc node (ENG-1390). + + Out-of-band annotations that travel with a block but aren't part of its content: + provenance (`sources`) and human edit attribution (`edited_by`). New annotation + types get added here as typed fields as the need arises. + + Empty by default. Because `Node.model_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 DocumentDocumentDealChildToolCall(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 DocumentDocumentDealChildToolResult(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 DocumentDocumentDealChildTraceMessage(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 DocumentDocumentDealChildUtterance(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 + + +DocumentDocumentDealChild: TypeAlias = Annotated[ + Union[ + DocumentDocumentDealChildBlob, + DocumentDocumentDealChildCallout, + DocumentDocumentDealChildChunk, + DocumentDocumentDealChildCode, + DocumentDocumentDealChildComment, + DocumentDocumentDealChildDivider, + DocumentDocumentDealChildEquation, + DocumentDocumentDealChildFootnote, + DocumentDocumentDealChildHeading, + DocumentDocumentDealChildImage, + DocumentDocumentDealChildLink, + DocumentDocumentDealChildLineBreak, + DocumentDocumentDealChildList, + DocumentDocumentDealChildListItem, + DocumentDocumentDealChildParagraph, + DocumentDocumentDealChildQuote, + DocumentDocumentDealChildTable, + DocumentDocumentDealChildTableCell, + DocumentDocumentDealChildTableRow, + DocumentDocumentDealChildText, + DocumentDocumentDealChildToDo, + DocumentDocumentDealChildToolCall, + DocumentDocumentDealChildToolResult, + DocumentDocumentDealChildTraceMessage, + DocumentDocumentDealChildUtterance, + ], + PropertyInfo(discriminator="type"), +] + + +class DocumentDocumentDeal(BaseModel): + """A CRM deal/opportunity record (ENG-2476/D10).""" + + id: Optional[str] = None + + amount: Optional[float] = None + + children: Optional[List[DocumentDocumentDealChild]] = 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 + + +DocumentDocument: TypeAlias = Annotated[ + Union[ + DocumentDocumentDocument, + DocumentDocumentWebsite, + DocumentDocumentTask, + DocumentDocumentPerson, + DocumentDocumentMessage, + DocumentDocumentEvent, + DocumentDocumentFile, + DocumentDocumentConversation, + DocumentDocumentTrace, + DocumentDocumentTranscript, + DocumentDocumentCompany, + DocumentDocumentDeal, + ], + PropertyInfo(discriminator="type"), +] + + +class Document(BaseModel): + """ + A `DocumentResponse` plus the query-path fields a `ScoredDocument` carries + (ENG-2479): relevance score, matched highlights, and the concatenated + summary of those highlights. + """ + + document: DocumentDocument + """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).""" + + highlights: Optional[List[object]] = None + """The matched chunks that made this document a hit, with per-chunk scores.""" + + 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.""" + + score: Optional[float] = None + """Relevance of the document to the query.""" + + status: Optional[Literal["pending", "processing", "completed", "failed", "pending_review", "skipped"]] = None + """Indexing status of the document.""" + + summary: Optional[str] = None + """Concatenated text of the matched highlights.""" + + title: Optional[str] = None + """Human-readable document title.""" + + +class ProvenanceEntity(BaseModel): + """A canonical entity referenced by the answer's source documents.""" + + id: str + + name: str + + type: str + + +class ProvenanceSource(BaseModel): + """A source document that informed the final answer (the post-rank result set).""" + + 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", + ] + + score: Optional[float] = None + + title: Optional[str] = None + + +class ProvenanceStep(BaseModel): + """One tool invocation in the agent's search trajectory (audit trail).""" + + iteration: int + + status: str + + tool: str + + query: Optional[str] = None + + result_count: Optional[int] = None + + source: Optional[str] = None + + +class Provenance(BaseModel): + """Auditability record attached to an agentic answer. + + Gated behind ``provenance=true`` on the request: the cheap parts (sources, + steps, failed_sources) are derived from in-memory loop state, but ``entities`` + costs one indexed DB lookup, so the whole record is only built on request. + """ + + entities: Optional[List[ProvenanceEntity]] = None + + failed_sources: Optional[List[str]] = None + + sources: Optional[List[ProvenanceSource]] = None + + steps: Optional[List[ProvenanceStep]] = None + + +class QueryResult(BaseModel): answer: Optional[str] = None """The answer to the query, if the request was set to answer.""" + documents: Optional[List[Document]] = None + """ + The matching documents, each carrying its hyperdoc tree plus query-path + score/highlights/summary (ENG-2479 Phase 4). + """ + errors: Optional[List[Dict[str, str]]] = None """Errors that occurred during the query. @@ -21,6 +38759,17 @@ class QueryResult(BaseModel): shown to the user. """ + provenance: Optional[Provenance] = None + """Auditability record attached to an agentic answer. + + Gated behind `provenance=true` on the request: the cheap parts (sources, steps, + failed_sources) are derived from in-memory loop state, but `entities` costs one + indexed DB lookup, so the whole record is only built on request. + """ + + query: Optional[str] = None + """The query string that was issued.""" + query_id: Optional[str] = None """The ID of the query. diff --git a/src/hyperspell/types/shared/resource.py b/src/hyperspell/types/shared/resource.py deleted file mode 100644 index ccc16b91..00000000 --- a/src/hyperspell/types/shared/resource.py +++ /dev/null @@ -1,43 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .metadata import Metadata -from ..._models import BaseModel - -__all__ = ["Resource"] - - -class Resource(BaseModel): - 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", - ] - - folder_id: Optional[str] = None - """Provider folder ID this resource belongs to""" - - metadata: Optional[Metadata] = None - - parent_folder_id: Optional[str] = None - """Parent folder ID for policy inheritance""" - - score: Optional[float] = None - """The relevance of the resource to the query""" - - title: Optional[str] = None diff --git a/tests/api_resources/test_evaluate.py b/tests/api_resources/test_evaluate.py index c8ab9f33..6a5cc524 100644 --- a/tests/api_resources/test_evaluate.py +++ b/tests/api_resources/test_evaluate.py @@ -11,8 +11,10 @@ from tests.utils import assert_matches_type from hyperspell.types import ( EvaluateScoreQueryResponse, + EvaluateListQueriesResponse, EvaluateScoreHighlightResponse, ) +from hyperspell.pagination import SyncCursorPage, AsyncCursorPage from hyperspell.types.shared import QueryResult base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -59,6 +61,40 @@ def test_path_params_get_query(self, client: Hyperspell) -> None: "", ) + @parametrize + def test_method_list_queries(self, client: Hyperspell) -> None: + evaluate = client.evaluate.list_queries() + assert_matches_type(SyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + def test_method_list_queries_with_all_params(self, client: Hyperspell) -> None: + evaluate = client.evaluate.list_queries( + cursor="cursor", + size=0, + user_id="user_id", + ) + assert_matches_type(SyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + def test_raw_response_list_queries(self, client: Hyperspell) -> None: + response = client.evaluate.with_raw_response.list_queries() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + evaluate = response.parse() + assert_matches_type(SyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + def test_streaming_response_list_queries(self, client: Hyperspell) -> None: + with client.evaluate.with_streaming_response.list_queries() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + evaluate = response.parse() + assert_matches_type(SyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_score_highlight(self, client: Hyperspell) -> None: evaluate = client.evaluate.score_highlight( @@ -196,6 +232,40 @@ async def test_path_params_get_query(self, async_client: AsyncHyperspell) -> Non "", ) + @parametrize + async def test_method_list_queries(self, async_client: AsyncHyperspell) -> None: + evaluate = await async_client.evaluate.list_queries() + assert_matches_type(AsyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + async def test_method_list_queries_with_all_params(self, async_client: AsyncHyperspell) -> None: + evaluate = await async_client.evaluate.list_queries( + cursor="cursor", + size=0, + user_id="user_id", + ) + assert_matches_type(AsyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + async def test_raw_response_list_queries(self, async_client: AsyncHyperspell) -> None: + response = await async_client.evaluate.with_raw_response.list_queries() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + evaluate = await response.parse() + assert_matches_type(AsyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + @parametrize + async def test_streaming_response_list_queries(self, async_client: AsyncHyperspell) -> None: + async with async_client.evaluate.with_streaming_response.list_queries() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + evaluate = await response.parse() + assert_matches_type(AsyncCursorPage[EvaluateListQueriesResponse], evaluate, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_score_highlight(self, async_client: AsyncHyperspell) -> None: evaluate = await async_client.evaluate.score_highlight( diff --git a/tests/api_resources/test_memories.py b/tests/api_resources/test_memories.py index 2a983b3f..913474ba 100644 --- a/tests/api_resources/test_memories.py +++ b/tests/api_resources/test_memories.py @@ -10,15 +10,16 @@ from hyperspell import Hyperspell, AsyncHyperspell from tests.utils import assert_matches_type from hyperspell.types import ( - Memory, MemoryStatus, + MemoryGetResponse, + MemoryListResponse, MemoryDeleteResponse, MemoryStatusResponse, MemoryAddBulkResponse, ) from hyperspell._utils import parse_datetime from hyperspell.pagination import SyncCursorPage, AsyncCursorPage -from hyperspell.types.shared import Resource, QueryResult +from hyperspell.types.shared import QueryResult base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -40,6 +41,7 @@ def test_method_update_with_all_params(self, client: Hyperspell) -> None: resource_id="resource_id", source="reddit", collection="string", + date=parse_datetime("2019-12-27T18:11:19.117Z"), metadata={"foo": "string"}, text="string", title="string", @@ -83,7 +85,7 @@ def test_path_params_update(self, client: Hyperspell) -> None: @parametrize def test_method_list(self, client: Hyperspell) -> None: memory = client.memories.list() - assert_matches_type(SyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(SyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Hyperspell) -> None: @@ -95,7 +97,7 @@ def test_method_list_with_all_params(self, client: Hyperspell) -> None: source="reddit", status="pending", ) - assert_matches_type(SyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(SyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize def test_raw_response_list(self, client: Hyperspell) -> None: @@ -104,7 +106,7 @@ def test_raw_response_list(self, client: Hyperspell) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = response.parse() - assert_matches_type(SyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(SyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize def test_streaming_response_list(self, client: Hyperspell) -> None: @@ -113,7 +115,7 @@ def test_streaming_response_list(self, client: Hyperspell) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = response.parse() - assert_matches_type(SyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(SyncCursorPage[MemoryListResponse], memory, path=["response"]) assert cast(Any, response.is_closed) is True @@ -243,7 +245,7 @@ def test_method_get(self, client: Hyperspell) -> None: resource_id="resource_id", source="reddit", ) - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) @parametrize def test_raw_response_get(self, client: Hyperspell) -> None: @@ -255,7 +257,7 @@ def test_raw_response_get(self, client: Hyperspell) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = response.parse() - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) @parametrize def test_streaming_response_get(self, client: Hyperspell) -> None: @@ -267,7 +269,7 @@ def test_streaming_response_get(self, client: Hyperspell) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = response.parse() - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) assert cast(Any, response.is_closed) is True @@ -291,7 +293,7 @@ def test_method_search_with_all_params(self, client: Hyperspell) -> None: memory = client.memories.search( query="What does Hyperspell do?", answer=True, - effort=0, + effort="minimal", max_results=0, options={ "after": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -314,6 +316,7 @@ def test_method_search_with_all_params(self, client: Hyperspell) -> None: "notion_page_ids": ["string"], "weight": 0, }, + "recency_half_life_days": 1, "reddit": { "period": "hour", "sort": "relevance", @@ -336,6 +339,7 @@ def test_method_search_with_all_params(self, client: Hyperspell) -> None: "weight": 0, }, }, + provenance=True, sources=["vault"], ) assert_matches_type(QueryResult, memory, path=["response"]) @@ -449,6 +453,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHyperspell resource_id="resource_id", source="reddit", collection="string", + date=parse_datetime("2019-12-27T18:11:19.117Z"), metadata={"foo": "string"}, text="string", title="string", @@ -492,7 +497,7 @@ async def test_path_params_update(self, async_client: AsyncHyperspell) -> None: @parametrize async def test_method_list(self, async_client: AsyncHyperspell) -> None: memory = await async_client.memories.list() - assert_matches_type(AsyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(AsyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHyperspell) -> None: @@ -504,7 +509,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHyperspell) source="reddit", status="pending", ) - assert_matches_type(AsyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(AsyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncHyperspell) -> None: @@ -513,7 +518,7 @@ async def test_raw_response_list(self, async_client: AsyncHyperspell) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = await response.parse() - assert_matches_type(AsyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(AsyncCursorPage[MemoryListResponse], memory, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncHyperspell) -> None: @@ -522,7 +527,7 @@ async def test_streaming_response_list(self, async_client: AsyncHyperspell) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = await response.parse() - assert_matches_type(AsyncCursorPage[Resource], memory, path=["response"]) + assert_matches_type(AsyncCursorPage[MemoryListResponse], memory, path=["response"]) assert cast(Any, response.is_closed) is True @@ -652,7 +657,7 @@ async def test_method_get(self, async_client: AsyncHyperspell) -> None: resource_id="resource_id", source="reddit", ) - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncHyperspell) -> None: @@ -664,7 +669,7 @@ async def test_raw_response_get(self, async_client: AsyncHyperspell) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = await response.parse() - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncHyperspell) -> None: @@ -676,7 +681,7 @@ async def test_streaming_response_get(self, async_client: AsyncHyperspell) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" memory = await response.parse() - assert_matches_type(Memory, memory, path=["response"]) + assert_matches_type(MemoryGetResponse, memory, path=["response"]) assert cast(Any, response.is_closed) is True @@ -700,7 +705,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncHyperspell memory = await async_client.memories.search( query="What does Hyperspell do?", answer=True, - effort=0, + effort="minimal", max_results=0, options={ "after": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -723,6 +728,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncHyperspell "notion_page_ids": ["string"], "weight": 0, }, + "recency_half_life_days": 1, "reddit": { "period": "hour", "sort": "relevance", @@ -745,6 +751,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncHyperspell "weight": 0, }, }, + provenance=True, sources=["vault"], ) assert_matches_type(QueryResult, memory, path=["response"]) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py deleted file mode 100644 index 93ca9c04..00000000 --- a/tests/test_deepcopy.py +++ /dev/null @@ -1,58 +0,0 @@ -from hyperspell._utils import deepcopy_minimal - - -def assert_different_identities(obj1: object, obj2: object) -> None: - assert obj1 == obj2 - assert id(obj1) != id(obj2) - - -def test_simple_dict() -> None: - obj1 = {"foo": "bar"} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - - -def test_nested_dict() -> None: - obj1 = {"foo": {"bar": True}} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1["foo"], obj2["foo"]) - - -def test_complex_nested_dict() -> None: - obj1 = {"foo": {"bar": [{"hello": "world"}]}} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1["foo"], obj2["foo"]) - assert_different_identities(obj1["foo"]["bar"], obj2["foo"]["bar"]) - assert_different_identities(obj1["foo"]["bar"][0], obj2["foo"]["bar"][0]) - - -def test_simple_list() -> None: - obj1 = ["a", "b", "c"] - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - - -def test_nested_list() -> None: - obj1 = ["a", [1, 2, 3]] - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert_different_identities(obj1[1], obj2[1]) - - -class MyObject: ... - - -def test_ignores_other_types() -> None: - # custom classes - my_obj = MyObject() - obj1 = {"foo": my_obj} - obj2 = deepcopy_minimal(obj1) - assert_different_identities(obj1, obj2) - assert obj1["foo"] is my_obj - - # tuples - obj3 = ("a", "b") - obj4 = deepcopy_minimal(obj3) - assert obj3 is obj4 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index da9fb3d5..e17802c5 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,7 +4,7 @@ import pytest -from hyperspell._types import FileTypes +from hyperspell._types import FileTypes, ArrayFormat from hyperspell._utils import extract_files @@ -37,10 +37,7 @@ def test_multiple_files() -> None: def test_top_level_file_array() -> None: query = {"files": [b"file one", b"file two"], "title": "hello"} - assert extract_files(query, paths=[["files", ""]]) == [ - ("files[]", b"file one"), - ("files[]", b"file two"), - ] + assert extract_files(query, paths=[["files", ""]]) == [("files[]", b"file one"), ("files[]", b"file two")] assert query == {"title": "hello"} @@ -71,3 +68,24 @@ def test_ignores_incorrect_paths( expected: list[tuple[str, FileTypes]], ) -> None: assert extract_files(query, paths=paths) == expected + + +@pytest.mark.parametrize( + "array_format,expected_top_level,expected_nested", + [ + ("brackets", [("files[]", b"a"), ("files[]", b"b")], [("items[][file]", b"a"), ("items[][file]", b"b")]), + ("repeat", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("comma", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("indices", [("files[0]", b"a"), ("files[1]", b"b")], [("items[0][file]", b"a"), ("items[1][file]", b"b")]), + ], +) +def test_array_format_controls_file_field_names( + array_format: ArrayFormat, + expected_top_level: list[tuple[str, FileTypes]], + expected_nested: list[tuple[str, FileTypes]], +) -> None: + top_level = {"files": [b"a", b"b"]} + assert extract_files(top_level, paths=[["files", ""]], array_format=array_format) == expected_top_level + + nested = {"items": [{"file": b"a"}, {"file": b"b"}]} + assert extract_files(nested, paths=[["items", "", "file"]], array_format=array_format) == expected_nested diff --git a/tests/test_files.py b/tests/test_files.py index aae00cb3..aded237c 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,8 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from hyperspell._files import to_httpx_files, async_to_httpx_files +from hyperspell._files import to_httpx_files, deepcopy_with_paths, async_to_httpx_files +from hyperspell._utils import extract_files readme_path = Path(__file__).parent.parent.joinpath("README.md") @@ -49,3 +50,99 @@ def test_string_not_allowed() -> None: "file": "foo", # type: ignore } ) + + +def assert_different_identities(obj1: object, obj2: object) -> None: + assert obj1 == obj2 + assert obj1 is not obj2 + + +class TestDeepcopyWithPaths: + def test_copies_top_level_dict(self) -> None: + original = {"file": b"data", "other": "value"} + result = deepcopy_with_paths(original, [["file"]]) + assert_different_identities(result, original) + + def test_file_value_is_same_reference(self) -> None: + file_bytes = b"contents" + original = {"file": file_bytes} + result = deepcopy_with_paths(original, [["file"]]) + assert_different_identities(result, original) + assert result["file"] is file_bytes + + def test_list_popped_wholesale(self) -> None: + files = [b"f1", b"f2"] + original = {"files": files, "title": "t"} + result = deepcopy_with_paths(original, [["files", ""]]) + assert_different_identities(result, original) + result_files = result["files"] + assert isinstance(result_files, list) + assert_different_identities(result_files, files) + + def test_nested_array_path_copies_list_and_elements(self) -> None: + elem1 = {"file": b"f1", "extra": 1} + elem2 = {"file": b"f2", "extra": 2} + original = {"items": [elem1, elem2]} + result = deepcopy_with_paths(original, [["items", "", "file"]]) + assert_different_identities(result, original) + result_items = result["items"] + assert isinstance(result_items, list) + assert_different_identities(result_items, original["items"]) + assert_different_identities(result_items[0], elem1) + assert_different_identities(result_items[1], elem2) + + def test_empty_paths_returns_same_object(self) -> None: + original = {"foo": "bar"} + result = deepcopy_with_paths(original, []) + assert result is original + + def test_multiple_paths(self) -> None: + f1 = b"file1" + f2 = b"file2" + original = {"a": f1, "b": f2, "c": "unchanged"} + result = deepcopy_with_paths(original, [["a"], ["b"]]) + assert_different_identities(result, original) + assert result["a"] is f1 + assert result["b"] is f2 + assert result["c"] is original["c"] + + def test_extract_files_does_not_mutate_original_top_level(self) -> None: + file_bytes = b"contents" + original = {"file": file_bytes, "other": "value"} + + copied = deepcopy_with_paths(original, [["file"]]) + extracted = extract_files(copied, paths=[["file"]]) + + assert extracted == [("file", file_bytes)] + assert original == {"file": file_bytes, "other": "value"} + assert copied == {"other": "value"} + + def test_extract_files_does_not_mutate_original_nested_array_path(self) -> None: + file1 = b"f1" + file2 = b"f2" + original = { + "items": [ + {"file": file1, "extra": 1}, + {"file": file2, "extra": 2}, + ], + "title": "example", + } + + copied = deepcopy_with_paths(original, [["items", "", "file"]]) + extracted = extract_files(copied, paths=[["items", "", "file"]]) + + assert [entry for _, entry in extracted] == [file1, file2] + assert original == { + "items": [ + {"file": file1, "extra": 1}, + {"file": file2, "extra": 2}, + ], + "title": "example", + } + assert copied == { + "items": [ + {"extra": 1}, + {"extra": 2}, + ], + "title": "example", + } diff --git a/tests/test_models.py b/tests/test_models.py index 88942a41..84a13569 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,7 +1,8 @@ import json -from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Iterable, Optional, cast from datetime import datetime, timezone -from typing_extensions import Literal, Annotated, TypeAliasType +from collections import deque +from typing_extensions import Literal, Annotated, TypedDict, TypeAliasType import pytest import pydantic @@ -9,7 +10,7 @@ from hyperspell._utils import PropertyInfo from hyperspell._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from hyperspell._models import DISCRIMINATOR_CACHE, BaseModel, construct_type +from hyperspell._models import DISCRIMINATOR_CACHE, BaseModel, EagerIterable, construct_type class BasicModel(BaseModel): @@ -961,3 +962,56 @@ def __getattr__(self, attr: str) -> Item: ... assert model.a.prop == 1 assert isinstance(model.a, Item) assert model.other == "foo" + + +# NOTE: Workaround for Pydantic Iterable behavior. +# Iterable fields are replaced with a ValidatorIterator and may be consumed +# during serialization, which can cause subsequent dumps to return empty data. +# See: https://github.com/pydantic/pydantic/issues/9541 +@pytest.mark.parametrize( + "data, expected_validated", + [ + ([1, 2, 3], [1, 2, 3]), + ((1, 2, 3), (1, 2, 3)), + (set([1, 2, 3]), set([1, 2, 3])), + (iter([1, 2, 3]), [1, 2, 3]), + ([], []), + ((x for x in [1, 2, 3]), [1, 2, 3]), + (map(lambda x: x, [1, 2, 3]), [1, 2, 3]), + (frozenset([1, 2, 3]), frozenset([1, 2, 3])), + (deque([1, 2, 3]), deque([1, 2, 3])), + ], + ids=["list", "tuple", "set", "iterator", "empty", "generator", "map", "frozenset", "deque"], +) +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2") +def test_iterable_construction(data: Iterable[int], expected_validated: Iterable[int]) -> None: + class TypeWithIterable(TypedDict): + items: EagerIterable[int] + + class Model(BaseModel): + data: TypeWithIterable + + m = Model.model_validate({"data": {"items": data}}) + assert m.data["items"] == expected_validated + + # Verify repeated dumps don't lose data (the original bug) + assert m.model_dump()["data"]["items"] == list(expected_validated) + assert m.model_dump()["data"]["items"] == list(expected_validated) + + +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2") +def test_iterable_construction_str_falls_back_to_list() -> None: + # str is iterable (over chars), but str(list_of_chars) produces the list's repr + # rather than reconstructing a string from items. We special-case str to fall + # back to list instead of attempting reconstruction. + class TypeWithIterable(TypedDict): + items: EagerIterable[str] + + class Model(BaseModel): + data: TypeWithIterable + + m = Model.model_validate({"data": {"items": "hello"}}) + + # falls back to list of chars rather than calling str(["h", "e", "l", "l", "o"]) + assert m.data["items"] == ["h", "e", "l", "l", "o"] + assert m.model_dump()["data"]["items"] == ["h", "e", "l", "l", "o"]