/** * The completion brain: (document text, cursor) → autocomplete items. * * Pure and dependency-free. Cursor context is derived from lightweight text * heuristics on the characters before the caret — robust while the document * is half-typed and invalid (a full parse would often fail). Dynamic lists * that DO need the document (sequence names for `parent=`) come from a * simple regex scan, not a parse, for the same robustness. * * Contexts detected: * - `<` (+ partial) → tag names * - `