Runtime Bridge
API reference for @crux/core/runtime-bridge schemas and command-plane helpers.
import {
BridgeCommandRequestSchema,
BridgeCommandResultSchema,
RuntimeBridgeMessageSchema,
RuntimePeerHelloSchema,
connectRuntimeBridge,
executeRuntimeBridgeCommand,
getRuntimeBridgeManifest,
} from '@crux/core/runtime-bridge'The Runtime Bridge is the local-dev command plane between the @crux/local Go service and a live application runtime. It is used for inspectable resources and framework-specific local commands. It is not the execution trace transport; runtime traces use @crux/core/observability.
Command errors
Failed commands return command.error with a stable error message and structured details. Runtime peers normalize thrown values with the same observability error contract used by spans, including thrown, summary, name, message, optional stack, safe raw data, phase, and errorKind when known.
The local Go bridge preserves those details for WebSocket, HTTP, and embedded eval-runner commands, and emits command.failed events for failed dispatches. Eval-runner process failures also become command errors, so devtools and the TUI can show bridge/eval failures even when no application span exists.
Schemas
| Export | Description |
|---|---|
RuntimeBridgeConfigSchema | Runtime bridge configuration accepted by Crux config/integrations. |
RuntimeBridgeMessageSchema | Union schema for bridge messages. |
RuntimePeerHelloSchema | Peer handshake payload. |
BridgeCommandRequestSchema | Command request sent by the Go service to a runtime peer. |
BridgeCommandResultSchema | Successful command response. |
BridgeCommandErrorSchema | Failed command response. |
Helpers
| Export | Description |
|---|---|
getRuntimeBridgeManifest() | Returns the runtime peer manifest exposed to the local service. |
connectRuntimeBridge() | Connects a long-lived runtime peer. |
executeRuntimeBridgeCommand() | Executes a typed bridge command against registered runtime resources. |
Related
- Reference: Devtools Plugin
- Reference: @crux/local
- Guide: Devtools