@datalayer/jupyter-react 1.1.8 → 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.
Files changed (528) hide show
  1. package/README.md +74 -1
  2. package/lib/app/tabs/components/CellComponent.js +4 -2
  3. package/lib/app/tabs/components/CellComponent.js.map +1 -1
  4. package/lib/app/tabs/components/NotebookComponent.js +2 -2
  5. package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
  6. package/lib/app/tabs/components/ViewerComponent.js +1 -1
  7. package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
  8. package/lib/components/cell/Cell.d.ts +5 -8
  9. package/lib/components/cell/Cell.js +6 -22
  10. package/lib/components/cell/Cell.js.map +1 -1
  11. package/lib/components/cell/CellAdapter.d.ts +1 -3
  12. package/lib/components/cell/CellAdapter.js +5 -17
  13. package/lib/components/cell/CellAdapter.js.map +1 -1
  14. package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +2 -2
  15. package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
  16. package/lib/components/console/ConsoleAdapter.d.ts +1 -1
  17. package/lib/components/console/ConsoleAdapter.js +1 -1
  18. package/lib/components/console/ConsoleAdapter.js.map +1 -1
  19. package/lib/components/jupyterlab/JupyterLabApp.d.ts +16 -19
  20. package/lib/components/jupyterlab/JupyterLabApp.js +27 -21
  21. package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
  22. package/lib/components/jupyterlab/JupyterLabAppAdapter.d.ts +4 -4
  23. package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
  24. package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
  25. package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +1 -4
  26. package/lib/components/jupyterlab/JupyterLabAppCss.js +1 -5
  27. package/lib/components/jupyterlab/JupyterLabAppCss.js.map +1 -1
  28. package/lib/components/kernel/KernelActionMenu.d.ts +2 -2
  29. package/lib/components/kernel/KernelActionMenu.js.map +1 -1
  30. package/lib/components/kernel/KernelDetective.d.ts +1 -1
  31. package/lib/components/kernel/{Kernelndicator.d.ts → KernelIndicator.d.ts} +2 -1
  32. package/lib/components/kernel/{Kernelndicator.js → KernelIndicator.js} +13 -5
  33. package/lib/components/kernel/KernelIndicator.js.map +1 -0
  34. package/lib/components/kernel/KernelInspector.d.ts +2 -2
  35. package/lib/components/kernel/KernelInspector.js.map +1 -1
  36. package/lib/components/kernel/KernelSelector.d.ts +2 -2
  37. package/lib/components/kernel/KernelSelector.js.map +1 -1
  38. package/lib/components/kernel/KernelUsage.d.ts +2 -2
  39. package/lib/components/kernel/KernelUsage.js.map +1 -1
  40. package/lib/components/kernel/KernelVariables.d.ts +2 -2
  41. package/lib/components/kernel/KernelVariables.js.map +1 -1
  42. package/lib/components/kernel/index.d.ts +1 -1
  43. package/lib/components/kernel/index.js +1 -1
  44. package/lib/components/kernel/index.js.map +1 -1
  45. package/lib/components/kernel/variables/kernelconnector.d.ts +2 -2
  46. package/lib/components/kernel/variables/kernelconnector.js +2 -2
  47. package/lib/components/kernel/variables/widget.d.ts +4 -2
  48. package/lib/components/kernel/variables/widget.js.map +1 -1
  49. package/lib/components/lumino/Lumino.d.ts +1 -1
  50. package/lib/components/lumino/LuminoBox.d.ts +3 -9
  51. package/lib/components/lumino/LuminoBox.js +1 -6
  52. package/lib/components/lumino/LuminoBox.js.map +1 -1
  53. package/lib/components/lumino/ReactPortalWidget.d.ts +1 -2
  54. package/lib/components/notebook/Notebook.d.ts +4 -6
  55. package/lib/components/notebook/Notebook.js +11 -26
  56. package/lib/components/notebook/Notebook.js.map +1 -1
  57. package/lib/components/notebook/Notebook2.d.ts +6 -2
  58. package/lib/components/notebook/Notebook2.js +3 -2
  59. package/lib/components/notebook/Notebook2.js.map +1 -1
  60. package/lib/components/notebook/Notebook2Adapter.d.ts +189 -0
  61. package/lib/components/notebook/Notebook2Adapter.js +554 -10
  62. package/lib/components/notebook/Notebook2Adapter.js.map +1 -1
  63. package/lib/components/notebook/Notebook2Base.d.ts +15 -9
  64. package/lib/components/notebook/Notebook2Base.js +89 -50
  65. package/lib/components/notebook/Notebook2Base.js.map +1 -1
  66. package/lib/components/notebook/Notebook2State.d.ts +35 -8
  67. package/lib/components/notebook/Notebook2State.js +74 -45
  68. package/lib/components/notebook/Notebook2State.js.map +1 -1
  69. package/lib/components/notebook/NotebookAdapter.d.ts +1 -0
  70. package/lib/components/notebook/NotebookAdapter.js +13 -8
  71. package/lib/components/notebook/NotebookAdapter.js.map +1 -1
  72. package/lib/components/notebook/NotebookCommands.d.ts +25 -2
  73. package/lib/components/notebook/NotebookCommands.js +89 -10
  74. package/lib/components/notebook/NotebookCommands.js.map +1 -1
  75. package/lib/components/notebook/NotebookState.d.ts +11 -11
  76. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +1 -1
  77. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.d.ts +2 -4
  78. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js +1 -3
  79. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js.map +1 -1
  80. package/lib/components/notebook/index.d.ts +1 -0
  81. package/lib/components/notebook/index.js +1 -0
  82. package/lib/components/notebook/index.js.map +1 -1
  83. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.d.ts +28 -1
  84. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js +15 -1
  85. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js.map +1 -1
  86. package/lib/components/output/Output.d.ts +11 -13
  87. package/lib/components/output/Output.js +19 -30
  88. package/lib/components/output/Output.js.map +1 -1
  89. package/lib/components/output/OutputIPyWidgets.d.ts +2 -2
  90. package/lib/components/output/OutputIPyWidgets.js.map +1 -1
  91. package/lib/components/output/OutputRenderer.d.ts +2 -2
  92. package/lib/components/output/OutputRenderer.js.map +1 -1
  93. package/lib/components/terminal/Terminal.d.ts +1 -4
  94. package/lib/components/terminal/Terminal.js +5 -8
  95. package/lib/components/terminal/Terminal.js.map +1 -1
  96. package/lib/components/viewer/Viewer.d.ts +1 -1
  97. package/lib/components/viewer/output/OutputViewer.d.ts +3 -6
  98. package/lib/components/viewer/output/OutputViewer.js +1 -5
  99. package/lib/components/viewer/output/OutputViewer.js.map +1 -1
  100. package/lib/examples/Bokeh.js +2 -2
  101. package/lib/examples/Bokeh.js.map +1 -1
  102. package/lib/examples/Bqplot.js +2 -2
  103. package/lib/examples/Bqplot.js.map +1 -1
  104. package/lib/examples/Cell.js +4 -4
  105. package/lib/examples/Cell.js.map +1 -1
  106. package/lib/examples/CellLite.js +16 -4
  107. package/lib/examples/CellLite.js.map +1 -1
  108. package/lib/examples/Cells.js +9 -6
  109. package/lib/examples/Cells.js.map +1 -1
  110. package/lib/examples/CellsExecute.js +13 -9
  111. package/lib/examples/CellsExecute.js.map +1 -1
  112. package/lib/examples/Console.js +2 -2
  113. package/lib/examples/Console.js.map +1 -1
  114. package/lib/examples/ConsoleLite.js +3 -3
  115. package/lib/examples/ConsoleLite.js.map +1 -1
  116. package/lib/examples/Dashboard.js +2 -2
  117. package/lib/examples/Dashboard.js.map +1 -1
  118. package/lib/examples/Deno.js +2 -2
  119. package/lib/examples/Deno.js.map +1 -1
  120. package/lib/examples/Examples.d.ts +23 -0
  121. package/lib/examples/Examples.js +342 -0
  122. package/lib/examples/Examples.js.map +1 -0
  123. package/lib/examples/FileBrowser.js +2 -2
  124. package/lib/examples/FileBrowser.js.map +1 -1
  125. package/lib/examples/GeoJson.js +2 -2
  126. package/lib/examples/GeoJson.js.map +1 -1
  127. package/lib/examples/IPyLeaflet.js +3 -3
  128. package/lib/examples/IPyLeaflet.js.map +1 -1
  129. package/lib/examples/IPyReact.js +3 -3
  130. package/lib/examples/IPyReact.js.map +1 -1
  131. package/lib/examples/IPyWidgets.js +3 -3
  132. package/lib/examples/IPyWidgets.js.map +1 -1
  133. package/lib/examples/IPyWidgetsState.js +3 -3
  134. package/lib/examples/IPyWidgetsState.js.map +1 -1
  135. package/lib/examples/JupyterContext.js +2 -2
  136. package/lib/examples/JupyterContext.js.map +1 -1
  137. package/lib/examples/JupyterLabAppHeadless.js +2 -2
  138. package/lib/examples/JupyterLabAppHeadless.js.map +1 -1
  139. package/lib/examples/JupyterLabAppHeadlessServerless.js +2 -2
  140. package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -1
  141. package/lib/examples/JupyterLabAppServerless.js +2 -2
  142. package/lib/examples/JupyterLabAppServerless.js.map +1 -1
  143. package/lib/examples/JupyterLabAppServiceManager.js +2 -2
  144. package/lib/examples/JupyterLabAppServiceManager.js.map +1 -1
  145. package/lib/examples/JupyterLabTheme.js +2 -2
  146. package/lib/examples/JupyterLabTheme.js.map +1 -1
  147. package/lib/examples/KernelExecute.d.ts +1 -1
  148. package/lib/examples/KernelExecute.js +9 -11
  149. package/lib/examples/KernelExecute.js.map +1 -1
  150. package/lib/examples/KernelExecuteLite.d.ts +1 -0
  151. package/lib/examples/KernelExecuteLite.js +51 -0
  152. package/lib/examples/KernelExecuteLite.js.map +1 -0
  153. package/lib/examples/KernelExecutor.js +10 -9
  154. package/lib/examples/KernelExecutor.js.map +1 -1
  155. package/lib/examples/KernelExecutorLite.js +63 -0
  156. package/lib/examples/KernelExecutorLite.js.map +1 -0
  157. package/lib/examples/Kernels.js +6 -5
  158. package/lib/examples/Kernels.js.map +1 -1
  159. package/lib/examples/Lumino.js +2 -2
  160. package/lib/examples/Lumino.js.map +1 -1
  161. package/lib/examples/Matplotlib.js +10 -6
  162. package/lib/examples/Matplotlib.js.map +1 -1
  163. package/lib/examples/Notebook.js +3 -2
  164. package/lib/examples/Notebook.js.map +1 -1
  165. package/lib/examples/Notebook2.js +9 -6
  166. package/lib/examples/Notebook2.js.map +1 -1
  167. package/lib/examples/Notebook2Actions.js +8 -6
  168. package/lib/examples/Notebook2Actions.js.map +1 -1
  169. package/lib/examples/Notebook2Collaborative.js +2 -2
  170. package/lib/examples/Notebook2Collaborative.js.map +1 -1
  171. package/lib/examples/Notebook2Lite.js +19 -14
  172. package/lib/examples/Notebook2Lite.js.map +1 -1
  173. package/lib/examples/NotebookCellSidebar.js +3 -3
  174. package/lib/examples/NotebookCellSidebar.js.map +1 -1
  175. package/lib/examples/NotebookCellToolbar.js +4 -4
  176. package/lib/examples/NotebookCellToolbar.js.map +1 -1
  177. package/lib/examples/NotebookCollaborative.js +2 -2
  178. package/lib/examples/NotebookCollaborative.js.map +1 -1
  179. package/lib/examples/NotebookColormode.js +15 -10
  180. package/lib/examples/NotebookColormode.js.map +1 -1
  181. package/lib/examples/NotebookExtension.js +4 -4
  182. package/lib/examples/NotebookExtension.js.map +1 -1
  183. package/lib/examples/NotebookExternalContent.js +18 -13
  184. package/lib/examples/NotebookExternalContent.js.map +1 -1
  185. package/lib/examples/NotebookInit.js +10 -9
  186. package/lib/examples/NotebookInit.js.map +1 -1
  187. package/lib/examples/NotebookKernel.js +4 -4
  188. package/lib/examples/NotebookKernel.js.map +1 -1
  189. package/lib/examples/NotebookKernelChange.js +2 -2
  190. package/lib/examples/NotebookKernelChange.js.map +1 -1
  191. package/lib/examples/NotebookLess.js +4 -4
  192. package/lib/examples/NotebookLess.js.map +1 -1
  193. package/lib/examples/NotebookLite.js +10 -6
  194. package/lib/examples/NotebookLite.js.map +1 -1
  195. package/lib/examples/NotebookLiteContext.js +10 -5
  196. package/lib/examples/NotebookLiteContext.js.map +1 -1
  197. package/lib/examples/NotebookLocalServer.js +3 -3
  198. package/lib/examples/NotebookLocalServer.js.map +1 -1
  199. package/lib/examples/NotebookNbformat.js +7 -5
  200. package/lib/examples/NotebookNbformat.js.map +1 -1
  201. package/lib/examples/NotebookNbformatChange.js +12 -6
  202. package/lib/examples/NotebookNbformatChange.js.map +1 -1
  203. package/lib/examples/NotebookNoContext.js +4 -3
  204. package/lib/examples/NotebookNoContext.js.map +1 -1
  205. package/lib/examples/NotebookNoPrimer.js +3 -2
  206. package/lib/examples/NotebookNoPrimer.js.map +1 -1
  207. package/lib/examples/NotebookOnSessionConnection.js +5 -5
  208. package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
  209. package/lib/examples/NotebookPath.js +2 -2
  210. package/lib/examples/NotebookPath.js.map +1 -1
  211. package/lib/examples/NotebookPathChange.js +5 -4
  212. package/lib/examples/NotebookPathChange.js.map +1 -1
  213. package/lib/examples/NotebookReadonly.js +4 -4
  214. package/lib/examples/NotebookReadonly.js.map +1 -1
  215. package/lib/examples/NotebookServiceManager.js +4 -4
  216. package/lib/examples/NotebookServiceManager.js.map +1 -1
  217. package/lib/examples/NotebookSkeleton.js +3 -2
  218. package/lib/examples/NotebookSkeleton.js.map +1 -1
  219. package/lib/examples/NotebookTOC.d.ts +1 -0
  220. package/lib/examples/{NotebookToc.js → NotebookTOC.js} +12 -6
  221. package/lib/examples/NotebookTOC.js.map +1 -0
  222. package/lib/examples/NotebookTheme.js +10 -5
  223. package/lib/examples/NotebookTheme.js.map +1 -1
  224. package/lib/examples/NotebookThemeColormode.js +4 -4
  225. package/lib/examples/NotebookThemeColormode.js.map +1 -1
  226. package/lib/examples/NotebookURL.js +3 -2
  227. package/lib/examples/NotebookURL.js.map +1 -1
  228. package/lib/examples/NotebookUnmount.js +13 -7
  229. package/lib/examples/NotebookUnmount.js.map +1 -1
  230. package/lib/examples/ObservableHQ.js +2 -2
  231. package/lib/examples/ObservableHQ.js.map +1 -1
  232. package/lib/examples/OutputIPyWidgets.js +3 -3
  233. package/lib/examples/OutputIPyWidgets.js.map +1 -1
  234. package/lib/examples/OutputWithMonitoring.js +3 -2
  235. package/lib/examples/OutputWithMonitoring.js.map +1 -1
  236. package/lib/examples/Outputs.js +8 -8
  237. package/lib/examples/Outputs.js.map +1 -1
  238. package/lib/examples/OutputsIpynb.js +4 -4
  239. package/lib/examples/OutputsIpynb.js.map +1 -1
  240. package/lib/examples/Panel.js +2 -2
  241. package/lib/examples/Panel.js.map +1 -1
  242. package/lib/examples/Plotly.js +2 -2
  243. package/lib/examples/Plotly.js.map +1 -1
  244. package/lib/examples/PyGWalker.js +4 -4
  245. package/lib/examples/PyGWalker.js.map +1 -1
  246. package/lib/examples/Terminal.js +4 -3
  247. package/lib/examples/Terminal.js.map +1 -1
  248. package/lib/examples/Vega.js +2 -2
  249. package/lib/examples/Vega.js.map +1 -1
  250. package/lib/examples/Viewer.js +5 -4
  251. package/lib/examples/Viewer.js.map +1 -1
  252. package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js +1 -1
  253. package/lib/index.d.ts +1 -0
  254. package/lib/index.js +1 -0
  255. package/lib/index.js.map +1 -1
  256. package/lib/jupyter/Jupyter.d.ts +1 -74
  257. package/lib/jupyter/Jupyter.js +2 -9
  258. package/lib/jupyter/Jupyter.js.map +1 -1
  259. package/lib/jupyter/JupyterConfig.js +7 -5
  260. package/lib/jupyter/JupyterConfig.js.map +1 -1
  261. package/lib/jupyter/JupyterContext.d.ts +2 -2
  262. package/lib/jupyter/collaboration/ICollaborationProvider.js.map +1 -1
  263. package/lib/jupyter/ipywidgets/classic/htmlmanager.d.ts +6 -0
  264. package/lib/jupyter/ipywidgets/classic/htmlmanager.js +8 -0
  265. package/lib/jupyter/ipywidgets/classic/htmlmanager.js.map +1 -1
  266. package/lib/jupyter/ipywidgets/lab/manager.d.ts +6 -0
  267. package/lib/jupyter/ipywidgets/lab/manager.js +8 -0
  268. package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
  269. package/lib/jupyter/ipywidgets/libembed-amd.d.ts +1 -1
  270. package/lib/jupyter/ipywidgets/libembed-amd.js +1 -1
  271. package/lib/jupyter/kernel/Kernel.js +21 -15
  272. package/lib/jupyter/kernel/Kernel.js.map +1 -1
  273. package/lib/jupyter/kernel/KernelState.d.ts +1 -1
  274. package/lib/jupyter/lite/Lite.d.ts +1 -1
  275. package/lib/jupyter/lite/LiteServer.d.ts +2 -2
  276. package/lib/jupyter/lite/LiteServer.js +21 -6
  277. package/lib/jupyter/lite/LiteServer.js.map +1 -1
  278. package/lib/jupyter/lite/contents/broadcast.d.ts +27 -0
  279. package/lib/jupyter/lite/contents/broadcast.js +60 -0
  280. package/lib/jupyter/lite/contents/broadcast.js.map +1 -0
  281. package/lib/jupyter/lite/contents/contents.d.ts +228 -0
  282. package/lib/jupyter/lite/contents/contents.js +774 -0
  283. package/lib/jupyter/lite/contents/contents.js.map +1 -0
  284. package/lib/jupyter/lite/contents/drivecontents.d.ts +92 -0
  285. package/lib/jupyter/lite/contents/drivecontents.js +133 -0
  286. package/lib/jupyter/lite/contents/drivecontents.js.map +1 -0
  287. package/lib/jupyter/lite/contents/drivefs.d.ts +193 -0
  288. package/lib/jupyter/lite/contents/drivefs.js +432 -0
  289. package/lib/jupyter/lite/contents/drivefs.js.map +1 -0
  290. package/lib/jupyter/lite/contents/emscripten.d.ts +89 -0
  291. package/lib/jupyter/lite/contents/emscripten.js +11 -0
  292. package/lib/jupyter/lite/contents/emscripten.js.map +1 -0
  293. package/lib/jupyter/lite/contents/index.d.ts +6 -0
  294. package/lib/jupyter/lite/contents/index.js +9 -0
  295. package/lib/jupyter/lite/contents/index.js.map +1 -0
  296. package/lib/jupyter/lite/contents/tokens.d.ts +136 -0
  297. package/lib/jupyter/lite/contents/tokens.js +66 -0
  298. package/lib/jupyter/lite/contents/tokens.js.map +1 -0
  299. package/lib/jupyter/lite/kernel/index.d.ts +4 -0
  300. package/lib/jupyter/lite/kernel/index.js +7 -0
  301. package/lib/jupyter/lite/kernel/index.js.map +1 -0
  302. package/lib/jupyter/lite/kernel/kernel.d.ts +245 -0
  303. package/lib/jupyter/lite/kernel/kernel.js +453 -0
  304. package/lib/jupyter/lite/kernel/kernel.js.map +1 -0
  305. package/lib/jupyter/lite/kernel/kernels.d.ts +85 -0
  306. package/lib/jupyter/lite/kernel/kernels.js +218 -0
  307. package/lib/jupyter/lite/kernel/kernels.js.map +1 -0
  308. package/lib/jupyter/lite/kernel/kernelspecs.d.ts +53 -0
  309. package/lib/jupyter/lite/kernel/kernelspecs.js +50 -0
  310. package/lib/jupyter/lite/kernel/kernelspecs.js.map +1 -0
  311. package/lib/jupyter/lite/kernel/tokens.d.ts +171 -0
  312. package/lib/jupyter/lite/kernel/tokens.js +16 -0
  313. package/lib/jupyter/lite/kernel/tokens.js.map +1 -0
  314. package/lib/jupyter/lite/licenses/index.d.ts +2 -0
  315. package/lib/jupyter/lite/licenses/index.js +5 -0
  316. package/lib/jupyter/lite/licenses/index.js.map +1 -0
  317. package/lib/jupyter/lite/licenses/licenses.d.ts +35 -0
  318. package/lib/jupyter/lite/licenses/licenses.js +95 -0
  319. package/lib/jupyter/lite/licenses/licenses.js.map +1 -0
  320. package/lib/jupyter/lite/licenses/tokens.d.ts +74 -0
  321. package/lib/jupyter/lite/licenses/tokens.js +13 -0
  322. package/lib/jupyter/lite/licenses/tokens.js.map +1 -0
  323. package/lib/jupyter/lite/localforage/index.d.ts +2 -0
  324. package/lib/jupyter/lite/localforage/index.js +5 -0
  325. package/lib/jupyter/lite/localforage/index.js.map +1 -0
  326. package/lib/jupyter/lite/localforage/memory.d.ts +5 -0
  327. package/lib/jupyter/lite/localforage/memory.js +10 -0
  328. package/lib/jupyter/lite/localforage/memory.js.map +1 -0
  329. package/lib/jupyter/lite/localforage/tokens.d.ts +12 -0
  330. package/lib/jupyter/lite/localforage/tokens.js +8 -0
  331. package/lib/jupyter/lite/localforage/tokens.js.map +1 -0
  332. package/lib/jupyter/lite/pyodide-kernel/_pypi.d.ts +18 -0
  333. package/lib/jupyter/lite/pyodide-kernel/_pypi.js +45 -0
  334. package/lib/jupyter/lite/pyodide-kernel/_pypi.js.map +1 -0
  335. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.d.ts +15 -0
  336. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js +63 -0
  337. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js.map +1 -0
  338. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.d.ts +9 -0
  339. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js +50 -0
  340. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js.map +1 -0
  341. package/lib/jupyter/lite/pyodide-kernel/index.d.ts +6 -0
  342. package/lib/jupyter/lite/pyodide-kernel/index.js +9 -0
  343. package/lib/jupyter/lite/pyodide-kernel/index.js.map +1 -0
  344. package/lib/jupyter/lite/pyodide-kernel/kernel.d.ts +157 -0
  345. package/lib/jupyter/lite/pyodide-kernel/kernel.js +294 -0
  346. package/lib/jupyter/lite/pyodide-kernel/kernel.js.map +1 -0
  347. package/lib/jupyter/lite/pyodide-kernel/pypi/all-local.json +128 -0
  348. package/lib/jupyter/lite/pyodide-kernel/pypi/all.json +128 -0
  349. package/lib/jupyter/lite/pyodide-kernel/schema/piplite.v0.schema.json +113 -0
  350. package/lib/jupyter/lite/pyodide-kernel/tokens.d.ts +82 -0
  351. package/lib/jupyter/lite/pyodide-kernel/tokens.js +8 -0
  352. package/lib/jupyter/lite/pyodide-kernel/tokens.js.map +1 -0
  353. package/lib/jupyter/lite/pyodide-kernel/worker.d.ts +138 -0
  354. package/lib/jupyter/lite/pyodide-kernel/worker.js +426 -0
  355. package/lib/jupyter/lite/pyodide-kernel/worker.js.map +1 -0
  356. package/lib/jupyter/lite/pyodide-kernel-extension/index.d.ts +4 -0
  357. package/lib/jupyter/lite/pyodide-kernel-extension/index.js +88 -0
  358. package/lib/jupyter/lite/pyodide-kernel-extension/index.js.map +1 -0
  359. package/lib/jupyter/lite/server/app.d.ts +87 -0
  360. package/lib/jupyter/lite/server/app.js +157 -0
  361. package/lib/jupyter/lite/server/app.js.map +1 -0
  362. package/lib/jupyter/lite/server/index.d.ts +4 -0
  363. package/lib/jupyter/lite/server/index.js +7 -0
  364. package/lib/jupyter/lite/server/index.js.map +1 -0
  365. package/lib/jupyter/lite/server/router.d.ts +99 -0
  366. package/lib/jupyter/lite/server/router.js +109 -0
  367. package/lib/jupyter/lite/server/router.js.map +1 -0
  368. package/lib/jupyter/lite/server/service-manager.d.ts +21 -0
  369. package/lib/jupyter/lite/server/service-manager.js +102 -0
  370. package/lib/jupyter/lite/server/service-manager.js.map +1 -0
  371. package/lib/jupyter/lite/server/service-worker.d.ts +58 -0
  372. package/lib/jupyter/lite/server/service-worker.js +145 -0
  373. package/lib/jupyter/lite/server/service-worker.js.map +1 -0
  374. package/lib/jupyter/lite/server/status.d.ts +18 -0
  375. package/lib/jupyter/lite/server/status.js +21 -0
  376. package/lib/jupyter/lite/server/status.js.map +1 -0
  377. package/lib/jupyter/lite/server/tokens.d.ts +38 -0
  378. package/lib/jupyter/lite/server/tokens.js +8 -0
  379. package/lib/jupyter/lite/server/tokens.js.map +1 -0
  380. package/lib/jupyter/lite/server-extension/index.d.ts +3 -0
  381. package/lib/jupyter/lite/server-extension/index.js +500 -0
  382. package/lib/jupyter/lite/server-extension/index.js.map +1 -0
  383. package/lib/jupyter/lite/session/index.d.ts +2 -0
  384. package/lib/jupyter/lite/session/index.js +5 -0
  385. package/lib/jupyter/lite/session/index.js.map +1 -0
  386. package/lib/jupyter/lite/session/sessions.d.ts +68 -0
  387. package/lib/jupyter/lite/session/sessions.js +185 -0
  388. package/lib/jupyter/lite/session/sessions.js.map +1 -0
  389. package/lib/jupyter/lite/session/tokens.d.ts +40 -0
  390. package/lib/jupyter/lite/session/tokens.js +6 -0
  391. package/lib/jupyter/lite/session/tokens.js.map +1 -0
  392. package/lib/jupyter/lite/settings/index.d.ts +2 -0
  393. package/lib/jupyter/lite/settings/index.js +5 -0
  394. package/lib/jupyter/lite/settings/index.js.map +1 -0
  395. package/lib/jupyter/lite/settings/settings.d.ts +75 -0
  396. package/lib/jupyter/lite/settings/settings.js +155 -0
  397. package/lib/jupyter/lite/settings/settings.js.map +1 -0
  398. package/lib/jupyter/lite/settings/tokens.d.ts +65 -0
  399. package/lib/jupyter/lite/settings/tokens.js +6 -0
  400. package/lib/jupyter/lite/settings/tokens.js.map +1 -0
  401. package/lib/jupyter/lite/translation/index.d.ts +2 -0
  402. package/lib/jupyter/lite/translation/index.js +5 -0
  403. package/lib/jupyter/lite/translation/index.js.map +1 -0
  404. package/lib/jupyter/lite/translation/tokens.d.ts +17 -0
  405. package/lib/jupyter/lite/translation/tokens.js +6 -0
  406. package/lib/jupyter/lite/translation/tokens.js.map +1 -0
  407. package/lib/jupyter/lite/translation/translation.d.ts +13 -0
  408. package/lib/jupyter/lite/translation/translation.js +52 -0
  409. package/lib/jupyter/lite/translation/translation.js.map +1 -0
  410. package/lib/jupyter/lite/types/index.d.ts +1 -0
  411. package/lib/jupyter/lite/types/index.js +4 -0
  412. package/lib/jupyter/lite/types/index.js.map +1 -0
  413. package/lib/jupyter/lite/types/tokens.d.ts +27 -0
  414. package/lib/jupyter/lite/types/tokens.js +4 -0
  415. package/lib/jupyter/lite/types/tokens.js.map +1 -0
  416. package/lib/jupyter/services/ServiceManagerLite.js +15 -6
  417. package/lib/jupyter/services/ServiceManagerLite.js.map +1 -1
  418. package/lib/state/JupyterReactState.js +7 -8
  419. package/lib/state/JupyterReactState.js.map +1 -1
  420. package/lib/theme/JupyterLabCss.d.ts +1 -1
  421. package/lib/theme/JupyterLabCss.js +4 -2
  422. package/lib/theme/JupyterLabCss.js.map +1 -1
  423. package/lib/theme/JupyterReactTheme.d.ts +1 -1
  424. package/lib/tools/__tests__/operationRunner.test.d.ts +1 -0
  425. package/lib/tools/__tests__/operationRunner.test.js +193 -0
  426. package/lib/tools/__tests__/operationRunner.test.js.map +1 -0
  427. package/lib/tools/core/executor.d.ts +46 -0
  428. package/lib/tools/core/executor.js +55 -0
  429. package/lib/tools/core/executor.js.map +1 -0
  430. package/lib/tools/core/formatter.d.ts +20 -0
  431. package/lib/tools/core/formatter.js +41 -0
  432. package/lib/tools/core/formatter.js.map +1 -0
  433. package/lib/tools/core/index.d.ts +18 -0
  434. package/lib/tools/core/index.js +24 -0
  435. package/lib/tools/core/index.js.map +1 -0
  436. package/lib/tools/core/interfaces.d.ts +38 -0
  437. package/lib/tools/core/interfaces.js +7 -0
  438. package/lib/tools/core/interfaces.js.map +1 -0
  439. package/lib/tools/core/operationRunner.d.ts +27 -0
  440. package/lib/tools/core/operationRunner.js +33 -0
  441. package/lib/tools/core/operationRunner.js.map +1 -0
  442. package/lib/tools/core/schema.d.ts +47 -0
  443. package/lib/tools/core/schema.js +7 -0
  444. package/lib/tools/core/schema.js.map +1 -0
  445. package/lib/tools/core/types.d.ts +36 -0
  446. package/lib/tools/core/types.js +7 -0
  447. package/lib/tools/core/types.js.map +1 -0
  448. package/lib/tools/core/zodUtils.d.ts +56 -0
  449. package/lib/tools/core/zodUtils.js +179 -0
  450. package/lib/tools/core/zodUtils.js.map +1 -0
  451. package/lib/tools/definitions/deleteCell.d.ts +7 -0
  452. package/lib/tools/definitions/deleteCell.js +25 -0
  453. package/lib/tools/definitions/deleteCell.js.map +1 -0
  454. package/lib/tools/definitions/executeCode.d.ts +7 -0
  455. package/lib/tools/definitions/executeCode.js +33 -0
  456. package/lib/tools/definitions/executeCode.js.map +1 -0
  457. package/lib/tools/definitions/index.d.ts +12 -0
  458. package/lib/tools/definitions/index.js +18 -0
  459. package/lib/tools/definitions/index.js.map +1 -0
  460. package/lib/tools/definitions/insertCell.d.ts +7 -0
  461. package/lib/tools/definitions/insertCell.js +24 -0
  462. package/lib/tools/definitions/insertCell.js.map +1 -0
  463. package/lib/tools/definitions/readAllCells.d.ts +7 -0
  464. package/lib/tools/definitions/readAllCells.js +24 -0
  465. package/lib/tools/definitions/readAllCells.js.map +1 -0
  466. package/lib/tools/definitions/readCell.d.ts +7 -0
  467. package/lib/tools/definitions/readCell.js +24 -0
  468. package/lib/tools/definitions/readCell.js.map +1 -0
  469. package/lib/tools/definitions/runCell.d.ts +7 -0
  470. package/lib/tools/definitions/runCell.js +31 -0
  471. package/lib/tools/definitions/runCell.js.map +1 -0
  472. package/lib/tools/definitions/updateCell.d.ts +7 -0
  473. package/lib/tools/definitions/updateCell.js +24 -0
  474. package/lib/tools/definitions/updateCell.js.map +1 -0
  475. package/lib/tools/index.d.ts +20 -0
  476. package/lib/tools/index.js +62 -0
  477. package/lib/tools/index.js.map +1 -0
  478. package/lib/tools/operations/deleteCell.d.ts +49 -0
  479. package/lib/tools/operations/deleteCell.js +103 -0
  480. package/lib/tools/operations/deleteCell.js.map +1 -0
  481. package/lib/tools/operations/executeCode.d.ts +33 -0
  482. package/lib/tools/operations/executeCode.js +45 -0
  483. package/lib/tools/operations/executeCode.js.map +1 -0
  484. package/lib/tools/operations/insertCell.d.ts +27 -0
  485. package/lib/tools/operations/insertCell.js +56 -0
  486. package/lib/tools/operations/insertCell.js.map +1 -0
  487. package/lib/tools/operations/readAllCells.d.ts +21 -0
  488. package/lib/tools/operations/readAllCells.js +45 -0
  489. package/lib/tools/operations/readAllCells.js.map +1 -0
  490. package/lib/tools/operations/readCell.d.ts +39 -0
  491. package/lib/tools/operations/readCell.js +90 -0
  492. package/lib/tools/operations/readCell.js.map +1 -0
  493. package/lib/tools/operations/runCell.d.ts +24 -0
  494. package/lib/tools/operations/runCell.js +124 -0
  495. package/lib/tools/operations/runCell.js.map +1 -0
  496. package/lib/tools/operations/updateCell.d.ts +27 -0
  497. package/lib/tools/operations/updateCell.js +53 -0
  498. package/lib/tools/operations/updateCell.js.map +1 -0
  499. package/lib/tools/schemas/deleteCell.d.ts +20 -0
  500. package/lib/tools/schemas/deleteCell.js +24 -0
  501. package/lib/tools/schemas/deleteCell.js.map +1 -0
  502. package/lib/tools/schemas/executeCode.d.ts +19 -0
  503. package/lib/tools/schemas/executeCode.js +28 -0
  504. package/lib/tools/schemas/executeCode.js.map +1 -0
  505. package/lib/tools/schemas/index.d.ts +12 -0
  506. package/lib/tools/schemas/index.js +18 -0
  507. package/lib/tools/schemas/index.js.map +1 -0
  508. package/lib/tools/schemas/insertCell.d.ts +24 -0
  509. package/lib/tools/schemas/insertCell.js +29 -0
  510. package/lib/tools/schemas/insertCell.js.map +1 -0
  511. package/lib/tools/schemas/readAllCells.d.ts +19 -0
  512. package/lib/tools/schemas/readAllCells.js +18 -0
  513. package/lib/tools/schemas/readAllCells.js.map +1 -0
  514. package/lib/tools/schemas/readCell.d.ts +19 -0
  515. package/lib/tools/schemas/readCell.js +24 -0
  516. package/lib/tools/schemas/readCell.js.map +1 -0
  517. package/lib/tools/schemas/runCell.d.ts +21 -0
  518. package/lib/tools/schemas/runCell.js +39 -0
  519. package/lib/tools/schemas/runCell.js.map +1 -0
  520. package/lib/tools/schemas/updateCell.d.ts +19 -0
  521. package/lib/tools/schemas/updateCell.js +21 -0
  522. package/lib/tools/schemas/updateCell.js.map +1 -0
  523. package/package.json +40 -28
  524. package/schema/kernel.v0.schema.json +42 -0
  525. package/style/icons/pyodide.svg +17 -0
  526. package/lib/components/kernel/Kernelndicator.js.map +0 -1
  527. package/lib/examples/NotebookToc.js.map +0 -1
  528. /package/lib/examples/{NotebookToc.d.ts → KernelExecutorLite.d.ts} +0 -0
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { executeCodeParamsSchema } from '../schemas/executeCode';
8
+ export const executeCodeTool = {
9
+ name: 'datalayer_executeCode',
10
+ displayName: 'Execute Code in Kernel',
11
+ toolReferenceName: 'executeCode',
12
+ description: 'Execute code directly in the kernel (not saved to notebook) on the current activated notebook.\n\n' +
13
+ 'Recommended to use in following cases:\n' +
14
+ '1. Execute Jupyter magic commands (e.g., %timeit, %pip install xxx)\n' +
15
+ '2. Performance profiling and debugging\n' +
16
+ '3. View intermediate variable values (e.g., print(xxx), df.head())\n' +
17
+ "4. Temporary calculations and quick tests (e.g., np.mean(df['xxx']))\n" +
18
+ '5. Execute Shell commands in Jupyter server (e.g., !git xxx)\n\n' +
19
+ 'Under no circumstances should you use this tool to:\n' +
20
+ '1. Import new modules or perform variable assignments that affect subsequent Notebook execution\n' +
21
+ "2. Execute dangerous code that may harm the Jupyter server or the user's data without permission",
22
+ parameters: zodToToolParameters(executeCodeParamsSchema),
23
+ operation: 'executeCode',
24
+ config: {
25
+ confirmationMessage: (params) => `Execute code: ${params.code.substring(0, 50)}${params.code.length > 50 ? '...' : ''}?`,
26
+ invocationMessage: () => 'Executing code in kernel',
27
+ requiresConfirmation: false,
28
+ canBeReferencedInPrompt: true,
29
+ priority: 'high',
30
+ },
31
+ tags: ['kernel', 'notebook', 'execute', 'code', 'inspection', 'magic'],
32
+ };
33
+ //# sourceMappingURL=executeCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeCode.js","sourceRoot":"","sources":["../../../src/tools/definitions/executeCode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,wBAAwB;IACrC,iBAAiB,EAAE,aAAa;IAChC,WAAW,EACT,oGAAoG;QACpG,0CAA0C;QAC1C,uEAAuE;QACvE,0CAA0C;QAC1C,sEAAsE;QACtE,wEAAwE;QACxE,kEAAkE;QAClE,uDAAuD;QACvD,mGAAmG;QACnG,kGAAkG;IAEpG,UAAU,EAAE,mBAAmB,CAAC,uBAAuB,CAAC;IAExD,SAAS,EAAE,aAAa;IAExB,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAC,MAAwB,EAAE,EAAE,CAChD,iBAAiB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG;QACzF,iBAAiB,EAAE,GAAG,EAAE,CAAC,0BAA0B;QACnD,oBAAoB,EAAE,KAAK;QAC3B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,MAAM;KACjB;IAED,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC;CACvE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tool definitions (schemas) for notebook operations.
3
+ *
4
+ * @module tools/definitions
5
+ */
6
+ export * from './insertCell';
7
+ export * from './deleteCell';
8
+ export * from './updateCell';
9
+ export * from './readCell';
10
+ export * from './readAllCells';
11
+ export * from './runCell';
12
+ export * from './executeCode';
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Tool definitions (schemas) for notebook operations.
8
+ *
9
+ * @module tools/definitions
10
+ */
11
+ export * from './insertCell';
12
+ export * from './deleteCell';
13
+ export * from './updateCell';
14
+ export * from './readCell';
15
+ export * from './readAllCells';
16
+ export * from './runCell';
17
+ export * from './executeCode';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Insert cell tool definition.
3
+ *
4
+ * @module tools/definitions/insertCell
5
+ */
6
+ import type { ToolDefinition } from '../core/schema';
7
+ export declare const insertCellTool: ToolDefinition;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { insertCellParamsSchema } from '../schemas/insertCell';
8
+ export const insertCellTool = {
9
+ name: 'datalayer_insertCell',
10
+ displayName: 'Insert Notebook Cell',
11
+ toolReferenceName: 'insertCell',
12
+ description: 'IMPORTANT: Call readAllCells first to see the current notebook structure and determine the correct insertion point. Then, insert a code or markdown cell into a Jupyter notebook at a specified position or at the end',
13
+ parameters: zodToToolParameters(insertCellParamsSchema),
14
+ operation: 'insertCell',
15
+ config: {
16
+ confirmationMessage: (params) => `Insert ${params.type} cell into notebook?\n\n${params.source}`,
17
+ invocationMessage: (params) => `Inserting ${params.type} cell into notebook`,
18
+ requiresConfirmation: true,
19
+ canBeReferencedInPrompt: true,
20
+ priority: 'high',
21
+ },
22
+ tags: ['cell', 'notebook', 'manipulation', 'create'],
23
+ };
24
+ //# sourceMappingURL=insertCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertCell.js","sourceRoot":"","sources":["../../../src/tools/definitions/insertCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,iBAAiB,EAAE,YAAY;IAC/B,WAAW,EACT,wNAAwN;IAE1N,UAAU,EAAE,mBAAmB,CAAC,sBAAsB,CAAC;IAEvD,SAAS,EAAE,YAAY;IAEvB,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAC,MAAwC,EAAE,EAAE,CAChE,UAAU,MAAM,CAAC,IAAI,2BAA2B,MAAM,CAAC,MAAM,EAAE;QACjE,iBAAiB,EAAE,CAAC,MAAwB,EAAE,EAAE,CAC9C,aAAa,MAAM,CAAC,IAAI,qBAAqB;QAC/C,oBAAoB,EAAE,IAAI;QAC1B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,MAAM;KACjB;IAED,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC;CACrD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Read all cells tool definition.
3
+ *
4
+ * @module tools/definitions/readAllCells
5
+ */
6
+ import type { ToolDefinition } from '../core/schema';
7
+ export declare const readAllCellsTool: ToolDefinition;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { readAllCellsParamsSchema } from '../schemas/readAllCells';
8
+ export const readAllCellsTool = {
9
+ name: 'datalayer_readAllCells',
10
+ displayName: 'Read All Notebook Cells',
11
+ toolReferenceName: 'readAllCells',
12
+ description: "Read all cells from the Jupyter notebook. Supports two response formats: 'brief' (default) returns index, type, and 40-char content preview for structure queries and counting cells; 'detailed' returns full content with source, execution_count, and outputs. Use brief when you need to see notebook structure, count cells, or quickly scan content. Use detailed when you need to read full cell content or outputs. Brief format preview shows first 40 characters of cell source. Returns array of cells with: index (cell position), type (code, markdown, raw), preview (brief only), and optionally source/execution_count/outputs (detailed only). Works on active notebook.",
13
+ parameters: zodToToolParameters(readAllCellsParamsSchema),
14
+ operation: 'readAllCells',
15
+ config: {
16
+ confirmationMessage: () => 'Read all cells from notebook?',
17
+ invocationMessage: () => 'Reading all cells',
18
+ requiresConfirmation: false,
19
+ canBeReferencedInPrompt: true,
20
+ priority: 'high',
21
+ },
22
+ tags: ['cell', 'notebook', 'read', 'inspect', 'all'],
23
+ };
24
+ //# sourceMappingURL=readAllCells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readAllCells.js","sourceRoot":"","sources":["../../../src/tools/definitions/readAllCells.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,yBAAyB;IACtC,iBAAiB,EAAE,cAAc;IACjC,WAAW,EACT,0pBAA0pB;IAE5pB,UAAU,EAAE,mBAAmB,CAAC,wBAAwB,CAAC;IAEzD,SAAS,EAAE,cAAc;IAEzB,MAAM,EAAE;QACN,mBAAmB,EAAE,GAAG,EAAE,CAAC,+BAA+B;QAC1D,iBAAiB,EAAE,GAAG,EAAE,CAAC,mBAAmB;QAC5C,oBAAoB,EAAE,KAAK;QAC3B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,MAAM;KACjB;IAED,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;CACrD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Read cell tool definition.
3
+ *
4
+ * @module tools/definitions/readCell
5
+ */
6
+ import type { ToolDefinition } from '../core/schema';
7
+ export declare const readCellTool: ToolDefinition;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { readCellParamsSchema } from '../schemas/readCell';
8
+ export const readCellTool = {
9
+ name: 'datalayer_readCell',
10
+ displayName: 'Read Notebook Cell',
11
+ toolReferenceName: 'readCell',
12
+ description: 'Reads a specific cell from a Jupyter notebook by index, including source code and outputs',
13
+ parameters: zodToToolParameters(readCellParamsSchema),
14
+ operation: 'readCell',
15
+ config: {
16
+ confirmationMessage: (params) => `Read cell at index ${params.index}?`,
17
+ invocationMessage: (params) => `Reading cell ${params.index}`,
18
+ requiresConfirmation: false,
19
+ canBeReferencedInPrompt: true,
20
+ priority: 'high',
21
+ },
22
+ tags: ['cell', 'notebook', 'read', 'inspect'],
23
+ };
24
+ //# sourceMappingURL=readCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readCell.js","sourceRoot":"","sources":["../../../src/tools/definitions/readCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,iBAAiB,EAAE,UAAU;IAC7B,WAAW,EACT,2FAA2F;IAE7F,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC;IAErD,SAAS,EAAE,UAAU;IAErB,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAC,MAAyB,EAAE,EAAE,CACjD,sBAAsB,MAAM,CAAC,KAAK,GAAG;QACvC,iBAAiB,EAAE,CAAC,MAAyB,EAAE,EAAE,CAC/C,gBAAgB,MAAM,CAAC,KAAK,EAAE;QAChC,oBAAoB,EAAE,KAAK;QAC3B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,MAAM;KACjB;IAED,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC;CAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Run cell tool definition.
3
+ *
4
+ * @module tools/definitions/runCell
5
+ */
6
+ import type { ToolDefinition } from '../core/schema';
7
+ export declare const runCellTool: ToolDefinition;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { runCellParamsSchema } from '../schemas/runCell';
8
+ export const runCellTool = {
9
+ name: 'datalayer_runCell',
10
+ displayName: 'Run Notebook Cell',
11
+ toolReferenceName: 'runCell',
12
+ description: 'Runs a code cell in a Jupyter notebook and returns its outputs with execution metadata. ' +
13
+ 'Supports timeout and streaming progress updates. ' +
14
+ 'Returns execution_count, outputs, and elapsed_time. ' +
15
+ 'If no index is provided, runs the currently active cell.',
16
+ parameters: zodToToolParameters(runCellParamsSchema),
17
+ operation: 'runCell',
18
+ config: {
19
+ confirmationMessage: (params) => params.index !== undefined
20
+ ? `Run cell at index ${params.index}?`
21
+ : 'Run cell?',
22
+ invocationMessage: (params) => params.index !== undefined
23
+ ? `Running cell ${params.index}${params.timeoutSeconds ? ` (timeout: ${params.timeoutSeconds}s)` : ''}`
24
+ : `Running cell${params.timeoutSeconds ? ` (timeout: ${params.timeoutSeconds}s)` : ''}`,
25
+ requiresConfirmation: false,
26
+ canBeReferencedInPrompt: true,
27
+ priority: 'high',
28
+ },
29
+ tags: ['cell', 'notebook', 'execute', 'run', 'outputs'],
30
+ };
31
+ //# sourceMappingURL=runCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runCell.js","sourceRoot":"","sources":["../../../src/tools/definitions/runCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,iBAAiB,EAAE,SAAS;IAC5B,WAAW,EACT,0FAA0F;QAC1F,mDAAmD;QACnD,sDAAsD;QACtD,0DAA0D;IAE5D,UAAU,EAAE,mBAAmB,CAAC,mBAAmB,CAAC;IAEpD,SAAS,EAAE,SAAS;IAEpB,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAC,MAA0B,EAAE,EAAE,CAClD,MAAM,CAAC,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,qBAAqB,MAAM,CAAC,KAAK,GAAG;YACtC,CAAC,CAAC,WAAW;QACjB,iBAAiB,EAAE,CAAC,MAAmD,EAAE,EAAE,CACzE,MAAM,CAAC,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,gBAAgB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACvG,CAAC,CAAC,eAAe,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3F,oBAAoB,EAAE,KAAK;QAC3B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,MAAM;KACjB;IAED,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC;CACxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Update cell tool definition.
3
+ *
4
+ * @module tools/definitions/updateCell
5
+ */
6
+ import type { ToolDefinition } from '../core/schema';
7
+ export declare const updateCellTool: ToolDefinition;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { zodToToolParameters } from '../core/zodUtils';
7
+ import { updateCellParamsSchema } from '../schemas/updateCell';
8
+ export const updateCellTool = {
9
+ name: 'datalayer_updateCell',
10
+ displayName: 'Update Notebook Cell',
11
+ toolReferenceName: 'updateCell',
12
+ description: "Updates (overwrites) a cell's source code at the specified index. Does NOT execute the cell.",
13
+ parameters: zodToToolParameters(updateCellParamsSchema),
14
+ operation: 'updateCell',
15
+ config: {
16
+ confirmationMessage: (params) => `Update cell at index ${params.index}?\n\n${params.source}`,
17
+ invocationMessage: (params) => `Updating cell ${params.index}`,
18
+ requiresConfirmation: false,
19
+ canBeReferencedInPrompt: true,
20
+ priority: 'medium',
21
+ },
22
+ tags: ['cell', 'notebook', 'manipulation', 'update'],
23
+ };
24
+ //# sourceMappingURL=updateCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCell.js","sourceRoot":"","sources":["../../../src/tools/definitions/updateCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,iBAAiB,EAAE,YAAY;IAC/B,WAAW,EACT,8FAA8F;IAEhG,UAAU,EAAE,mBAAmB,CAAC,sBAAsB,CAAC;IAEvD,SAAS,EAAE,YAAY;IAEvB,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAC,MAAyC,EAAE,EAAE,CACjE,wBAAwB,MAAM,CAAC,KAAK,QAAQ,MAAM,CAAC,MAAM,EAAE;QAC7D,iBAAiB,EAAE,CAAC,MAAyB,EAAE,EAAE,CAC/C,iBAAiB,MAAM,CAAC,KAAK,EAAE;QACjC,oBAAoB,EAAE,KAAK;QAC3B,uBAAuB,EAAE,IAAI;QAC7B,QAAQ,EAAE,QAAQ;KACnB;IAED,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC;CACrD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { ToolDefinition } from './core/schema';
2
+ import type { ToolOperation } from './core/interfaces';
3
+ /**
4
+ * Array of all notebook tool definitions
5
+ */
6
+ export declare const notebookToolDefinitions: ToolDefinition[];
7
+ /**
8
+ * Registry of all notebook tool operations
9
+ * Maps operation names to their implementations
10
+ */
11
+ export declare const notebookToolOperations: Record<string, ToolOperation<unknown, unknown>>;
12
+ /**
13
+ * Complete notebook tools bundle for easy iteration and registration
14
+ */
15
+ export declare const notebookTools: {
16
+ definitions: ToolDefinition<unknown>[];
17
+ operations: Record<string, ToolOperation<unknown, unknown>>;
18
+ };
19
+ export * from './core';
20
+ export * from './definitions';
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Platform-agnostic notebook tools.
8
+ *
9
+ * @module tools
10
+ */
11
+ // Import all tool definitions
12
+ import { insertCellTool } from './definitions/insertCell';
13
+ import { deleteCellTool } from './definitions/deleteCell';
14
+ import { updateCellTool } from './definitions/updateCell';
15
+ import { readCellTool } from './definitions/readCell';
16
+ import { readAllCellsTool } from './definitions/readAllCells';
17
+ import { runCellTool } from './definitions/runCell';
18
+ import { executeCodeTool } from './definitions/executeCode';
19
+ // Import all operations
20
+ import { insertCellOperation } from './operations/insertCell';
21
+ import { deleteCellOperation } from './operations/deleteCell';
22
+ import { updateCellOperation } from './operations/updateCell';
23
+ import { readCellOperation } from './operations/readCell';
24
+ import { readAllCellsOperation } from './operations/readAllCells';
25
+ import { runCellOperation } from './operations/runCell';
26
+ import { executeCodeOperation } from './operations/executeCode';
27
+ /**
28
+ * Array of all notebook tool definitions
29
+ */
30
+ export const notebookToolDefinitions = [
31
+ insertCellTool,
32
+ deleteCellTool,
33
+ updateCellTool,
34
+ readCellTool,
35
+ readAllCellsTool,
36
+ runCellTool,
37
+ executeCodeTool,
38
+ ];
39
+ /**
40
+ * Registry of all notebook tool operations
41
+ * Maps operation names to their implementations
42
+ */
43
+ export const notebookToolOperations = {
44
+ insertCell: insertCellOperation,
45
+ deleteCell: deleteCellOperation,
46
+ updateCell: updateCellOperation,
47
+ readCell: readCellOperation,
48
+ readAllCells: readAllCellsOperation,
49
+ runCell: runCellOperation,
50
+ executeCode: executeCodeOperation,
51
+ };
52
+ /**
53
+ * Complete notebook tools bundle for easy iteration and registration
54
+ */
55
+ export const notebookTools = {
56
+ definitions: notebookToolDefinitions,
57
+ operations: notebookToolOperations,
58
+ };
59
+ // Re-export everything for convenience
60
+ export * from './core';
61
+ export * from './definitions';
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,wBAAwB;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAMhE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqB;IACvD,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,eAAe;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAG/B;IACF,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE,mBAAmB;IAC/B,QAAQ,EAAE,iBAAiB;IAC3B,YAAY,EAAE,qBAAqB;IACnC,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,oBAAoB;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,sBAAsB;CACnC,CAAC;AAEF,uCAAuC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Platform-agnostic cell deletion operation.
3
+ *
4
+ * @module tools/operations/deleteCell
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ import { type DeleteCellParams } from '../schemas/deleteCell';
8
+ /**
9
+ * Information about a deleted cell.
10
+ */
11
+ export interface DeletedCellInfo {
12
+ /** Original index of the deleted cell */
13
+ index: number;
14
+ /** Cell type (code, markdown, raw) */
15
+ type: string;
16
+ /** Cell source content */
17
+ source: string;
18
+ }
19
+ /**
20
+ * Result from deleteCell operation.
21
+ */
22
+ export interface DeleteCellResult {
23
+ success: boolean;
24
+ deletedCells: DeletedCellInfo[];
25
+ message: string;
26
+ }
27
+ /**
28
+ * Deletes one or more cells from a notebook at the specified indices.
29
+ *
30
+ * Cells are deleted in reverse order (highest index first) to prevent
31
+ * index shifting issues during multi-cell deletion. This matches the
32
+ * behavior of the Jupyter MCP Server.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * // Delete single cell
37
+ * await deleteCellOperation.execute(
38
+ * { indices: [2] },
39
+ * { documentId: "file:///path/to/notebook.ipynb", executor }
40
+ * );
41
+ *
42
+ * // Delete multiple cells
43
+ * await deleteCellOperation.execute(
44
+ * { indices: [1, 3, 5] },
45
+ * { documentId: "file:///path/to/notebook.ipynb", executor }
46
+ * );
47
+ * ```
48
+ */
49
+ export declare const deleteCellOperation: ToolOperation<DeleteCellParams, DeleteCellResult>;
@@ -0,0 +1,103 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { readAllCellsOperation } from './readAllCells';
7
+ import { validateWithZod } from '../core/zodUtils';
8
+ import { deleteCellParamsSchema, } from '../schemas/deleteCell';
9
+ /**
10
+ * Deletes one or more cells from a notebook at the specified indices.
11
+ *
12
+ * Cells are deleted in reverse order (highest index first) to prevent
13
+ * index shifting issues during multi-cell deletion. This matches the
14
+ * behavior of the Jupyter MCP Server.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Delete single cell
19
+ * await deleteCellOperation.execute(
20
+ * { indices: [2] },
21
+ * { documentId: "file:///path/to/notebook.ipynb", executor }
22
+ * );
23
+ *
24
+ * // Delete multiple cells
25
+ * await deleteCellOperation.execute(
26
+ * { indices: [1, 3, 5] },
27
+ * { documentId: "file:///path/to/notebook.ipynb", executor }
28
+ * );
29
+ * ```
30
+ */
31
+ export const deleteCellOperation = {
32
+ name: 'deleteCell',
33
+ async execute(params, context) {
34
+ // Validate params using Zod schema
35
+ const { indices } = validateWithZod(deleteCellParamsSchema, params, this.name);
36
+ const { documentId } = context;
37
+ if (!documentId) {
38
+ throw new Error('Document ID is required for deleteCell operation. ' +
39
+ 'Ensure the tool execution context includes a valid documentId.');
40
+ }
41
+ // Ensure executor is available
42
+ if (!context.executor) {
43
+ throw new Error('Executor is required for deleteCell operation. ' +
44
+ 'This should be provided by the platform (DefaultExecutor, BridgeExecutor, etc.)');
45
+ }
46
+ try {
47
+ // First, read all cells to get current state and validate indices
48
+ // Request detailed format to get full source for deletion confirmation
49
+ const cellsResult = await readAllCellsOperation.execute({ format: 'detailed' }, context);
50
+ if (!cellsResult.success || !cellsResult.cells) {
51
+ throw new Error('Failed to read cells for bounds validation');
52
+ }
53
+ const cellCount = cellsResult.cellCount || cellsResult.cells.length;
54
+ const cells = cellsResult.cells;
55
+ // Validate ALL indices are in range (match Jupyter MCP Server error format)
56
+ for (const index of indices) {
57
+ if (index < 0 || index >= cellCount) {
58
+ throw new Error(`Cell index ${index} is out of range. Notebook has ${cellCount} cells.`);
59
+ }
60
+ }
61
+ // Sort indices in REVERSE order (highest to lowest) to prevent index shifting
62
+ // This matches the Jupyter MCP Server behavior
63
+ const sortedIndices = [...indices].sort((a, b) => b - a);
64
+ // Store information about cells before deletion
65
+ const deletedCells = [];
66
+ // Delete each cell in reverse order
67
+ for (const index of sortedIndices) {
68
+ // Store cell info before deletion (from original read)
69
+ const cell = cells[index];
70
+ // Execute deletion via executor
71
+ await context.executor.execute(this.name, {
72
+ index,
73
+ });
74
+ // Track deletion with original index
75
+ deletedCells.push({
76
+ index,
77
+ type: cell.type,
78
+ source: cell.source,
79
+ });
80
+ }
81
+ // Format message similar to Jupyter MCP Server
82
+ const message = deletedCells
83
+ .map(cell => {
84
+ return (`Deleted cell at index ${cell.index}:\n` +
85
+ `Type: ${cell.type}\n` +
86
+ `----------------------------------------`);
87
+ })
88
+ .join('\n\n');
89
+ // Return success result
90
+ return {
91
+ success: true,
92
+ deletedCells: deletedCells.reverse(), // Reverse to show in original order
93
+ message,
94
+ };
95
+ }
96
+ catch (error) {
97
+ // Convert error to descriptive error
98
+ const errorMessage = error instanceof Error ? error.message : String(error);
99
+ throw new Error(`Failed to delete cell(s): ${errorMessage}`);
100
+ }
101
+ },
102
+ };
103
+ //# sourceMappingURL=deleteCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteCell.js","sourceRoot":"","sources":["../../../src/tools/operations/deleteCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAuB/B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAG5B;IACF,IAAI,EAAE,YAAY;IAElB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CACjC,sBAAsB,EACtB,MAAM,EACN,IAAI,CAAC,IAAI,CACV,CAAC;QACF,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE/B,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,oDAAoD;gBAClD,gEAAgE,CACnE,CAAC;QACJ,CAAC;QAED,+BAA+B;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,iDAAiD;gBAC/C,iFAAiF,CACpF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,kEAAkE;YAClE,uEAAuE;YACvE,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,OAAO,CACrD,EAAE,MAAM,EAAE,UAAU,EAAE,EACtB,OAAO,CACR,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YAED,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;YACpE,MAAM,KAAK,GAAG,WAAW,CAAC,KAA+C,CAAC;YAE1E,4EAA4E;YAC5E,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;oBACpC,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,kCAAkC,SAAS,SAAS,CACxE,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,8EAA8E;YAC9E,+CAA+C;YAC/C,MAAM,aAAa,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAEzD,gDAAgD;YAChD,MAAM,YAAY,GAAsB,EAAE,CAAC;YAE3C,oCAAoC;YACpC,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;gBAClC,uDAAuD;gBACvD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;gBAE1B,gCAAgC;gBAChC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;oBACxC,KAAK;iBACN,CAAC,CAAC;gBAEH,qCAAqC;gBACrC,YAAY,CAAC,IAAI,CAAC;oBAChB,KAAK;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,MAAM,EAAE,IAAI,CAAC,MAAM;iBACpB,CAAC,CAAC;YACL,CAAC;YAED,+CAA+C;YAC/C,MAAM,OAAO,GAAG,YAAY;iBACzB,GAAG,CAAC,IAAI,CAAC,EAAE;gBACV,OAAO,CACL,yBAAyB,IAAI,CAAC,KAAK,KAAK;oBACxC,SAAS,IAAI,CAAC,IAAI,IAAI;oBACtB,0CAA0C,CAC3C,CAAC;YACJ,CAAC,CAAC;iBACD,IAAI,CAAC,MAAM,CAAC,CAAC;YAEhB,wBAAwB;YACxB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE,EAAE,oCAAoC;gBAC1E,OAAO;aACR,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qCAAqC;YACrC,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Platform-agnostic code execution operation.
3
+ * Executes code directly in the kernel without creating or modifying cells.
4
+ *
5
+ * @module tools/operations/executeCode
6
+ */
7
+ import type { ToolOperation } from '../core/interfaces';
8
+ import { type ExecuteCodeParams } from '../schemas/executeCode';
9
+ /**
10
+ * Result from executeCode operation.
11
+ */
12
+ export interface ExecuteCodeResult {
13
+ success: boolean;
14
+ /** Execution outputs (streams, results, errors) */
15
+ outputs?: Array<{
16
+ type: 'stream' | 'execute_result' | 'display_data' | 'error';
17
+ content: unknown;
18
+ }>;
19
+ /** Error message if execution failed */
20
+ error?: string;
21
+ /** Execution count (if stored in history) */
22
+ executionCount?: number;
23
+ }
24
+ /**
25
+ * Executes code directly in the kernel without creating a cell.
26
+ *
27
+ * This is useful for:
28
+ * - Variable inspection
29
+ * - Environment setup
30
+ * - Background tasks
31
+ * - Tool introspection
32
+ */
33
+ export declare const executeCodeOperation: ToolOperation<ExecuteCodeParams, ExecuteCodeResult>;
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { validateWithZod } from '../core/zodUtils';
7
+ import { executeCodeParamsSchema, } from '../schemas/executeCode';
8
+ /**
9
+ * Executes code directly in the kernel without creating a cell.
10
+ *
11
+ * This is useful for:
12
+ * - Variable inspection
13
+ * - Environment setup
14
+ * - Background tasks
15
+ * - Tool introspection
16
+ */
17
+ export const executeCodeOperation = {
18
+ name: 'executeCode',
19
+ async execute(params, context) {
20
+ // Validate params using Zod schema
21
+ validateWithZod(executeCodeParamsSchema, params, this.name);
22
+ const { documentId } = context;
23
+ if (!documentId) {
24
+ return {
25
+ success: false,
26
+ error: 'Document ID is required for this operation.',
27
+ };
28
+ }
29
+ // Ensure executor is available
30
+ if (!context.executor) {
31
+ throw new Error('Executor is required for executeCode operation. ' +
32
+ 'This should be provided by the platform (DefaultExecutor, BridgeExecutor, etc.)');
33
+ }
34
+ try {
35
+ // Call executor (uses this.name for DRY principle)
36
+ const result = await context.executor.execute(this.name, params);
37
+ return result;
38
+ }
39
+ catch (error) {
40
+ const errorMessage = error instanceof Error ? error.message : String(error);
41
+ throw new Error(`Failed to execute code: ${errorMessage}`);
42
+ }
43
+ },
44
+ };
45
+ //# sourceMappingURL=executeCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeCode.js","sourceRoot":"","sources":["../../../src/tools/operations/executeCode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,uBAAuB,GAExB,MAAM,wBAAwB,CAAC;AAkBhC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAG7B;IACF,IAAI,EAAE,aAAa;IAEnB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,eAAe,CAAC,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5D,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE/B,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,6CAA6C;aACrD,CAAC;QACJ,CAAC;QAED,+BAA+B;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,kDAAkD;gBAChD,iFAAiF,CACpF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,mDAAmD;YACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAEjE,OAAO,MAA2B,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Platform-agnostic cell insertion operation.
3
+ *
4
+ * @module tools/operations/insertCell
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ import { type InsertCellParams } from '../schemas/insertCell';
8
+ /**
9
+ * Result from insertCell operation.
10
+ */
11
+ export interface InsertCellResult {
12
+ success: boolean;
13
+ index: number;
14
+ message: string;
15
+ }
16
+ /**
17
+ * Inserts a cell into a notebook at the specified position.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * await insertCellOperation.execute(
22
+ * { type: 'code', source: 'print("Hello")' },
23
+ * { documentId: 'file:///path/to/notebook.ipynb', executor }
24
+ * );
25
+ * ```
26
+ */
27
+ export declare const insertCellOperation: ToolOperation<InsertCellParams, InsertCellResult>;