Saltar al contenido principal

Variable: PluginRuntimeFrameType

const PluginRuntimeFrameType: object

Defined in: packages/contracts/src/pluginRuntime.ts:101

Frame types on the host ↔ runtime wire (§15.2). Values are wire bytes and MUST NOT be renumbered once released; only additive changes allowed.

Type Declaration

BRIDGE_MESSAGE

readonly BRIDGE_MESSAGE: 21 = 0x15

runtime -> host: app-level worker bridge message that no runtime component understands (module-graph-loaded/error today, live delivery in Stage F). Payload is opaque (§15.1); the host narrows by kind.

BROKER_REVOKE

readonly BROKER_REVOKE: 19 = 0x13

host -> runtime: revoke a plugin capability (§10.2, Stage D part 9b).

ERROR

readonly ERROR: 64 = 0x40

runtime -> host: protocol/runtime error (wire body is a WireError).

EVENT

readonly EVENT: 18 = 0x12

opaque plugin event routed runtime -> host.

FATAL_DIAGNOSTIC

readonly FATAL_DIAGNOSTIC: 29 = 0x1d

runtime -> host: worker fatal diagnostic (§9.1.4, §26.1.3/4). Emitted by the dying worker over the bridge and forwarded immediately; the envelope is small and bounded and cannot be displaced by log flood. The host keeps the last envelope per worker for crash attribution.

HELLO

readonly HELLO: 1 = 0x01

runtime -> host: handshake identity (version, epoch, pid, capabilities).

HELLO_ACK

readonly HELLO_ACK: 2 = 0x02

host -> runtime: handshake accepted.

HOST_BRIDGE_MESSAGE

readonly HOST_BRIDGE_MESSAGE: 22 = 0x16

host -> runtime: app-level worker bridge message routed to one worker (Stage F live delivery: event-push subscriptions). The runtime only checks the worker identity and forwards the payload to the worker's control port; the worker narrows by kind.

LOG_BATCH

readonly LOG_BATCH: 27 = 0x1b

runtime -> host: one batch of plugin console records (§9.1.1). The payload is the worker-encoded PluginRuntimeLogBatchPayload JSON, forwarded opaque by the runtime — the host is the single decode point (§15.1). The runtime never decodes or re-encodes the batch; a bounded payload keeps control frames small (§15.3). The host consumes the batch (log router), emits the synthetic suppressed-record when droppedCount > 0, and answers LOG_BATCH_ACK to replenish the worker's log credits.

LOG_BATCH_ACK

readonly LOG_BATCH_ACK: 28 = 0x1c

host -> runtime: credit ack for one consumed LOG_BATCH frame (§9.1.1). The runtime validates the worker identity and forwards { kind: 'log-batch-ack', seq } to the worker's control port; the worker replenishes its flush credit (bounded). Without acks the worker stops flushing — its ring stays the only log buffer (no secondary unbounded queue, §9.1.1 rule 5).

MODULE_GRAPH

readonly MODULE_GRAPH: 20 = 0x14

host -> runtime: signed module graph for a spawned worker (Stage A). Sent after WORKER_READY, addressed by worker id/epoch; the runtime forwards it to the worker's control port as a load-module-graph bridge message. The graph itself is plugin payload and stays opaque to the wire (§15.1) — the worker validates its shape and digests.

MODULE_GRAPH_DATA

readonly MODULE_GRAPH_DATA: 23 = 0x17

host -> runtime: module graph for a spawned worker, transported on the data pipe (fd 3, §15.9). Used when the signed graph does not fit the control path (§15.3/§15.11 string bounds); the payload is the same { workerId, workerEpoch, graph } JSON body as MODULE_GRAPH, but stays opaque to the wire and is decoded exactly once by the worker (§15.1).

PING

readonly PING: 33 = 0x21

host -> runtime: liveness probe.

PONG

readonly PONG: 34 = 0x22

runtime -> host: liveness reply carrying telemetry (§40).

RPC_REQUEST

readonly RPC_REQUEST: 16 = 0x10

opaque plugin RPC payload routed host ↔ runtime (§15.1).

RPC_REQUEST_DATA

readonly RPC_REQUEST_DATA: 25 = 0x19

worker -> host (via the runtime): broker-call request with arguments transported on the data pipe (fd 4, §15.9). Used when the call args (e.g. a large KV/settings value) exceed the control path; the payload is the same PluginRuntimeRpcRequestBody JSON as RPC_REQUEST but stays opaque to the runtime and is decoded exactly once by the host (§15.1).

RPC_RESPONSE

readonly RPC_RESPONSE: 17 = 0x11

opaque plugin RPC reply routed host ↔ runtime (§15.1).

RPC_RESPONSE_DATA

readonly RPC_RESPONSE_DATA: 24 = 0x18

host -> runtime: broker-call result for one worker, transported on the data pipe (fd 3, §15.9). Used when the response body (e.g. a large network fetch body) exceeds the control path; the payload is the same PluginRuntimeRpcResponseBody JSON as RPC_RESPONSE but stays opaque to the wire and is decoded exactly once by the worker (§15.1).

RPC_RESPONSE_STREAM

readonly RPC_RESPONSE_STREAM: 26 = 0x1a

host -> runtime: one chunk of a broker-call response body streamed over the data pipe (fd 3, §17 credit-based backpressure). Used when the encoded PluginRuntimeRpcResponseBody JSON exceeds one chunk; each frame carries at most RPC_STREAM_CHUNK_BYTES of the SAME opaque body JSON as RPC_RESPONSE, the last chunk has final: true. The payload is a JSON header ({ requestId, seq, final } — JSON text can never contain a raw NUL) followed by a NUL byte and the raw chunk bytes; the runtime forwards it opaque and the worker is the single assembly and decode point (§15.1).

TELEMETRY

readonly TELEMETRY: 32 = 0x20

runtime -> host: periodic resource telemetry (§40).

TERMINATE

readonly TERMINATE: 48 = 0x30

host -> runtime: graceful shutdown of the whole runtime.

TERMINATE_ACK

readonly TERMINATE_ACK: 49 = 0x31

runtime -> host: shutdown acknowledged.

WORKER_READY

readonly WORKER_READY: 4 = 0x04

runtime -> host: a worker finished its SES bootstrap (ADR-0028).

WORKER_SPAWN

readonly WORKER_SPAWN: 5 = 0x05

host -> runtime: activate a worker.

WORKER_TERMINATE

readonly WORKER_TERMINATE: 6 = 0x06

host -> runtime: terminate a worker (two-phase, §25.1).

WORKER_TERMINATED

readonly WORKER_TERMINATED: 7 = 0x07

runtime -> host: worker terminated.