@datalayer/jupyter-react 1.1.7 → 1.1.9

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 (222) hide show
  1. package/lib/components/cell/Cell.d.ts +3 -6
  2. package/lib/components/cell/Cell.js +2 -11
  3. package/lib/components/cell/Cell.js.map +1 -1
  4. package/lib/components/cell/CellAdapter.d.ts +1 -1
  5. package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +2 -2
  6. package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
  7. package/lib/components/console/ConsoleAdapter.d.ts +1 -1
  8. package/lib/components/console/ConsoleAdapter.js +1 -1
  9. package/lib/components/console/ConsoleAdapter.js.map +1 -1
  10. package/lib/components/jupyterlab/JupyterLabApp.d.ts +16 -19
  11. package/lib/components/jupyterlab/JupyterLabApp.js +21 -21
  12. package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
  13. package/lib/components/jupyterlab/JupyterLabAppAdapter.d.ts +4 -4
  14. package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
  15. package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
  16. package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +1 -4
  17. package/lib/components/jupyterlab/JupyterLabAppCss.js +1 -5
  18. package/lib/components/jupyterlab/JupyterLabAppCss.js.map +1 -1
  19. package/lib/components/kernel/KernelActionMenu.d.ts +2 -2
  20. package/lib/components/kernel/KernelActionMenu.js.map +1 -1
  21. package/lib/components/kernel/KernelDetective.d.ts +1 -1
  22. package/lib/components/kernel/KernelInspector.d.ts +2 -2
  23. package/lib/components/kernel/KernelInspector.js.map +1 -1
  24. package/lib/components/kernel/KernelSelector.d.ts +2 -2
  25. package/lib/components/kernel/KernelSelector.js.map +1 -1
  26. package/lib/components/kernel/KernelUsage.d.ts +2 -2
  27. package/lib/components/kernel/KernelUsage.js.map +1 -1
  28. package/lib/components/kernel/KernelVariables.d.ts +2 -2
  29. package/lib/components/kernel/KernelVariables.js.map +1 -1
  30. package/lib/components/kernel/Kernelndicator.d.ts +1 -1
  31. package/lib/components/kernel/Kernelndicator.js +17 -13
  32. package/lib/components/kernel/Kernelndicator.js.map +1 -1
  33. package/lib/components/kernel/variables/kernelconnector.d.ts +2 -2
  34. package/lib/components/kernel/variables/kernelconnector.js +2 -2
  35. package/lib/components/kernel/variables/widget.d.ts +4 -2
  36. package/lib/components/kernel/variables/widget.js.map +1 -1
  37. package/lib/components/lumino/Lumino.d.ts +2 -8
  38. package/lib/components/lumino/Lumino.js +1 -6
  39. package/lib/components/lumino/Lumino.js.map +1 -1
  40. package/lib/components/lumino/LuminoBox.d.ts +3 -9
  41. package/lib/components/lumino/LuminoBox.js +1 -6
  42. package/lib/components/lumino/LuminoBox.js.map +1 -1
  43. package/lib/components/lumino/ReactPortalWidget.d.ts +1 -2
  44. package/lib/components/notebook/Notebook.d.ts +4 -6
  45. package/lib/components/notebook/Notebook.js +11 -27
  46. package/lib/components/notebook/Notebook.js.map +1 -1
  47. package/lib/components/notebook/Notebook2.d.ts +7 -0
  48. package/lib/components/notebook/Notebook2.js +13 -2
  49. package/lib/components/notebook/Notebook2.js.map +1 -1
  50. package/lib/components/notebook/Notebook2Adapter.d.ts +197 -0
  51. package/lib/components/notebook/Notebook2Adapter.js +563 -9
  52. package/lib/components/notebook/Notebook2Adapter.js.map +1 -1
  53. package/lib/components/notebook/Notebook2Base.d.ts +15 -6
  54. package/lib/components/notebook/Notebook2Base.js +183 -15
  55. package/lib/components/notebook/Notebook2Base.js.map +1 -1
  56. package/lib/components/notebook/Notebook2State.d.ts +36 -8
  57. package/lib/components/notebook/Notebook2State.js +75 -21
  58. package/lib/components/notebook/Notebook2State.js.map +1 -1
  59. package/lib/components/notebook/NotebookAdapter.js +6 -87
  60. package/lib/components/notebook/NotebookAdapter.js.map +1 -1
  61. package/lib/components/notebook/NotebookState.d.ts +11 -11
  62. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +1 -1
  63. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.d.ts +2 -4
  64. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js +1 -3
  65. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js.map +1 -1
  66. package/lib/components/notebook/index.d.ts +1 -0
  67. package/lib/components/notebook/index.js +1 -0
  68. package/lib/components/notebook/index.js.map +1 -1
  69. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.d.ts +28 -1
  70. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js +15 -1
  71. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js.map +1 -1
  72. package/lib/components/output/Output.d.ts +11 -13
  73. package/lib/components/output/Output.js +43 -35
  74. package/lib/components/output/Output.js.map +1 -1
  75. package/lib/components/output/OutputAdapter.d.ts +1 -0
  76. package/lib/components/output/OutputAdapter.js +6 -0
  77. package/lib/components/output/OutputAdapter.js.map +1 -1
  78. package/lib/components/output/OutputIPyWidgets.d.ts +2 -2
  79. package/lib/components/output/OutputIPyWidgets.js.map +1 -1
  80. package/lib/components/output/OutputRenderer.d.ts +2 -2
  81. package/lib/components/output/OutputRenderer.js +11 -1
  82. package/lib/components/output/OutputRenderer.js.map +1 -1
  83. package/lib/components/output/ipywidgets/IPyWidgetsViewManager.js +1 -3
  84. package/lib/components/output/ipywidgets/IPyWidgetsViewManager.js.map +1 -1
  85. package/lib/components/terminal/Terminal.d.ts +1 -4
  86. package/lib/components/terminal/Terminal.js +4 -7
  87. package/lib/components/terminal/Terminal.js.map +1 -1
  88. package/lib/components/viewer/Viewer.d.ts +1 -1
  89. package/lib/components/viewer/output/OutputViewer.d.ts +3 -6
  90. package/lib/components/viewer/output/OutputViewer.js +1 -5
  91. package/lib/components/viewer/output/OutputViewer.js.map +1 -1
  92. package/lib/examples/JupyterLabAppHeadless.js +1 -1
  93. package/lib/examples/JupyterLabAppHeadless.js.map +1 -1
  94. package/lib/examples/JupyterLabAppHeadlessServerless.js +1 -1
  95. package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -1
  96. package/lib/examples/Notebook2Actions.js +2 -2
  97. package/lib/examples/Notebook2Actions.js.map +1 -1
  98. package/lib/examples/RunningSessions.js +1 -1
  99. package/lib/examples/RunningSessions.js.map +1 -1
  100. package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js +1 -1
  101. package/lib/index.d.ts +4 -0
  102. package/lib/index.js +1 -0
  103. package/lib/index.js.map +1 -1
  104. package/lib/jupyter/Jupyter.d.ts +1 -74
  105. package/lib/jupyter/Jupyter.js +2 -9
  106. package/lib/jupyter/Jupyter.js.map +1 -1
  107. package/lib/jupyter/JupyterConfig.d.ts +6 -0
  108. package/lib/jupyter/JupyterConfig.js +10 -2
  109. package/lib/jupyter/JupyterConfig.js.map +1 -1
  110. package/lib/jupyter/JupyterContext.d.ts +2 -2
  111. package/lib/jupyter/ipywidgets/classic/htmlmanager.d.ts +6 -0
  112. package/lib/jupyter/ipywidgets/classic/htmlmanager.js +8 -0
  113. package/lib/jupyter/ipywidgets/classic/htmlmanager.js.map +1 -1
  114. package/lib/jupyter/ipywidgets/lab/manager.d.ts +6 -0
  115. package/lib/jupyter/ipywidgets/lab/manager.js +8 -0
  116. package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
  117. package/lib/jupyter/ipywidgets/libembed-amd.d.ts +1 -1
  118. package/lib/jupyter/ipywidgets/libembed-amd.js +1 -1
  119. package/lib/jupyter/lite/LiteServer.d.ts +1 -1
  120. package/lib/jupyter/lite/LiteServer.js +1 -1
  121. package/lib/theme/JupyterLabCss.d.ts +1 -1
  122. package/lib/theme/JupyterReactTheme.d.ts +1 -1
  123. package/lib/tools/__tests__/operationRunner.test.d.ts +1 -0
  124. package/lib/tools/__tests__/operationRunner.test.js +193 -0
  125. package/lib/tools/__tests__/operationRunner.test.js.map +1 -0
  126. package/lib/tools/core/executor.d.ts +46 -0
  127. package/lib/tools/core/executor.js +55 -0
  128. package/lib/tools/core/executor.js.map +1 -0
  129. package/lib/tools/core/formatter.d.ts +20 -0
  130. package/lib/tools/core/formatter.js +41 -0
  131. package/lib/tools/core/formatter.js.map +1 -0
  132. package/lib/tools/core/index.d.ts +18 -0
  133. package/lib/tools/core/index.js +24 -0
  134. package/lib/tools/core/index.js.map +1 -0
  135. package/lib/tools/core/interfaces.d.ts +38 -0
  136. package/lib/tools/core/interfaces.js +7 -0
  137. package/lib/tools/core/interfaces.js.map +1 -0
  138. package/lib/tools/core/operationRunner.d.ts +27 -0
  139. package/lib/tools/core/operationRunner.js +33 -0
  140. package/lib/tools/core/operationRunner.js.map +1 -0
  141. package/lib/tools/core/schema.d.ts +47 -0
  142. package/lib/tools/core/schema.js +7 -0
  143. package/lib/tools/core/schema.js.map +1 -0
  144. package/lib/tools/core/types.d.ts +36 -0
  145. package/lib/tools/core/types.js +7 -0
  146. package/lib/tools/core/types.js.map +1 -0
  147. package/lib/tools/core/zodUtils.d.ts +56 -0
  148. package/lib/tools/core/zodUtils.js +179 -0
  149. package/lib/tools/core/zodUtils.js.map +1 -0
  150. package/lib/tools/definitions/deleteCell.d.ts +7 -0
  151. package/lib/tools/definitions/deleteCell.js +25 -0
  152. package/lib/tools/definitions/deleteCell.js.map +1 -0
  153. package/lib/tools/definitions/executeCode.d.ts +7 -0
  154. package/lib/tools/definitions/executeCode.js +33 -0
  155. package/lib/tools/definitions/executeCode.js.map +1 -0
  156. package/lib/tools/definitions/index.d.ts +12 -0
  157. package/lib/tools/definitions/index.js +18 -0
  158. package/lib/tools/definitions/index.js.map +1 -0
  159. package/lib/tools/definitions/insertCell.d.ts +7 -0
  160. package/lib/tools/definitions/insertCell.js +24 -0
  161. package/lib/tools/definitions/insertCell.js.map +1 -0
  162. package/lib/tools/definitions/readAllCells.d.ts +7 -0
  163. package/lib/tools/definitions/readAllCells.js +24 -0
  164. package/lib/tools/definitions/readAllCells.js.map +1 -0
  165. package/lib/tools/definitions/readCell.d.ts +7 -0
  166. package/lib/tools/definitions/readCell.js +24 -0
  167. package/lib/tools/definitions/readCell.js.map +1 -0
  168. package/lib/tools/definitions/runCell.d.ts +7 -0
  169. package/lib/tools/definitions/runCell.js +31 -0
  170. package/lib/tools/definitions/runCell.js.map +1 -0
  171. package/lib/tools/definitions/updateCell.d.ts +7 -0
  172. package/lib/tools/definitions/updateCell.js +24 -0
  173. package/lib/tools/definitions/updateCell.js.map +1 -0
  174. package/lib/tools/index.d.ts +20 -0
  175. package/lib/tools/index.js +62 -0
  176. package/lib/tools/index.js.map +1 -0
  177. package/lib/tools/operations/deleteCell.d.ts +49 -0
  178. package/lib/tools/operations/deleteCell.js +103 -0
  179. package/lib/tools/operations/deleteCell.js.map +1 -0
  180. package/lib/tools/operations/executeCode.d.ts +33 -0
  181. package/lib/tools/operations/executeCode.js +45 -0
  182. package/lib/tools/operations/executeCode.js.map +1 -0
  183. package/lib/tools/operations/insertCell.d.ts +27 -0
  184. package/lib/tools/operations/insertCell.js +56 -0
  185. package/lib/tools/operations/insertCell.js.map +1 -0
  186. package/lib/tools/operations/readAllCells.d.ts +21 -0
  187. package/lib/tools/operations/readAllCells.js +45 -0
  188. package/lib/tools/operations/readAllCells.js.map +1 -0
  189. package/lib/tools/operations/readCell.d.ts +39 -0
  190. package/lib/tools/operations/readCell.js +90 -0
  191. package/lib/tools/operations/readCell.js.map +1 -0
  192. package/lib/tools/operations/runCell.d.ts +24 -0
  193. package/lib/tools/operations/runCell.js +124 -0
  194. package/lib/tools/operations/runCell.js.map +1 -0
  195. package/lib/tools/operations/updateCell.d.ts +27 -0
  196. package/lib/tools/operations/updateCell.js +53 -0
  197. package/lib/tools/operations/updateCell.js.map +1 -0
  198. package/lib/tools/schemas/deleteCell.d.ts +20 -0
  199. package/lib/tools/schemas/deleteCell.js +24 -0
  200. package/lib/tools/schemas/deleteCell.js.map +1 -0
  201. package/lib/tools/schemas/executeCode.d.ts +19 -0
  202. package/lib/tools/schemas/executeCode.js +28 -0
  203. package/lib/tools/schemas/executeCode.js.map +1 -0
  204. package/lib/tools/schemas/index.d.ts +12 -0
  205. package/lib/tools/schemas/index.js +18 -0
  206. package/lib/tools/schemas/index.js.map +1 -0
  207. package/lib/tools/schemas/insertCell.d.ts +24 -0
  208. package/lib/tools/schemas/insertCell.js +29 -0
  209. package/lib/tools/schemas/insertCell.js.map +1 -0
  210. package/lib/tools/schemas/readAllCells.d.ts +19 -0
  211. package/lib/tools/schemas/readAllCells.js +18 -0
  212. package/lib/tools/schemas/readAllCells.js.map +1 -0
  213. package/lib/tools/schemas/readCell.d.ts +19 -0
  214. package/lib/tools/schemas/readCell.js +24 -0
  215. package/lib/tools/schemas/readCell.js.map +1 -0
  216. package/lib/tools/schemas/runCell.d.ts +21 -0
  217. package/lib/tools/schemas/runCell.js +39 -0
  218. package/lib/tools/schemas/runCell.js.map +1 -0
  219. package/lib/tools/schemas/updateCell.d.ts +19 -0
  220. package/lib/tools/schemas/updateCell.js +21 -0
  221. package/lib/tools/schemas/updateCell.js.map +1 -0
  222. package/package.json +25 -16
