Expand description
C ABI exports for editor plugin native bindings.
Provides a minimal FFI surface for component parsing, patch application, and CRDT merge — the operations currently duplicated in Kotlin and TypeScript.
§Safety
All extern "C" functions accept raw pointers. Callers must ensure:
- String pointers are valid, non-null, NUL-terminated UTF-8
- Returned pointers are freed with
agent_doc_free_string - Byte-buffer pointers (
*const u8) have the specified length
Structs§
- FfiComponent
List - Serialized component info returned by
agent_doc_parse_components. - FfiMerge
Result - Result of
agent_doc_crdt_merge. - FfiPatch
Result - Result of
agent_doc_apply_patch.
Functions§
- agent_
doc_ ⚠apply_ patch - Apply a patch to a document component.
- agent_
doc_ ⚠apply_ patch_ with_ boundary - Apply a component patch using a boundary marker for insertion point.
- agent_
doc_ ⚠apply_ patch_ with_ caret - Apply a component patch with cursor-aware ordering for append mode.
- agent_
doc_ ⚠crdt_ merge - CRDT merge (3-way conflict-free).
- agent_
doc_ ⚠free_ state - Free a state buffer returned by
agent_doc_crdt_merge. - agent_
doc_ ⚠free_ string - Free a string returned by any
agent_doc_*function. - agent_
doc_ ⚠merge_ frontmatter - Merge YAML key/value pairs into a document’s frontmatter.
- agent_
doc_ ⚠parse_ components - Parse components from a document.
- agent_
doc_ ⚠reposition_ boundary_ to_ end - Reposition boundary marker to end of exchange component.