Creates a new LocalKernelClient instance.
Kernel information including Python path and kernel spec
OptionaldocumentUri: UriOptional document URI for setting kernel working directory
Private_Path to the kernel connection file
Private_Indicates whether this client has been disposed
Private Optional_Optional document URI for setting kernel working directory
Private_Kernel information including Python path and kernel spec
Private_The spawned kernel process
Private_The JupyterLab kernel connection instance
Private_Indicates whether a restart is in progress
PrivatecreateCreate a kernel connection file with random ports.
Object containing the connection file path and configuration
Dispose of the kernel client and clean up resources.
Note: For local kernels, we skip the shutdown() API call because:
PrivatefindFind a free port by letting the OS assign one.
A free port number assigned by the operating system
Get the underlying kernel connection.
The JupyterLab kernel connection instance, or undefined if not started
PrivategetGet the working directory for the kernel process.
Absolute path to use as kernel working directory
Get native kernel information (Python path, kernel spec, etc.).
Native kernel information
Restart the kernel by killing the current process and starting a new one. If the client has been disposed, it will be re-initialized.
Note: For local kernels, we skip the shutdown() API call because:
PrivatespawnSpawn the ipykernel process and create ZMQ connection.
Client for local Python kernels using direct ZMQ communication. Works with environments that only have ipykernel installed (no jupyter-server needed).