Custom deserializer module that accepts either a Vec<String>
(legacy bare-string completions) or a Vec<CompletionItem> (new
typed shape). Lets plugins call setCompletions(key, ["a", "b"])
and setCompletions(key, [{ value: "a", kind: "history" }])
interchangeably.
A rectangular region, in cells. Used by the animation plugin API so
callers can target arbitrary screen regions without going through a
virtual buffer.
Minimal command registry for PluginApi.
This is a stub that provides basic command storage for plugin use.
The editor’s full CommandRegistry lives in fresh-editor.
One candidate row in a Text widget’s completion popup. value is
what gets sent back to the plugin as the completion_accept
payload when the user picks the row. kind is an optional
presentation hint the renderer reads to style certain rows
differently from the rest — e.g. "history" rows render with
a leading marker glyph + italic so the user can tell at-a-glance
that the entry came from their submission history rather than
from the live completion source. None is the default “regular”
candidate.
A search handle’s shared state plus its cancellation flag. Owned by an
Arc so producers (host searcher tasks) and consumers (the JS plugin via
the registry) can both reference it.
Inner state of a streaming search, written by the host’s parallel
searchers and drained by the plugin via SearchHandle.take(). The plugin
observes deltas (mem::take on pending) at its own cadence; producers
write at full speed without per-chunk dispatches.
A run of text with optional styling. style reuses
OverlayOptions — the same primitive plugins use for virtual
text — so a hint is just { text: "Alt+P cycle", style: { fg: "ui.help_key_fg" } }. None style means “no styling override”;
each consumer applies its own default (e.g. the floating-prompt
title uses prompt_fg + bold).
One node in a Tree widget’s flat-list spec. The plugin walks
its hierarchy depth-first and emits one TreeNode per node;
depth controls indent, has_children controls whether the
disclosure glyph (and its hit area) is rendered. The host filters
the visible window — descendants of collapsed nodes are skipped.
Modifier-only overlay applied to a byte range within a virtual line’s
text. Used by plugins (live-diff) to bold + underline removed words on
a deletion virtual line without varying the line’s overall fg/bg.
Information about an editor session (plugin-visible). Returned
by editor.listWindows() and carried in the snapshot. Mirrors
the editor-side Session struct — see
crates/fresh-editor/src/app/session.rs and
docs/internal/orchestrator-sessions-design.md.
Color carried by a ViewTokenStyle. Untagged so JSON plugins can
keep passing [r, g, b] arrays, while richer themes can use named
ANSI colors ("Red", "LightGreen", "Default") or theme keys
("editor.diff_remove_bg"). The renderer resolves named/theme
strings against the active theme at draw time; unknown strings
fall through to the terminal’s default color.
Action a plugin can request the widget runtime to perform on a
mounted panel. Bundled into a single WidgetCommand PluginCommand
so the plugin’s TypeScript layer exposes one routing method
(editor.widgetCommand(panel_id, action)) rather than a fanout
of per-key IPC.
Targeted in-place mutation of a mounted widget panel — the
IPC fast path. Plugins use these when the model change touches
one widget; the host applies the mutation directly to the
panel’s spec / instance state and re-renders without
re-transmitting the full spec.
Registry mapping a handle ID to its shared SearchHandleState. Shared
between the JS thread (where JsEditorApi registers handles and serves
take()/cancel()) and the editor thread (where the host’s searcher
tasks write into the same state).