mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 00:02:38 +00:00
* feat(ipynb): set up ipykernel in a new .venv when pip is locked out, and show install progress in the dialog * fix(ipynb): drop the retired installFailed string from translated catalogs * refactor(ipynb): drive the setup dialog from one setup state; fix review findings - Kernel status now only describes the kernel; a single `setup` object (base, offer, phase, error) drives the dialog, replacing the extra statuses and the externallyManaged/setupError fields. - The picker's 'Create virtual environment…' opens the same dialog; success switches through selectEnvironment, so a running kernel is only replaced once the venv exists. - Async setup results are dropped when the dialog they belong to is gone (tab closed/reopened). - main verifies ipykernel imports after pip, reuses an existing .venv instead of re-running venv over it, and explains failures that printed nothing. - Windows copy command guards the install with if ($?); notebooks at a filesystem root get a correct .venv parent; 'Try again' shows for both retry paths. * fix(ipynb): close the setup prompt when another Python is picked
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
import { ipcRenderer } from 'electron'
|
|
import type { PreloadApi } from '../api-types'
|
|
import type { KernelFrameEvent } from '../../shared/notebook-kernel-types'
|
|
|
|
export const notebookApi = {
|
|
listPythonEnvironments: (args) => ipcRenderer.invoke('notebook:listPythonEnvironments', args),
|
|
describePython: (args) => ipcRenderer.invoke('notebook:describePython', args),
|
|
startKernel: (args) => ipcRenderer.invoke('notebook:startKernel', args),
|
|
installIpykernel: (args) => ipcRenderer.invoke('notebook:installIpykernel', args),
|
|
createVenv: (args) => ipcRenderer.invoke('notebook:createVenv', args),
|
|
execute: (args) => ipcRenderer.invoke('notebook:execute', args),
|
|
interrupt: (args) => ipcRenderer.invoke('notebook:interrupt', args),
|
|
shutdownKernel: (args) => ipcRenderer.invoke('notebook:shutdownKernel', args),
|
|
onKernelFrame: (callback) => {
|
|
const listener = (_event: Electron.IpcRendererEvent, payload: KernelFrameEvent) =>
|
|
callback(payload)
|
|
ipcRenderer.on('notebook:kernelFrame', listener)
|
|
return () => ipcRenderer.removeListener('notebook:kernelFrame', listener)
|
|
}
|
|
} satisfies PreloadApi['notebook']
|