@dxos/plugin-script 0.8.3 → 0.8.4-main.1c7ec43d41

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 (590) hide show
  1. package/README.md +15 -13
  2. package/dist/lib/browser/DeploymentDialog-6DBF3V6C.mjs +112 -0
  3. package/dist/lib/browser/DeploymentDialog-6DBF3V6C.mjs.map +7 -0
  4. package/dist/lib/browser/NotebookContainer-RO4NJRYH.mjs +760 -0
  5. package/dist/lib/browser/NotebookContainer-RO4NJRYH.mjs.map +7 -0
  6. package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs +79 -0
  7. package/dist/lib/browser/ScriptContainer-2OPBAXFB.mjs.map +7 -0
  8. package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs +304 -0
  9. package/dist/lib/browser/ScriptProperties-NRXG4PBX.mjs.map +7 -0
  10. package/dist/lib/browser/TestContainer-JNFPLAJX.mjs +44 -0
  11. package/dist/lib/browser/TestContainer-JNFPLAJX.mjs.map +7 -0
  12. package/dist/lib/browser/access-token-created-QX2T7AXK.mjs +37 -0
  13. package/dist/lib/browser/access-token-created-QX2T7AXK.mjs.map +7 -0
  14. package/dist/lib/browser/blueprints/index.mjs +58 -0
  15. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  17. package/dist/lib/browser/chunk-K6K54DEE.mjs +105 -0
  18. package/dist/lib/browser/chunk-K6K54DEE.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-KF6H7J5N.mjs +81 -0
  20. package/dist/lib/browser/chunk-KF6H7J5N.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-MI6X5CTJ.mjs +336 -0
  22. package/dist/lib/browser/chunk-MI6X5CTJ.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-NRKFVW2L.mjs +49 -0
  24. package/dist/lib/browser/chunk-NRKFVW2L.mjs.map +7 -0
  25. package/dist/lib/browser/containers/index.mjs +17 -0
  26. package/dist/lib/browser/containers/index.mjs.map +7 -0
  27. package/dist/lib/browser/create-K6FDPHFX.mjs +44 -0
  28. package/dist/lib/browser/create-K6FDPHFX.mjs.map +7 -0
  29. package/dist/lib/browser/create-script-TUYHIH4R.mjs +45 -0
  30. package/dist/lib/browser/create-script-TUYHIH4R.mjs.map +7 -0
  31. package/dist/lib/browser/delete-PAUWA2QM.mjs +21 -0
  32. package/dist/lib/browser/delete-PAUWA2QM.mjs.map +7 -0
  33. package/dist/lib/browser/deploy-CXVW54JJ.mjs +62 -0
  34. package/dist/lib/browser/deploy-CXVW54JJ.mjs.map +7 -0
  35. package/dist/lib/browser/index.mjs +179 -193
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs +59 -0
  38. package/dist/lib/browser/inspect-invocations-LEOEP5I2.mjs.map +7 -0
  39. package/dist/lib/browser/install-function-5N24Q45W.mjs +51 -0
  40. package/dist/lib/browser/install-function-5N24Q45W.mjs.map +7 -0
  41. package/dist/lib/browser/invoke-5QVEZ3X5.mjs +33 -0
  42. package/dist/lib/browser/invoke-5QVEZ3X5.mjs.map +7 -0
  43. package/dist/lib/browser/meta.json +1 -1
  44. package/dist/lib/browser/operations/index.mjs +14 -0
  45. package/dist/lib/browser/operations/index.mjs.map +7 -0
  46. package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs +30 -0
  47. package/dist/lib/browser/query-deployed-functions-FVD7NYPA.mjs.map +7 -0
  48. package/dist/lib/browser/read-FFOSK6A3.mjs +26 -0
  49. package/dist/lib/browser/read-FFOSK6A3.mjs.map +7 -0
  50. package/dist/lib/browser/templates/index.mjs +10 -0
  51. package/dist/lib/browser/translations.mjs +104 -0
  52. package/dist/lib/browser/translations.mjs.map +7 -0
  53. package/dist/lib/browser/types/index.mjs +14 -0
  54. package/dist/lib/browser/update-PJS5GG3Y.mjs +63 -0
  55. package/dist/lib/browser/update-PJS5GG3Y.mjs.map +7 -0
  56. package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs +113 -0
  57. package/dist/lib/node-esm/DeploymentDialog-A5BZHUJB.mjs.map +7 -0
  58. package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs +761 -0
  59. package/dist/lib/node-esm/NotebookContainer-DPT65MA7.mjs.map +7 -0
  60. package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs +80 -0
  61. package/dist/lib/node-esm/ScriptContainer-UKD7QORM.mjs.map +7 -0
  62. package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs +305 -0
  63. package/dist/lib/node-esm/ScriptProperties-FQXEOJKG.mjs.map +7 -0
  64. package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs +45 -0
  65. package/dist/lib/node-esm/TestContainer-Y4XVV7KQ.mjs.map +7 -0
  66. package/dist/lib/node-esm/access-token-created-JOL3XE2U.mjs +38 -0
  67. package/dist/lib/node-esm/access-token-created-JOL3XE2U.mjs.map +7 -0
  68. package/dist/lib/node-esm/blueprints/index.mjs +59 -0
  69. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-2DZNF5NG.mjs +82 -0
  71. package/dist/lib/node-esm/chunk-2DZNF5NG.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-47VGEN37.mjs +50 -0
  73. package/dist/lib/node-esm/chunk-47VGEN37.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  75. package/dist/lib/node-esm/chunk-QTUPYAZ7.mjs +107 -0
  76. package/dist/lib/node-esm/chunk-QTUPYAZ7.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-XFM2BEHY.mjs +338 -0
  78. package/dist/lib/node-esm/chunk-XFM2BEHY.mjs.map +7 -0
  79. package/dist/lib/node-esm/containers/index.mjs +18 -0
  80. package/dist/lib/node-esm/containers/index.mjs.map +7 -0
  81. package/dist/lib/node-esm/create-VWULFYRC.mjs +45 -0
  82. package/dist/lib/node-esm/create-VWULFYRC.mjs.map +7 -0
  83. package/dist/lib/node-esm/create-script-G7FAWI3E.mjs +46 -0
  84. package/dist/lib/node-esm/create-script-G7FAWI3E.mjs.map +7 -0
  85. package/dist/lib/node-esm/delete-YXLT7J27.mjs +22 -0
  86. package/dist/lib/node-esm/delete-YXLT7J27.mjs.map +7 -0
  87. package/dist/lib/node-esm/deploy-MXVZXAUC.mjs +63 -0
  88. package/dist/lib/node-esm/deploy-MXVZXAUC.mjs.map +7 -0
  89. package/dist/lib/node-esm/index.mjs +179 -193
  90. package/dist/lib/node-esm/index.mjs.map +4 -4
  91. package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs +60 -0
  92. package/dist/lib/node-esm/inspect-invocations-TVAKGYX5.mjs.map +7 -0
  93. package/dist/lib/node-esm/install-function-ST3VABJH.mjs +52 -0
  94. package/dist/lib/node-esm/install-function-ST3VABJH.mjs.map +7 -0
  95. package/dist/lib/node-esm/invoke-64WDU55Y.mjs +34 -0
  96. package/dist/lib/node-esm/invoke-64WDU55Y.mjs.map +7 -0
  97. package/dist/lib/node-esm/meta.json +1 -1
  98. package/dist/lib/node-esm/operations/index.mjs +15 -0
  99. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  100. package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs +31 -0
  101. package/dist/lib/node-esm/query-deployed-functions-2VCNGQ7X.mjs.map +7 -0
  102. package/dist/lib/node-esm/read-PECQUAPS.mjs +27 -0
  103. package/dist/lib/node-esm/read-PECQUAPS.mjs.map +7 -0
  104. package/dist/lib/node-esm/templates/index.mjs +11 -0
  105. package/dist/lib/node-esm/templates/index.mjs.map +7 -0
  106. package/dist/lib/node-esm/translations.mjs +105 -0
  107. package/dist/lib/node-esm/translations.mjs.map +7 -0
  108. package/dist/lib/node-esm/types/index.mjs +15 -0
  109. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  110. package/dist/lib/node-esm/update-XDFTGSPP.mjs +64 -0
  111. package/dist/lib/node-esm/update-XDFTGSPP.mjs.map +7 -0
  112. package/dist/types/src/ScriptPlugin.d.ts +3 -1
  113. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  114. package/dist/types/src/ScriptPlugin.node.d.ts +4 -0
  115. package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -0
  116. package/dist/types/src/ScriptPlugin.test.d.ts +2 -0
  117. package/dist/types/src/ScriptPlugin.test.d.ts.map +1 -0
  118. package/dist/types/src/blueprints/functions/create.d.ts +11 -0
  119. package/dist/types/src/blueprints/functions/create.d.ts.map +1 -0
  120. package/dist/types/src/blueprints/functions/definitions.d.ts +141 -0
  121. package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -0
  122. package/dist/types/src/blueprints/functions/delete.d.ts +18 -0
  123. package/dist/types/src/blueprints/functions/delete.d.ts.map +1 -0
  124. package/dist/types/src/blueprints/functions/deploy.d.ts +22 -0
  125. package/dist/types/src/blueprints/functions/deploy.d.ts.map +1 -0
  126. package/dist/types/src/blueprints/functions/index.d.ts +4 -0
  127. package/dist/types/src/blueprints/functions/index.d.ts.map +1 -0
  128. package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +29 -0
  129. package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +1 -0
  130. package/dist/types/src/blueprints/functions/install-function.d.ts +11 -0
  131. package/dist/types/src/blueprints/functions/install-function.d.ts.map +1 -0
  132. package/dist/types/src/blueprints/functions/invoke.d.ts +22 -0
  133. package/dist/types/src/blueprints/functions/invoke.d.ts.map +1 -0
  134. package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts +13 -0
  135. package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +1 -0
  136. package/dist/types/src/blueprints/functions/read.d.ts +22 -0
  137. package/dist/types/src/blueprints/functions/read.d.ts.map +1 -0
  138. package/dist/types/src/blueprints/functions/update.d.ts +27 -0
  139. package/dist/types/src/blueprints/functions/update.d.ts.map +1 -0
  140. package/dist/types/src/blueprints/index.d.ts +2 -0
  141. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  142. package/dist/types/src/blueprints/script-blueprint.d.ts +4 -0
  143. package/dist/types/src/blueprints/script-blueprint.d.ts.map +1 -0
  144. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  145. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  146. package/dist/types/src/capabilities/artifact-definition.d.ts +3 -2
  147. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  148. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  149. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  150. package/dist/types/src/capabilities/compiler.d.ts +3 -1
  151. package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
  152. package/dist/types/src/capabilities/create-object.d.ts +16 -0
  153. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  154. package/dist/types/src/capabilities/index.d.ts +19 -7
  155. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  156. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  157. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  158. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  159. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  160. package/dist/types/src/capabilities/settings.d.ts +5 -2
  161. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  162. package/dist/types/src/compiler/compiler.d.ts +1 -1
  163. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  164. package/dist/types/src/components/FramePanel/FramePanel.d.ts +12 -0
  165. package/dist/types/src/components/FramePanel/FramePanel.d.ts.map +1 -0
  166. package/dist/types/src/components/FramePanel/index.d.ts +2 -0
  167. package/dist/types/src/components/FramePanel/index.d.ts.map +1 -0
  168. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
  169. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
  170. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
  171. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
  172. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +16 -0
  173. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
  174. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +240 -0
  175. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
  176. package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
  177. package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
  178. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +5 -0
  179. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -0
  180. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +13 -0
  181. package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -0
  182. package/dist/types/src/components/QueryEditor/index.d.ts +2 -0
  183. package/dist/types/src/components/QueryEditor/index.d.ts.map +1 -0
  184. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +8 -0
  185. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +1 -0
  186. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts +241 -0
  187. package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +1 -0
  188. package/dist/types/src/components/ScriptPluginSettings/index.d.ts +2 -0
  189. package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +1 -0
  190. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +10 -9
  191. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  192. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +237 -10
  193. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  194. package/dist/types/src/components/TestPanel/TestPanel.d.ts +4 -2
  195. package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
  196. package/dist/types/src/components/TestPanel/index.d.ts +0 -1
  197. package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
  198. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +8 -2
  199. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  200. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +13 -4
  201. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  202. package/dist/types/src/components/index.d.ts +7 -7
  203. package/dist/types/src/components/index.d.ts.map +1 -1
  204. package/dist/types/src/constants.d.ts +2 -0
  205. package/dist/types/src/constants.d.ts.map +1 -0
  206. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts +9 -0
  207. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -0
  208. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +240 -0
  209. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -0
  210. package/dist/types/src/containers/DeploymentDialog/index.d.ts +2 -0
  211. package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -0
  212. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts +7 -0
  213. package/dist/types/src/containers/NotebookContainer/NotebookContainer.d.ts.map +1 -0
  214. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts +7 -0
  215. package/dist/types/src/containers/NotebookContainer/NotebookContainer.stories.d.ts.map +1 -0
  216. package/dist/types/src/containers/NotebookContainer/index.d.ts +2 -0
  217. package/dist/types/src/containers/NotebookContainer/index.d.ts.map +1 -0
  218. package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts +10 -0
  219. package/dist/types/src/containers/ScriptContainer/ScriptContainer.d.ts.map +1 -0
  220. package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts +242 -0
  221. package/dist/types/src/containers/ScriptContainer/ScriptContainer.stories.d.ts.map +1 -0
  222. package/dist/types/src/containers/ScriptContainer/index.d.ts +2 -0
  223. package/dist/types/src/containers/ScriptContainer/index.d.ts.map +1 -0
  224. package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +7 -0
  225. package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +1 -0
  226. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +7 -0
  227. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -0
  228. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +7 -0
  229. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -0
  230. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +6 -0
  231. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -0
  232. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +242 -0
  233. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -0
  234. package/dist/types/src/containers/ScriptProperties/index.d.ts +2 -0
  235. package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -0
  236. package/dist/types/src/containers/TestContainer/TestContainer.d.ts +8 -0
  237. package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -0
  238. package/dist/types/src/containers/TestContainer/index.d.ts +2 -0
  239. package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -0
  240. package/dist/types/src/containers/index.d.ts +7 -0
  241. package/dist/types/src/containers/index.d.ts.map +1 -0
  242. package/dist/types/src/e2e/ai.test.d.ts +2 -0
  243. package/dist/types/src/e2e/ai.test.d.ts.map +1 -0
  244. package/dist/types/src/e2e/deploy.test.d.ts +2 -0
  245. package/dist/types/src/e2e/deploy.test.d.ts.map +1 -0
  246. package/dist/types/src/hooks/deploy.d.ts +31 -32
  247. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  248. package/dist/types/src/hooks/format.d.ts +5 -4
  249. package/dist/types/src/hooks/format.d.ts.map +1 -1
  250. package/dist/types/src/hooks/index.d.ts +1 -0
  251. package/dist/types/src/hooks/index.d.ts.map +1 -1
  252. package/dist/types/src/hooks/template.d.ts +7 -16
  253. package/dist/types/src/hooks/template.d.ts.map +1 -1
  254. package/dist/types/src/hooks/useCompiler.d.ts +7 -0
  255. package/dist/types/src/hooks/useCompiler.d.ts.map +1 -0
  256. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  257. package/dist/types/src/hooks/useToolbarState.d.ts +8 -1
  258. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
  259. package/dist/types/src/index.d.ts +4 -3
  260. package/dist/types/src/index.d.ts.map +1 -1
  261. package/dist/types/src/meta.d.ts +2 -3
  262. package/dist/types/src/meta.d.ts.map +1 -1
  263. package/dist/types/src/notebook/compute-graph.d.ts +58 -0
  264. package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
  265. package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
  266. package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
  267. package/dist/types/src/notebook/eval.d.ts +13 -0
  268. package/dist/types/src/notebook/eval.d.ts.map +1 -0
  269. package/dist/types/src/notebook/index.d.ts +2 -0
  270. package/dist/types/src/notebook/index.d.ts.map +1 -0
  271. package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
  272. package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
  273. package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
  274. package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
  275. package/dist/types/src/operations/access-token-created.d.ts +5 -0
  276. package/dist/types/src/operations/access-token-created.d.ts.map +1 -0
  277. package/dist/types/src/operations/create-script.d.ts +5 -0
  278. package/dist/types/src/operations/create-script.d.ts.map +1 -0
  279. package/dist/types/src/operations/definitions.d.ts +29 -0
  280. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  281. package/dist/types/src/operations/index.d.ts +4 -0
  282. package/dist/types/src/operations/index.d.ts.map +1 -0
  283. package/dist/types/src/templates/anthropic.d.ts +7 -0
  284. package/dist/types/src/templates/anthropic.d.ts.map +1 -0
  285. package/dist/types/src/templates/chat.d.ts.map +1 -1
  286. package/dist/types/src/templates/chess-bot.d.ts +12 -0
  287. package/dist/types/src/templates/chess-bot.d.ts.map +1 -0
  288. package/dist/types/src/templates/commentary.d.ts +13 -0
  289. package/dist/types/src/templates/commentary.d.ts.map +1 -0
  290. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  291. package/dist/types/src/templates/discord.d.ts.map +1 -1
  292. package/dist/types/src/templates/email.d.ts.map +1 -1
  293. package/dist/types/src/templates/forex-effect.d.ts +5 -1
  294. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  295. package/dist/types/src/templates/forex.d.ts +5 -1
  296. package/dist/types/src/templates/forex.d.ts.map +1 -1
  297. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  298. package/dist/types/src/templates/index.d.ts +54 -1
  299. package/dist/types/src/templates/index.d.ts.map +1 -1
  300. package/dist/types/src/templates/ping.d.ts +4 -0
  301. package/dist/types/src/templates/ping.d.ts.map +1 -0
  302. package/dist/types/src/testing/index.d.ts +3 -0
  303. package/dist/types/src/testing/index.d.ts.map +1 -0
  304. package/dist/types/src/testing/simulator.test.d.ts +2 -0
  305. package/dist/types/src/testing/simulator.test.d.ts.map +1 -0
  306. package/dist/types/src/testing/test-notebook.d.ts +3 -0
  307. package/dist/types/src/testing/test-notebook.d.ts.map +1 -0
  308. package/dist/types/src/testing/test-script.d.ts +7 -0
  309. package/dist/types/src/testing/test-script.d.ts.map +1 -0
  310. package/dist/types/src/translations.d.ts +224 -176
  311. package/dist/types/src/translations.d.ts.map +1 -1
  312. package/dist/types/src/types/Notebook.d.ts +120 -0
  313. package/dist/types/src/types/Notebook.d.ts.map +1 -0
  314. package/dist/types/src/types/Settings.d.ts +7 -0
  315. package/dist/types/src/types/Settings.d.ts.map +1 -0
  316. package/dist/types/src/types/capabilities.d.ts +9 -0
  317. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  318. package/dist/types/src/types/events.d.ts +5 -0
  319. package/dist/types/src/types/events.d.ts.map +1 -0
  320. package/dist/types/src/types/index.d.ts +5 -0
  321. package/dist/types/src/types/index.d.ts.map +1 -0
  322. package/dist/types/src/types/types.d.ts +2 -0
  323. package/dist/types/src/types/types.d.ts.map +1 -0
  324. package/dist/types/src/util/deploy.d.ts +7 -7
  325. package/dist/types/src/util/deploy.d.ts.map +1 -1
  326. package/dist/types/src/util/functions.d.ts +6 -3
  327. package/dist/types/src/util/functions.d.ts.map +1 -1
  328. package/dist/types/tsconfig.tsbuildinfo +1 -1
  329. package/package.json +158 -91
  330. package/src/ScriptPlugin.node.ts +21 -0
  331. package/src/ScriptPlugin.test.ts +31 -0
  332. package/src/ScriptPlugin.tsx +30 -81
  333. package/src/blueprints/functions/create.ts +47 -0
  334. package/src/blueprints/functions/definitions.ts +323 -0
  335. package/src/blueprints/functions/delete.ts +23 -0
  336. package/src/blueprints/functions/deploy.ts +70 -0
  337. package/src/blueprints/functions/index.ts +19 -0
  338. package/src/blueprints/functions/inspect-invocations.ts +56 -0
  339. package/src/blueprints/functions/install-function.ts +56 -0
  340. package/src/blueprints/functions/invoke.ts +35 -0
  341. package/src/blueprints/functions/query-deployed-functions.ts +31 -0
  342. package/src/blueprints/functions/read.ts +29 -0
  343. package/src/blueprints/functions/update.ts +68 -0
  344. package/src/blueprints/index.ts +5 -0
  345. package/src/blueprints/script-blueprint.ts +55 -0
  346. package/src/capabilities/app-graph-builder.ts +40 -57
  347. package/src/capabilities/artifact-definition.ts +105 -107
  348. package/src/capabilities/blueprint-definition.ts +19 -0
  349. package/src/capabilities/compiler.ts +100 -22
  350. package/src/capabilities/create-object.ts +48 -0
  351. package/src/capabilities/index.ts +13 -9
  352. package/src/capabilities/operation-handler.ts +21 -0
  353. package/src/capabilities/react-surface.tsx +121 -80
  354. package/src/capabilities/settings.ts +26 -14
  355. package/src/compiler/compiler.ts +18 -4
  356. package/src/components/{FrameContainer/FrameContainer.tsx → FramePanel/FramePanel.tsx} +10 -8
  357. package/src/components/{FrameContainer → FramePanel}/index.ts +1 -1
  358. package/src/components/NotebookStack/NotebookCell.tsx +226 -0
  359. package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
  360. package/src/components/NotebookStack/NotebookStack.stories.tsx +53 -0
  361. package/src/components/NotebookStack/NotebookStack.tsx +97 -0
  362. package/src/components/NotebookStack/index.ts +6 -0
  363. package/src/components/QueryEditor/QueryEditor.stories.tsx +96 -0
  364. package/src/components/QueryEditor/QueryEditor.tsx +47 -0
  365. package/src/components/QueryEditor/index.ts +5 -0
  366. package/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx +32 -0
  367. package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +42 -0
  368. package/src/components/ScriptPluginSettings/index.ts +5 -0
  369. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +56 -17
  370. package/src/components/ScriptToolbar/ScriptToolbar.tsx +43 -41
  371. package/src/components/TestPanel/TestPanel.tsx +124 -185
  372. package/src/components/TestPanel/index.ts +0 -1
  373. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +89 -34
  374. package/src/components/TypescriptEditor/TypescriptEditor.tsx +88 -78
  375. package/src/components/index.ts +7 -5
  376. package/src/constants.ts +7 -0
  377. package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +63 -0
  378. package/src/containers/DeploymentDialog/DeploymentDialog.tsx +99 -0
  379. package/src/containers/DeploymentDialog/index.ts +5 -0
  380. package/src/containers/NotebookContainer/NotebookContainer.stories.tsx +85 -0
  381. package/src/containers/NotebookContainer/NotebookContainer.tsx +254 -0
  382. package/src/containers/NotebookContainer/index.ts +5 -0
  383. package/src/containers/ScriptContainer/ScriptContainer.stories.tsx +106 -0
  384. package/src/containers/ScriptContainer/ScriptContainer.tsx +85 -0
  385. package/src/containers/ScriptContainer/index.ts +5 -0
  386. package/src/containers/ScriptProperties/BlueprintEditor.tsx +101 -0
  387. package/src/containers/ScriptProperties/FunctionBinding.tsx +83 -0
  388. package/src/containers/ScriptProperties/FunctionPublishing.tsx +121 -0
  389. package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +75 -0
  390. package/src/containers/ScriptProperties/ScriptProperties.tsx +24 -0
  391. package/src/containers/ScriptProperties/index.ts +5 -0
  392. package/src/containers/TestContainer/TestContainer.tsx +44 -0
  393. package/src/containers/TestContainer/index.ts +5 -0
  394. package/src/containers/index.ts +11 -0
  395. package/src/e2e/ai.test.ts +93 -0
  396. package/src/e2e/deploy.test.ts +66 -0
  397. package/src/hooks/deploy.ts +54 -45
  398. package/src/hooks/format.ts +10 -5
  399. package/src/hooks/index.ts +1 -0
  400. package/src/hooks/template.ts +24 -26
  401. package/src/hooks/useCompiler.ts +25 -0
  402. package/src/hooks/useCreateAndDeployScriptTemplates.ts +16 -16
  403. package/src/hooks/useToolbarState.ts +29 -4
  404. package/src/index.ts +8 -4
  405. package/src/meta.ts +10 -8
  406. package/src/notebook/compute-graph.test.ts +82 -0
  407. package/src/notebook/compute-graph.ts +230 -0
  408. package/src/notebook/eval.ts +105 -0
  409. package/src/notebook/index.ts +5 -0
  410. package/src/notebook/vfs-parser.test.ts +149 -0
  411. package/src/notebook/vfs-parser.ts +458 -0
  412. package/src/operations/access-token-created.ts +37 -0
  413. package/src/operations/create-script.ts +46 -0
  414. package/src/operations/definitions.ts +40 -0
  415. package/src/operations/index.ts +12 -0
  416. package/src/templates/anthropic.ts +49 -0
  417. package/src/templates/chat.ts +1 -1
  418. package/src/templates/chess-bot.ts +63 -0
  419. package/src/templates/commentary.ts +249 -0
  420. package/src/templates/data-generator.ts +11 -5
  421. package/src/templates/discord.ts +14 -6
  422. package/src/templates/email.ts +2 -2
  423. package/src/templates/forex-effect.ts +35 -25
  424. package/src/templates/forex.ts +27 -15
  425. package/src/templates/gmail.ts +38 -68
  426. package/src/templates/index.ts +38 -23
  427. package/src/templates/ping.ts +25 -0
  428. package/src/testing/index.ts +6 -0
  429. package/src/testing/simulator.test.ts +39 -0
  430. package/src/testing/test-notebook.ts +71 -0
  431. package/src/testing/test-script.ts +29 -0
  432. package/src/translations.ts +96 -67
  433. package/src/types/Notebook.ts +45 -0
  434. package/src/types/Settings.ts +20 -0
  435. package/src/types/capabilities.ts +17 -0
  436. package/src/types/events.ts +11 -0
  437. package/src/types/index.ts +8 -0
  438. package/src/types/types.ts +5 -0
  439. package/src/util/deploy.ts +40 -61
  440. package/src/util/functions.ts +59 -25
  441. package/src/vite-env.d.ts +2 -0
  442. package/dist/lib/browser/DeploymentDialog-RPPPWEEL.mjs +0 -12
  443. package/dist/lib/browser/ScriptContainer-RSN52NH7.mjs +0 -261
  444. package/dist/lib/browser/ScriptContainer-RSN52NH7.mjs.map +0 -7
  445. package/dist/lib/browser/app-graph-builder-5Z3MUX4N.mjs +0 -64
  446. package/dist/lib/browser/app-graph-builder-5Z3MUX4N.mjs.map +0 -7
  447. package/dist/lib/browser/artifact-definition-A4TBQL75.mjs +0 -249
  448. package/dist/lib/browser/artifact-definition-A4TBQL75.mjs.map +0 -7
  449. package/dist/lib/browser/chunk-3FU4QZVP.mjs +0 -364
  450. package/dist/lib/browser/chunk-3FU4QZVP.mjs.map +0 -7
  451. package/dist/lib/browser/chunk-3JLR2SHJ.mjs +0 -557
  452. package/dist/lib/browser/chunk-3JLR2SHJ.mjs.map +0 -7
  453. package/dist/lib/browser/chunk-6ZHHWU6S.mjs +0 -28
  454. package/dist/lib/browser/chunk-6ZHHWU6S.mjs.map +0 -7
  455. package/dist/lib/browser/chunk-LA66DQGU.mjs +0 -153
  456. package/dist/lib/browser/chunk-LA66DQGU.mjs.map +0 -7
  457. package/dist/lib/browser/chunk-QJH7I2UV.mjs +0 -233
  458. package/dist/lib/browser/chunk-QJH7I2UV.mjs.map +0 -7
  459. package/dist/lib/browser/chunk-WB3X5Z7Q.mjs +0 -40
  460. package/dist/lib/browser/chunk-WB3X5Z7Q.mjs.map +0 -7
  461. package/dist/lib/browser/chunk-YSQMXTYO.mjs +0 -15
  462. package/dist/lib/browser/chunk-YSQMXTYO.mjs.map +0 -7
  463. package/dist/lib/browser/compiler-W4BYJYTL.mjs +0 -82
  464. package/dist/lib/browser/compiler-W4BYJYTL.mjs.map +0 -7
  465. package/dist/lib/browser/intent-resolver-JOJNH4UX.mjs +0 -90
  466. package/dist/lib/browser/intent-resolver-JOJNH4UX.mjs.map +0 -7
  467. package/dist/lib/browser/react-surface-7BKUWL2U.mjs +0 -105
  468. package/dist/lib/browser/react-surface-7BKUWL2U.mjs.map +0 -7
  469. package/dist/lib/browser/settings-Z22D6JVJ.mjs +0 -24
  470. package/dist/lib/browser/settings-Z22D6JVJ.mjs.map +0 -7
  471. package/dist/lib/browser/types.mjs +0 -13
  472. package/dist/lib/node/DeploymentDialog-C3EEYGRH.cjs +0 -33
  473. package/dist/lib/node/DeploymentDialog-C3EEYGRH.cjs.map +0 -7
  474. package/dist/lib/node/ScriptContainer-CAC7AISY.cjs +0 -278
  475. package/dist/lib/node/ScriptContainer-CAC7AISY.cjs.map +0 -7
  476. package/dist/lib/node/app-graph-builder-25OOTBW4.cjs +0 -80
  477. package/dist/lib/node/app-graph-builder-25OOTBW4.cjs.map +0 -7
  478. package/dist/lib/node/artifact-definition-QKZI6PTO.cjs +0 -265
  479. package/dist/lib/node/artifact-definition-QKZI6PTO.cjs.map +0 -7
  480. package/dist/lib/node/chunk-AU2FOE26.cjs +0 -369
  481. package/dist/lib/node/chunk-AU2FOE26.cjs.map +0 -7
  482. package/dist/lib/node/chunk-BUOBOT3V.cjs +0 -179
  483. package/dist/lib/node/chunk-BUOBOT3V.cjs.map +0 -7
  484. package/dist/lib/node/chunk-HCRW6T3G.cjs +0 -60
  485. package/dist/lib/node/chunk-HCRW6T3G.cjs.map +0 -7
  486. package/dist/lib/node/chunk-OSBMUJ4T.cjs +0 -580
  487. package/dist/lib/node/chunk-OSBMUJ4T.cjs.map +0 -7
  488. package/dist/lib/node/chunk-QG2X6J74.cjs +0 -52
  489. package/dist/lib/node/chunk-QG2X6J74.cjs.map +0 -7
  490. package/dist/lib/node/chunk-YO5W2IPQ.cjs +0 -251
  491. package/dist/lib/node/chunk-YO5W2IPQ.cjs.map +0 -7
  492. package/dist/lib/node/chunk-ZEV3VARQ.cjs +0 -34
  493. package/dist/lib/node/chunk-ZEV3VARQ.cjs.map +0 -7
  494. package/dist/lib/node/compiler-TFSJRLL4.cjs +0 -104
  495. package/dist/lib/node/compiler-TFSJRLL4.cjs.map +0 -7
  496. package/dist/lib/node/index.cjs +0 -225
  497. package/dist/lib/node/index.cjs.map +0 -7
  498. package/dist/lib/node/intent-resolver-BQ2NKEM7.cjs +0 -100
  499. package/dist/lib/node/intent-resolver-BQ2NKEM7.cjs.map +0 -7
  500. package/dist/lib/node/meta.json +0 -1
  501. package/dist/lib/node/react-surface-EUKPDFU3.cjs +0 -120
  502. package/dist/lib/node/react-surface-EUKPDFU3.cjs.map +0 -7
  503. package/dist/lib/node/settings-WO53FLYZ.cjs +0 -38
  504. package/dist/lib/node/settings-WO53FLYZ.cjs.map +0 -7
  505. package/dist/lib/node/types.cjs +0 -34
  506. package/dist/lib/node/types.cjs.map +0 -7
  507. package/dist/lib/node-esm/DeploymentDialog-IA4CH6WZ.mjs +0 -13
  508. package/dist/lib/node-esm/ScriptContainer-4IOOIPBF.mjs +0 -262
  509. package/dist/lib/node-esm/ScriptContainer-4IOOIPBF.mjs.map +0 -7
  510. package/dist/lib/node-esm/app-graph-builder-IOOUTHV2.mjs +0 -65
  511. package/dist/lib/node-esm/app-graph-builder-IOOUTHV2.mjs.map +0 -7
  512. package/dist/lib/node-esm/artifact-definition-4XRYAP54.mjs +0 -250
  513. package/dist/lib/node-esm/artifact-definition-4XRYAP54.mjs.map +0 -7
  514. package/dist/lib/node-esm/chunk-2KJYPUQD.mjs +0 -16
  515. package/dist/lib/node-esm/chunk-2KJYPUQD.mjs.map +0 -7
  516. package/dist/lib/node-esm/chunk-AEB5TPEW.mjs +0 -30
  517. package/dist/lib/node-esm/chunk-AEB5TPEW.mjs.map +0 -7
  518. package/dist/lib/node-esm/chunk-B4TP3LSZ.mjs +0 -558
  519. package/dist/lib/node-esm/chunk-B4TP3LSZ.mjs.map +0 -7
  520. package/dist/lib/node-esm/chunk-MJJQBUOL.mjs +0 -234
  521. package/dist/lib/node-esm/chunk-MJJQBUOL.mjs.map +0 -7
  522. package/dist/lib/node-esm/chunk-T7XDCUTF.mjs +0 -154
  523. package/dist/lib/node-esm/chunk-T7XDCUTF.mjs.map +0 -7
  524. package/dist/lib/node-esm/chunk-UESZKXLR.mjs +0 -41
  525. package/dist/lib/node-esm/chunk-UESZKXLR.mjs.map +0 -7
  526. package/dist/lib/node-esm/chunk-W2DAXWHA.mjs +0 -365
  527. package/dist/lib/node-esm/chunk-W2DAXWHA.mjs.map +0 -7
  528. package/dist/lib/node-esm/compiler-7PQ4D43R.mjs +0 -83
  529. package/dist/lib/node-esm/compiler-7PQ4D43R.mjs.map +0 -7
  530. package/dist/lib/node-esm/intent-resolver-HTM5PSRZ.mjs +0 -91
  531. package/dist/lib/node-esm/intent-resolver-HTM5PSRZ.mjs.map +0 -7
  532. package/dist/lib/node-esm/react-surface-6UO64YOS.mjs +0 -106
  533. package/dist/lib/node-esm/react-surface-6UO64YOS.mjs.map +0 -7
  534. package/dist/lib/node-esm/settings-KZEGCDYX.mjs +0 -25
  535. package/dist/lib/node-esm/settings-KZEGCDYX.mjs.map +0 -7
  536. package/dist/lib/node-esm/types.mjs +0 -14
  537. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  538. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  539. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  540. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  541. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +0 -11
  542. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +0 -1
  543. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +0 -18
  544. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +0 -1
  545. package/dist/types/src/components/DeploymentDialog/index.d.ts +0 -4
  546. package/dist/types/src/components/DeploymentDialog/index.d.ts.map +0 -1
  547. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +0 -12
  548. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +0 -1
  549. package/dist/types/src/components/FrameContainer/frame.d.ts +0 -2
  550. package/dist/types/src/components/FrameContainer/frame.d.ts.map +0 -1
  551. package/dist/types/src/components/FrameContainer/index.d.ts +0 -2
  552. package/dist/types/src/components/FrameContainer/index.d.ts.map +0 -1
  553. package/dist/types/src/components/ScriptContainer.d.ts +0 -12
  554. package/dist/types/src/components/ScriptContainer.d.ts.map +0 -1
  555. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +0 -8
  556. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +0 -1
  557. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +0 -6
  558. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +0 -1
  559. package/dist/types/src/components/Settings/index.d.ts +0 -3
  560. package/dist/types/src/components/Settings/index.d.ts.map +0 -1
  561. package/dist/types/src/components/TestPanel/TestContainer.d.ts +0 -7
  562. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +0 -1
  563. package/dist/types/src/events.d.ts +0 -4
  564. package/dist/types/src/events.d.ts.map +0 -1
  565. package/dist/types/src/templates/chess.d.ts +0 -3
  566. package/dist/types/src/templates/chess.d.ts.map +0 -1
  567. package/dist/types/src/templates/echo.d.ts +0 -6
  568. package/dist/types/src/templates/echo.d.ts.map +0 -1
  569. package/dist/types/src/types.d.ts +0 -40
  570. package/dist/types/src/types.d.ts.map +0 -1
  571. package/src/capabilities/capabilities.ts +0 -12
  572. package/src/capabilities/intent-resolver.ts +0 -80
  573. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +0 -39
  574. package/src/components/DeploymentDialog/DeploymentDialog.tsx +0 -112
  575. package/src/components/DeploymentDialog/index.ts +0 -9
  576. package/src/components/FrameContainer/frame.html +0 -25
  577. package/src/components/FrameContainer/frame.tsx +0 -51
  578. package/src/components/ScriptContainer.tsx +0 -67
  579. package/src/components/Settings/ScriptObjectSettings.tsx +0 -206
  580. package/src/components/Settings/ScriptPluginSettings.tsx +0 -71
  581. package/src/components/Settings/index.ts +0 -6
  582. package/src/components/TestPanel/TestContainer.tsx +0 -21
  583. package/src/events.ts +0 -11
  584. package/src/templates/chess.ts +0 -47
  585. package/src/templates/echo.ts +0 -8
  586. package/src/types.ts +0 -42
  587. /package/dist/lib/browser/{DeploymentDialog-RPPPWEEL.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  588. /package/dist/lib/browser/{types.mjs.map → templates/index.mjs.map} +0 -0
  589. /package/dist/lib/{node-esm/DeploymentDialog-IA4CH6WZ.mjs.map → browser/types/index.mjs.map} +0 -0
  590. /package/dist/lib/node-esm/{types.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -0,0 +1,68 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { next as A, type Doc } from '@automerge/automerge';
6
+ import * as Effect from 'effect/Effect';
7
+
8
+ import { type Script, Operation } from '@dxos/compute';
9
+ import { Database, Obj } from '@dxos/echo';
10
+ import { DocAccessor, createDocAccessor } from '@dxos/echo-db';
11
+
12
+ import { Update } from './definitions';
13
+
14
+ export default Update.pipe(
15
+ Operation.withHandler(
16
+ Effect.fn(function* ({ function: fn, name, description, edits }) {
17
+ const loaded = yield* Database.load(fn);
18
+ if (!loaded.source) {
19
+ return yield* Effect.fail(new Error('Function has no source script.'));
20
+ }
21
+ const script = (yield* Database.load(loaded.source)) as Script.Script;
22
+
23
+ if (name !== undefined || description !== undefined) {
24
+ Obj.update(script, (script) => {
25
+ if (name !== undefined) {
26
+ script.name = name;
27
+ }
28
+ if (description !== undefined) {
29
+ script.description = description;
30
+ }
31
+ });
32
+ }
33
+
34
+ if (edits && edits.length > 0) {
35
+ const text = yield* Database.load(script.source);
36
+ const accessor = createDocAccessor(text, ['content']);
37
+
38
+ for (const edit of edits) {
39
+ accessor.handle.change((doc: Doc<typeof text>) => {
40
+ const source = DocAccessor.getValue<string>(accessor);
41
+ if (edit.replaceAll) {
42
+ let idx = source.indexOf(edit.oldString);
43
+ while (idx !== -1) {
44
+ A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
45
+ const updated = DocAccessor.getValue<string>(accessor);
46
+ idx = updated.indexOf(edit.oldString, idx + edit.newString.length);
47
+ }
48
+ } else {
49
+ const idx = source.indexOf(edit.oldString);
50
+ if (idx === -1) {
51
+ throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);
52
+ }
53
+ A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);
54
+ }
55
+ });
56
+ }
57
+
58
+ Obj.update(script, (script) => {
59
+ script.changed = true;
60
+ });
61
+ }
62
+
63
+ return {
64
+ function: Obj.getDXN(loaded).toString(),
65
+ };
66
+ }),
67
+ ),
68
+ );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as ScriptBlueprint } from './script-blueprint';
@@ -0,0 +1,55 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Blueprint, Template } from '@dxos/compute';
6
+ import { trim } from '@dxos/util';
7
+
8
+ import {
9
+ Create,
10
+ Read,
11
+ Update,
12
+ Delete,
13
+ Deploy,
14
+ Invoke,
15
+ InspectInvocations,
16
+ QueryDeployedFunctions,
17
+ InstallFunction,
18
+ } from './functions';
19
+
20
+ const BLUEPRINT_KEY = 'org.dxos.blueprint.script';
21
+
22
+ const make = () =>
23
+ Blueprint.make({
24
+ key: BLUEPRINT_KEY,
25
+ name: 'Script',
26
+ agentCanEnable: true,
27
+ tools: Blueprint.toolDefinitions({
28
+ operations: [
29
+ Create,
30
+ Read,
31
+ Update,
32
+ Delete,
33
+ Deploy,
34
+ Invoke,
35
+ InspectInvocations,
36
+ QueryDeployedFunctions,
37
+ InstallFunction,
38
+ ],
39
+ }),
40
+ instructions: Template.make({
41
+ source: trim`
42
+ You can create, read, update, and delete scripts which contain TypeScript code.
43
+ You can deploy scripts to the Edge runtime and invoke deployed scripts.
44
+ You can inspect the invocation history of a deployed script.
45
+ You can query all functions deployed to the EDGE runtime and install them into the current space.
46
+ `,
47
+ }),
48
+ });
49
+
50
+ const blueprint: Blueprint.Definition = {
51
+ key: BLUEPRINT_KEY,
52
+ make,
53
+ };
54
+
55
+ export default blueprint;
@@ -2,63 +2,46 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
5
+ import * as Effect from 'effect/Effect';
7
6
 
