Skip to main content

Module ffi

Module ffi 

Source
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§

FfiComponentList
Serialized component info returned by agent_doc_parse_components.
FfiMergeResult
Result of agent_doc_crdt_merge.
FfiPatchResult
Result of agent_doc_apply_patch.

Functions§

agent_doc_apply_patch
Apply a patch to a document component.
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_parse_components
Parse components from a document.