Creates a new LocalKernelProxy instance.
The local kernel client managing the kernel lifecycle
The webview panel to send messages to
The initial WebSocket connection ID
Private_Set of all active WebSocket connection IDs for this kernel
Private_The underlying JupyterLab kernel connection
Private Readonly_The local kernel client managing the kernel lifecycle
Private_The kernel's actual session ID
Private_Map of message handlers for routing kernel messages
Private_RawSocket from the kernel connection for direct ZMQ communication
Private_Maps request message IDs to JupyterLab's session IDs. Required because the kernel uses its own session ID, but JupyterLab expects replies to use the same session ID as the request.
Private Readonly_The webview panel to send messages to
Private_Forwards a kernel message to the webview as a WebSocket message. Sanitizes Buffer objects in the idents field to proper format for postMessage. Also translates the kernel's session ID to JupyterLab's expected session ID.
Private_Sends a message to the webview. Broadcasts to all registered client connections, or to a specific client if specified.
OptionalspecificClientId: stringPrivate_Sets up listeners for kernel messages and forwards them to the webview. Connects to the kernel's IOPub and status change signals.
Registers an additional WebSocket connection to this kernel.
The WebSocket connection ID to register
An empty object for the websocket-open message body
Closes the proxy and cleans up resources.
Handles incoming WebSocket messages from the webview. Translates them to kernel protocol operations.
CRITICAL: Intercepts kernel_info_request and responds immediately with a proper reply. This allows JupyterLab's kernel.ready Promise to resolve correctly.
Removes a WebSocket connection from this kernel.
The WebSocket connection ID to remove
True if there are still active connections, false if this was the last one
Simulates a WebSocket connection for a local ZMQ kernel. Routes kernel protocol messages between the webview and the LocalKernelClient. Supports multiple WebSocket connections to the same kernel.