Skip to main content

ragrig_gpui/editor/
mod.rs

1//! The editor roundtrip contract.
2//!
3//! `ragrig-gpui` does not own an editor. It owns the protocol an editor and a
4//! RAG co-writer share: versioned context containers, guarded write-back, and
5//! the traits a host implements for its concrete editor component.
6//!
7//! A host implements [`EditorSurface`] for its document type and
8//! [`RoundtripHost`] for the state that owns the active editor, then hands the
9//! agent a [`Roundtrip`]. Swapping the editor backend (zorite, gpuikit, …)
10//! leaves the protocol and the agent untouched.
11
12pub(crate) mod bibtex;
13mod host;
14mod protocol;
15
16pub use bibtex::bibtex_entry_offset;
17pub use host::{
18    EditorSnapshot, EditorSurface, ReplacementOutcome, ReplacementTarget, Roundtrip, RoundtripHost,
19    SelectionContext, SelectionSnapshot, char_index_for_line_column,
20};
21pub use protocol::{
22    ContextNote, EditorBuffer, MARKER_CONTEXT, MARKER_DOCUMENT, MARKER_LIBRARY, MARKER_REPLACE,
23    MARKER_SELECTION, MARKER_TRUNCATED, MARKERS, MAX_CONTEXT_CHARS, PROTOCOL, Replacement,
24    RoundtripContext, RoundtripKind, byte_to_char_index, char_range_to_bytes, context_note, digest,
25    missing_markers, replace_at, verified_bytes,
26};