8
- import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
9
- import { Obj } from '@dxos/echo';
10
- import { ScriptType } from '@dxos/functions';
11
- import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
12
- import { createExtension } from '@dxos/plugin-graph';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
9
+ import { Script } from '@dxos/compute';
10
+ import { GraphBuilder } from '@dxos/plugin-graph';
13
11
 
14
- import { meta } from '../meta';
12
+ import { meta } from '#meta';
15
13
 
16
- export default (context: PluginContext) =>
17
- contributes(Capabilities.AppGraphBuilder, [
18
- createExtension({
19
- id: `${meta.id}/execute`,
20
- connector: (node) =>
21
- Rx.make((get) =>
22
- pipe(
23
- get(node),
24
- Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),
25
- Option.map((node) => [
26
- {
27
- id: [node.id, 'execute'].join(ATTENDABLE_PATH_SEPARATOR),
28
- type: PLANK_COMPANION_TYPE,
29
- data: 'execute',
30
- properties: {
31
- label: ['script test label', { ns: meta.id }],
32
- icon: 'ph--terminal--regular',
33
- disposition: 'hidden',
34
- },
35
- },
36
- ]),
37
- Option.getOrElse(() => []),
38
- ),
39
- ),
40
- }),
41
- createExtension({
42
- id: `${meta.id}/logs`,
43
- connector: (node) =>
44
- Rx.make((get) =>
45
- pipe(
46
- get(node),
47
- Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),
48
- Option.map((node) => [
49
- {
50
- id: [node.id, 'logs'].join(ATTENDABLE_PATH_SEPARATOR),
51
- type: PLANK_COMPANION_TYPE,
52
- data: 'logs',
53
- properties: {
54
- label: ['script logs label', { ns: meta.id }],
55
- icon: 'ph--clock-countdown--regular',
56
- disposition: 'hidden',
57
- },
58
- },
59
- ]),
60
- Option.getOrElse(() => []),
61
- ),
62
- ),
63
- }),
64
- ]);
14
+ export default Capability.makeModule(
15
+ Effect.fnUntraced(function* () {
16
+ const extensions = yield* Effect.all([
17
+ GraphBuilder.createTypeExtension({
18
+ id: 'execute',
19
+ type: Script.Script,
20
+ connector: () =>
21
+ Effect.succeed([
22
+ AppNode.makeCompanion({
23
+ id: 'execute',
24
+ label: ['script-test.label', { ns: meta.id }],
25
+ icon: 'ph--terminal--regular',
26
+ data: 'execute',
27
+ }),
28
+ ]),
29
+ }),
30
+ GraphBuilder.createTypeExtension({
31
+ id: 'logs',
32
+ type: Script.Script,
33
+ connector: () =>
34
+ Effect.succeed([
35
+ AppNode.makeCompanion({
36
+ id: 'logs',
37
+ label: ['script-logs.label', { ns: meta.id }],
38
+ icon: 'ph--clock-countdown--regular',
39
+ data: 'logs',
40
+ }),
41
+ ]),
42
+ }),
43
+ ]);
44
+
45
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
46
+ }),
47
+ );
@@ -2,20 +2,23 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ // ISSUE(burdon): defineArtifact
6
+ // @ts-nocheck
6
7
 
