Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docs/plugin-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -3137,11 +3137,36 @@ Before the first publication the menu is also hidden: syntax matching is not evi
of loading. Providers must publish an explicit status for actual pending work. Escape
still revokes unpublished work, without exposing ARIA controls for a missing listbox.

A provider registered with `supplement: true` never owns the caret. It mounts
beside the winner when its own match has the same start, with its own query, and
it never opens a menu alone. Each provider's rows form a section, and sections
follow `order`, then the contribution key, with the winner among them. A
supplement's section sits under a host-drawn heading with its `title`, and so
does the winner's when another section comes first and the winner draws no
heading of its own. The first row is selected by default, so Enter and Tab take a
supplement row ordered above the winner's; a terminator still accepts only the
winner's exact match. A supplement that publishes later with a lower `order`
moves the default row until the user moves the selection, which then stays on
its row while that row exists. Each row keeps its provider: a row is identified by
provider and ID, and acceptance, `canSelect`, `disabled`, retry and status go to
the provider that published it. Each provider keeps its own 50-row cap. A
supplement decides no exact match. The host ignores its `spaceId`, `spacePending`,
`agent` and `group`. Its `holdAutoSelect: true` says that its whole source, not only its
shown rows, has or extends the typed name, or is still loading. Then a typed
terminator never accepts the winner's exact match and types as text. A supplement
that has not published yet for this query holds the same way, so supplements
publish on mount, even with no rows. One that fails drops only its own section
and holds nothing. A hold has no time limit.

Providers receive immutable observation/range evidence and `publish(result)`—not
DOM, focus or replacement commands. Results contain stable IDs, labels, optional
detail/decorative previews, an optional `agent` flag (marked and announced only
for the bundled mention and channel providers) and either text, an exact `{ pubkey, name }` mention,
or a `mentions` array of up to 32 such recipients. Batch edit primitives are
or a `mentions` array of up to 32 such recipients. A `mentions` edit may add a
`label`: one `@label` chip that notifies each mention and is sent as the plain
text `@label`, with one `p` tag per mention. In code, and in a message edit, it
inserts only the text `@label`, since edits add no recipients. Removing every
recipient leaves the text. Batch edit primitives are
copied and frozen before display, and accepted as a single editor transaction.
The host copies edit/query primitives and caps publications at 50 choices. A
publication returns its own withdrawal disposer (or `false` after revocation).
Expand Down
Loading
Loading