Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Resolve two explicit anchors into a contiguous document range. Returns a transparent SelectionTarget, a mutation-ready ref, and preview metadata. Stateless and deterministic.- Operation ID:
ranges.resolve - API member path:
editor.doc.ranges.resolve(...) - Mutates document:
no - Idempotency:
idempotent - Supports tracked mode:
no - Supports dry run:
no - Deterministic target resolution:
yes
Expected result
Returns a ResolveRangeOutput with evaluatedRevision, handle.ref, target (SelectionTarget), and preview metadata.Input fields
| Field | Type | Required | Description | ||
|---|---|---|---|---|---|
end | object(kind=“document”) \ | object(kind=“point”) \ | object(kind=“ref”) | yes | One of: object(kind=“document”), object(kind=“point”), object(kind=“ref”) |
expectedRevision | string | no | |||
start | object(kind=“document”) \ | object(kind=“point”) \ | object(kind=“ref”) | yes | One of: object(kind=“document”), object(kind=“point”), object(kind=“ref”) |
Example request
Output fields
| Field | Type | Required | Description | |
|---|---|---|---|---|
evaluatedRevision | string | yes | ||
handle | object(refStability=“ephemeral”) | yes | ||
handle.coversFullTarget | boolean | yes | ||
handle.ref | string \ | null | yes | One of: string, null |
handle.refStability | "ephemeral" | yes | Constant: "ephemeral" | |
preview | object | yes | ||
preview.blocks | object[] | yes | ||
preview.text | string | yes | ||
preview.truncated | boolean | yes | ||
target | SelectionTarget | yes | SelectionTarget | |
target.end | SelectionPoint | yes | SelectionPoint | |
target.kind | "selection" | yes | Constant: "selection" | |
target.start | SelectionPoint | yes | SelectionPoint |
Example response
Pre-apply throws
INVALID_INPUTINVALID_TARGETTARGET_NOT_FOUNDINVALID_CONTEXTREVISION_MISMATCH
Non-applied failure codes
- None
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema

