@datalayer/jupyter-react 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -1
- package/lib/app/tabs/components/CellComponent.js +4 -2
- package/lib/app/tabs/components/CellComponent.js.map +1 -1
- package/lib/app/tabs/components/NotebookComponent.js +2 -2
- package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
- package/lib/app/tabs/components/ViewerComponent.js +1 -1
- package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
- package/lib/components/cell/Cell.d.ts +3 -3
- package/lib/components/cell/Cell.js +5 -12
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.d.ts +0 -2
- package/lib/components/cell/CellAdapter.js +5 -17
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabApp.js +6 -0
- package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
- package/lib/components/kernel/{Kernelndicator.d.ts → KernelIndicator.d.ts} +1 -0
- package/lib/components/kernel/{Kernelndicator.js → KernelIndicator.js} +13 -5
- package/lib/components/kernel/KernelIndicator.js.map +1 -0
- package/lib/components/kernel/index.d.ts +1 -1
- package/lib/components/kernel/index.js +1 -1
- package/lib/components/kernel/index.js.map +1 -1
- package/lib/components/notebook/Notebook2.d.ts +6 -2
- package/lib/components/notebook/Notebook2.js +3 -2
- package/lib/components/notebook/Notebook2.js.map +1 -1
- package/lib/components/notebook/Notebook2Adapter.d.ts +10 -0
- package/lib/components/notebook/Notebook2Adapter.js +12 -0
- package/lib/components/notebook/Notebook2Adapter.js.map +1 -1
- package/lib/components/notebook/Notebook2Base.d.ts +7 -3
- package/lib/components/notebook/Notebook2Base.js +78 -48
- package/lib/components/notebook/Notebook2Base.js.map +1 -1
- package/lib/components/notebook/Notebook2State.d.ts +1 -0
- package/lib/components/notebook/Notebook2State.js +3 -0
- package/lib/components/notebook/Notebook2State.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +1 -0
- package/lib/components/notebook/NotebookAdapter.js +7 -3
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.d.ts +25 -2
- package/lib/components/notebook/NotebookCommands.js +89 -10
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/terminal/Terminal.js +1 -1
- package/lib/components/terminal/Terminal.js.map +1 -1
- package/lib/examples/Bokeh.js +2 -2
- package/lib/examples/Bokeh.js.map +1 -1
- package/lib/examples/Bqplot.js +2 -2
- package/lib/examples/Bqplot.js.map +1 -1
- package/lib/examples/Cell.js +4 -4
- package/lib/examples/Cell.js.map +1 -1
- package/lib/examples/CellLite.js +16 -4
- package/lib/examples/CellLite.js.map +1 -1
- package/lib/examples/Cells.js +9 -6
- package/lib/examples/Cells.js.map +1 -1
- package/lib/examples/CellsExecute.js +13 -9
- package/lib/examples/CellsExecute.js.map +1 -1
- package/lib/examples/Console.js +2 -2
- package/lib/examples/Console.js.map +1 -1
- package/lib/examples/ConsoleLite.js +3 -3
- package/lib/examples/ConsoleLite.js.map +1 -1
- package/lib/examples/Dashboard.js +2 -2
- package/lib/examples/Dashboard.js.map +1 -1
- package/lib/examples/Deno.js +2 -2
- package/lib/examples/Deno.js.map +1 -1
- package/lib/examples/Examples.d.ts +23 -0
- package/lib/examples/Examples.js +342 -0
- package/lib/examples/Examples.js.map +1 -0
- package/lib/examples/FileBrowser.js +2 -2
- package/lib/examples/FileBrowser.js.map +1 -1
- package/lib/examples/GeoJson.js +2 -2
- package/lib/examples/GeoJson.js.map +1 -1
- package/lib/examples/IPyLeaflet.js +3 -3
- package/lib/examples/IPyLeaflet.js.map +1 -1
- package/lib/examples/IPyReact.js +3 -3
- package/lib/examples/IPyReact.js.map +1 -1
- package/lib/examples/IPyWidgets.js +3 -3
- package/lib/examples/IPyWidgets.js.map +1 -1
- package/lib/examples/IPyWidgetsState.js +3 -3
- package/lib/examples/IPyWidgetsState.js.map +1 -1
- package/lib/examples/JupyterContext.js +2 -2
- package/lib/examples/JupyterContext.js.map +1 -1
- package/lib/examples/JupyterLabAppHeadless.js +2 -2
- package/lib/examples/JupyterLabAppHeadless.js.map +1 -1
- package/lib/examples/JupyterLabAppHeadlessServerless.js +2 -2
- package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -1
- package/lib/examples/JupyterLabAppServerless.js +2 -2
- package/lib/examples/JupyterLabAppServerless.js.map +1 -1
- package/lib/examples/JupyterLabAppServiceManager.js +2 -2
- package/lib/examples/JupyterLabAppServiceManager.js.map +1 -1
- package/lib/examples/JupyterLabTheme.js +2 -2
- package/lib/examples/JupyterLabTheme.js.map +1 -1
- package/lib/examples/KernelExecute.d.ts +1 -1
- package/lib/examples/KernelExecute.js +9 -11
- package/lib/examples/KernelExecute.js.map +1 -1
- package/lib/examples/KernelExecuteLite.d.ts +1 -0
- package/lib/examples/KernelExecuteLite.js +51 -0
- package/lib/examples/KernelExecuteLite.js.map +1 -0
- package/lib/examples/KernelExecutor.js +10 -9
- package/lib/examples/KernelExecutor.js.map +1 -1
- package/lib/examples/KernelExecutorLite.js +63 -0
- package/lib/examples/KernelExecutorLite.js.map +1 -0
- package/lib/examples/Kernels.js +6 -5
- package/lib/examples/Kernels.js.map +1 -1
- package/lib/examples/Lumino.js +2 -2
- package/lib/examples/Lumino.js.map +1 -1
- package/lib/examples/Matplotlib.js +10 -6
- package/lib/examples/Matplotlib.js.map +1 -1
- package/lib/examples/Notebook.js +3 -2
- package/lib/examples/Notebook.js.map +1 -1
- package/lib/examples/Notebook2.js +9 -6
- package/lib/examples/Notebook2.js.map +1 -1
- package/lib/examples/Notebook2Actions.js +8 -6
- package/lib/examples/Notebook2Actions.js.map +1 -1
- package/lib/examples/Notebook2Collaborative.js +2 -2
- package/lib/examples/Notebook2Collaborative.js.map +1 -1
- package/lib/examples/Notebook2Lite.js +19 -14
- package/lib/examples/Notebook2Lite.js.map +1 -1
- package/lib/examples/NotebookCellSidebar.js +3 -3
- package/lib/examples/NotebookCellSidebar.js.map +1 -1
- package/lib/examples/NotebookCellToolbar.js +4 -4
- package/lib/examples/NotebookCellToolbar.js.map +1 -1
- package/lib/examples/NotebookCollaborative.js +2 -2
- package/lib/examples/NotebookCollaborative.js.map +1 -1
- package/lib/examples/NotebookColormode.js +15 -10
- package/lib/examples/NotebookColormode.js.map +1 -1
- package/lib/examples/NotebookExtension.js +4 -4
- package/lib/examples/NotebookExtension.js.map +1 -1
- package/lib/examples/NotebookExternalContent.js +18 -13
- package/lib/examples/NotebookExternalContent.js.map +1 -1
- package/lib/examples/NotebookInit.js +10 -9
- package/lib/examples/NotebookInit.js.map +1 -1
- package/lib/examples/NotebookKernel.js +4 -4
- package/lib/examples/NotebookKernel.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js +2 -2
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLess.js +4 -4
- package/lib/examples/NotebookLess.js.map +1 -1
- package/lib/examples/NotebookLite.js +10 -6
- package/lib/examples/NotebookLite.js.map +1 -1
- package/lib/examples/NotebookLiteContext.js +10 -5
- package/lib/examples/NotebookLiteContext.js.map +1 -1
- package/lib/examples/NotebookLocalServer.js +3 -3
- package/lib/examples/NotebookLocalServer.js.map +1 -1
- package/lib/examples/NotebookNbformat.js +7 -5
- package/lib/examples/NotebookNbformat.js.map +1 -1
- package/lib/examples/NotebookNbformatChange.js +12 -6
- package/lib/examples/NotebookNbformatChange.js.map +1 -1
- package/lib/examples/NotebookNoContext.js +4 -3
- package/lib/examples/NotebookNoContext.js.map +1 -1
- package/lib/examples/NotebookNoPrimer.js +3 -2
- package/lib/examples/NotebookNoPrimer.js.map +1 -1
- package/lib/examples/NotebookOnSessionConnection.js +5 -5
- package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
- package/lib/examples/NotebookPath.js +2 -2
- package/lib/examples/NotebookPath.js.map +1 -1
- package/lib/examples/NotebookPathChange.js +5 -4
- package/lib/examples/NotebookPathChange.js.map +1 -1
- package/lib/examples/NotebookReadonly.js +4 -4
- package/lib/examples/NotebookReadonly.js.map +1 -1
- package/lib/examples/NotebookServiceManager.js +4 -4
- package/lib/examples/NotebookServiceManager.js.map +1 -1
- package/lib/examples/NotebookSkeleton.js +3 -2
- package/lib/examples/NotebookSkeleton.js.map +1 -1
- package/lib/examples/NotebookTOC.d.ts +1 -0
- package/lib/examples/{NotebookToc.js → NotebookTOC.js} +12 -6
- package/lib/examples/NotebookTOC.js.map +1 -0
- package/lib/examples/NotebookTheme.js +10 -5
- package/lib/examples/NotebookTheme.js.map +1 -1
- package/lib/examples/NotebookThemeColormode.js +4 -4
- package/lib/examples/NotebookThemeColormode.js.map +1 -1
- package/lib/examples/NotebookURL.js +3 -2
- package/lib/examples/NotebookURL.js.map +1 -1
- package/lib/examples/NotebookUnmount.js +13 -7
- package/lib/examples/NotebookUnmount.js.map +1 -1
- package/lib/examples/ObservableHQ.js +2 -2
- package/lib/examples/ObservableHQ.js.map +1 -1
- package/lib/examples/OutputIPyWidgets.js +3 -3
- package/lib/examples/OutputIPyWidgets.js.map +1 -1
- package/lib/examples/OutputWithMonitoring.js +3 -2
- package/lib/examples/OutputWithMonitoring.js.map +1 -1
- package/lib/examples/Outputs.js +8 -8
- package/lib/examples/Outputs.js.map +1 -1
- package/lib/examples/OutputsIpynb.js +4 -4
- package/lib/examples/OutputsIpynb.js.map +1 -1
- package/lib/examples/Panel.js +2 -2
- package/lib/examples/Panel.js.map +1 -1
- package/lib/examples/Plotly.js +2 -2
- package/lib/examples/Plotly.js.map +1 -1
- package/lib/examples/PyGWalker.js +4 -4
- package/lib/examples/PyGWalker.js.map +1 -1
- package/lib/examples/Terminal.js +4 -3
- package/lib/examples/Terminal.js.map +1 -1
- package/lib/examples/Vega.js +2 -2
- package/lib/examples/Vega.js.map +1 -1
- package/lib/examples/Viewer.js +5 -4
- package/lib/examples/Viewer.js.map +1 -1
- package/lib/jupyter/JupyterConfig.js +6 -4
- package/lib/jupyter/JupyterConfig.js.map +1 -1
- package/lib/jupyter/collaboration/ICollaborationProvider.js.map +1 -1
- package/lib/jupyter/kernel/Kernel.js +21 -15
- package/lib/jupyter/kernel/Kernel.js.map +1 -1
- package/lib/jupyter/kernel/KernelState.d.ts +1 -1
- package/lib/jupyter/lite/Lite.d.ts +1 -1
- package/lib/jupyter/lite/LiteServer.d.ts +1 -1
- package/lib/jupyter/lite/LiteServer.js +20 -5
- package/lib/jupyter/lite/LiteServer.js.map +1 -1
- package/lib/jupyter/lite/contents/broadcast.d.ts +27 -0
- package/lib/jupyter/lite/contents/broadcast.js +60 -0
- package/lib/jupyter/lite/contents/broadcast.js.map +1 -0
- package/lib/jupyter/lite/contents/contents.d.ts +228 -0
- package/lib/jupyter/lite/contents/contents.js +774 -0
- package/lib/jupyter/lite/contents/contents.js.map +1 -0
- package/lib/jupyter/lite/contents/drivecontents.d.ts +92 -0
- package/lib/jupyter/lite/contents/drivecontents.js +133 -0
- package/lib/jupyter/lite/contents/drivecontents.js.map +1 -0
- package/lib/jupyter/lite/contents/drivefs.d.ts +193 -0
- package/lib/jupyter/lite/contents/drivefs.js +432 -0
- package/lib/jupyter/lite/contents/drivefs.js.map +1 -0
- package/lib/jupyter/lite/contents/emscripten.d.ts +89 -0
- package/lib/jupyter/lite/contents/emscripten.js +11 -0
- package/lib/jupyter/lite/contents/emscripten.js.map +1 -0
- package/lib/jupyter/lite/contents/index.d.ts +6 -0
- package/lib/jupyter/lite/contents/index.js +9 -0
- package/lib/jupyter/lite/contents/index.js.map +1 -0
- package/lib/jupyter/lite/contents/tokens.d.ts +136 -0
- package/lib/jupyter/lite/contents/tokens.js +66 -0
- package/lib/jupyter/lite/contents/tokens.js.map +1 -0
- package/lib/jupyter/lite/kernel/index.d.ts +4 -0
- package/lib/jupyter/lite/kernel/index.js +7 -0
- package/lib/jupyter/lite/kernel/index.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernel.d.ts +245 -0
- package/lib/jupyter/lite/kernel/kernel.js +453 -0
- package/lib/jupyter/lite/kernel/kernel.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernels.d.ts +85 -0
- package/lib/jupyter/lite/kernel/kernels.js +218 -0
- package/lib/jupyter/lite/kernel/kernels.js.map +1 -0
- package/lib/jupyter/lite/kernel/kernelspecs.d.ts +53 -0
- package/lib/jupyter/lite/kernel/kernelspecs.js +50 -0
- package/lib/jupyter/lite/kernel/kernelspecs.js.map +1 -0
- package/lib/jupyter/lite/kernel/tokens.d.ts +171 -0
- package/lib/jupyter/lite/kernel/tokens.js +16 -0
- package/lib/jupyter/lite/kernel/tokens.js.map +1 -0
- package/lib/jupyter/lite/licenses/index.d.ts +2 -0
- package/lib/jupyter/lite/licenses/index.js +5 -0
- package/lib/jupyter/lite/licenses/index.js.map +1 -0
- package/lib/jupyter/lite/licenses/licenses.d.ts +35 -0
- package/lib/jupyter/lite/licenses/licenses.js +95 -0
- package/lib/jupyter/lite/licenses/licenses.js.map +1 -0
- package/lib/jupyter/lite/licenses/tokens.d.ts +74 -0
- package/lib/jupyter/lite/licenses/tokens.js +13 -0
- package/lib/jupyter/lite/licenses/tokens.js.map +1 -0
- package/lib/jupyter/lite/localforage/index.d.ts +2 -0
- package/lib/jupyter/lite/localforage/index.js +5 -0
- package/lib/jupyter/lite/localforage/index.js.map +1 -0
- package/lib/jupyter/lite/localforage/memory.d.ts +5 -0
- package/lib/jupyter/lite/localforage/memory.js +10 -0
- package/lib/jupyter/lite/localforage/memory.js.map +1 -0
- package/lib/jupyter/lite/localforage/tokens.d.ts +12 -0
- package/lib/jupyter/lite/localforage/tokens.js +8 -0
- package/lib/jupyter/lite/localforage/tokens.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.d.ts +18 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.js +45 -0
- package/lib/jupyter/lite/pyodide-kernel/_pypi.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.d.ts +15 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js +63 -0
- package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.d.ts +9 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js +50 -0
- package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/index.d.ts +6 -0
- package/lib/jupyter/lite/pyodide-kernel/index.js +9 -0
- package/lib/jupyter/lite/pyodide-kernel/index.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.d.ts +157 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.js +294 -0
- package/lib/jupyter/lite/pyodide-kernel/kernel.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/pypi/all-local.json +128 -0
- package/lib/jupyter/lite/pyodide-kernel/pypi/all.json +128 -0
- package/lib/jupyter/lite/pyodide-kernel/schema/piplite.v0.schema.json +113 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.d.ts +82 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.js +8 -0
- package/lib/jupyter/lite/pyodide-kernel/tokens.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.d.ts +138 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.js +426 -0
- package/lib/jupyter/lite/pyodide-kernel/worker.js.map +1 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.d.ts +4 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.js +88 -0
- package/lib/jupyter/lite/pyodide-kernel-extension/index.js.map +1 -0
- package/lib/jupyter/lite/server/app.d.ts +87 -0
- package/lib/jupyter/lite/server/app.js +157 -0
- package/lib/jupyter/lite/server/app.js.map +1 -0
- package/lib/jupyter/lite/server/index.d.ts +4 -0
- package/lib/jupyter/lite/server/index.js +7 -0
- package/lib/jupyter/lite/server/index.js.map +1 -0
- package/lib/jupyter/lite/server/router.d.ts +99 -0
- package/lib/jupyter/lite/server/router.js +109 -0
- package/lib/jupyter/lite/server/router.js.map +1 -0
- package/lib/jupyter/lite/server/service-manager.d.ts +21 -0
- package/lib/jupyter/lite/server/service-manager.js +102 -0
- package/lib/jupyter/lite/server/service-manager.js.map +1 -0
- package/lib/jupyter/lite/server/service-worker.d.ts +58 -0
- package/lib/jupyter/lite/server/service-worker.js +145 -0
- package/lib/jupyter/lite/server/service-worker.js.map +1 -0
- package/lib/jupyter/lite/server/status.d.ts +18 -0
- package/lib/jupyter/lite/server/status.js +21 -0
- package/lib/jupyter/lite/server/status.js.map +1 -0
- package/lib/jupyter/lite/server/tokens.d.ts +38 -0
- package/lib/jupyter/lite/server/tokens.js +8 -0
- package/lib/jupyter/lite/server/tokens.js.map +1 -0
- package/lib/jupyter/lite/server-extension/index.d.ts +3 -0
- package/lib/jupyter/lite/server-extension/index.js +500 -0
- package/lib/jupyter/lite/server-extension/index.js.map +1 -0
- package/lib/jupyter/lite/session/index.d.ts +2 -0
- package/lib/jupyter/lite/session/index.js +5 -0
- package/lib/jupyter/lite/session/index.js.map +1 -0
- package/lib/jupyter/lite/session/sessions.d.ts +68 -0
- package/lib/jupyter/lite/session/sessions.js +185 -0
- package/lib/jupyter/lite/session/sessions.js.map +1 -0
- package/lib/jupyter/lite/session/tokens.d.ts +40 -0
- package/lib/jupyter/lite/session/tokens.js +6 -0
- package/lib/jupyter/lite/session/tokens.js.map +1 -0
- package/lib/jupyter/lite/settings/index.d.ts +2 -0
- package/lib/jupyter/lite/settings/index.js +5 -0
- package/lib/jupyter/lite/settings/index.js.map +1 -0
- package/lib/jupyter/lite/settings/settings.d.ts +75 -0
- package/lib/jupyter/lite/settings/settings.js +155 -0
- package/lib/jupyter/lite/settings/settings.js.map +1 -0
- package/lib/jupyter/lite/settings/tokens.d.ts +65 -0
- package/lib/jupyter/lite/settings/tokens.js +6 -0
- package/lib/jupyter/lite/settings/tokens.js.map +1 -0
- package/lib/jupyter/lite/translation/index.d.ts +2 -0
- package/lib/jupyter/lite/translation/index.js +5 -0
- package/lib/jupyter/lite/translation/index.js.map +1 -0
- package/lib/jupyter/lite/translation/tokens.d.ts +17 -0
- package/lib/jupyter/lite/translation/tokens.js +6 -0
- package/lib/jupyter/lite/translation/tokens.js.map +1 -0
- package/lib/jupyter/lite/translation/translation.d.ts +13 -0
- package/lib/jupyter/lite/translation/translation.js +52 -0
- package/lib/jupyter/lite/translation/translation.js.map +1 -0
- package/lib/jupyter/lite/types/index.d.ts +1 -0
- package/lib/jupyter/lite/types/index.js +4 -0
- package/lib/jupyter/lite/types/index.js.map +1 -0
- package/lib/jupyter/lite/types/tokens.d.ts +27 -0
- package/lib/jupyter/lite/types/tokens.js +4 -0
- package/lib/jupyter/lite/types/tokens.js.map +1 -0
- package/lib/jupyter/services/ServiceManagerLite.js +15 -6
- package/lib/jupyter/services/ServiceManagerLite.js.map +1 -1
- package/lib/state/JupyterReactState.js +7 -8
- package/lib/state/JupyterReactState.js.map +1 -1
- package/lib/theme/JupyterLabCss.js +4 -2
- package/lib/theme/JupyterLabCss.js.map +1 -1
- package/package.json +23 -16
- package/schema/kernel.v0.schema.json +42 -0
- package/style/icons/pyodide.svg +17 -0
- package/lib/components/kernel/Kernelndicator.js.map +0 -1
- package/lib/examples/NotebookToc.js.map +0 -1
- /package/lib/examples/{NotebookToc.d.ts → KernelExecutorLite.d.ts} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ReadonlyJSONObject, Token } from '@lumino/coreutils';
|
|
2
|
+
/**
|
|
3
|
+
* The well-known name of the file. Can actually be configured by alternate
|
|
4
|
+
* implementations, but the default is probably good enough for "best-effort."
|
|
5
|
+
*/
|
|
6
|
+
export declare const THIRD_PARTY_LICENSES = "third-party-licenses.json";
|
|
7
|
+
/**
|
|
8
|
+
* The token for the licenses service.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ILicenses: Token<ILicenses>;
|
|
11
|
+
/**
|
|
12
|
+
* The interface for the Settings service.
|
|
13
|
+
*/
|
|
14
|
+
export interface ILicenses {
|
|
15
|
+
/**
|
|
16
|
+
* Get licenses
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
get(): Promise<ILicenseResponse | undefined>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A named bundle of licenses
|
|
23
|
+
*/
|
|
24
|
+
export interface ILicenseBundles {
|
|
25
|
+
[key: string]: ILicenseBundle;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The JSON response from the API
|
|
29
|
+
*/
|
|
30
|
+
export interface ILicenseResponse {
|
|
31
|
+
bundles: ILicenseBundles;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A top-level report of the licenses for all code included in a bundle
|
|
35
|
+
*
|
|
36
|
+
* Note
|
|
37
|
+
*
|
|
38
|
+
* This is roughly informed by the terms defined in the SPDX spec, though is not
|
|
39
|
+
* an SPDX Document, since there seem to be several (incompatible) specs
|
|
40
|
+
* in that repo.
|
|
41
|
+
*
|
|
42
|
+
* @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
|
|
43
|
+
**/
|
|
44
|
+
export interface ILicenseBundle extends ReadonlyJSONObject {
|
|
45
|
+
packages: IPackageLicenseInfo[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A best-effort single bundled package's information.
|
|
49
|
+
*
|
|
50
|
+
* Note
|
|
51
|
+
*
|
|
52
|
+
* This is roughly informed by SPDX `packages` and `hasExtractedLicenseInfos`,
|
|
53
|
+
* as making it conformant would vastly complicate the structure.
|
|
54
|
+
*
|
|
55
|
+
* @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
|
|
56
|
+
**/
|
|
57
|
+
export interface IPackageLicenseInfo extends ReadonlyJSONObject {
|
|
58
|
+
/**
|
|
59
|
+
* the name of the package as it appears in package.json
|
|
60
|
+
*/
|
|
61
|
+
name: string;
|
|
62
|
+
/**
|
|
63
|
+
* the version of the package, or an empty string if unknown
|
|
64
|
+
*/
|
|
65
|
+
versionInfo: string;
|
|
66
|
+
/**
|
|
67
|
+
* an SPDX license identifier or LicenseRef, or an empty string if unknown
|
|
68
|
+
*/
|
|
69
|
+
licenseId: string;
|
|
70
|
+
/**
|
|
71
|
+
* the verbatim extracted text of the license, or an empty string if unknown
|
|
72
|
+
*/
|
|
73
|
+
extractedText: string;
|
|
74
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { Token } from '@lumino/coreutils';
|
|
4
|
+
/**
|
|
5
|
+
* The well-known name of the file. Can actually be configured by alternate
|
|
6
|
+
* implementations, but the default is probably good enough for "best-effort."
|
|
7
|
+
*/
|
|
8
|
+
export const THIRD_PARTY_LICENSES = 'third-party-licenses.json';
|
|
9
|
+
/**
|
|
10
|
+
* The token for the licenses service.
|
|
11
|
+
*/
|
|
12
|
+
export const ILicenses = new Token('@jupyterlite/licenses:ILicenses');
|
|
13
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/licenses/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAsB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAChC,iCAAiC,CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import memoryStorageDriver from 'localforage-memoryStorageDriver';
|
|
4
|
+
/**
|
|
5
|
+
* Ensure a localforage singleton has had the memory storage driver installed
|
|
6
|
+
*/
|
|
7
|
+
export async function ensureMemoryStorage(theLocalforage) {
|
|
8
|
+
return await theLocalforage.defineDriver(memoryStorageDriver);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/memory.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,cAAkC;IAElC,OAAO,MAAM,cAAc,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type localforage from 'localforage';
|
|
2
|
+
import { Token } from '@lumino/coreutils';
|
|
3
|
+
/**
|
|
4
|
+
* The token for the localforage singleton.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ILocalForage: Token<ILocalForage>;
|
|
7
|
+
/**
|
|
8
|
+
* An interface for the localforage singleton.
|
|
9
|
+
*/
|
|
10
|
+
export interface ILocalForage {
|
|
11
|
+
localforage: typeof localforage;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { Token } from '@lumino/coreutils';
|
|
4
|
+
/**
|
|
5
|
+
* The token for the localforage singleton.
|
|
6
|
+
*/
|
|
7
|
+
export const ILocalForage = new Token('@jupyterlite/localforge:ILocalForage');
|
|
8
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAI3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,KAAK,CACnC,sCAAsC,CACvC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const allJSONUrl: {
|
|
2
|
+
readonly default: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const ipykernelWheelUrl: {
|
|
5
|
+
readonly default: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const pipliteWheelUrl: {
|
|
8
|
+
readonly default: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const pyodide_kernelWheelUrl: {
|
|
11
|
+
readonly default: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const widgetsnbextensionWheelUrl: {
|
|
14
|
+
readonly default: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const widgetsnbextensionWheelUrl1: {
|
|
17
|
+
readonly default: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Wheel URLs must be full HTTP URLs for micropip to recognize as remote
|
|
2
|
+
// We construct them at runtime using the origin
|
|
3
|
+
// Helper to get the base URL - works in both main thread and workers
|
|
4
|
+
function getBaseUrl() {
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
return window.location.origin;
|
|
7
|
+
}
|
|
8
|
+
if (typeof self !== 'undefined' && 'location' in self) {
|
|
9
|
+
return self.location.origin;
|
|
10
|
+
}
|
|
11
|
+
return '';
|
|
12
|
+
}
|
|
13
|
+
// Export as namespace objects with default property to match the original API
|
|
14
|
+
// The URLs are getters so they're resolved at runtime
|
|
15
|
+
export const allJSONUrl = {
|
|
16
|
+
get default() {
|
|
17
|
+
return `${getBaseUrl()}/pypi/all.json`;
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const ipykernelWheelUrl = {
|
|
21
|
+
get default() {
|
|
22
|
+
return `${getBaseUrl()}/pypi/ipykernel-6.9.2-py3-none-any.whl`;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const pipliteWheelUrl = {
|
|
26
|
+
get default() {
|
|
27
|
+
return `${getBaseUrl()}/pypi/piplite-0.5.1-py3-none-any.whl`;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const pyodide_kernelWheelUrl = {
|
|
31
|
+
get default() {
|
|
32
|
+
return `${getBaseUrl()}/pypi/pyodide_kernel-0.5.1-py3-none-any.whl`;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
export const widgetsnbextensionWheelUrl = {
|
|
36
|
+
get default() {
|
|
37
|
+
return `${getBaseUrl()}/pypi/widgetsnbextension-3.6.999-py3-none-any.whl`;
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const widgetsnbextensionWheelUrl1 = {
|
|
41
|
+
get default() {
|
|
42
|
+
return `${getBaseUrl()}/pypi/widgetsnbextension-4.0.999-py3-none-any.whl`;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=_pypi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_pypi.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/_pypi.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,gDAAgD;AAEhD,qEAAqE;AACrE,SAAS,UAAU;IACjB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChC,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACtD,OAAQ,IAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,8EAA8E;AAC9E,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,gBAAgB,CAAC;IACzC,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,wCAAwC,CAAC;IACjE,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,sCAAsC,CAAC;IAC/D,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,6CAA6C,CAAC;IACtE,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,mDAAmD,CAAC;IAC5E,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,mDAAmD,CAAC;IAC5E,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContentsAPI, TDriveMethod, TDriveRequest, TDriveResponse } from '@jupyterlite/contents';
|
|
2
|
+
import { IPyodideWorkerKernel } from './tokens';
|
|
3
|
+
import { PyodideRemoteKernel } from './worker';
|
|
4
|
+
/**
|
|
5
|
+
* An Emscripten-compatible synchronous Contents API using shared array buffers.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SharedBufferContentsAPI extends ContentsAPI {
|
|
8
|
+
request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T>;
|
|
9
|
+
}
|
|
10
|
+
export declare class PyodideCoincidentKernel extends PyodideRemoteKernel {
|
|
11
|
+
/**
|
|
12
|
+
* Setup custom Emscripten FileSystem
|
|
13
|
+
*/
|
|
14
|
+
protected initFilesystem(options: IPyodideWorkerKernel.IOptions): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
/**
|
|
4
|
+
* A WebWorker entrypoint that uses coincident to handle postMessage details
|
|
5
|
+
*/
|
|
6
|
+
import coincident from 'coincident';
|
|
7
|
+
import { ContentsAPI, DriveFS, } from '@jupyterlite/contents';
|
|
8
|
+
import { PyodideRemoteKernel } from './worker';
|
|
9
|
+
const workerAPI = coincident(self);
|
|
10
|
+
/**
|
|
11
|
+
* An Emscripten-compatible synchronous Contents API using shared array buffers.
|
|
12
|
+
*/
|
|
13
|
+
export class SharedBufferContentsAPI extends ContentsAPI {
|
|
14
|
+
request(data) {
|
|
15
|
+
return workerAPI.processDriveRequest(data);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A custom drive implementation which uses shared array buffers (via coincident) if available
|
|
20
|
+
*/
|
|
21
|
+
class PyodideDriveFS extends DriveFS {
|
|
22
|
+
createAPI(options) {
|
|
23
|
+
return new SharedBufferContentsAPI(options.driveName, options.mountpoint, options.FS, options.ERRNO_CODES);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class PyodideCoincidentKernel extends PyodideRemoteKernel {
|
|
27
|
+
/**
|
|
28
|
+
* Setup custom Emscripten FileSystem
|
|
29
|
+
*/
|
|
30
|
+
async initFilesystem(options) {
|
|
31
|
+
if (options.mountDrive) {
|
|
32
|
+
const mountpoint = '/drive';
|
|
33
|
+
const { FS, PATH, ERRNO_CODES } = this._pyodide;
|
|
34
|
+
const { baseUrl } = options;
|
|
35
|
+
const driveFS = new PyodideDriveFS({
|
|
36
|
+
FS: FS,
|
|
37
|
+
PATH,
|
|
38
|
+
ERRNO_CODES,
|
|
39
|
+
baseUrl,
|
|
40
|
+
driveName: this._driveName,
|
|
41
|
+
mountpoint,
|
|
42
|
+
});
|
|
43
|
+
FS.mkdirTree(mountpoint);
|
|
44
|
+
FS.mount(driveFS, {}, mountpoint);
|
|
45
|
+
FS.chdir(mountpoint);
|
|
46
|
+
this._driveFS = driveFS;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const worker = new PyodideCoincidentKernel();
|
|
51
|
+
const sendWorkerMessage = workerAPI.processWorkerMessage.bind(workerAPI);
|
|
52
|
+
worker.registerCallback(sendWorkerMessage);
|
|
53
|
+
workerAPI.initialize = worker.initialize.bind(worker);
|
|
54
|
+
workerAPI.execute = worker.execute.bind(worker);
|
|
55
|
+
workerAPI.complete = worker.complete.bind(worker);
|
|
56
|
+
workerAPI.inspect = worker.inspect.bind(worker);
|
|
57
|
+
workerAPI.isComplete = worker.isComplete.bind(worker);
|
|
58
|
+
workerAPI.commInfo = worker.commInfo.bind(worker);
|
|
59
|
+
workerAPI.commOpen = worker.commOpen.bind(worker);
|
|
60
|
+
workerAPI.commMsg = worker.commMsg.bind(worker);
|
|
61
|
+
workerAPI.commClose = worker.commClose.bind(worker);
|
|
62
|
+
workerAPI.inputReply = worker.inputReply.bind(worker);
|
|
63
|
+
//# sourceMappingURL=coincident.worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coincident.worker.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/coincident.worker.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPyodideWorkerKernel } from './tokens';
|
|
2
|
+
import { PyodideRemoteKernel } from './worker';
|
|
3
|
+
export declare class PyodideComlinkKernel extends PyodideRemoteKernel {
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
* Setup custom Emscripten FileSystem
|
|
7
|
+
*/
|
|
8
|
+
protected initFilesystem(options: IPyodideWorkerKernel.IOptions): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
/**
|
|
4
|
+
* A WebWorker entrypoint that uses comlink to handle postMessage details
|
|
5
|
+
*/
|
|
6
|
+
import { expose } from 'comlink';
|
|
7
|
+
import { DriveFS, ServiceWorkerContentsAPI, } from '@jupyterlite/contents';
|
|
8
|
+
import { PyodideRemoteKernel } from './worker';
|
|
9
|
+
/**
|
|
10
|
+
* A custom drive implementation which uses the service worker
|
|
11
|
+
*/
|
|
12
|
+
class PyodideDriveFS extends DriveFS {
|
|
13
|
+
createAPI(options) {
|
|
14
|
+
return new ServiceWorkerContentsAPI(options.baseUrl, options.driveName, options.mountpoint, options.FS, options.ERRNO_CODES);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class PyodideComlinkKernel extends PyodideRemoteKernel {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this._sendWorkerMessage = (msg) => {
|
|
21
|
+
// use postMessage, but in a format, that comlink would not process.
|
|
22
|
+
postMessage({ _kernelMessage: msg });
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Setup custom Emscripten FileSystem
|
|
27
|
+
*/
|
|
28
|
+
async initFilesystem(options) {
|
|
29
|
+
if (options.mountDrive) {
|
|
30
|
+
const mountpoint = '/drive';
|
|
31
|
+
const { FS, PATH, ERRNO_CODES } = this._pyodide;
|
|
32
|
+
const { baseUrl } = options;
|
|
33
|
+
const driveFS = new PyodideDriveFS({
|
|
34
|
+
FS: FS,
|
|
35
|
+
PATH,
|
|
36
|
+
ERRNO_CODES,
|
|
37
|
+
baseUrl,
|
|
38
|
+
driveName: this._driveName,
|
|
39
|
+
mountpoint,
|
|
40
|
+
});
|
|
41
|
+
FS.mkdirTree(mountpoint);
|
|
42
|
+
FS.mount(driveFS, {}, mountpoint);
|
|
43
|
+
FS.chdir(mountpoint);
|
|
44
|
+
this._driveFS = driveFS;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const worker = new PyodideComlinkKernel();
|
|
49
|
+
expose(worker);
|
|
50
|
+
//# sourceMappingURL=comlink.worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comlink.worker.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/comlink.worker.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAEL,OAAO,EACP,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,cAAe,SAAQ,OAAO;IAClC,SAAS,CAAC,OAAyB;QACjC,OAAO,IAAI,wBAAwB,CACjC,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,WAAW,CACpB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAC3D;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,kBAAkB,GAAG,CAAC,GAAQ,EAAE,EAAE;YACrC,oEAAoE;YACpE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,cAAc,CAC5B,OAAsC;QAEtC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,QAAQ,CAAC;YAC5B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;YAE5B,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC;gBACjC,EAAE,EAAE,EAAS;gBACb,IAAI;gBACJ,WAAW;gBACX,OAAO;gBACP,SAAS,EAAE,IAAI,CAAC,UAAU;gBAC1B,UAAU;aACX,CAAC,CAAC;YACH,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzB,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAClC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
export * from './_pypi';
|
|
4
|
+
export * from './coincident.worker';
|
|
5
|
+
export * from './comlink.worker';
|
|
6
|
+
export * from './kernel';
|
|
7
|
+
export * from './tokens';
|
|
8
|
+
export * from './worker';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Contents, KernelMessage } from '@jupyterlab/services';
|
|
2
|
+
import { BaseKernel, IKernel } from '@jupyterlite/kernel';
|
|
3
|
+
import { IPyodideWorkerKernel } from './tokens';
|
|
4
|
+
/**
|
|
5
|
+
* A kernel that executes Python code with Pyodide.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PyodideKernel extends BaseKernel implements IKernel {
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate a new PyodideKernel
|
|
10
|
+
*
|
|
11
|
+
* @param options The instantiation options for a new PyodideKernel
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: PyodideKernel.IOptions);
|
|
14
|
+
/**
|
|
15
|
+
* Load the worker.
|
|
16
|
+
*
|
|
17
|
+
* ### Note
|
|
18
|
+
*
|
|
19
|
+
* Subclasses must implement this typographically almost _exactly_ for
|
|
20
|
+
* webpack to find it.
|
|
21
|
+
*/
|
|
22
|
+
protected initWorker(options: PyodideKernel.IOptions): Worker;
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the remote kernel.
|
|
25
|
+
* Use coincident if crossOriginIsolated, comlink otherwise
|
|
26
|
+
* See the two following issues for more context:
|
|
27
|
+
* - https://github.com/jupyterlite/jupyterlite/issues/1424
|
|
28
|
+
* - https://github.com/jupyterlite/pyodide-kernel/pull/126
|
|
29
|
+
*/
|
|
30
|
+
protected initRemote(options: PyodideKernel.IOptions): IPyodideWorkerKernel;
|
|
31
|
+
protected initRemoteOptions(options: PyodideKernel.IOptions): IPyodideWorkerKernel.IOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Dispose the kernel.
|
|
34
|
+
*/
|
|
35
|
+
dispose(): void;
|
|
36
|
+
/**
|
|
37
|
+
* A promise that is fulfilled when the kernel is ready.
|
|
38
|
+
*/
|
|
39
|
+
get ready(): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Process a message coming from the pyodide web worker.
|
|
42
|
+
*
|
|
43
|
+
* @param msg The worker message to process.
|
|
44
|
+
*/
|
|
45
|
+
private _processWorkerMessage;
|
|
46
|
+
/**
|
|
47
|
+
* Handle a kernel_info_request message
|
|
48
|
+
*/
|
|
49
|
+
kernelInfoRequest(): Promise<KernelMessage.IInfoReplyMsg['content']>;
|
|
50
|
+
/**
|
|
51
|
+
* Handle an `execute_request` message
|
|
52
|
+
*
|
|
53
|
+
* @param msg The parent message.
|
|
54
|
+
*/
|
|
55
|
+
executeRequest(content: KernelMessage.IExecuteRequestMsg['content']): Promise<KernelMessage.IExecuteReplyMsg['content']>;
|
|
56
|
+
/**
|
|
57
|
+
* Handle an complete_request message
|
|
58
|
+
*
|
|
59
|
+
* @param msg The parent message.
|
|
60
|
+
*/
|
|
61
|
+
completeRequest(content: KernelMessage.ICompleteRequestMsg['content']): Promise<KernelMessage.ICompleteReplyMsg['content']>;
|
|
62
|
+
/**
|
|
63
|
+
* Handle an `inspect_request` message.
|
|
64
|
+
*
|
|
65
|
+
* @param content - The content of the request.
|
|
66
|
+
*
|
|
67
|
+
* @returns A promise that resolves with the response message.
|
|
68
|
+
*/
|
|
69
|
+
inspectRequest(content: KernelMessage.IInspectRequestMsg['content']): Promise<KernelMessage.IInspectReplyMsg['content']>;
|
|
70
|
+
/**
|
|
71
|
+
* Handle an `is_complete_request` message.
|
|
72
|
+
*
|
|
73
|
+
* @param content - The content of the request.
|
|
74
|
+
*
|
|
75
|
+
* @returns A promise that resolves with the response message.
|
|
76
|
+
*/
|
|
77
|
+
isCompleteRequest(content: KernelMessage.IIsCompleteRequestMsg['content']): Promise<KernelMessage.IIsCompleteReplyMsg['content']>;
|
|
78
|
+
/**
|
|
79
|
+
* Handle a `comm_info_request` message.
|
|
80
|
+
*
|
|
81
|
+
* @param content - The content of the request.
|
|
82
|
+
*
|
|
83
|
+
* @returns A promise that resolves with the response message.
|
|
84
|
+
*/
|
|
85
|
+
commInfoRequest(content: KernelMessage.ICommInfoRequestMsg['content']): Promise<KernelMessage.ICommInfoReplyMsg['content']>;
|
|
86
|
+
/**
|
|
87
|
+
* Send an `comm_open` message.
|
|
88
|
+
*
|
|
89
|
+
* @param msg - The comm_open message.
|
|
90
|
+
*/
|
|
91
|
+
commOpen(msg: KernelMessage.ICommOpenMsg): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Send an `comm_msg` message.
|
|
94
|
+
*
|
|
95
|
+
* @param msg - The comm_msg message.
|
|
96
|
+
*/
|
|
97
|
+
commMsg(msg: KernelMessage.ICommMsgMsg): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Send an `comm_close` message.
|
|
100
|
+
*
|
|
101
|
+
* @param close - The comm_close message.
|
|
102
|
+
*/
|
|
103
|
+
commClose(msg: KernelMessage.ICommCloseMsg): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Send an `input_reply` message.
|
|
106
|
+
*
|
|
107
|
+
* @param content - The content of the reply.
|
|
108
|
+
*/
|
|
109
|
+
inputReply(content: KernelMessage.IInputReplyMsg['content']): Promise<void>;
|
|
110
|
+
private _contentsManager;
|
|
111
|
+
private _contentsProcessor;
|
|
112
|
+
private _worker;
|
|
113
|
+
private _remoteKernel;
|
|
114
|
+
private _ready;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A namespace for PyodideKernel statics.
|
|
118
|
+
*/
|
|
119
|
+
export declare namespace PyodideKernel {
|
|
120
|
+
/**
|
|
121
|
+
* The instantiation options for a Pyodide kernel
|
|
122
|
+
*/
|
|
123
|
+
interface IOptions extends IKernel.IOptions {
|
|
124
|
+
/**
|
|
125
|
+
* The URL to fetch Pyodide.
|
|
126
|
+
*/
|
|
127
|
+
pyodideUrl: string;
|
|
128
|
+
/**
|
|
129
|
+
* The URL to fetch piplite
|
|
130
|
+
*/
|
|
131
|
+
pipliteWheelUrl?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The URLs from which to attempt PyPI API requests
|
|
134
|
+
*/
|
|
135
|
+
pipliteUrls: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Do not try pypi.org if `piplite.install` fails against local URLs
|
|
138
|
+
*/
|
|
139
|
+
disablePyPIFallback: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether or not to mount the Emscripten drive
|
|
142
|
+
*/
|
|
143
|
+
mountDrive: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* additional options to provide to `loadPyodide`
|
|
146
|
+
* @see https://pyodide.org/en/stable/usage/api/js-api.html#globalThis.loadPyodide
|
|
147
|
+
*/
|
|
148
|
+
loadPyodideOptions: Record<string, any> & {
|
|
149
|
+
lockFileURL: string;
|
|
150
|
+
packages: string[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* The Jupyterlite content manager
|
|
154
|
+
*/
|
|
155
|
+
contentsManager: Contents.IManager;
|
|
156
|
+
}
|
|
157
|
+
}
|