Creates a new KernelBridge instance.
Broadcasts kernel selection to all registered webviews. Used when a runtime is selected that should apply to multiple documents.
Selected runtime to broadcast.
Broadcasts kernel termination to all registered webviews. Used when a runtime is terminated that affects multiple documents.
Connects a webview document (notebook or lexical) to a runtime. Sends runtime information to the webview for ServiceManager creation.
NOTE: Caller should call sendKernelStartingMessage() BEFORE this method To minimize lag between selection and spinner appearance.
The target document identifier to look up.
Selected runtime.
Connects a webview document to a local kernel (Python environment, Jupyter kernel, or Jupyter server). Starts the kernel and sends kernel information to the webview.
The target document identifier to look up.
Native kernel information.
Connects a webview document (notebook or lexical) to Pyodide kernel. Sends Pyodide runtime information to the webview for in-browser Python execution.
The target document identifier to look up.
Detects the type of notebook (native vs webview).
The target document identifier to look up.
Either "webview" for Datalayer notebooks or "native" for others.
Disposes of the bridge and cleans up resources.
Gets the local kernel client for a document. Used by runtime bridge to interrupt/restart kernels for specific documents.
The target document identifier to look up.
Local kernel client or undefined.
Gets the current kernel info for a notebook.
Notebook URI.
Kernel information or undefined.
Gets a local kernel client by ID. Used by network proxy to route messages to local ZMQ kernels.
Kernel identifier.
Local kernel client or undefined.
Handles kernel lifecycle commands.
Notebook URI.
Command to execute.
Handles kernel-ready message from webview. Sends the pending kernel-selected message to complete kernel initialization.
Document URI.
Registers a webview panel for kernel communication.
Notebook URI.
Webview panel.
Sends "kernel-starting" message to webview immediately. Used to trigger spinner before any async operations.
Document URI.
Selected runtime.
Sends a kernel status update to a notebook.
Notebook URI.
The current execution state to report.
Unregisters a webview panel.
Notebook URI.
Bridges kernel connections between VS Code and notebooks. Routes to WebSocket for native notebooks or webview messages for Datalayer notebooks.