@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,56 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { validateWithZod } from '../core/zodUtils';
7
+ import { insertCellParamsSchema, } from '../schemas/insertCell';
8
+ /**
9
+ * Inserts a cell into a notebook at the specified position.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * await insertCellOperation.execute(
14
+ * { type: 'code', source: 'print("Hello")' },
15
+ * { documentId: 'file:///path/to/notebook.ipynb', executor }
16
+ * );
17
+ * ```
18
+ */
19
+ export const insertCellOperation = {
20
+ name: 'insertCell',
21
+ async execute(params, context) {
22
+ // Validate params using Zod schema
23
+ const { type, source, index } = validateWithZod(insertCellParamsSchema, params, this.name);
24
+ const { documentId } = context;
25
+ // Validate context
26
+ if (!documentId) {
27
+ throw new Error('Document ID is required for insertCell operation. ' +
28
+ 'Ensure the tool execution context includes a valid documentId.');
29
+ }
30
+ // Ensure executor is available
31
+ if (!context.executor) {
32
+ throw new Error('Executor is required for insertCell operation. ' +
33
+ 'This should be provided by the platform (DefaultExecutor, BridgeExecutor, etc.)');
34
+ }
35
+ try {
36
+ // Call executor (uses this.name for DRY principle)
37
+ await context.executor.execute(this.name, {
38
+ type,
39
+ source,
40
+ index, // undefined means insert at end
41
+ });
42
+ // Return success result
43
+ return {
44
+ success: true,
45
+ index: index ?? -1,
46
+ message: `Cell inserted at index ${index ?? -1}`,
47
+ };
48
+ }
49
+ catch (error) {
50
+ // Convert error to result with failure status
51
+ const errorMessage = error instanceof Error ? error.message : String(error);
52
+ throw new Error(`Failed to insert cell: ${errorMessage}`);
53
+ }
54
+ },
55
+ };
56
+ //# sourceMappingURL=insertCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertCell.js","sourceRoot":"","sources":["../../../src/tools/operations/insertCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAW/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAG5B;IACF,IAAI,EAAE,YAAY;IAElB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,CAC7C,sBAAsB,EACtB,MAAM,EACN,IAAI,CAAC,IAAI,CACV,CAAC;QACF,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE/B,mBAAmB;QACnB,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,mDAAmD;YACnD,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;gBACxC,IAAI;gBACJ,MAAM;gBACN,KAAK,EAAE,gCAAgC;aACxC,CAAC,CAAC;YAEH,wBAAwB;YACxB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC;gBAClB,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC,CAAC,EAAE;aACjD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,8CAA8C;YAC9C,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,0BAA0B,YAAY,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Platform-agnostic operation to read all cells.
3
+ *
4
+ * @module tools/operations/readAllCells
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ import type { BriefCell, DetailedCell } from '../core/types';
8
+ import { type ReadAllCellsParams } from '../schemas/readAllCells';
9
+ /**
10
+ * Result from readAllCells operation.
11
+ */
12
+ export interface ReadAllCellsResult {
13
+ success: boolean;
14
+ cells?: BriefCell[] | DetailedCell[];
15
+ cellCount?: number;
16
+ error?: string;
17
+ }
18
+ /**
19
+ * Reads all cells from a notebook with source and outputs.
20
+ */
21
+ export declare const readAllCellsOperation: ToolOperation<ReadAllCellsParams, ReadAllCellsResult>;
@@ -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 { readAllCellsParamsSchema, } from '../schemas/readAllCells';
8
+ /**
9
+ * Reads all cells from a notebook with source and outputs.
10
+ */
11
+ export const readAllCellsOperation = {
12
+ name: 'readAllCells',
13
+ async execute(params, context) {
14
+ // Validate params using Zod
15
+ const validatedParams = validateWithZod(readAllCellsParamsSchema, params || {}, 'readAllCells');
16
+ const { format = 'brief' } = validatedParams;
17
+ const { documentId } = context;
18
+ if (!documentId) {
19
+ return {
20
+ success: false,
21
+ error: 'Document ID is required for this operation.',
22
+ };
23
+ }
24
+ if (!context.executor) {
25
+ throw new Error('Executor is required for readAllCells operation. ' +
26
+ 'This should be provided by the platform (DefaultExecutor, BridgeExecutor, etc.)');
27
+ }
28
+ try {
29
+ // Call executor with format parameter
30
+ const cells = (await context.executor.execute(this.name, {
31
+ format,
32
+ }));
33
+ return {
34
+ success: true,
35
+ cells,
36
+ cellCount: cells.length,
37
+ };
38
+ }
39
+ catch (error) {
40
+ const errorMessage = error instanceof Error ? error.message : String(error);
41
+ throw new Error(`Failed to read all cells: ${errorMessage}`);
42
+ }
43
+ },
44
+ };
45
+ //# sourceMappingURL=readAllCells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readAllCells.js","sourceRoot":"","sources":["../../../src/tools/operations/readAllCells.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,wBAAwB,GAEzB,MAAM,yBAAyB,CAAC;AAYjC;;GAEG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,IAAI,EAAE,cAAc;IAEpB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,4BAA4B;QAC5B,MAAM,eAAe,GAAG,eAAe,CACrC,wBAAwB,EACxB,MAAM,IAAI,EAAE,EACZ,cAAc,CACf,CAAC;QAEF,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,eAAe,CAAC;QAC7C,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,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,mDAAmD;gBACjD,iFAAiF,CACpF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,sCAAsC;YACtC,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;gBACvD,MAAM;aACP,CAAC,CAAiC,CAAC;YAEpC,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,KAAK;gBACL,SAAS,EAAE,KAAK,CAAC,MAAM;aACxB,CAAC;QACJ,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,6BAA6B,YAAY,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Platform-agnostic cell read operation.
3
+ *
4
+ * @module tools/operations/readCell
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ /**
8
+ * Parameters for readCell operation.
9
+ */
10
+ export interface ReadCellParams {
11
+ /** Cell index (0-based) */
12
+ index: number;
13
+ /** Whether to include cell outputs in the response (default: true) */
14
+ includeOutputs?: boolean;
15
+ }
16
+ /**
17
+ * Result from readCell operation.
18
+ */
19
+ export interface ReadCellResult {
20
+ success: boolean;
21
+ index?: number;
22
+ type?: string;
23
+ source?: string;
24
+ execution_count?: number | null;
25
+ outputs?: string[];
26
+ error?: string;
27
+ }
28
+ /**
29
+ * Reads cell content and metadata at the specified index.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * const result = await readCellOperation.execute(
34
+ * { index: 0 },
35
+ * { documentId: 'file:///notebook.ipynb', executor }
36
+ * );
37
+ * ```
38
+ */
39
+ export declare const readCellOperation: ToolOperation<ReadCellParams, ReadCellResult>;
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { readAllCellsOperation } from './readAllCells';
7
+ /**
8
+ * Validates ReadCellParams at runtime.
9
+ */
10
+ function isReadCellParams(params) {
11
+ if (typeof params !== 'object' || params === null) {
12
+ return false;
13
+ }
14
+ const p = params;
15
+ // Validate required field
16
+ if (typeof p.index !== 'number') {
17
+ return false;
18
+ }
19
+ // Validate optional field
20
+ if (p.includeOutputs !== undefined && typeof p.includeOutputs !== 'boolean') {
21
+ return false;
22
+ }
23
+ return true;
24
+ }
25
+ /**
26
+ * Reads cell content and metadata at the specified index.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const result = await readCellOperation.execute(
31
+ * { index: 0 },
32
+ * { documentId: 'file:///notebook.ipynb', executor }
33
+ * );
34
+ * ```
35
+ */
36
+ export const readCellOperation = {
37
+ name: 'readCell',
38
+ async execute(params, context) {
39
+ // Validate params using type guard
40
+ if (!isReadCellParams(params)) {
41
+ throw new Error(`Invalid parameters for readCell. Expected { index: number }. ` +
42
+ `Received: ${JSON.stringify(params)}`);
43
+ }
44
+ // Now TypeScript knows params is ReadCellParams!
45
+ const { index } = params;
46
+ const { documentId } = context;
47
+ if (!documentId) {
48
+ return {
49
+ success: false,
50
+ error: 'Document ID is required for this operation.',
51
+ };
52
+ }
53
+ if (!context.executor) {
54
+ throw new Error('Executor is required for readCell operation.');
55
+ }
56
+ try {
57
+ // First, validate that the index is within bounds
58
+ const cellsResult = await readAllCellsOperation.execute({}, context);
59
+ if (!cellsResult.success || !cellsResult.cells) {
60
+ throw new Error('Failed to read cells for bounds validation');
61
+ }
62
+ const cellCount = cellsResult.cellCount || cellsResult.cells.length;
63
+ // Validate index bounds (match Jupyter MCP Server error format)
64
+ if (index < 0 || index >= cellCount) {
65
+ return {
66
+ success: false,
67
+ error: `Cell index ${index} is out of range. Notebook has ${cellCount} cells.`,
68
+ };
69
+ }
70
+ // Call executor (uses this.name for DRY principle)
71
+ const includeOutputs = params.includeOutputs ?? true;
72
+ const cellData = await context.executor.execute(this.name, {
73
+ index,
74
+ includeOutputs,
75
+ });
76
+ const result = {
77
+ success: true,
78
+ ...(typeof cellData === 'object' && cellData !== null
79
+ ? cellData
80
+ : {}),
81
+ };
82
+ return result;
83
+ }
84
+ catch (error) {
85
+ const errorMessage = error instanceof Error ? error.message : String(error);
86
+ throw new Error(`Failed to read cell: ${errorMessage}`);
87
+ }
88
+ },
89
+ };
90
+ //# sourceMappingURL=readCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readCell.js","sourceRoot":"","sources":["../../../src/tools/operations/readCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAYvD;;GAEG;AACH,SAAS,gBAAgB,CAAC,MAAe;IACvC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,GAAG,MAAiC,CAAC;IAE5C,0BAA0B;IAC1B,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,IAAI,CAAC,CAAC,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAeD;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAC5B;IACE,IAAI,EAAE,UAAU;IAEhB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YA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gBACb,OAAO,EAAE,IAAI;gBACb,GAAG,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI;oBACnD,CAAC,CAAC,QAAQ;oBACV,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;YAEF,OAAO,MAAM,CAAC;QAChB,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,wBAAwB,YAAY,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Platform-agnostic cell execution operation.
3
+ *
4
+ * @module tools/operations/runCell
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ import { type RunCellParams } from '../schemas/runCell';
8
+ /**
9
+ * Result from runCell operation (snake_case for outputs, matching MCP and existing tools).
10
+ */
11
+ export interface RunCellResult {
12
+ success: boolean;
13
+ index?: number;
14
+ execution_count?: number | null;
15
+ outputs?: Array<string>;
16
+ elapsed_time?: number;
17
+ message?: string;
18
+ error?: string;
19
+ timeout?: boolean;
20
+ }
21
+ /**
22
+ * Executes a cell and displays its output.
23
+ */
24
+ export declare const runCellOperation: ToolOperation<RunCellParams, RunCellResult>;
@@ -0,0 +1,124 @@
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 { runCellParamsSchema } from '../schemas/runCell';
9
+ /**
10
+ * Executes a cell and displays its output.
11
+ */
12
+ export const runCellOperation = {
13
+ name: 'runCell',
14
+ async execute(params, context) {
15
+ // Validate params using Zod schema
16
+ const { index, timeoutSeconds, stream = false, progressInterval = 5, } = validateWithZod(runCellParamsSchema, params, this.name);
17
+ const { documentId } = context;
18
+ if (!documentId) {
19
+ return {
20
+ success: false,
21
+ error: 'Document ID is required for this operation.',
22
+ };
23
+ }
24
+ // Ensure executor is available
25
+ if (!context.executor) {
26
+ throw new Error('Executor is required for runCell operation. ' +
27
+ 'This should be provided by the platform (DefaultExecutor, BridgeExecutor, etc.)');
28
+ }
29
+ const startTime = Date.now();
30
+ try {
31
+ // If index is provided, validate that it's within bounds
32
+ if (index !== undefined) {
33
+ const cellsResult = await readAllCellsOperation.execute({}, context);
34
+ if (!cellsResult.success || !cellsResult.cells) {
35
+ throw new Error('Failed to read cells for bounds validation');
36
+ }
37
+ const cellCount = cellsResult.cellCount || cellsResult.cells.length;
38
+ // Validate index bounds
39
+ if (index < 0 || index >= cellCount) {
40
+ return {
41
+ success: false,
42
+ error: `Index ${index} is out of bounds. The notebook has ${cellCount} cell${cellCount !== 1 ? 's' : ''} (valid indices: 0-${cellCount - 1}).`,
43
+ };
44
+ }
45
+ }
46
+ // Call executor with timeout and streaming parameters
47
+ const executionPromise = context.executor.execute(this.name, {
48
+ index,
49
+ timeoutSeconds,
50
+ stream,
51
+ progressInterval,
52
+ });
53
+ // Only enforce timeout if explicitly provided
54
+ let result;
55
+ if (timeoutSeconds !== undefined) {
56
+ // Wrap execution with timeout
57
+ const timeoutPromise = new Promise((_, reject) => {
58
+ setTimeout(() => {
59
+ reject(new Error(`TIMEOUT_ERROR: Cell execution exceeded ${timeoutSeconds} seconds`));
60
+ }, timeoutSeconds * 1000);
61
+ });
62
+ // Race between execution and timeout
63
+ result = await Promise.race([executionPromise, timeoutPromise]);
64
+ }
65
+ else {
66
+ // No timeout - wait indefinitely (normal Jupyter behavior)
67
+ result = await executionPromise;
68
+ }
69
+ // Calculate elapsed time
70
+ const elapsed_time = (Date.now() - startTime) / 1000;
71
+ // Extract outputs from result
72
+ const executionResult = result;
73
+ const message = index !== undefined
74
+ ? `Cell at index ${index} executed in ${elapsed_time.toFixed(2)}s`
75
+ : `Active cell executed in ${elapsed_time.toFixed(2)}s`;
76
+ return {
77
+ success: true,
78
+ index,
79
+ execution_count: executionResult.execution_count ?? null,
80
+ outputs: executionResult.outputs ?? [],
81
+ elapsed_time,
82
+ message,
83
+ };
84
+ }
85
+ catch (error) {
86
+ const elapsed_time = (Date.now() - startTime) / 1000;
87
+ const errorMessage = error instanceof Error ? error.message : String(error);
88
+ // Check if this is a timeout error
89
+ if (errorMessage.includes('TIMEOUT_ERROR')) {
90
+ // Try to get partial outputs
91
+ let partialOutputs = [];
92
+ try {
93
+ const cellData = await context.executor.execute('readCell', {
94
+ index,
95
+ includeOutputs: true,
96
+ });
97
+ if (cellData &&
98
+ typeof cellData === 'object' &&
99
+ 'outputs' in cellData) {
100
+ partialOutputs =
101
+ cellData.outputs ?? [];
102
+ }
103
+ }
104
+ catch {
105
+ // Ignore errors reading partial outputs
106
+ }
107
+ return {
108
+ success: false,
109
+ timeout: true,
110
+ index,
111
+ outputs: [
112
+ `[TIMEOUT ERROR: Cell execution exceeded ${timeoutSeconds} seconds. Partial outputs may be available.]`,
113
+ ...partialOutputs,
114
+ ],
115
+ elapsed_time,
116
+ error: `Execution timed out after ${timeoutSeconds} seconds`,
117
+ };
118
+ }
119
+ // Regular error (not timeout)
120
+ throw new Error(`Failed to run cell: ${errorMessage}`);
121
+ }
122
+ },
123
+ };
124
+ //# sourceMappingURL=runCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runCell.js","sourceRoot":"","sources":["../../../src/tools/operations/runCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAsB,MAAM,oBAAoB,CAAC;AAgB7E;;GAEG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,IAAI,EAAE,SAAS;IAEf,KAAK,CAAC,OAAO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cell update operation.
3
+ *
4
+ * @module tools/operations/updateCell
5
+ */
6
+ import type { ToolOperation } from '../core/interfaces';
7
+ import { type UpdateCellParams } from '../schemas/updateCell';
8
+ /**
9
+ * Result from updateCell operation.
10
+ */
11
+ export interface UpdateCellResult {
12
+ success: boolean;
13
+ message: string;
14
+ diff?: string;
15
+ }
16
+ /**
17
+ * Updates cell source content at the specified index.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * await updateCellOperation.execute(
22
+ * { index: 0, source: 'print("Updated")' },
23
+ * { documentId: 'file:///notebook.ipynb', executor }
24
+ * );
25
+ * ```
26
+ */
27
+ export declare const updateCellOperation: ToolOperation<UpdateCellParams, UpdateCellResult>;
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ import { validateWithZod } from '../core/zodUtils';
7
+ import { updateCellParamsSchema, } from '../schemas/updateCell';
8
+ /**
9
+ * Updates cell source content at the specified index.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * await updateCellOperation.execute(
14
+ * { index: 0, source: 'print("Updated")' },
15
+ * { documentId: 'file:///notebook.ipynb', executor }
16
+ * );
17
+ * ```
18
+ */
19
+ export const updateCellOperation = {
20
+ name: 'updateCell',
21
+ async execute(params, context) {
22
+ // Validate params using Zod schema
23
+ const { index, source } = validateWithZod(updateCellParamsSchema, params, this.name);
24
+ const { documentId } = context;
25
+ if (!documentId) {
26
+ throw new Error('Document ID is required for updateCell operation.');
27
+ }
28
+ if (!context.executor) {
29
+ throw new Error('Executor is required for updateCell operation.');
30
+ }
31
+ try {
32
+ // Call executor - adapter returns diff string
33
+ const diff = (await context.executor.execute(this.name, {
34
+ index,
35
+ source,
36
+ }));
37
+ // Format message like MCP server
38
+ const message = diff
39
+ ? `Cell ${index} overwritten successfully:\n\n\`\`\`diff\n${diff}\n\`\`\``
40
+ : `Cell ${index} overwritten successfully - no changes detected`;
41
+ return {
42
+ success: true,
43
+ message,
44
+ diff,
45
+ };
46
+ }
47
+ catch (error) {
48
+ const errorMessage = error instanceof Error ? error.message : String(error);
49
+ throw new Error(`Failed to update cell: ${errorMessage}`);
50
+ }
51
+ },
52
+ };
53
+ //# sourceMappingURL=updateCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCell.js","sourceRoot":"","sources":["../../../src/tools/operations/updateCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAW/B;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAG5B;IACF,IAAI,EAAE,YAAY;IAElB,KAAK,CAAC,OAAO,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,eAAe,CACvC,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,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,CAAC;YACH,8CAA8C;YAC9C,MAAM,IAAI,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;gBACtD,KAAK;gBACL,MAAM;aACP,CAAC,CAAW,CAAC;YAEd,iCAAiC;YACjC,MAAM,OAAO,GAAG,IAAI;gBAClB,CAAC,CAAC,QAAQ,KAAK,6CAA6C,IAAI,UAAU;gBAC1E,CAAC,CAAC,QAAQ,KAAK,iDAAiD,CAAC;YAEnE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO;gBACP,IAAI;aACL,CAAC;QACJ,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,0BAA0B,YAAY,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Zod schema for deleteCell operation parameters
3
+ *
4
+ * @module tools/schemas/deleteCell
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for deleteCell parameters
9
+ *
10
+ * Validates that indices is a non-empty array of non-negative integers.
11
+ */
12
+ export declare const deleteCellParamsSchema: z.ZodObject<{
13
+ indices: z.ZodArray<z.ZodNumber>;
14
+ }, z.core.$strip>;
15
+ /**
16
+ * TypeScript type inferred from Zod schema.
17
+ *
18
+ * This replaces the manual interface definition and is guaranteed to stay in sync with the schema.
19
+ */
20
+ export type DeleteCellParams = z.infer<typeof deleteCellParamsSchema>;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for deleteCell operation parameters
8
+ *
9
+ * @module tools/schemas/deleteCell
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for deleteCell parameters
14
+ *
15
+ * Validates that indices is a non-empty array of non-negative integers.
16
+ */
17
+ export const deleteCellParamsSchema = z.object({
18
+ indices: z
19
+ .array(z.number().int().nonnegative())
20
+ .min(1)
21
+ .describe('Array of cell indices (0-based) to delete. ' +
22
+ 'Cells will be deleted in reverse order (highest index first) to prevent index shifting.'),
23
+ });
24
+ //# sourceMappingURL=deleteCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteCell.js","sourceRoot":"","sources":["../../../src/tools/schemas/deleteCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;SACrC,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,6CAA6C;QAC3C,yFAAyF,CAC5F;CACJ,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Zod schema for executeCode operation parameters
3
+ *
4
+ * @module tools/schemas/executeCode
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for executeCode parameters
9
+ *
10
+ * Validates code string and optional timeout with range constraint.
11
+ */
12
+ export declare const executeCodeParamsSchema: z.ZodObject<{
13
+ code: z.ZodString;
14
+ timeout: z.ZodOptional<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ /**
17
+ * TypeScript type inferred from Zod schema.
18
+ */
19
+ export type ExecuteCodeParams = z.infer<typeof executeCodeParamsSchema>;
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for executeCode operation parameters
8
+ *
9
+ * @module tools/schemas/executeCode
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for executeCode parameters
14
+ *
15
+ * Validates code string and optional timeout with range constraint.
16
+ */
17
+ export const executeCodeParamsSchema = z.object({
18
+ code: z
19
+ .string()
20
+ .describe('Code to execute (supports magic commands with %, shell commands with !)'),
21
+ timeout: z
22
+ .number()
23
+ .min(0)
24
+ .max(60)
25
+ .optional()
26
+ .describe('Execution timeout in seconds (default: 30, maximum: 60)'),
27
+ });
28
+ //# sourceMappingURL=executeCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeCode.js","sourceRoot":"","sources":["../../../src/tools/schemas/executeCode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CACP,yEAAyE,CAC1E;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;CACvE,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Central export for all tool parameter schemas.
3
+ *
4
+ * @module tools/schemas
5
+ */
6
+ export * from './deleteCell';
7
+ export * from './insertCell';
8
+ export * from './updateCell';
9
+ export * from './readCell';
10
+ export * from './executeCode';
11
+ export * from './runCell';
12
+ export * from './readAllCells';
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Central export for all tool parameter schemas.
8
+ *
9
+ * @module tools/schemas
10
+ */
11
+ export * from './deleteCell';
12
+ export * from './insertCell';
13
+ export * from './updateCell';
14
+ export * from './readCell';
15
+ export * from './executeCode';
16
+ export * from './runCell';
17
+ export * from './readAllCells';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/schemas/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,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}