import { type AstDocument, type AstMap, type AstNode, type CelSegment, type Position } from "@telorun/analyzer"; /** The cursor's resolved position against the read-only AST. `locate` produces * this; `detect-context` maps it onto a `CompletionCtx`. Structure comes from * the AST; the cursor *column* is used only to resolve empty-space (blank / * trailing-indent) key positions, where indentation is the sole signal for * "which container am I typing into". */ export interface ResolvedCursor { docIndex: number; /** The cursor as a document offset. Carried so a consumer hit-testing inside a * node (a CEL chain, the halves of an `Alias.Name` value) reuses the one this * resolution was performed with, rather than recomputing the line table and * risking a different answer. */ offset: number; /** Top-level `kind:` value of the cursor's document, when present. */ docKind?: string; slot: "key" | "value"; /** Value slot: ancestor keys + the field key (last element is the field). * Key slot: the container map's ancestor key chain. */ path: string[]; node?: AstNode; container?: AstMap; replaceRange?: { start: Position; end: Position; }; /** Value slot: text from the value start up to the cursor. */ prefix?: string; /** Value slot: true when whitespace separates the key's colon from the value * (distinguishes `Console: ` — a value — from `Tiny:` — a bare header). */ spaceAfterColon?: boolean; /** Value slot: the value of a sibling `kind:` in the same map (object-form * ref name completion). */ siblingKind?: string; /** Key slot: keys already present in the container (the key under the cursor * excluded so it still suggests itself). */ existingKeys?: Set; /** Key slot: the kind of the nearest enclosing inline resource (or the root * resource), whose schema the prop keys are completed against. Falls back to * the document kind at the root. */ resourceKind?: string; /** Key slot: number of `path` segments that reach `resourceKind`'s map, so * the schema-relative path is `path.slice(resourceDepth)`. */ resourceDepth?: number; /** The path with sequence INDICES kept (`routes[0].handler.url`), * as distinct from `path`, through which arrays are transparent. This is the * address the analyzer speaks — an `x-telo-context` scope, an error-bearing * region and a step's identity are all resolved per item — so it is what a * CEL site is looked up by. */ concretePath?: string; /** Set when the cursor sits inside a CEL body (closed or open). The CEL * segment plus the cursor's document offset — what completion and hover * hit-test the expression's chain against. */ cel?: { segment: CelSegment; offset: number; }; } export declare function scalarString(node: AstNode | undefined): string | undefined; /** Resolve `(line, character)` against the AST (Approach B: AST for structure, * cursor column only to place empty-space key positions). */ export declare function resolveNodeAtPosition(text: string, docs: AstDocument[], line: number, character: number): ResolvedCursor | undefined; //# sourceMappingURL=resolve-node.d.ts.map