@@ -6253,3 +6253,65 @@ and deduplicated. No setting values cross windows: receivers read their own
62536253project layers. Native owners must recheck window/project lifetime on delivery.
62546254Invalid surface input returns ` plugin.settings.invalidSurface ` ; owner mismatch
62556255returns ` plugin.settings.ownerChanged ` . Shared vectors: ` rust/fixtures/plugins/settings-surfaces.json ` .
6256+
6257+
6258+ ### Editor essentials (desktop internal commands)
6259+
6260+ ` editor.find ` executes through ` lithe_core_execute_document_json(request, bytes, length) ` .
6261+ The caller owns valid UTF-8 bytes for the synchronous call; Core borrows them only until
6262+ return, retains no pointer or text cache, and returns its normal owned response string
6263+ (free with ` lithe_core_free_string ` ). A null buffer is valid only at length zero.
6264+ The ordinary JSON entry point rejects this command with ` missing_document ` .
6265+ Cancellation uses the operation ID registry, including cancellation checks between matches.
6266+ The host must run on a worker and guard the document snapshot and query generation before
6267+ applying ranges or a replacement. This ABI adds no public plugin host methods.
6268+
6269+ The payload is `{query, caseSensitive?: false , wholeWord?: false , regex?: false ,
6270+ range?:{start,end}, replacement?: string , replaceStart?: number , caret?:0, backwards?: false }`.
6271+ All offsets are original UTF-8 byte offsets, half-open and on rune boundaries. An omitted
6272+ range searches the whole snapshot. Regex uses Unicode case folding/word boundaries and
6273+ multiline anchors; regex replacement expands ` $1 ` /` ${name} ` captures; literal replacement
6274+ preserves dollar signs. ` replaceStart ` selects only that match; omitted means replace all.
6275+ Results are ` {matches:[{start,end}],edits:[{start,end,text}],selected:number|null,truncated} ` .
6276+ Scoped requests also return ` range ` , adjusted for the planned replacement lengths so the
6277+ selection remains valid after applying a bulk edit.
6278+ Limits: 64 MiB source, 4096-byte query, 10,000 returned matches, 8 MiB total inserted text,
6279+ 1 MiB compiled regex and 2 MiB DFA. A truncated search is useful for navigation but bulk
6280+ replacement fails atomically. Invalid requests return ` invalid_request ` with stable details:
6281+ ` invalid_request ` , ` missing_document ` , ` invalid_range ` , ` invalid_pattern ` , ` query_too_large ` ,
6282+ ` source_too_large ` , ` source_too_large_or_invalid ` , ` replacement_too_large ` , ` too_many_matches ` .
6283+ Source, query and replacement are never included in errors or diagnostic logs.
6284+
6285+ ` editor.preferences.resolve ` accepts optional ` lineNumbers ` , ` whitespace ` , ` cursorStyle `
6286+ (` line ` , ` block ` , ` underline ` ), ` cursorBlink ` and ` autoSaveDelayMilliseconds ` . It returns
6287+ actual values and minimum/maximum delay. Defaults: true, false, line, true, 1500 ms;
6288+ unknown styles resolve to line and delay clamps to 250–60,000 ms.
6289+
6290+ ` editor.recent.reduce ` accepts ` entries ` , optional ` event:{kind,path,name,line,column} ` ,
6291+ ` query ` and ` onlyEdited ` . It returns bounded ` entries ` and filtered ` results ` . Paths are
6292+ opaque host-owned workspace-relative identities, position is zero-based UTF-16. Kinds are
6293+ opened/edited/removed. Logical sequence numbers produce deterministic MRU order independent
6294+ of clocks; edit recency survives subsequent opens. Up to 80 entries, 4096-byte query,
6295+ 32,768-byte path, 1024-byte name. Native storage and rendering belong to the host.
6296+
6297+ ` editor.recovery.decide ` accepts ` {baseHash,diskHash?,scratch?,bytes?,saved?,discarded?} ` .
6298+ It returns action ` remove ` , ` tooLarge ` , ` restoreScratch ` , ` restore ` , or ` restoreConflict ` ,
6299+ plus ` maxDocumentBytes ` (64 MiB), ` maxStorageBytes ` (256 MiB), ` maxDocuments ` (64).
6300+ Hash equality is a native fact (including actual encoding bytes where applicable).
6301+ Missing or changed disk data retains a conflict; it never authorizes an overwrite.
6302+ The native adapter owns private atomic checkpoint files in application data, quota
6303+ accounting, write serialization, and explicit save/discard cleanup. Recovery is independent
6304+ of auto-save. A save/remove queued after a checkpoint must win over that checkpoint.
6305+
6306+ ` keymap.schemes.reduce ` accepts `{state:{active,schemes:[ {id,name,bindings}] },current?,
6307+ operation?,id?,name?,bindings?}` and returns ` {state,bindings}` for the active scheme.
6308+ Empty state migrates current overrides into default. Operations: empty (resolve), update,
6309+ select, saveAs (clone active), rename and delete. Default cannot be renamed/deleted;
6310+ deleting the active custom scheme selects default. Up to 16 schemes; names trim to 1–64
6311+ characters without controls and are case-insensitively unique; IDs are ASCII alphanumeric,
6312+ hyphen or underscore, up to 64 bytes. Bindings use existing explicit-modifier key syntax.
6313+ Failures use ` invalid_request ` plus stable details such as ` invalid_name ` , ` duplicate_name ` ,
6314+ ` too_many_schemes ` , ` missing_scheme ` , ` default_is_fixed ` and ` invalid_binding ` .
6315+ No third-party keymap import or plugin protocol change is introduced.
6316+
6317+ Executable vectors: ` rust/fixtures/editor/ide-essentials-v1.json ` (C ABI tests).
0 commit comments