@dxos/plugin-script 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (556) hide show
  1. package/README.md +15 -13
  2. package/dist/lib/neutral/DeploymentDialog-6DBF3V6C.mjs +112 -0
  3. package/dist/lib/neutral/DeploymentDialog-6DBF3V6C.mjs.map +7 -0
  4. package/dist/lib/neutral/NotebookContainer-FIAQI3A2.mjs +760 -0
  5. package/dist/lib/neutral/NotebookContainer-FIAQI3A2.mjs.map +7 -0
  6. package/dist/lib/neutral/ScriptContainer-2OPBAXFB.mjs +79 -0
  7. package/dist/lib/neutral/ScriptContainer-2OPBAXFB.mjs.map +7 -0
  8. package/dist/lib/neutral/ScriptPlugin.mjs +39 -0
  9. package/dist/lib/neutral/ScriptPlugin.mjs.map +7 -0
  10. package/dist/lib/neutral/ScriptPlugin.node.mjs +27 -0
  11. package/dist/lib/neutral/ScriptPlugin.node.mjs.map +7 -0
  12. package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs +31 -0
  13. package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +7 -0
  14. package/dist/lib/neutral/ScriptProperties-F6NE6M4H.mjs +296 -0
  15. package/dist/lib/neutral/ScriptProperties-F6NE6M4H.mjs.map +7 -0
  16. package/dist/lib/neutral/TestContainer-JNFPLAJX.mjs +44 -0
  17. package/dist/lib/neutral/TestContainer-JNFPLAJX.mjs.map +7 -0
  18. package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs +34 -0
  19. package/dist/lib/neutral/access-token-created-ENMCEGVU.mjs.map +7 -0
  20. package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs +52 -0
  21. package/dist/lib/neutral/app-graph-builder-7AWFCEQF.mjs.map +7 -0
  22. package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs +15 -0
  23. package/dist/lib/neutral/blueprint-definition-T33SBPP2.mjs.map +7 -0
  24. package/dist/lib/neutral/blueprints/index.mjs +10 -0
  25. package/dist/lib/neutral/capabilities/index.mjs +21 -0
  26. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  27. package/dist/lib/neutral/capabilities/node.mjs +17 -0
  28. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  29. package/dist/lib/neutral/chunk-2DMPFVUM.mjs +8 -0
  30. package/dist/lib/neutral/chunk-2DMPFVUM.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-4RJALG6K.mjs +151 -0
  32. package/dist/lib/neutral/chunk-4RJALG6K.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-B4FVQEHV.mjs +8 -0
  34. package/dist/lib/neutral/chunk-B4FVQEHV.mjs.map +7 -0
  35. package/dist/lib/neutral/chunk-BDRB6ZX2.mjs +52 -0
  36. package/dist/lib/neutral/chunk-BDRB6ZX2.mjs.map +7 -0
  37. package/dist/lib/neutral/chunk-BUKQITZT.mjs +105 -0
  38. package/dist/lib/neutral/chunk-BUKQITZT.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-D7DFASAE.mjs +52 -0
  40. package/dist/lib/neutral/chunk-D7DFASAE.mjs.map +7 -0
  41. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  42. package/dist/lib/neutral/chunk-MI6X5CTJ.mjs +336 -0
  43. package/dist/lib/neutral/chunk-MI6X5CTJ.mjs.map +7 -0
  44. package/dist/lib/neutral/chunk-P2F3STZN.mjs +8 -0
  45. package/dist/lib/neutral/chunk-P2F3STZN.mjs.map +7 -0
  46. package/dist/lib/neutral/chunk-PDB6UOSB.mjs +125 -0
  47. package/dist/lib/neutral/chunk-PDB6UOSB.mjs.map +7 -0
  48. package/dist/lib/{browser/chunk-QYAREHGH.mjs → neutral/chunk-UYR3YH4Q.mjs} +9 -6
  49. package/dist/lib/neutral/chunk-UYR3YH4Q.mjs.map +7 -0
  50. package/dist/lib/neutral/compiler-SMVIP5UN.mjs +101 -0
  51. package/dist/lib/neutral/compiler-SMVIP5UN.mjs.map +7 -0
  52. package/dist/lib/neutral/components/index.mjs +719 -0
  53. package/dist/lib/neutral/components/index.mjs.map +7 -0
  54. package/dist/lib/neutral/containers/index.mjs +17 -0
  55. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  56. package/dist/lib/neutral/create-OZRIZ7RN.mjs +44 -0
  57. package/dist/lib/neutral/create-OZRIZ7RN.mjs.map +7 -0
  58. package/dist/lib/neutral/create-object-F2NWICFV.mjs +44 -0
  59. package/dist/lib/neutral/create-object-F2NWICFV.mjs.map +7 -0
  60. package/dist/lib/neutral/create-script-VBA3SLSU.mjs +45 -0
  61. package/dist/lib/neutral/create-script-VBA3SLSU.mjs.map +7 -0
  62. package/dist/lib/neutral/delete-PAUWA2QM.mjs +21 -0
  63. package/dist/lib/neutral/delete-PAUWA2QM.mjs.map +7 -0
  64. package/dist/lib/neutral/deploy-CXVW54JJ.mjs +62 -0
  65. package/dist/lib/neutral/deploy-CXVW54JJ.mjs.map +7 -0
  66. package/dist/lib/neutral/hooks/index.mjs +369 -0
  67. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  68. package/dist/lib/neutral/index.mjs +41 -0
  69. package/dist/lib/neutral/inspect-invocations-LEOEP5I2.mjs +59 -0
  70. package/dist/lib/neutral/inspect-invocations-LEOEP5I2.mjs.map +7 -0
  71. package/dist/lib/neutral/install-function-5N24Q45W.mjs +51 -0
  72. package/dist/lib/neutral/install-function-5N24Q45W.mjs.map +7 -0
  73. package/dist/lib/neutral/invoke-5QVEZ3X5.mjs +33 -0
  74. package/dist/lib/neutral/invoke-5QVEZ3X5.mjs.map +7 -0
  75. package/dist/lib/neutral/meta.json +1 -0
  76. package/dist/lib/neutral/meta.mjs +10 -0
  77. package/dist/lib/neutral/operation-handler-OTCWYDFI.mjs +18 -0
  78. package/dist/lib/neutral/operation-handler-OTCWYDFI.mjs.map +7 -0
  79. package/dist/lib/neutral/operations/index.mjs +8 -0
  80. package/dist/lib/neutral/plugin.mjs +16 -0
  81. package/dist/lib/neutral/plugin.mjs.map +7 -0
  82. package/dist/lib/neutral/query-deployed-functions-FVD7NYPA.mjs +30 -0
  83. package/dist/lib/neutral/query-deployed-functions-FVD7NYPA.mjs.map +7 -0
  84. package/dist/lib/neutral/react-surface-JH2AOK7V.mjs +117 -0
  85. package/dist/lib/neutral/react-surface-JH2AOK7V.mjs.map +7 -0
  86. package/dist/lib/neutral/read-FFOSK6A3.mjs +26 -0
  87. package/dist/lib/neutral/read-FFOSK6A3.mjs.map +7 -0
  88. package/dist/lib/neutral/settings-VJBW4OMK.mjs +30 -0
  89. package/dist/lib/neutral/settings-VJBW4OMK.mjs.map +7 -0
  90. package/dist/lib/{browser → neutral}/templates/index.mjs +2 -1
  91. package/dist/lib/neutral/translations.mjs +104 -0
  92. package/dist/lib/neutral/translations.mjs.map +7 -0
  93. package/dist/lib/neutral/types/index.mjs +17 -0
  94. package/dist/lib/neutral/types/index.mjs.map +7 -0
  95. package/dist/lib/neutral/update-PJS5GG3Y.mjs +63 -0
  96. package/dist/lib/neutral/update-PJS5GG3Y.mjs.map +7 -0
  97. package/dist/types/src/ScriptPlugin.d.ts +3 -1
  98. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  99. package/dist/types/src/ScriptPlugin.node.d.ts +4 -0
  100. package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -0
  101. package/dist/types/src/ScriptPlugin.test.d.ts +2 -0
  102. package/dist/types/src/ScriptPlugin.test.d.ts.map +1 -0
  103. package/dist/types/src/blueprints/functions/create.d.ts +11 -0
  104. package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
  105. package/dist/types/src/blueprints/functions/definitions.d.ts +141 -0
  106. package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
  107. package/dist/types/src/blueprints/functions/delete.d.ts +18 -0
  108. package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
  109. package/dist/types/src/blueprints/functions/deploy.d.ts +22 -0
  110. package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
  111. package/dist/types/src/blueprints/functions/index.d.ts +4 -0
  112. package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
  113. package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +29 -0
  114. package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
  115. package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
  116. package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
  117. package/dist/types/src/blueprints/functions/invoke.d.ts +22 -0
  118. package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
  119. package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
  120. package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
  121. package/dist/types/src/blueprints/functions/read.d.ts +22 -0
  122. package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
  123. package/dist/types/src/blueprints/functions/update.d.ts +27 -0
  124. package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
  125. package/dist/types/src/blueprints/index.d.ts +2 -0
  126. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  127. package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
  128. package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  130. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  131. package/dist/types/src/capabilities/artifact-definition.d.ts +3 -2
  132. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  133. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
  134. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  135. package/dist/types/src/capabilities/compiler.d.ts +3 -1
  136. package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
  137. package/dist/types/src/capabilities/create-object.d.ts +16 -0
  138. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/index.d.ts +19 -7
  140. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  141. package/dist/types/src/capabilities/node.d.ts +18 -0
  142. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  144. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  146. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  147. package/dist/types/src/capabilities/settings.d.ts +5 -2
  148. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  149. package/dist/types/src/compiler/compiler.d.ts +1 -1
  150. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  151. package/dist/types/src/components/FramePanel/FramePanel.d.ts +12 -0
  152. package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
  153. package/dist/types/src/components/FramePanel/index.d.ts +2 -0
  154. package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
  155. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
  156. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
  157. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
  158. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
  159. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +16 -0
  160. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
  161. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +240 -0
  162. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
  163. package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
  164. package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
  165. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
  166. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
  167. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
  168. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
  169. package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
  170. package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
  171. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
  172. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
  173. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts +241 -0
  174. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
  175. package/dist/types/src/components/ScriptPluginSettings/index.d.ts +2 -0
  176. package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
  177. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +10 -9
  178. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  179. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +232 -2
  180. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  181. package/dist/types/src/components/TestPanel/TestPanel.d.ts +4 -2
  182. package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
  183. package/dist/types/src/components/TestPanel/index.d.ts +0 -1
  184. package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
  185. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +8 -2
  186. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  187. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +5 -3
  188. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  189. package/dist/types/src/components/index.d.ts +7 -4
  190. package/dist/types/src/components/index.d.ts.map +1 -1
  191. package/dist/types/src/constants.d.ts +2 -0
  192. package/dist/types/src/constants.d.ts.map +1 -0
  193. package/dist/types/src/{components → containers}/DeploymentDialog/DeploymentDialog.d.ts +2 -4
  194. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
  195. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +240 -0
  196. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
  197. package/dist/types/src/containers/DeploymentDialog/index.d.ts +2 -0
  198. package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
  199. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +7 -0
  200. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
  201. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +7 -0
  202. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
  203. package/dist/types/src/containers/NotebookContainer/index.d.ts +2 -0
  204. package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
  205. package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
  206. package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
  207. package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts +242 -0
  208. package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +1 -0
  209. package/dist/types/src/containers/ScriptContainer/index.d.ts +2 -0
  210. package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
  211. package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +7 -0
  212. package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -0
  213. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +7 -0
  214. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -0
  215. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +7 -0
  216. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -0
  217. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +6 -0
  218. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
  219. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +242 -0
  220. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -0
  221. package/dist/types/src/containers/ScriptProperties/index.d.ts +2 -0
  222. package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
  223. package/dist/types/src/containers/TestContainer/TestContainer.d.ts +8 -0
  224. package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
  225. package/dist/types/src/containers/TestContainer/index.d.ts +2 -0
  226. package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
  227. package/dist/types/src/containers/index.d.ts +7 -0
  228. package/dist/types/src/containers/index.d.ts.map +1 -0
  229. package/dist/types/src/e2e/ai.test.d.ts +2 -0
  230. package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
  231. package/dist/types/src/e2e/deploy.test.d.ts +2 -0
  232. package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
  233. package/dist/types/src/hooks/deploy.d.ts +28 -30
  234. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  235. package/dist/types/src/hooks/format.d.ts +5 -4
  236. package/dist/types/src/hooks/format.d.ts.map +1 -1
  237. package/dist/types/src/hooks/index.d.ts +1 -0
  238. package/dist/types/src/hooks/index.d.ts.map +1 -1
  239. package/dist/types/src/hooks/template.d.ts +7 -16
  240. package/dist/types/src/hooks/template.d.ts.map +1 -1
  241. package/dist/types/src/hooks/useCompiler.d.ts +7 -0
  242. package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
  243. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  244. package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
  245. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
  246. package/dist/types/src/index.d.ts +3 -3
  247. package/dist/types/src/index.d.ts.map +1 -1
  248. package/dist/types/src/meta.d.ts +2 -3
  249. package/dist/types/src/meta.d.ts.map +1 -1
  250. package/dist/types/src/notebook/compute-graph.d.ts +58 -0
  251. package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
  252. package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
  253. package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
  254. package/dist/types/src/notebook/eval.d.ts +13 -0
  255. package/dist/types/src/notebook/eval.d.ts.map +1 -0
  256. package/dist/types/src/notebook/index.d.ts +2 -0
  257. package/dist/types/src/notebook/index.d.ts.map +1 -0
  258. package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
  259. package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
  260. package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
  261. package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
  262. package/dist/types/src/operations/access-token-created.d.ts +5 -0
  263. package/dist/types/src/operations/access-token-created.d.ts.map +1 -0
  264. package/dist/types/src/operations/create-script.d.ts +5 -0
  265. package/dist/types/src/operations/create-script.d.ts.map +1 -0
  266. package/dist/types/src/operations/index.d.ts +3 -0
  267. package/dist/types/src/operations/index.d.ts.map +1 -0
  268. package/dist/types/src/plugin.d.ts +4 -0
  269. package/dist/types/src/plugin.d.ts.map +1 -0
  270. package/dist/types/src/templates/anthropic.d.ts +7 -0
  271. package/dist/types/src/templates/anthropic.d.ts.map +1 -0
  272. package/dist/types/src/templates/chat.d.ts.map +1 -1
  273. package/dist/types/src/templates/chess-bot.d.ts +12 -0
  274. package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
  275. package/dist/types/src/templates/commentary.d.ts +13 -0
  276. package/dist/types/src/templates/commentary.d.ts.map +1 -0
  277. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  278. package/dist/types/src/templates/discord.d.ts.map +1 -1
  279. package/dist/types/src/templates/email.d.ts.map +1 -1
  280. package/dist/types/src/templates/forex-effect.d.ts +5 -1
  281. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  282. package/dist/types/src/templates/forex.d.ts +5 -1
  283. package/dist/types/src/templates/forex.d.ts.map +1 -1
  284. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  285. package/dist/types/src/templates/index.d.ts +52 -1
  286. package/dist/types/src/templates/index.d.ts.map +1 -1
  287. package/dist/types/src/templates/ping.d.ts +4 -0
  288. package/dist/types/src/templates/ping.d.ts.map +1 -0
  289. package/dist/types/src/testing/index.d.ts +3 -0
  290. package/dist/types/src/testing/index.d.ts.map +1 -0
  291. package/dist/types/src/testing/simulator.test.d.ts +2 -0
  292. package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
  293. package/dist/types/src/testing/test-notebook.d.ts +3 -0
  294. package/dist/types/src/testing/test-notebook.d.ts.map +1 -0
  295. package/dist/types/src/testing/test-script.d.ts +7 -0
  296. package/dist/types/src/testing/test-script.d.ts.map +1 -0
  297. package/dist/types/src/translations.d.ts +222 -66
  298. package/dist/types/src/translations.d.ts.map +1 -1
  299. package/dist/types/src/types/Notebook.d.ts +120 -0
  300. package/dist/types/src/types/Notebook.d.ts.map +1 -0
  301. package/dist/types/src/types/ScriptCapabilities.d.ts +6 -0
  302. package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -0
  303. package/dist/types/src/types/ScriptEvents.d.ts +3 -0
  304. package/dist/types/src/types/ScriptEvents.d.ts.map +1 -0
  305. package/dist/types/src/types/ScriptOperation.d.ts +29 -0
  306. package/dist/types/src/types/ScriptOperation.d.ts.map +1 -0
  307. package/dist/types/src/types/Settings.d.ts +7 -0
  308. package/dist/types/src/types/Settings.d.ts.map +1 -0
  309. package/dist/types/src/types/index.d.ts +5 -1
  310. package/dist/types/src/types/index.d.ts.map +1 -1
  311. package/dist/types/src/types/types.d.ts +2 -0
  312. package/dist/types/src/types/types.d.ts.map +1 -0
  313. package/dist/types/src/util/deploy.d.ts +4 -4
  314. package/dist/types/src/util/deploy.d.ts.map +1 -1
  315. package/dist/types/src/util/functions.d.ts +6 -3
  316. package/dist/types/src/util/functions.d.ts.map +1 -1
  317. package/dist/types/tsconfig.tsbuildinfo +1 -1
  318. package/package.json +175 -90
  319. package/src/ScriptPlugin.node.ts +21 -0
  320. package/src/ScriptPlugin.test.ts +31 -0
  321. package/src/ScriptPlugin.tsx +29 -80
  322. package/src/blueprints/functions/create.ts +47 -0
  323. package/src/blueprints/functions/definitions.ts +323 -0
  324. package/src/blueprints/functions/delete.ts +23 -0
  325. package/src/blueprints/functions/deploy.ts +70 -0
  326. package/src/blueprints/functions/index.ts +19 -0
  327. package/src/blueprints/functions/inspect-invocations.ts +56 -0
  328. package/src/blueprints/functions/install-function.ts +56 -0
  329. package/src/blueprints/functions/invoke.ts +35 -0
  330. package/src/blueprints/functions/query-deployed-functions.ts +31 -0
  331. package/src/blueprints/functions/read.ts +29 -0
  332. package/src/blueprints/functions/update.ts +68 -0
  333. package/src/blueprints/index.ts +5 -0
  334. package/src/blueprints/script-blueprint.ts +55 -0
  335. package/src/capabilities/app-graph-builder.ts +40 -57
  336. package/src/capabilities/artifact-definition.ts +100 -99
  337. package/src/capabilities/blueprint-definition.ts +13 -24
  338. package/src/capabilities/compiler.ts +100 -23
  339. package/src/capabilities/create-object.ts +48 -0
  340. package/src/capabilities/index.ts +13 -9
  341. package/src/capabilities/node.ts +16 -0
  342. package/src/capabilities/operation-handler.ts +21 -0
  343. package/src/capabilities/react-surface.tsx +120 -80
  344. package/src/capabilities/settings.ts +26 -14
  345. package/src/compiler/compiler.ts +17 -3
  346. package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +8 -7
  347. package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
  348. package/src/components/NotebookStack/NotebookCell.tsx +226 -0
  349. package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
  350. package/src/components/NotebookStack/NotebookStack.stories.tsx +53 -0
  351. package/src/components/NotebookStack/NotebookStack.tsx +97 -0
  352. package/src/components/NotebookStack/index.ts +6 -0
  353. package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
  354. package/src/components/QueryEditor/QueryEditor.tsx +47 -0
  355. package/src/components/QueryEditor/index.ts +5 -0
  356. package/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx +32 -0
  357. package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +42 -0
  358. package/src/components/ScriptPluginSettings/index.ts +5 -0
  359. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +54 -20
  360. package/src/components/ScriptToolbar/ScriptToolbar.tsx +43 -51
  361. package/src/components/TestPanel/TestPanel.tsx +124 -185
  362. package/src/components/TestPanel/index.ts +0 -1
  363. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +80 -18
  364. package/src/components/TypescriptEditor/TypescriptEditor.tsx +85 -77
  365. package/src/components/index.ts +7 -5
  366. package/src/constants.ts +7 -0
  367. package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +63 -0
  368. package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
  369. package/src/containers/DeploymentDialog/index.ts +5 -0
  370. package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +85 -0
  371. package/src/containers/NotebookContainer/NotebookContainer.tsx +254 -0
  372. package/src/containers/NotebookContainer/index.ts +5 -0
  373. package/src/containers/ScriptContainer/ScriptContainer.stories.tsx +106 -0
  374. package/src/containers/ScriptContainer/ScriptContainer.tsx +85 -0
  375. package/src/containers/ScriptContainer/index.ts +5 -0
  376. package/src/containers/ScriptProperties/BlueprintEditor.tsx +101 -0
  377. package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
  378. package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
  379. package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +75 -0
  380. package/src/containers/ScriptProperties/ScriptProperties.tsx +24 -0
  381. package/src/containers/ScriptProperties/index.ts +5 -0
  382. package/src/containers/TestContainer/TestContainer.tsx +44 -0
  383. package/src/containers/TestContainer/index.ts +5 -0
  384. package/src/containers/index.ts +11 -0
  385. package/src/e2e/ai.test.ts +93 -0
  386. package/src/e2e/deploy.test.ts +66 -0
  387. package/src/hooks/deploy.ts +49 -40
  388. package/src/hooks/format.ts +10 -5
  389. package/src/hooks/index.ts +1 -0
  390. package/src/hooks/template.ts +23 -25
  391. package/src/hooks/useCompiler.ts +25 -0
  392. package/src/hooks/useCreateAndDeployScriptTemplates.ts +15 -16
  393. package/src/hooks/useToolbarState.ts +29 -4
  394. package/src/index.ts +3 -4
  395. package/src/meta.ts +10 -8
  396. package/src/notebook/compute-graph.test.ts +82 -0
  397. package/src/notebook/compute-graph.ts +230 -0
  398. package/src/notebook/eval.ts +105 -0
  399. package/src/notebook/index.ts +5 -0
  400. package/src/notebook/vfs-parser.test.ts +149 -0
  401. package/src/notebook/vfs-parser.ts +458 -0
  402. package/src/operations/access-token-created.ts +37 -0
  403. package/src/operations/create-script.ts +46 -0
  404. package/src/operations/index.ts +10 -0
  405. package/src/plugin.ts +11 -0
  406. package/src/templates/anthropic.ts +49 -0
  407. package/src/templates/chat.ts +1 -1
  408. package/src/templates/chess-bot.ts +63 -0
  409. package/src/templates/commentary.ts +249 -0
  410. package/src/templates/data-generator.ts +3 -1
  411. package/src/templates/discord.ts +11 -3
  412. package/src/templates/forex-effect.ts +35 -25
  413. package/src/templates/forex.ts +27 -15
  414. package/src/templates/gmail.ts +25 -14
  415. package/src/templates/index.ts +36 -23
  416. package/src/templates/ping.ts +25 -0
  417. package/src/testing/index.ts +6 -0
  418. package/src/testing/simulator.test.ts +39 -0
  419. package/src/testing/test-notebook.ts +71 -0
  420. package/src/testing/test-script.ts +29 -0
  421. package/src/translations.ts +92 -66
  422. package/src/types/Notebook.ts +45 -0
  423. package/src/types/ScriptCapabilities.ts +18 -0
  424. package/src/types/ScriptEvents.ts +11 -0
  425. package/src/types/ScriptOperation.ts +42 -0
  426. package/src/types/Settings.ts +20 -0
  427. package/src/types/index.ts +6 -1
  428. package/src/types/types.ts +5 -0
  429. package/src/util/deploy.ts +32 -40
  430. package/src/util/functions.ts +57 -23
  431. package/src/vite-env.d.ts +2 -0
  432. package/dist/lib/browser/DeploymentDialog-QZSTVNIS.mjs +0 -12
  433. package/dist/lib/browser/ScriptContainer-DNNA6XC6.mjs +0 -265
  434. package/dist/lib/browser/ScriptContainer-DNNA6XC6.mjs.map +0 -7
  435. package/dist/lib/browser/app-graph-builder-IABOSTBK.mjs +0 -64
  436. package/dist/lib/browser/app-graph-builder-IABOSTBK.mjs.map +0 -7
  437. package/dist/lib/browser/blueprint-definition-AR7ITBCD.mjs +0 -28
  438. package/dist/lib/browser/blueprint-definition-AR7ITBCD.mjs.map +0 -7
  439. package/dist/lib/browser/chunk-5TVBECWH.mjs +0 -15
  440. package/dist/lib/browser/chunk-5TVBECWH.mjs.map +0 -7
  441. package/dist/lib/browser/chunk-6CAH7VIE.mjs +0 -283
  442. package/dist/lib/browser/chunk-6CAH7VIE.mjs.map +0 -7
  443. package/dist/lib/browser/chunk-GZKWMME3.mjs +0 -556
  444. package/dist/lib/browser/chunk-GZKWMME3.mjs.map +0 -7
  445. package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
  446. package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
  447. package/dist/lib/browser/chunk-NXKU3BNX.mjs +0 -222
  448. package/dist/lib/browser/chunk-NXKU3BNX.mjs.map +0 -7
  449. package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
  450. package/dist/lib/browser/chunk-RNGIQIEJ.mjs +0 -88
  451. package/dist/lib/browser/chunk-RNGIQIEJ.mjs.map +0 -7
  452. package/dist/lib/browser/chunk-YCZPTTFO.mjs +0 -153
  453. package/dist/lib/browser/chunk-YCZPTTFO.mjs.map +0 -7
  454. package/dist/lib/browser/compiler-2HJH34GM.mjs +0 -98
  455. package/dist/lib/browser/compiler-2HJH34GM.mjs.map +0 -7
  456. package/dist/lib/browser/index.mjs +0 -210
  457. package/dist/lib/browser/index.mjs.map +0 -7
  458. package/dist/lib/browser/intent-resolver-F4YSRPJI.mjs +0 -89
  459. package/dist/lib/browser/intent-resolver-F4YSRPJI.mjs.map +0 -7
  460. package/dist/lib/browser/meta.json +0 -1
  461. package/dist/lib/browser/react-surface-BBHFU6MI.mjs +0 -104
  462. package/dist/lib/browser/react-surface-BBHFU6MI.mjs.map +0 -7
  463. package/dist/lib/browser/settings-KCTBK5TY.mjs +0 -24
  464. package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
  465. package/dist/lib/browser/types/index.mjs +0 -10
  466. package/dist/lib/node-esm/DeploymentDialog-G6EHEPXN.mjs +0 -13
  467. package/dist/lib/node-esm/ScriptContainer-KPYZN2KY.mjs +0 -266
  468. package/dist/lib/node-esm/ScriptContainer-KPYZN2KY.mjs.map +0 -7
  469. package/dist/lib/node-esm/app-graph-builder-CQTTAYHP.mjs +0 -65
  470. package/dist/lib/node-esm/app-graph-builder-CQTTAYHP.mjs.map +0 -7
  471. package/dist/lib/node-esm/blueprint-definition-TJY4TX6S.mjs +0 -30
  472. package/dist/lib/node-esm/blueprint-definition-TJY4TX6S.mjs.map +0 -7
  473. package/dist/lib/node-esm/chunk-2GBESIHU.mjs +0 -284
  474. package/dist/lib/node-esm/chunk-2GBESIHU.mjs.map +0 -7
  475. package/dist/lib/node-esm/chunk-35M3CHYE.mjs +0 -16
  476. package/dist/lib/node-esm/chunk-35M3CHYE.mjs.map +0 -7
  477. package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs +0 -30
  478. package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
  479. package/dist/lib/node-esm/chunk-GWHLP5LM.mjs +0 -90
  480. package/dist/lib/node-esm/chunk-GWHLP5LM.mjs.map +0 -7
  481. package/dist/lib/node-esm/chunk-HUHVIOL5.mjs +0 -557
  482. package/dist/lib/node-esm/chunk-HUHVIOL5.mjs.map +0 -7
  483. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
  484. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
  485. package/dist/lib/node-esm/chunk-M642JUOZ.mjs +0 -223
  486. package/dist/lib/node-esm/chunk-M642JUOZ.mjs.map +0 -7
  487. package/dist/lib/node-esm/chunk-ZA36GO4T.mjs +0 -154
  488. package/dist/lib/node-esm/chunk-ZA36GO4T.mjs.map +0 -7
  489. package/dist/lib/node-esm/compiler-7SP27RA6.mjs +0 -99
  490. package/dist/lib/node-esm/compiler-7SP27RA6.mjs.map +0 -7
  491. package/dist/lib/node-esm/index.mjs +0 -211
  492. package/dist/lib/node-esm/index.mjs.map +0 -7
  493. package/dist/lib/node-esm/intent-resolver-CGQYRWWD.mjs +0 -90
  494. package/dist/lib/node-esm/intent-resolver-CGQYRWWD.mjs.map +0 -7
  495. package/dist/lib/node-esm/meta.json +0 -1
  496. package/dist/lib/node-esm/react-surface-UWIWPKZD.mjs +0 -105
  497. package/dist/lib/node-esm/react-surface-UWIWPKZD.mjs.map +0 -7
  498. package/dist/lib/node-esm/settings-DXZ334A3.mjs +0 -25
  499. package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
  500. package/dist/lib/node-esm/templates/index.mjs +0 -10
  501. package/dist/lib/node-esm/types/index.mjs +0 -11
  502. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  503. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  504. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  505. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  506. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
  507. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -145
  508. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
  509. package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
  510. package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
  511. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +0 -12
  512. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
  513. package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
  514. package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
  515. package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
  516. package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
  517. package/dist/types/src/components/ScriptContainer.d.ts +0 -12
  518. package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
  519. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
  520. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
  521. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
  522. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
  523. package/dist/types/src/components/Settings/index.d.ts +0 -3
  524. package/dist/types/src/components/Settings/index.d.ts.map +0 -1
  525. package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -8
  526. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
  527. package/dist/types/src/events.d.ts +0 -4
  528. package/dist/types/src/events.d.ts.map +0 -1
  529. package/dist/types/src/templates/chess.d.ts +0 -3
  530. package/dist/types/src/templates/chess.d.ts.map +0 -1
  531. package/dist/types/src/templates/echo.d.ts +0 -6
  532. package/dist/types/src/templates/echo.d.ts.map +0 -1
  533. package/dist/types/src/types/schema.d.ts +0 -38
  534. package/dist/types/src/types/schema.d.ts.map +0 -1
  535. package/src/capabilities/capabilities.ts +0 -12
  536. package/src/capabilities/intent-resolver.ts +0 -77
  537. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -51
  538. package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -112
  539. package/src/components/DeploymentDialog/index.ts +0 -9
  540. package/src/components/FrameContainer/frame.html +0 -25
  541. package/src/components/FrameContainer/frame.tsx +0 -51
  542. package/src/components/ScriptContainer.tsx +0 -69
  543. package/src/components/Settings/ScriptObjectSettings.tsx +0 -202
  544. package/src/components/Settings/ScriptPluginSettings.tsx +0 -76
  545. package/src/components/Settings/index.ts +0 -6
  546. package/src/components/TestPanel/TestContainer.tsx +0 -27
  547. package/src/events.ts +0 -11
  548. package/src/templates/chess.ts +0 -47
  549. package/src/templates/echo.ts +0 -8
  550. package/src/types/schema.ts +0 -37
  551. /package/dist/lib/{browser/templates → neutral/blueprints}/index.mjs.map +0 -0
  552. /package/dist/lib/{browser/DeploymentDialog-QZSTVNIS.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  553. /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
  554. /package/dist/lib/{node-esm/DeploymentDialog-G6EHEPXN.mjs.map → neutral/meta.mjs.map} +0 -0
  555. /package/dist/lib/{node-esm/templates → neutral/operations}/index.mjs.map +0 -0
  556. /package/dist/lib/{node-esm/types → neutral/templates}/index.mjs.map +0 -0
@@ -0,0 +1,149 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { describe, expect, test } from 'vitest';
6
+
7
+ import { NotebookVirtualParser, VirtualTypeScriptParser } from './vfs-parser';
8
+
9
+ describe('vfs-parser', () => {
10
+ test('parse simple assignments', () => {
11
+ const parser = new VirtualTypeScriptParser();
12
+
13
+ const tests = [
14
+ {
15
+ input: 'const a = 1',
16
+ expected: {
17
+ name: 'a',
18
+ type: 'variable',
19
+ },
20
+ },
21
+ {
22
+ input: 'a = 1',
23
+ expected: {
24
+ name: 'a',
25
+ type: 'variable',
26
+ },
27
+ },
28
+ ];
29
+
30
+ tests.forEach(({ input, expected }) => {
31
+ const result = parser.parseExpression(input);
32
+ expect(result, input).toMatchObject(expected);
33
+ });
34
+ });
35
+
36
+ test('parse variable with references', () => {
37
+ const parser = new VirtualTypeScriptParser();
38
+
39
+ const tests = [
40
+ {
41
+ input: 'const y = x * 2',
42
+ expected: {
43
+ name: 'y',
44
+ type: 'variable',
45
+ references: ['x'],
46
+ },
47
+ },
48
+ {
49
+ input: 'y = x * 2',
50
+ expected: {
51
+ name: 'y',
52
+ type: 'variable',
53
+ references: ['x'],
54
+ },
55
+ },
56
+ ];
57
+
58
+ tests.forEach(({ input, expected }) => {
59
+ const result = parser.parseExpression(input);
60
+ expect(result, input).toMatchObject(expected);
61
+ });
62
+ });
63
+
64
+ test('parse simple expression with references', () => {
65
+ const parser = new VirtualTypeScriptParser();
66
+
67
+ const result = parser.parseExpression('(a + b) * c');
68
+ expect(result).toMatchObject({
69
+ references: ['a', 'b', 'c'],
70
+ });
71
+ });
72
+
73
+ test('parse single expression', () => {
74
+ const parser = new VirtualTypeScriptParser();
75
+
76
+ const result = parser.parseExpression('const add = (a: number, b: number): number => a + b;');
77
+ expect(result).toMatchObject({
78
+ name: 'add',
79
+ type: 'function',
80
+ valueType: expect.stringContaining('(a: number, b: number) => number'),
81
+ returnType: 'number',
82
+ parameters: [
83
+ { name: 'a', type: 'number' },
84
+ { name: 'b', type: 'number' },
85
+ ],
86
+ });
87
+ });
88
+
89
+ test('analyze multiple files', () => {
90
+ const parser = new VirtualTypeScriptParser();
91
+
92
+ const files = [
93
+ {
94
+ filename: '/test.ts',
95
+ content: 'export const PI = 3.14159;\nexport function square(x: number): number { return x * x; }',
96
+ },
97
+ ];
98
+
99
+ const results = parser.analyzeFiles(files);
100
+ expect(results).toHaveLength(2);
101
+ expect(results[0]).toMatchObject({
102
+ name: 'PI',
103
+ type: 'variable',
104
+ valueType: '3.14159',
105
+ });
106
+ expect(results[1]).toMatchObject({
107
+ name: 'square',
108
+ type: 'function',
109
+ returnType: 'number',
110
+ parameters: [{ name: 'x', type: 'number' }],
111
+ });
112
+ });
113
+
114
+ test('notebook cell analysis', () => {
115
+ const parser = new NotebookVirtualParser();
116
+
117
+ const cells = [
118
+ { id: 'cell1', code: 'const x: number = 10;' },
119
+ { id: 'cell2', code: 'const y = x * 2;' },
120
+ { id: 'cell3', code: 'console.log(y);' },
121
+ ];
122
+
123
+ const analysis = parser.analyzeNotebook(cells);
124
+
125
+ // Cell 1 exports x.
126
+ const cell1 = analysis.get('cell1');
127
+ expect(cell1?.exports).toHaveLength(1);
128
+ expect(cell1?.exports[0]).toMatchObject({
129
+ name: 'x',
130
+ type: 'variable',
131
+ valueType: 'number',
132
+ });
133
+ expect(cell1?.imports).toHaveLength(0);
134
+
135
+ // Cell 2 imports x and exports y.
136
+ const cell2 = analysis.get('cell2');
137
+ expect(cell2?.exports).toHaveLength(1);
138
+ expect(cell2?.exports[0]).toMatchObject({
139
+ name: 'y',
140
+ type: 'variable',
141
+ });
142
+ expect(cell2?.imports).toContain('x');
143
+
144
+ // Cell 3 imports y.
145
+ const cell3 = analysis.get('cell3');
146
+ expect(cell3?.exports).toHaveLength(0);
147
+ expect(cell3?.imports).toContain('y');
148
+ });
149
+ });
@@ -0,0 +1,458 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { createSystem, createVirtualTypeScriptEnvironment } from '@typescript/vfs';
6
+ import ts from 'typescript';
7
+
8
+ import { invariant } from '@dxos/invariant';
9
+
10
+ import { builtIns, systemDefinitions } from './eval';
11
+
12
+ /**
13
+ * Default system definitions.
14
+ */
15
+ const systemFiles: VirtualFile[] = [
16
+ {
17
+ filename: '/lib.d.ts',
18
+ content: systemDefinitions,
19
+ },
20
+ ];
21
+
22
+ export type ParsedExpression = {
23
+ name?: string;
24
+ type?: 'function' | 'variable' | 'class' | 'interface';
25
+ value?: any;
26
+ valueType?: string;
27
+ parameters?: Array<{ name: string; type: string }>;
28
+ returnType?: string;
29
+ references?: string[];
30
+ };
31
+
32
+ export type VirtualFile = {
33
+ filename: string;
34
+ content: string;
35
+ };
36
+
37
+ /**
38
+ * TypeScript parser using Virtual File System for browser compatibility.
39
+ * This provides full TypeScript analysis including type information.
40
+ */
41
+ export class VirtualTypeScriptParser {
42
+ protected compilerOptions: ts.CompilerOptions = {
43
+ target: ts.ScriptTarget.ES2020,
44
+ module: ts.ModuleKind.ESNext,
45
+ moduleResolution: ts.ModuleResolutionKind.Bundler,
46
+ strict: true,
47
+ esModuleInterop: true,
48
+ skipLibCheck: true,
49
+ forceConsistentCasingInfilenames: true,
50
+ jsx: ts.JsxEmit.React,
51
+ noLib: true, // Don't automatically include default lib files.
52
+ };
53
+
54
+ /**
55
+ * Parse a single expression or statement.
56
+ */
57
+ parseExpression(input: string): ParsedExpression {
58
+ invariant(input.trim() !== '', 'input must not be empty');
59
+ const files: VirtualFile[] = [{ filename: '/temp.ts', content: input }];
60
+ const analysis = this.analyzeFiles(files);
61
+
62
+ // If no declarations found, check for standalone expression references.
63
+ if (analysis.length === 0) {
64
+ const sourcefilename = '/temp.ts';
65
+ const env = this.createEnvironment([{ filename: sourcefilename, content: input }]);
66
+ const sourceFile = env.getSourceFile(sourcefilename);
67
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
68
+
69
+ if (sourceFile && typeChecker) {
70
+ // Check for assignment expressions.
71
+ const assignmentInfo = this.findAssignmentExpression(sourceFile, typeChecker);
72
+ if (assignmentInfo) {
73
+ return assignmentInfo;
74
+ }
75
+
76
+ const references = this.findAllReferences(sourceFile, typeChecker);
77
+ return { references };
78
+ }
79
+ }
80
+
81
+ return analysis[0];
82
+ }
83
+
84
+ /**
85
+ * Analyze multiple files with full type information.
86
+ */
87
+ analyzeFiles(files: VirtualFile[]): ParsedExpression[] {
88
+ const env = this.createEnvironment(files);
89
+ const results: ParsedExpression[] = [];
90
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
91
+
92
+ // Analyze each file.
93
+ files.forEach((file) => {
94
+ const sourceFile = env.getSourceFile(file.filename);
95
+ if (!sourceFile || !typeChecker) {
96
+ return;
97
+ }
98
+
99
+ const fileResults = this.analyzeSourceFile(sourceFile, typeChecker);
100
+ results.push(...fileResults);
101
+ });
102
+
103
+ return results;
104
+ }
105
+
106
+ /**
107
+ * Analyze a source file with type information.
108
+ */
109
+ protected analyzeSourceFile(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression[] {
110
+ const results: ParsedExpression[] = [];
111
+
112
+ const visit = (node: ts.Node) => {
113
+ // Function declarations.
114
+ if (ts.isFunctionDeclaration(node) && node.name) {
115
+ const symbol = typeChecker.getSymbolAtLocation(node.name);
116
+ const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node);
117
+ const signature = type && typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call)[0];
118
+
119
+ results.push({
120
+ name: node.name.text,
121
+ type: 'function',
122
+ parameters: this.extractParameters(signature, typeChecker),
123
+ returnType: signature ? typeChecker.typeToString(signature.getReturnType()) : 'any',
124
+ references: this.findReferences(node, sourceFile, typeChecker),
125
+ });
126
+ }
127
+
128
+ // Variable declarations.
129
+ else if (ts.isVariableStatement(node)) {
130
+ node.declarationList.declarations.forEach((declaration) => {
131
+ if (ts.isIdentifier(declaration.name)) {
132
+ const symbol = typeChecker.getSymbolAtLocation(declaration.name);
133
+ const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
134
+
135
+ let kind: 'function' | 'variable' = 'variable';
136
+ let parameters: Array<{ name: string; type: string }> | undefined;
137
+ let returnType: string | undefined;
138
+ let value: any;
139
+
140
+ // Get the type string.
141
+ const typeString = type ? typeChecker.typeToString(type) : 'any';
142
+
143
+ // Check if it's a function.
144
+ if (declaration.initializer) {
145
+ if (ts.isArrowFunction(declaration.initializer) || ts.isFunctionExpression(declaration.initializer)) {
146
+ kind = 'function';
147
+ const funcType = typeChecker.getTypeAtLocation(declaration.initializer);
148
+ const signature = typeChecker.getSignaturesOfType(funcType, ts.SignatureKind.Call)[0];
149
+ if (signature) {
150
+ parameters = this.extractParameters(signature, typeChecker);
151
+ returnType = typeChecker.typeToString(signature.getReturnType());
152
+ }
153
+ } else {
154
+ // Extract literal values
155
+ if (ts.isNumericLiteral(declaration.initializer)) {
156
+ value = Number(declaration.initializer.text);
157
+ } else if (ts.isStringLiteral(declaration.initializer)) {
158
+ value = declaration.initializer.text;
159
+ }
160
+ }
161
+ }
162
+
163
+ // Find references in the initializer only.
164
+ const refs = declaration.initializer
165
+ ? this.findReferences(declaration.initializer, sourceFile, typeChecker)
166
+ : [];
167
+
168
+ results.push({
169
+ name: declaration.name.text,
170
+ type: kind,
171
+ valueType: typeString,
172
+ value,
173
+ parameters,
174
+ returnType,
175
+ references: refs,
176
+ });
177
+ }
178
+ });
179
+ }
180
+
181
+ // Class declarations.
182
+ else if (ts.isClassDeclaration(node) && node.name) {
183
+ results.push({
184
+ name: node.name.text,
185
+ type: 'class',
186
+ references: this.findReferences(node, sourceFile, typeChecker),
187
+ });
188
+ }
189
+
190
+ // Interface declarations.
191
+ else if (ts.isInterfaceDeclaration(node)) {
192
+ results.push({
193
+ name: node.name.text,
194
+ type: 'interface',
195
+ references: this.findReferences(node, sourceFile, typeChecker),
196
+ });
197
+ }
198
+
199
+ ts.forEachChild(node, visit);
200
+ };
201
+
202
+ visit(sourceFile);
203
+ return results;
204
+ }
205
+
206
+ /**
207
+ * Extract parameter information from a signature.
208
+ */
209
+ private extractParameters(
210
+ signature: ts.Signature | undefined,
211
+ typeChecker: ts.TypeChecker,
212
+ ): Array<{ name: string; type: string }> {
213
+ if (!signature) {
214
+ return [];
215
+ }
216
+
217
+ return signature.parameters.map((param) => ({
218
+ name: param.getName(),
219
+ type: typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(param, param.valueDeclaration!)),
220
+ }));
221
+ }
222
+
223
+ /**
224
+ * Find all references to variables used in a node.
225
+ */
226
+ private findReferences(node: ts.Node, _sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
227
+ const references = new Set<string>();
228
+ const localSymbols = new Set<string>();
229
+
230
+ // First, collect local symbols (parameters, local variables).
231
+ const collectLocalSymbols = (node: ts.Node) => {
232
+ if (ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
233
+ node.parameters.forEach((param) => {
234
+ if (ts.isIdentifier(param.name)) {
235
+ localSymbols.add(param.name.text);
236
+ }
237
+ });
238
+ }
239
+
240
+ if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {
241
+ localSymbols.add(node.name.text);
242
+ }
243
+
244
+ ts.forEachChild(node, collectLocalSymbols);
245
+ };
246
+
247
+ collectLocalSymbols(node);
248
+
249
+ // Then find all identifier references.
250
+ const findRefs = (node: ts.Node) => {
251
+ if (ts.isIdentifier(node)) {
252
+ // Skip if it's a local symbol.
253
+ if (!localSymbols.has(node.text)) {
254
+ // Check if it's a reference (not a declaration).
255
+ const parent = node.parent;
256
+ const isDeclaration =
257
+ (ts.isVariableDeclaration(parent) && parent.name === node) ||
258
+ (ts.isFunctionDeclaration(parent) && parent.name === node) ||
259
+ (ts.isParameter(parent) && parent.name === node);
260
+
261
+ if (!isDeclaration && !this.isBuiltIn(node.text)) {
262
+ references.add(node.text);
263
+ }
264
+ }
265
+ }
266
+ ts.forEachChild(node, findRefs);
267
+ };
268
+
269
+ findRefs(node);
270
+ return Array.from(references);
271
+ }
272
+
273
+ /**
274
+ * Check if a name is a built-in global.
275
+ */
276
+ protected isBuiltIn(name: string): boolean {
277
+ return builtIns.has(name);
278
+ }
279
+
280
+ /**
281
+ * Find assignment expressions in a source file.
282
+ */
283
+ private findAssignmentExpression(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression | null {
284
+ let result: ParsedExpression | null = null;
285
+
286
+ const visit = (node: ts.Node) => {
287
+ if (ts.isExpressionStatement(node) && ts.isBinaryExpression(node.expression)) {
288
+ const expr = node.expression;
289
+ if (expr.operatorToken.kind === ts.SyntaxKind.EqualsToken && ts.isIdentifier(expr.left)) {
290
+ const type = typeChecker.getTypeAtLocation(expr.right);
291
+ const typeString = typeChecker.typeToString(type);
292
+
293
+ // Get the literal value if it's a literal.
294
+ let value: any;
295
+ if (ts.isNumericLiteral(expr.right)) {
296
+ value = Number(expr.right.text);
297
+ } else if (ts.isStringLiteral(expr.right)) {
298
+ value = expr.right.text;
299
+ }
300
+
301
+ // Find references in the right-hand side.
302
+ const references = this.findReferences(expr.right, sourceFile, typeChecker);
303
+
304
+ result = {
305
+ name: expr.left.text,
306
+ type: 'variable',
307
+ valueType: typeString,
308
+ value,
309
+ references,
310
+ };
311
+ }
312
+ }
313
+ if (!result) {
314
+ ts.forEachChild(node, visit);
315
+ }
316
+ };
317
+
318
+ visit(sourceFile);
319
+ return result;
320
+ }
321
+
322
+ /**
323
+ * Find all identifier references in a source file.
324
+ */
325
+ protected findAllReferences(sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
326
+ const references = new Set<string>();
327
+
328
+ const visit = (node: ts.Node) => {
329
+ if (ts.isIdentifier(node)) {
330
+ // Skip if it's a declaration.
331
+ const parent = node.parent;
332
+ const isDeclaration =
333
+ (ts.isVariableDeclaration(parent) && parent.name === node) ||
334
+ (ts.isFunctionDeclaration(parent) && parent.name === node) ||
335
+ (ts.isParameter(parent) && parent.name === node);
336
+
337
+ // Skip if it's the left-hand side of an assignment.
338
+ const isAssignmentTarget =
339
+ ts.isBinaryExpression(parent) &&
340
+ parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
341
+ parent.left === node;
342
+
343
+ if (!isDeclaration && !isAssignmentTarget && !this.isBuiltIn(node.text)) {
344
+ references.add(node.text);
345
+ }
346
+ }
347
+ ts.forEachChild(node, visit);
348
+ };
349
+
350
+ visit(sourceFile);
351
+ return Array.from(references);
352
+ }
353
+
354
+ protected createEnvironment(files: VirtualFile[]) {
355
+ const allFiles = [...systemFiles, ...files];
356
+
357
+ const fileMap = new Map<string, string>();
358
+ allFiles.forEach(({ filename, content }) => {
359
+ fileMap.set(filename, content);
360
+ });
361
+
362
+ const system = createSystem(fileMap);
363
+ return createVirtualTypeScriptEnvironment(
364
+ system,
365
+ allFiles.map(({ filename }) => filename),
366
+ ts,
367
+ this.compilerOptions,
368
+ );
369
+ }
370
+ }
371
+
372
+ /**
373
+ * Notebook-specific parser with dependency analysis.
374
+ */
375
+ export class NotebookVirtualParser extends VirtualTypeScriptParser {
376
+ /**
377
+ * Analyze notebook cells with full type checking.
378
+ */
379
+ analyzeNotebook(cells: Array<{ id: string; code: string }>) {
380
+ // Create cumulative environment where each cell can see previous cells.
381
+ const cumulativeCode: string[] = [];
382
+ const cellAnalysis: Map<
383
+ string,
384
+ {
385
+ exports: ParsedExpression[];
386
+ imports: string[];
387
+ errors: ts.Diagnostic[];
388
+ }
389
+ > = new Map();
390
+
391
+ cells.forEach((cell) => {
392
+ // Create files for all cells up to current.
393
+ const files: VirtualFile[] = [];
394
+
395
+ // Add previous cells as context.
396
+ if (cumulativeCode.length > 0) {
397
+ files.push({
398
+ filename: '/context.ts',
399
+ content: cumulativeCode.join('\n'),
400
+ });
401
+ }
402
+
403
+ // Add current cell.
404
+ const filename = `/cell/${cell.id}.ts`;
405
+ files.push({
406
+ filename,
407
+ content: cell.code,
408
+ });
409
+
410
+ // Create environment.
411
+ const env = this.createEnvironment(files);
412
+
413
+ // Get diagnostics (errors).
414
+ const diagnostics = env.languageService.getSemanticDiagnostics(filename);
415
+
416
+ // Analyze current cell.
417
+ const sourceFile = env.getSourceFile(filename);
418
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
419
+
420
+ if (sourceFile && typeChecker) {
421
+ const exports = this.analyzeSourceFile(sourceFile, typeChecker);
422
+
423
+ // Find all references in the current cell.
424
+ const allRefs = new Set<string>();
425
+ exports.forEach((exp) => {
426
+ exp.references?.forEach((ref) => allRefs.add(ref));
427
+ });
428
+
429
+ // Also check for references not in exports (e.g., console.log(y)).
430
+ const additionalRefs = this.findAllReferences(sourceFile, typeChecker);
431
+ additionalRefs.forEach((ref) => allRefs.add(ref));
432
+
433
+ // Determine which references are imports from previous cells.
434
+ const previousExports = new Set<string>();
435
+ for (const [_prevCellId, prevAnalysis] of cellAnalysis) {
436
+ prevAnalysis.exports.forEach((exp) => {
437
+ if (exp.name) {
438
+ previousExports.add(exp.name);
439
+ }
440
+ });
441
+ }
442
+
443
+ const imports = Array.from(allRefs).filter((ref) => previousExports.has(ref));
444
+
445
+ cellAnalysis.set(cell.id, {
446
+ exports,
447
+ imports,
448
+ errors: diagnostics,
449
+ });
450
+ }
451
+
452
+ // Add current cell code to cumulative.
453
+ cumulativeCode.push(cell.code);
454
+ });
455
+
456
+ return cellAnalysis;
457
+ }
458
+ }
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Predicate from 'effect/Predicate';
7
+
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/compute';
10
+ import { IntegrationOperation } from '@dxos/plugin-integration';
11
+
12
+ import { defaultScriptsForIntegration } from '#meta';
13
+
14
+ import { DEPLOYMENT_DIALOG } from '../constants';
15
+ import { templates } from '../templates';
16
+
17
+ const handler: Operation.WithHandler<typeof IntegrationOperation.AccessTokenCreated> =
18
+ IntegrationOperation.AccessTokenCreated.pipe(
19
+ Operation.withHandler(
20
+ Effect.fnUntraced(function* ({ accessToken }) {
21
+ const scriptTemplates = (defaultScriptsForIntegration[accessToken.source] ?? [])
22
+ .map((id) => templates.find((t) => t.id === id))
23
+ .filter(Predicate.isNotNullable);
24
+
25
+ if (scriptTemplates.length > 0) {
26
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
27
+ subject: DEPLOYMENT_DIALOG,
28
+ blockAlign: 'start',
29
+ state: true,
30
+ props: { accessToken, scriptTemplates },
31
+ });
32
+ }
33
+ }),
34
+ ),
35
+ );
36
+
37
+ export default handler;
@@ -0,0 +1,46 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Octokit } from '@octokit/core';
6
+ import * as Effect from 'effect/Effect';
7
+
8
+ import { Script, Operation } from '@dxos/compute';
9
+
10
+ import { templates } from '../templates';
11
+ import { ScriptOperation } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof ScriptOperation.CreateScript> = ScriptOperation.CreateScript.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* ({ name, gistUrl, initialTemplateId }) {
16
+ let source = templates[0].source;
17
+ let scriptName = name;
18
+
19
+ const gistId = gistUrl?.split('/').at(-1);
20
+ if (gistId) {
21
+ const octokit = new Octokit();
22
+ const response = yield* Effect.promise(() =>
23
+ octokit.request('GET /gists/{gist_id}', {
24
+ gist_id: gistId,
25
+ }),
26
+ );
27
+ const gistContent = Object.values(response.data.files ?? {})[0]?.content;
28
+ if (gistContent) {
29
+ source = gistContent;
30
+ }
31
+ }
32
+
33
+ if (initialTemplateId) {
34
+ const template = templates.find((template) => template.id === initialTemplateId);
35
+ if (template) {
36
+ source = template.source;
37
+ scriptName = scriptName || template.name;
38
+ }
39
+ }
40
+
41
+ return { object: Script.make({ name: scriptName, source }) };
42
+ }),
43
+ ),
44
+ );
45
+
46
+ export default handler;
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const ScriptOperationHandlerSet = OperationHandlerSet.lazy(
8
+ () => import('./access-token-created'),
9
+ () => import('./create-script'),
10
+ );