Files
openidea/wit/extensions.wit
T
Lucas 43b5c69ecd feat(plugins): add bounded background WebSockets (API 1.6) (#2544)
Plugins get a host-owned WebSocket resource (net.websocket-connect → websocket with id/send/drain/close; dropping it closes the transport). The connection is bound to the project it was opened for, needs the endpoint's net:<host> grant, uses WSS outside loopback with the shared rustls config, and is capped at eight per plugin. Request headers (secret placeholders expanded) go with the handshake, except the ones the handshake owns; an empty subprotocol requests none; the handshake is bounded by the call's I/O budget. Incoming frames queue in a bounded FIFO, signalled by the websocket-ready event. Checked-in components are rebuilt for API 1.6.

Co-authored-by: SorPuti <56741582+SorPuti@users.noreply.github.com>
2026-11-12 10:09:15 +08:00

22 lines
857 B
Plaintext

package openidea:plugin@1.6.0;
/// What other plugins contributed to the extension points this plugin declares
/// (`[[extension-points]]` in `plugin.toml`; the contributors list this plugin
/// in `[[depends]]`). A change is announced by the `extensions-changed` event.
interface extensions {
use types.{error};
record contribution {
/// The contributing plugin's id.
plugin: string,
/// Its `[[contributes."<point>"]]` table as JSON, checked by the host
/// against the fields the point declares.
data: string,
}
/// The contributions to `point`, in the order the plugins started. Only the
/// plugin that declares `point` may read it (`denied` otherwise); `not-found`
/// when no running plugin declares it.
contributions: func(point: string) -> result<list<contribution>, error>;
}