7
- import { createTool, ToolResult } from '@dxos/ai';
8
- import { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
9
- import { ArtifactId, defineArtifact } from '@dxos/artifact';
10
- import { createArtifactElement } from '@dxos/assistant';
8
+ import * as Effect from 'effect/Effect';
9
+ import * as Schema from 'effect/Schema';
10
+
11
+ import { ToolResult, createTool } from '@dxos/ai';
12
+ import { Capabilities, Capability, type PromiseIntentDispatcher, createIntent } from '@dxos/app-framework';
13
+ import { ArtifactId, createArtifactElement } from '@dxos/assistant';
14
+ import { defineArtifact, ScriptType } from '@dxos/compute';
11
15
  import { Filter, Obj, Ref } from '@dxos/echo';
12
- import { ScriptType } from '@dxos/functions';
13
16
  import { invariant } from '@dxos/invariant';
14
17
  import { SpaceAction } from '@dxos/plugin-space/types';
15
18
  import { type Space } from '@dxos/react-client/echo';
16
- import { DataType } from '@dxos/schema';
17
19
 
18
- import { meta } from '../meta';
20
+ import { meta } from '#meta';
21
+
19
22
  // TODO(burdon): Factor out.
20
23
  declare global {
21
24
  interface ToolContextExtensions {
@@ -24,14 +27,15 @@ declare global {
24
27
  }
25
28
  }
26
29
 
27
- export default () => {
28
- const definition = defineArtifact({
29
- id: `artifact:${meta.id}`,
30
- name: meta.name,
31
- // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
32
- // we should offload the work of synthesizing the code to a separate model.
33
- // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
34
- instructions: `
30
+ export default Capability.makeModule(() =>
31
+ Effect.sync(() => {
32
+ const definition = defineArtifact({
33
+ id: `artifact:${meta.id}`,
34
+ name: meta.name,
35
+ // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
36
+ // we should offload the work of synthesizing the code to a separate model.
37
+ // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
38
+ instructions: `
35
39
  If the user explicitly requests you to write a script, you can create one.
36
40
  If the user requests you to change one of the existing script, you can update it.
37
41
  You must not create a script unless the user explicitly requests it.
@@ -51,7 +55,7 @@ export default () => {
51
55
  The description is used by AI to understand the script and its purpose.
52
56
  The description must provide cases on when the script should be used.
53
57
 
54
- Schema:
58
+ Schema:
55
59
  The schema is defined using a schema-DSL library called Effect Schema.
56
60
  The input schema describes the arguments that the script accepts.
57
61
  The output schema describes the result that the script produces.
@@ -72,18 +76,18 @@ export default () => {
72
76
  - Detailed output schema
73
77
 
74
78
  <apis>
75
- export function defineFunction(params: {
76
- description: string,
77
- inputSchema: Schema.Schema,
78
- outputSchema: Schema.Schema,
79
- handler: (params: { event: { data: TInput } }) => Promise<TOutput>
79
+ export function defineFunction(params: {
80
+ description: string,
81
+ inputSchema: Schema.Schema,
82
+ outputSchema: Schema.Schema,
83
+ handler: (params: { event: { data: TInput } }) => Promise<TOutput>
80
84
  }): FunctionDefinition
81
85
  /**
82
86
  * Effect Schema
83
87
  */
84
- export const Schema;
88
+ export const Schema;
85
89
 
86
- // Examples:
90
+ // Examples:
87
91
 
88
92
  Schema.String
89
93
  Schema.Number
@@ -101,7 +105,7 @@ export default () => {
101
105
  <handler_function>
102
106
  Async function that takes the argument in the form of:
103
107
 
104
- type HandlerFunctionParam = {
108
+ type HandlerFunctionProp = {
105
109
  event: {
106
110
  data: T // The input schema
107
111
  },
@@ -109,7 +113,7 @@ export default () => {
109
113
 
110
114
  The function must return the result that matches the output schema.
111
115
  </handler_function>
112
-
116
+
113
117
  <example>
114
118
  import { defineFunction, S } from 'dxos:functions';
115
119
 
@@ -140,89 +144,83 @@ export default () => {
140
144
  });
141
145
  </example>
142
146
  `,
143
- schema: ScriptType,
144
- tools: [
145
- createTool(meta.id, {
146
- name: 'create',
147
- description: 'Create a new script. Returns the artifact definition for the script',
148
- caption: 'Creating script...',
149
- schema: Schema.Struct({
150
- name: Schema.String.annotations({ description: 'The name of the script' }),
151
- code: Schema.String.annotations({
152
- description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
147
+ schema: ScriptType,
148
+ tools: [
149
+ createTool(meta.id, {
150
+ name: 'create',
151
+ description: 'Create a new script. Returns the artifact definition for the script',
152
+ caption: 'Creating script...',
153
+ schema: Schema.Struct({
154
+ name: Schema.String.annotations({ description: 'The name of the script' }),
155
+ code: Schema.String.annotations({
156
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
157
+ }),
153
158
  }),
159
+ execute: async ({ name, code }, { extensions }) => {
160
+ invariant(extensions?.space, 'No space');
161
+ invariant(extensions?.dispatch, 'No intent dispatcher');
162
+ const script = Obj.make(ScriptType, { name, source: Ref.make(Text.make({ content: code })) });
163
+ extensions.space.db.add(script);
164
+ await extensions.space.db.flush();
165
+
166
+ const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });
167
+ const { data, error } = await extensions.dispatch(intent);
168
+ if (!data || error) {
169
+ return ToolResult.Error(error?.message ?? 'Failed to create chess game');
170
+ }
171
+
172
+ return ToolResult.Success(createArtifactElement(script.id));
173
+ },
154
174
  }),
155
- execute: async ({ name, code }, { extensions }) => {
156
- invariant(extensions?.space, 'No space');
157
- invariant(extensions?.dispatch, 'No intent dispatcher');
158
- const script = Obj.make(ScriptType, {
159
- name,
160
- source: Ref.make(
161
- Obj.make(DataType.Text, {
162
- content: code,
163
- }),
164
- ),
165
- });
166
- extensions.space.db.add(script);
167
- await extensions.space.db.flush();
168
-
169
- const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });
170
- const { data, error } = await extensions.dispatch(intent);
171
- if (!data || error) {
172
- return ToolResult.Error(error?.message ?? 'Failed to create chess game');
173
- }
174
-
175
- return ToolResult.Success(createArtifactElement(script.id));
176
- },
177
- }),
178
- createTool(meta.id, {
179
- name: 'inspect',
180
- description: 'Inspect a script. Returns the artifact definition for the script',
181
- caption: 'Inspecting script...',
182
- schema: Schema.Struct({
183
- id: ArtifactId,
175
+ createTool(meta.id, {
176
+ name: 'inspect',
177
+ description: 'Inspect a script. Returns the artifact definition for the script',
178
+ caption: 'Inspecting script...',
179
+ schema: Schema.Struct({
180
+ id: ArtifactId,
181
+ }),
182
+ execute: async ({ id }, { extensions }) => {
183
+ invariant(extensions?.space, 'No space');
184
+
185
+ const script = (await extensions.space.db.query(Filter.id(id)).first()) as ScriptType;
186
+ const { content } = await script.source.load();
187
+
188
+ return ToolResult.Success({
189
+ name: script.name,
190
+ code: content,
191
+ });
192
+ },
184
193
  }),
185
- execute: async ({ id }, { extensions }) => {
186
- invariant(extensions?.space, 'No space');
187
-
188
- const script = (await extensions.space.db.query(Filter.ids(id)).first()) as ScriptType;
189
- const { content } = await script.source.load();
190
-
191
- return ToolResult.Success({
192
- name: script.name,
193
- code: content,
194
- });
195
- },
196
- }),
197
- createTool(meta.id, {
198
- name: 'update',
199
- description: 'Update a script. Returns the artifact definition for the script',
200
- caption: 'Updating script...',
201
- schema: Schema.Struct({
202
- id: ArtifactId,
203
- code: Schema.String.annotations({
204
- description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
194
+ createTool(meta.id, {
195
+ name: 'update',
196
+ description: 'Update a script. Returns the artifact definition for the script',
197
+ caption: 'Updating script...',
198
+ schema: Schema.Struct({
199
+ id: ArtifactId,
200
+ code: Schema.String.annotations({
201
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
202
+ }),
205
203
  }),
204
+ execute: async ({ id, code }, { extensions }) => {
205
+ invariant(extensions?.space, 'No space');
206
+
207
+ const script = (await extensions.space.db.query(Filter.id(id)).first()) as ScriptType;
208
+ const source = await script.source.load();
209
+ if (!source) {
210
+ return ToolResult.Error('Script not found');
211
+ }
212
+
213
+ source.content = code;
214
+ await extensions.space?.db.flush();
215
+
216
+ return ToolResult.Success({
217
+ name: script.name,
218
+ });
219
+ },
206
220
  }),
207
- execute: async ({ id, code }, { extensions }) => {
208
- invariant(extensions?.space, 'No space');
209
-
210
- const script = (await extensions.space.db.query(Filter.ids(id)).first()) as ScriptType;
211
- const source = await script.source.load();
212
- if (!source) {
213
- return ToolResult.Error('Script not found');
214
- }
215
-
216
- source.content = code;
217
- await extensions.space?.db.flush();
218
-
219
- return ToolResult.Success({
220
- name: script.name,
221
- });
222
- },
223
- }),
224
- ],
225
- });
226
-
227
- return contributes(Capabilities.ArtifactDefinition, definition);
228
- };
221
+ ],
222
+ });
223
+
224
+ return Capability.contributes(Capabilities.ArtifactDefinition, definition);
225
+ }),
226
+ );
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ // eslint-disable-next-line unused-imports/no-unused-imports
10
+ import type { Blueprint } from '@dxos/compute';
11
+
12
+ import { ScriptBlueprint } from '#blueprints';
13
+
14
+ const blueprintDefinition = Capability.makeModule<
15
+ [],
16
+ Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
17
+ >(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ScriptBlueprint)]));
18
+
19
+ export default blueprintDefinition;
@@ -2,32 +2,110 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- // @ts-ignore
5
+ import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
6
+ import * as HttpClient from '@effect/platform/HttpClient';
7
+ import * as Effect from 'effect/Effect';
8
+ import * as Schedule from 'effect/Schedule';
9
+ import * as Schema from 'effect/Schema';
6
10
  import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
11
+ import * as ts from 'typescript';
7
12
 
8
- import { contributes } from '@dxos/app-framework';
9
- import { initializeBundler } from '@dxos/functions/bundler';
13
+ import { Capability } from '@dxos/app-framework';
14
+ import { initializeBundler } from '@dxos/functions-runtime/bundler';
15
+ import { log } from '@dxos/log';
16
+ import { trim } from '@dxos/util';
17
+
18
+ import { ScriptCapabilities } from '#types';
10
19
 
11
- import { ScriptCapabilities } from './capabilities';
12
20
  import { Compiler } from '../compiler';
13
21
 
14
- export default async () => {
15
- const compiler = new Compiler();
16
-
17
- await compiler.initialize();
18
- // TODO(wittjosiah): Fetch types for https modules.
19
- compiler.setFile('/src/typings.d.ts', "declare module 'https://*';");
20
- // TODO(wittjosiah): Proper function handler types.
21
- // TODO(wittjosiah): Remove.
22
- compiler.setFile(
23
- '/src/runtime.ts',
24
- `
25
- export const Filter: any = {};
26
- export type FunctionHandler = ({ event, context }: { event: any; context: any }) => Promise<Response>;
27
- export const functionHandler = (handler: FunctionHandler) => handler;
28
- `,
22
+ // TODO(burdon): Document.
23
+ const SCRIPT_PACKAGES_BUCKET = 'https://pub-5745ae82e450484aa28f75fc6a175935.r2.dev/dev/';
24
+ const DECLARATION_EXTS = ['.d.ts', '.d.mts'];
25
+ const NO_TYPES = true; // Types temopararly disabled due to compiler erorrs.
26
+
27
+ export default Capability.makeModule(() =>
28
+ Effect.gen(function* () {
29
+ yield* Effect.tryPromise({
30
+ try: () => initializeBundler({ wasmUrl }),
31
+ catch: (error) => new Error(`Failed to initialize bundler: ${error}`),
32
+ });
33
+
34
+ const runtimeModules = yield* fetchRuntimeModules().pipe(Effect.provide(FetchHttpClient.layer));
35
+
36
+ const compiler = new Compiler({
37
+ target: ts.ScriptTarget.ES2022,
38
+ lib: ['lib.es2022.d.ts', 'lib.dom.d.ts'],
39
+ skipLibCheck: true,
40
+ moduleResolution: ts.ModuleResolutionKind.Bundler,
41
+ allowImportingTsExtensions: true,
42
+ noEmit: true,
43
+ strict: true,
44
+ esModuleInterop: true,
45
+ paths: Object.fromEntries(runtimeModules.map((mod: any) => [mod.moduleName, [`./src/${mod.filename}`]])),
46
+ });
47
+
48
+ yield* Effect.tryPromise({
49
+ try: () =>
50
+ compiler.initialize(trim`
51
+ declare module 'https://*';
52
+ ${NO_TYPES ? '' : 'declare module "*";'}
53
+ `),
54
+ catch: (error) => new Error(`Failed to initialize compiler: ${error}`),
55
+ });
56
+ if (!NO_TYPES) {
57
+ for (const mod of runtimeModules) {
58
+ compiler.setFile(`/src/${mod.filename}`, mod.content);
59
+ }
60
+ }
61
+
62
+ return Capability.contributes(ScriptCapabilities.Compiler, compiler);
63
+ }),
64
+ );
65
+
66
+ const fetchRuntimeModules = Effect.fnUntraced(function* () {
67
+ // { key, size, contentType }
68
+ const manifest = yield* HttpClient.get(new URL('manifest.json', SCRIPT_PACKAGES_BUCKET)).pipe(
69
+ Effect.flatMap((_) => _.json),
70
+ Effect.flatMap(
71
+ Schema.decodeUnknown(
72
+ Schema.Struct({
73
+ files: Schema.Array(
74
+ Schema.Struct({
75
+ key: Schema.String,
76
+ }),
77
+ ),
78
+ }),
79
+ ),
80
+ ),
81
+ Effect.map((manifest) => ({ ...manifest, files: manifest.files.map((f) => f.key) })),
82
+ );
83
+
84
+ const declarationFiles = manifest.files.filter((file) => DECLARATION_EXTS.some((ext) => file.endsWith(ext)));
85
+
86
+ let fetched = 0;
87
+ const modules = yield* Effect.forEach(
88
+ declarationFiles,
89
+ Effect.fnUntraced(
90
+ function* (filename) {
91
+ const response = yield* HttpClient.get(new URL(filename, SCRIPT_PACKAGES_BUCKET)).pipe(
92
+ Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
93
+ );
94
+ const content = yield* response.text;
95
+ const moduleName = filename.replace(/\.d\.(ts|mts)$/, '');
96
+ fetched++;
97
+
98
+ return {
99
+ moduleName,
100
+ filename,
101
+ content,
102
+ };
103
+ },
104
+ Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),
105
+ ),
106
+ { concurrency: 20 },
29
107
  );
30
- await initializeBundler({ wasmUrl });
31
108
 
32
- return contributes(ScriptCapabilities.Compiler, compiler);
33
- };
109
+ log.info('runtime modules', { manifest: manifest.files.length, files: declarationFiles.length, fetched });
110
+ return modules;
111
+ });