@@ -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,CACX,MAAe,EACf,OAA6B;QAE7B,mCAAmC;QACnC,MAAM,EACJ,KAAK,EACL,cAAc,EACd,MAAM,GAAG,KAAK,EACd,gBAAgB,GAAG,CAAC,GACrB,GAAG,eAAe,CAAC,mBAAmB,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE/B,IAAI,CAAC,UAAU,E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,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAEzD,mCAAmC;YACnC,IAAI,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC3C,6BAA6B;gBAC7B,IAAI,cAAc,GAAkB,EAAE,CAAC;gBACvC,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE;wBAC1D,KAAK;wBACL,cAAc,EAAE,IAAI;qBACrB,CAAC,CAAC;oBACH,IACE,QAAQ;wBACR,OAAO,QAAQ,KAAK,QAAQ;wBAC5B,SAAS,IAAI,QAAQ,EACrB,CAAC;wBACD,cAAc;4BACX,QAAwC,CAAC,OAAO,IAAI,EAAE,CAAC;oBAC5D,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,wCAAwC;gBAC1C,CAAC;gBAED,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,IAAI;oBACb,KAAK;oBACL,OAAO,EAAE;wBACP,2CAA2C,cAAc,8CAA8C;wBACvG,GAAG,cAAc;qBAClB;oBACD,YAAY;oBACZ,KAAK,EAAE,6BAA6B,cAAc,UAAU;iBAC7D,CAAC;YACJ,CAAC;YAED,8BAA8B;YAC9B,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Platform-agnostic 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,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AAC,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"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Zod schema for insertCell operation parameters
3
+ *
4
+ * @module tools/schemas/insertCell
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for insertCell parameters
9
+ *
10
+ * Validates cell type, source content, and optional insertion index.
11
+ */
12
+ export declare const insertCellParamsSchema: z.ZodObject<{
13
+ type: z.ZodEnum<{
14
+ code: "code";
15
+ raw: "raw";
16
+ markdown: "markdown";
17
+ }>;
18
+ source: z.ZodString;
19
+ index: z.ZodOptional<z.ZodNumber>;
20
+ }, z.core.$strip>;
21
+ /**
22
+ * TypeScript type inferred from Zod schema.
23
+ */
24
+ export type InsertCellParams = z.infer<typeof insertCellParamsSchema>;
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for insertCell operation parameters
8
+ *
9
+ * @module tools/schemas/insertCell
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for insertCell parameters
14
+ *
15
+ * Validates cell type, source content, and optional insertion index.
16
+ */
17
+ export const insertCellParamsSchema = z.object({
18
+ type: z
19
+ .enum(['code', 'markdown', 'raw'])
20
+ .describe("Cell type: 'code', 'markdown', or 'raw'"),
21
+ source: z.string().describe('Cell source content'),
22
+ index: z
23
+ .number()
24
+ .int()
25
+ .nonnegative()
26
+ .optional()
27
+ .describe('Insert position (0-based index). If omitted, cell is inserted at the end.'),
28
+ });
29
+ //# sourceMappingURL=insertCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertCell.js","sourceRoot":"","sources":["../../../src/tools/schemas/insertCell.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,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;SACjC,QAAQ,CAAC,yCAAyC,CAAC;IACtD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAClD,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,QAAQ,CACP,2EAA2E,CAC5E;CACJ,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Zod schema for readAllCells operation parameters
3
+ *
4
+ * @module tools/schemas/readAllCells
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for readAllCells parameters
9
+ */
10
+ export declare const readAllCellsParamsSchema: z.ZodObject<{
11
+ format: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
12
+ brief: "brief";
13
+ detailed: "detailed";
14
+ }>>>;
15
+ }, z.core.$strip>;
16
+ /**
17
+ * TypeScript type inferred from Zod schema.
18
+ */
19
+ export type ReadAllCellsParams = z.infer<typeof readAllCellsParamsSchema>;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for readAllCells operation parameters
8
+ *
9
+ * @module tools/schemas/readAllCells
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for readAllCells parameters
14
+ */
15
+ export const readAllCellsParamsSchema = z.object({
16
+ format: z.enum(['brief', 'detailed']).default('brief').optional(),
17
+ });
18
+ //# sourceMappingURL=readAllCells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readAllCells.js","sourceRoot":"","sources":["../../../src/tools/schemas/readAllCells.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;CAClE,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Zod schema for readCell operation parameters
3
+ *
4
+ * @module tools/schemas/readCell
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for readCell parameters
9
+ *
10
+ * Validates cell index and optional output inclusion flag.
11
+ */
12
+ export declare const readCellParamsSchema: z.ZodObject<{
13
+ index: z.ZodNumber;
14
+ includeOutputs: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$strip>;
16
+ /**
17
+ * TypeScript type inferred from Zod schema.
18
+ */
19
+ export type ReadCellParams = z.infer<typeof readCellParamsSchema>;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for readCell operation parameters
8
+ *
9
+ * @module tools/schemas/readCell
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for readCell parameters
14
+ *
15
+ * Validates cell index and optional output inclusion flag.
16
+ */
17
+ export const readCellParamsSchema = z.object({
18
+ index: z.number().int().nonnegative().describe('Cell index (0-based)'),
19
+ includeOutputs: z
20
+ .boolean()
21
+ .optional()
22
+ .describe('Whether to include cell outputs in the response (default: true)'),
23
+ });
24
+ //# sourceMappingURL=readCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readCell.js","sourceRoot":"","sources":["../../../src/tools/schemas/readCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACtE,cAAc,EAAE,CAAC;SACd,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,iEAAiE,CAClE;CACJ,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Zod schema for runCell operation parameters
3
+ *
4
+ * @module tools/schemas/runCell
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for runCell parameters
9
+ *
10
+ * Validates optional cell index, timeout, streaming, and progress interval settings.
11
+ */
12
+ export declare const runCellParamsSchema: z.ZodObject<{
13
+ index: z.ZodOptional<z.ZodNumber>;
14
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
15
+ stream: z.ZodOptional<z.ZodBoolean>;
16
+ progressInterval: z.ZodOptional<z.ZodNumber>;
17
+ }, z.core.$strip>;
18
+ /**
19
+ * TypeScript type inferred from Zod schema.
20
+ */
21
+ export type RunCellParams = z.infer<typeof runCellParamsSchema>;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for runCell operation parameters
8
+ *
9
+ * @module tools/schemas/runCell
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for runCell parameters
14
+ *
15
+ * Validates optional cell index, timeout, streaming, and progress interval settings.
16
+ */
17
+ export const runCellParamsSchema = z.object({
18
+ index: z
19
+ .number()
20
+ .int()
21
+ .nonnegative()
22
+ .optional()
23
+ .describe('Cell index to execute (0-based). If omitted, executes the currently active cell.'),
24
+ timeoutSeconds: z
25
+ .number()
26
+ .positive()
27
+ .optional()
28
+ .describe('Execution timeout in seconds. If omitted, no timeout is enforced (normal Jupyter behavior).'),
29
+ stream: z
30
+ .boolean()
31
+ .optional()
32
+ .describe('Enable streaming progress updates (default: false)'),
33
+ progressInterval: z
34
+ .number()
35
+ .positive()
36
+ .optional()
37
+ .describe('Progress update interval in seconds when stream=true (default: 5)'),
38
+ });
39
+ //# sourceMappingURL=runCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runCell.js","sourceRoot":"","sources":["../../../src/tools/schemas/runCell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,QAAQ,CACP,kFAAkF,CACnF;IACH,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,6FAA6F,CAC9F;IACH,MAAM,EAAE,CAAC;SACN,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;IACjE,gBAAgB,EAAE,CAAC;SAChB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,mEAAmE,CACpE;CACJ,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Zod schema for updateCell operation parameters
3
+ *
4
+ * @module tools/schemas/updateCell
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * Schema for updateCell parameters
9
+ *
10
+ * Validates cell index and new source content.
11
+ */
12
+ export declare const updateCellParamsSchema: z.ZodObject<{
13
+ index: z.ZodNumber;
14
+ source: z.ZodString;
15
+ }, z.core.$strip>;
16
+ /**
17
+ * TypeScript type inferred from Zod schema.
18
+ */
19
+ export type UpdateCellParams = z.infer<typeof updateCellParamsSchema>;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2021-2023 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * Zod schema for updateCell operation parameters
8
+ *
9
+ * @module tools/schemas/updateCell
10
+ */
11
+ import { z } from 'zod';
12
+ /**
13
+ * Schema for updateCell parameters
14
+ *
15
+ * Validates cell index and new source content.
16
+ */
17
+ export const updateCellParamsSchema = z.object({
18
+ index: z.number().int().nonnegative().describe('Cell index (0-based)'),
19
+ source: z.string().describe('New cell source content'),
20
+ });
21
+ //# sourceMappingURL=updateCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCell.js","sourceRoot":"","sources":["../../../src/tools/schemas/updateCell.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,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACtE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACvD,CAAC,CAAC"}