Expand description
The picker-source boundary mirrors (plugin-host.md §4.2 / §5 picker-source).
Slice PH7.4a. The picker-source WIT interface is the plugin-facing API a
WASM picker source authors against (the user’s “expose the api, not sources”:
native sources stay native Rust; a plugin implements a source against these
types and registers through the same PickerRegistry::register_generator
seam a native source uses). This module round-trips that API’s data types:
Annotation(+KeyChord) — marginalia. The whole closed enum crosses (PH7.4a decision) so a plugin candidate can define + populate themed columns.slot/categoryare theme element KEYS resolved at paint, never baked colors, so:colorschemerecolors plugin marginalia live. The host lays outAnnotationColumnsfrom the visible set (a render-consumed projection), so only the per-candidate annotations cross, never the column layout.ArgSpec/PickerSourceSpec— the source’s declared metadata.RoutingPayload/OpenTarget— the per-candidate token a source emits and consumes inaccept.- the owned
PickerContextprojection (§4.2) the host handsinit— host→guest only, so it mirrors one-way (aproject_*fn, theproject_buffer_snapshotprecedent), nofrom_wit.
The &'static str seam. PickerSourceSpec/ArgSpec use &'static str
for ids/docs/prompts — native sources supply compile-time literals. A WASM
plugin supplies owned runtime strings, so from_wit interns them
([intern], Box::leak). This is bounded by the loaded-source count (each
source’s spec is leaked once at registration); unbounded re-registration
(hot reload) is a PH7.12 concern — see the slice plan.
The active buffer’s bulk rope text + syntax-highlight overlay do NOT ride the
context projection; they cross via the buffer document resource handle,
wired with the init(ctx) guest export at PH7.4c. A fuzzy-finder needs
neither.
Functions§
- project_
picker_ context - Project a live
PickerContextinto its owned WIT mirror (§4.2). Host→guest only: the host builds this atinittime; the guest never sends a context back. A non-UTF-8 path anywhere in the context is a typed error (§4.4), never a lossy encoding.