@dxos/plugin-script 0.8.4-main.28f8d3d → 0.8.4-main.406dc2a

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 (269) hide show
  1. package/dist/lib/browser/DeploymentDialog-65TWT6S5.mjs +13 -0
  2. package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs +683 -0
  3. package/dist/lib/browser/NotebookContainer-LVGRPFY3.mjs.map +7 -0
  4. package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs +149 -0
  5. package/dist/lib/browser/ScriptContainer-LRTRN7JW.mjs.map +7 -0
  6. package/dist/lib/browser/{app-graph-builder-IABOSTBK.mjs → app-graph-builder-DPYULSME.mjs} +8 -7
  7. package/dist/lib/browser/app-graph-builder-DPYULSME.mjs.map +7 -0
  8. package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs +28 -0
  9. package/dist/lib/browser/blueprint-definition-ET5KZ46I.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-5CYLWXRH.mjs +89 -0
  11. package/dist/lib/browser/chunk-5CYLWXRH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-75LH4EUR.mjs +326 -0
  13. package/dist/lib/browser/chunk-75LH4EUR.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-MWZDJNCQ.mjs → chunk-E7DXDICD.mjs} +27 -28
  15. package/dist/lib/browser/chunk-E7DXDICD.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-EZVXV6DA.mjs} +3 -5
  17. package/dist/lib/browser/chunk-EZVXV6DA.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-OULPWKXN.mjs → chunk-I3QSGUFJ.mjs} +157 -66
  19. package/dist/lib/browser/chunk-I3QSGUFJ.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-SUOLJH55.mjs → chunk-JO2O7W6J.mjs} +71 -50
  21. package/dist/lib/browser/chunk-JO2O7W6J.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-N6M34EUC.mjs +112 -0
  23. package/dist/lib/browser/chunk-N6M34EUC.mjs.map +7 -0
  24. package/dist/lib/browser/{chunk-OAVS36Q3.mjs → chunk-NM4WQS4F.mjs} +14 -14
  25. package/dist/lib/browser/chunk-NM4WQS4F.mjs.map +7 -0
  26. package/dist/lib/browser/{chunk-5TVBECWH.mjs → chunk-OKXN2N7M.mjs} +2 -2
  27. package/dist/lib/browser/chunk-ST3ACVUC.mjs +88 -0
  28. package/dist/lib/browser/chunk-ST3ACVUC.mjs.map +7 -0
  29. package/dist/lib/browser/{compiler-RIWQVBPX.mjs → compiler-G2N2CG63.mjs} +24 -11
  30. package/dist/lib/browser/{compiler-RIWQVBPX.mjs.map → compiler-G2N2CG63.mjs.map} +2 -2
  31. package/dist/lib/browser/index.mjs +113 -37
  32. package/dist/lib/browser/index.mjs.map +3 -3
  33. package/dist/lib/browser/{intent-resolver-SAL2TM7U.mjs → intent-resolver-JLU7DVLQ.mjs} +31 -15
  34. package/dist/lib/browser/intent-resolver-JLU7DVLQ.mjs.map +7 -0
  35. package/dist/lib/browser/meta.json +1 -1
  36. package/dist/lib/browser/{react-surface-E3SXU6ON.mjs → react-surface-76SDTUYG.mjs} +38 -15
  37. package/dist/lib/browser/react-surface-76SDTUYG.mjs.map +7 -0
  38. package/dist/lib/browser/{settings-KCTBK5TY.mjs → settings-ERFKVNUK.mjs} +9 -8
  39. package/dist/lib/browser/settings-ERFKVNUK.mjs.map +7 -0
  40. package/dist/lib/browser/templates/index.mjs +1 -1
  41. package/dist/lib/browser/types/index.mjs +7 -4
  42. package/dist/lib/node-esm/{DeploymentDialog-O2XZVRLU.mjs → DeploymentDialog-I63ZC2HH.mjs} +6 -5
  43. package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs +684 -0
  44. package/dist/lib/node-esm/NotebookContainer-QY5NJGJI.mjs.map +7 -0
  45. package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs +150 -0
  46. package/dist/lib/node-esm/ScriptContainer-SVXCSLNH.mjs.map +7 -0
  47. package/dist/lib/node-esm/{app-graph-builder-CQTTAYHP.mjs → app-graph-builder-UXJGHXSL.mjs} +8 -7
  48. package/dist/lib/node-esm/app-graph-builder-UXJGHXSL.mjs.map +7 -0
  49. package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs +30 -0
  50. package/dist/lib/node-esm/blueprint-definition-AIYFOT7Q.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-2GVTWESW.mjs +90 -0
  52. package/dist/lib/node-esm/chunk-2GVTWESW.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-4X375PGY.mjs +90 -0
  54. package/dist/lib/node-esm/chunk-4X375PGY.mjs.map +7 -0
  55. package/dist/lib/node-esm/chunk-67OVZHI3.mjs +327 -0
  56. package/dist/lib/node-esm/chunk-67OVZHI3.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-IO6T72KY.mjs → chunk-C2ORIPKH.mjs} +14 -14
  58. package/dist/lib/node-esm/chunk-C2ORIPKH.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-35M3CHYE.mjs → chunk-NUXZQQ6P.mjs} +2 -2
  60. package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-OG2SIKHE.mjs} +3 -5
  61. package/dist/lib/node-esm/chunk-OG2SIKHE.mjs.map +7 -0
  62. package/dist/lib/node-esm/{chunk-6WMFL3JL.mjs → chunk-SMFPSKQT.mjs} +157 -66
  63. package/dist/lib/node-esm/chunk-SMFPSKQT.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-VRSDE4CI.mjs +114 -0
  65. package/dist/lib/node-esm/chunk-VRSDE4CI.mjs.map +7 -0
  66. package/dist/lib/node-esm/{chunk-7L4JDSXJ.mjs → chunk-VZAFGLD7.mjs} +27 -28
  67. package/dist/lib/node-esm/chunk-VZAFGLD7.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-PACUN7RS.mjs → chunk-YW36TZ7K.mjs} +71 -50
  69. package/dist/lib/node-esm/chunk-YW36TZ7K.mjs.map +7 -0
  70. package/dist/lib/node-esm/{compiler-S52P5P3F.mjs → compiler-PLDAZ5GJ.mjs} +24 -11
  71. package/dist/lib/node-esm/{compiler-S52P5P3F.mjs.map → compiler-PLDAZ5GJ.mjs.map} +2 -2
  72. package/dist/lib/node-esm/index.mjs +113 -37
  73. package/dist/lib/node-esm/index.mjs.map +3 -3
  74. package/dist/lib/node-esm/{intent-resolver-GO53JOPL.mjs → intent-resolver-SFGTIFOG.mjs} +31 -15
  75. package/dist/lib/node-esm/intent-resolver-SFGTIFOG.mjs.map +7 -0
  76. package/dist/lib/node-esm/meta.json +1 -1
  77. package/dist/lib/node-esm/{react-surface-W3NRCS5O.mjs → react-surface-SHEBNW4R.mjs} +38 -15
  78. package/dist/lib/node-esm/react-surface-SHEBNW4R.mjs.map +7 -0
  79. package/dist/lib/node-esm/{settings-DXZ334A3.mjs → settings-5TYXQ42N.mjs} +9 -8
  80. package/dist/lib/node-esm/settings-5TYXQ42N.mjs.map +7 -0
  81. package/dist/lib/node-esm/templates/index.mjs +1 -1
  82. package/dist/lib/node-esm/types/index.mjs +7 -4
  83. package/dist/types/src/ScriptPlugin.d.ts +1 -1
  84. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  86. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
  88. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/compiler.d.ts +1 -1
  90. package/dist/types/src/capabilities/index.d.ts +6 -5
  91. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  92. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  93. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  94. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  95. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  96. package/dist/types/src/capabilities/settings.d.ts +1 -1
  97. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +2 -2
  98. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  99. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +246 -13
  100. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
  101. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  102. package/dist/types/src/components/NotebookContainer.d.ts +10 -0
  103. package/dist/types/src/components/NotebookContainer.d.ts.map +1 -0
  104. package/dist/types/src/components/NotebookContainer.stories.d.ts +248 -0
  105. package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
  106. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +14 -0
  107. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
  108. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
  109. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
  110. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
  111. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
  112. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +248 -0
  113. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
  114. package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
  115. package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
  116. package/dist/types/src/components/ScriptContainer.d.ts +2 -2
  117. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  118. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  119. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +245 -10
  120. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  121. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
  122. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +2 -2
  123. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
  124. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +4 -2
  125. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  126. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +11 -4
  127. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  128. package/dist/types/src/components/index.d.ts +3 -4
  129. package/dist/types/src/components/index.d.ts.map +1 -1
  130. package/dist/types/src/events.d.ts.map +1 -1
  131. package/dist/types/src/hooks/deploy.d.ts +12 -11
  132. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  133. package/dist/types/src/hooks/template.d.ts.map +1 -1
  134. package/dist/types/src/index.d.ts +1 -0
  135. package/dist/types/src/index.d.ts.map +1 -1
  136. package/dist/types/src/meta.d.ts +0 -1
  137. package/dist/types/src/meta.d.ts.map +1 -1
  138. package/dist/types/src/notebook/eval.d.ts +13 -0
  139. package/dist/types/src/notebook/eval.d.ts.map +1 -0
  140. package/dist/types/src/notebook/index.d.ts +2 -0
  141. package/dist/types/src/notebook/index.d.ts.map +1 -0
  142. package/dist/types/src/notebook/notebook.d.ts +35 -0
  143. package/dist/types/src/notebook/notebook.d.ts.map +1 -0
  144. package/dist/types/src/notebook/notebook.test.d.ts +2 -0
  145. package/dist/types/src/notebook/notebook.test.d.ts.map +1 -0
  146. package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
  147. package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
  148. package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
  149. package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
  150. package/dist/types/src/templates/chess.d.ts.map +1 -1
  151. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  152. package/dist/types/src/templates/discord.d.ts.map +1 -1
  153. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  154. package/dist/types/src/templates/forex.d.ts.map +1 -1
  155. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  156. package/dist/types/src/templates/index.d.ts +43 -1
  157. package/dist/types/src/templates/index.d.ts.map +1 -1
  158. package/dist/types/src/templates/{echo.d.ts → ping.d.ts} +1 -1
  159. package/dist/types/src/templates/ping.d.ts.map +1 -0
  160. package/dist/types/src/testing/data.d.ts +19 -0
  161. package/dist/types/src/testing/data.d.ts.map +1 -0
  162. package/dist/types/src/testing/index.d.ts +2 -0
  163. package/dist/types/src/testing/index.d.ts.map +1 -0
  164. package/dist/types/src/translations.d.ts +28 -2
  165. package/dist/types/src/translations.d.ts.map +1 -1
  166. package/dist/types/src/types/actions.d.ts +66 -0
  167. package/dist/types/src/types/actions.d.ts.map +1 -0
  168. package/dist/types/src/types/index.d.ts +1 -0
  169. package/dist/types/src/types/index.d.ts.map +1 -1
  170. package/dist/types/src/types/schema.d.ts +54 -31
  171. package/dist/types/src/types/schema.d.ts.map +1 -1
  172. package/dist/types/src/util/deploy.d.ts +3 -3
  173. package/dist/types/src/util/deploy.d.ts.map +1 -1
  174. package/dist/types/src/util/functions.d.ts +5 -2
  175. package/dist/types/src/util/functions.d.ts.map +1 -1
  176. package/dist/types/tsconfig.tsbuildinfo +1 -1
  177. package/package.json +72 -68
  178. package/src/ScriptPlugin.tsx +99 -64
  179. package/src/capabilities/app-graph-builder.ts +4 -3
  180. package/src/capabilities/artifact-definition.ts +1 -1
  181. package/src/capabilities/blueprint-definition.ts +30 -0
  182. package/src/capabilities/index.ts +1 -0
  183. package/src/capabilities/intent-resolver.ts +14 -4
  184. package/src/capabilities/react-surface.tsx +17 -5
  185. package/src/capabilities/settings.ts +3 -3
  186. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +34 -20
  187. package/src/components/DeploymentDialog/DeploymentDialog.tsx +12 -18
  188. package/src/components/FrameContainer/FrameContainer.tsx +3 -2
  189. package/src/components/NotebookContainer.stories.tsx +32 -0
  190. package/src/components/NotebookContainer.tsx +124 -0
  191. package/src/components/NotebookStack/NotebookCell.tsx +217 -0
  192. package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
  193. package/src/components/NotebookStack/NotebookStack.stories.tsx +32 -0
  194. package/src/components/NotebookStack/NotebookStack.tsx +79 -0
  195. package/src/components/NotebookStack/index.ts +6 -0
  196. package/src/components/ScriptContainer.tsx +2 -2
  197. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +34 -18
  198. package/src/components/ScriptToolbar/ScriptToolbar.tsx +29 -22
  199. package/src/components/Settings/ScriptObjectSettings.tsx +109 -29
  200. package/src/components/Settings/ScriptPluginSettings.tsx +37 -47
  201. package/src/components/TestPanel/TestPanel.tsx +6 -6
  202. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +74 -27
  203. package/src/components/TypescriptEditor/TypescriptEditor.tsx +30 -24
  204. package/src/components/index.ts +3 -0
  205. package/src/events.ts +2 -2
  206. package/src/hooks/deploy.ts +17 -18
  207. package/src/hooks/format.ts +2 -2
  208. package/src/hooks/template.ts +4 -3
  209. package/src/hooks/useCreateAndDeployScriptTemplates.ts +3 -3
  210. package/src/index.ts +1 -0
  211. package/src/meta.ts +2 -4
  212. package/src/notebook/eval.ts +105 -0
  213. package/src/notebook/index.ts +5 -0
  214. package/src/notebook/notebook.test.ts +70 -0
  215. package/src/notebook/notebook.ts +183 -0
  216. package/src/notebook/vfs-parser.test.ts +149 -0
  217. package/src/notebook/vfs-parser.ts +451 -0
  218. package/src/templates/chess.ts +2 -0
  219. package/src/templates/data-generator.ts +2 -0
  220. package/src/templates/discord.ts +11 -3
  221. package/src/templates/forex-effect.ts +6 -2
  222. package/src/templates/forex.ts +2 -0
  223. package/src/templates/gmail.ts +31 -60
  224. package/src/templates/index.ts +6 -6
  225. package/src/testing/data.ts +47 -0
  226. package/src/testing/index.ts +5 -0
  227. package/src/translations.ts +31 -4
  228. package/src/types/actions.ts +53 -0
  229. package/src/types/index.ts +1 -0
  230. package/src/types/schema.ts +30 -19
  231. package/src/util/deploy.ts +20 -33
  232. package/src/util/functions.ts +35 -6
  233. package/dist/lib/browser/DeploymentDialog-C3XH2Z56.mjs +0 -12
  234. package/dist/lib/browser/ScriptContainer-FUBR4OZE.mjs +0 -263
  235. package/dist/lib/browser/ScriptContainer-FUBR4OZE.mjs.map +0 -7
  236. package/dist/lib/browser/app-graph-builder-IABOSTBK.mjs.map +0 -7
  237. package/dist/lib/browser/chunk-G4A2MGAL.mjs +0 -88
  238. package/dist/lib/browser/chunk-G4A2MGAL.mjs.map +0 -7
  239. package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
  240. package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
  241. package/dist/lib/browser/chunk-MWZDJNCQ.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-OAVS36Q3.mjs.map +0 -7
  243. package/dist/lib/browser/chunk-OULPWKXN.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
  245. package/dist/lib/browser/chunk-SUOLJH55.mjs.map +0 -7
  246. package/dist/lib/browser/intent-resolver-SAL2TM7U.mjs.map +0 -7
  247. package/dist/lib/browser/react-surface-E3SXU6ON.mjs.map +0 -7
  248. package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
  249. package/dist/lib/node-esm/ScriptContainer-VJ75TM24.mjs +0 -264
  250. package/dist/lib/node-esm/ScriptContainer-VJ75TM24.mjs.map +0 -7
  251. package/dist/lib/node-esm/app-graph-builder-CQTTAYHP.mjs.map +0 -7
  252. package/dist/lib/node-esm/chunk-3BBEM2U7.mjs +0 -90
  253. package/dist/lib/node-esm/chunk-3BBEM2U7.mjs.map +0 -7
  254. package/dist/lib/node-esm/chunk-6WMFL3JL.mjs.map +0 -7
  255. package/dist/lib/node-esm/chunk-7L4JDSXJ.mjs.map +0 -7
  256. package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-IO6T72KY.mjs.map +0 -7
  258. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
  259. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
  260. package/dist/lib/node-esm/chunk-PACUN7RS.mjs.map +0 -7
  261. package/dist/lib/node-esm/intent-resolver-GO53JOPL.mjs.map +0 -7
  262. package/dist/lib/node-esm/react-surface-W3NRCS5O.mjs.map +0 -7
  263. package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
  264. package/dist/types/src/templates/echo.d.ts.map +0 -1
  265. /package/dist/lib/browser/{DeploymentDialog-C3XH2Z56.mjs.map → DeploymentDialog-65TWT6S5.mjs.map} +0 -0
  266. /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-OKXN2N7M.mjs.map} +0 -0
  267. /package/dist/lib/node-esm/{DeploymentDialog-O2XZVRLU.mjs.map → DeploymentDialog-I63ZC2HH.mjs.map} +0 -0
  268. /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-NUXZQQ6P.mjs.map} +0 -0
  269. /package/src/templates/{echo.ts → ping.ts} +0 -0
@@ -6,11 +6,11 @@ import chat from './chat.ts?raw';
6
6
  import chess from './chess.ts?raw';
7
7
  import dataGenerator from './data-generator.ts?raw';
8
8
  import discord from './discord.ts?raw';
9
- import echo from './echo.ts?raw';
10
9
  import email from './email.ts?raw';
11
10
  import forexEffect from './forex-effect.ts?raw';
12
11
  import forex from './forex.ts?raw';
13
12
  import gmail from './gmail.ts?raw';
13
+ import ping from './ping.ts?raw';
14
14
 
15
15
  const removeHeader = (str: string) => str.split('\n').slice(4).join('\n');
16
16
 
@@ -23,11 +23,11 @@ export type Template = {
23
23
  presetId?: string;
24
24
  };
25
25
 
26
- export const templates: Template[] = [
26
+ export const templates = [
27
27
  {
28
- id: 'dxos.org/script/echo',
29
- name: 'Echo',
30
- source: removeHeader(echo),
28
+ id: 'dxos.org/script/ping',
29
+ name: 'Ping',
30
+ source: removeHeader(ping),
31
31
  },
32
32
  {
33
33
  id: 'dxos.org/script/forex',
@@ -75,4 +75,4 @@ export const templates: Template[] = [
75
75
  source: removeHeader(dataGenerator),
76
76
  presetId: 'dxos.org/function/data-generator',
77
77
  },
78
- ];
78
+ ] as const;
@@ -0,0 +1,47 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Ref } from '@dxos/echo';
6
+ import { createObject } from '@dxos/echo-db';
7
+ import { PublicKey } from '@dxos/keys';
8
+ import { DataType } from '@dxos/schema';
9
+
10
+ import { Notebook } from '../types';
11
+
12
+ // NOTE: createObject(DataType.makeText is required to make codemirror work.
13
+ export const createNotebook = () =>
14
+ Notebook.make({
15
+ cells: [
16
+ {
17
+ id: PublicKey.random().toString(),
18
+ type: 'script',
19
+ script: Ref.make(createObject(DataType.makeText(['c = a() + b', '', ''].join('\n')))),
20
+ },
21
+ {
22
+ id: PublicKey.random().toString(),
23
+ type: 'script',
24
+ script: Ref.make(createObject(DataType.makeText(['a = () => 100', ''].join('\n')))),
25
+ },
26
+ {
27
+ id: PublicKey.random().toString(),
28
+ type: 'script',
29
+ script: Ref.make(createObject(DataType.makeText(['b = 200'].join('\n')))),
30
+ },
31
+ {
32
+ id: PublicKey.random().toString(),
33
+ type: 'script',
34
+ script: Ref.make(createObject(DataType.makeText(['d = a() * 2'].join('\n')))),
35
+ },
36
+ {
37
+ id: PublicKey.random().toString(),
38
+ type: 'script',
39
+ script: Ref.make(createObject(DataType.makeText(['c + d', '', '', ''].join('\n')))),
40
+ },
41
+ {
42
+ id: PublicKey.random().toString(),
43
+ type: 'query',
44
+ script: Ref.make(createObject(DataType.makeText('#test'))),
45
+ },
46
+ ],
47
+ });
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './data';
@@ -6,6 +6,7 @@ import { ScriptType } from '@dxos/functions';
6
6
  import { type Resource } from '@dxos/react-ui';
7
7
 
8
8
  import { meta } from './meta';
9
+ import { Notebook } from './types';
9
10
 
10
11
  export const translations = [
11
12
  {
@@ -19,8 +20,18 @@ export const translations = [
19
20
  'rename object label': 'Rename script',
20
21
  'delete object label': 'Delete script',
21
22
  },
23
+ [Notebook.Notebook.typename]: {
24
+ 'typename label': 'Notebook',
25
+ 'typename label_zero': 'Notebooks',
26
+ 'typename label_one': 'Notebook',
27
+ 'typename label_other': 'Notebooks',
28
+ 'object name placeholder': 'New notebook',
29
+ 'rename object label': 'Rename notebook',
30
+ 'delete object label': 'Delete notebook',
31
+ },
22
32
  [meta.id]: {
23
33
  'plugin name': 'Scripts',
34
+ 'settings title': 'Scripts plugin settings',
24
35
  'description label': 'Description',
25
36
  'description placeholder': 'Enter description',
26
37
  'binding placeholder': 'Function name',
@@ -44,6 +55,12 @@ export const translations = [
44
55
  'open token manager label': 'Open Token Manager',
45
56
  'publish label': 'Publish',
46
57
  'publishing label': 'Publishing',
58
+ 'blueprint editor label': 'Blueprint',
59
+ 'blueprint editor description': 'Create a blueprint that exposes this script as a tool.',
60
+ 'blueprint instructions label': 'Instructions',
61
+ 'blueprint instructions placeholder': 'Describe how this tool should be used.',
62
+ 'create blueprint label': 'Create blueprint',
63
+ 'creating label': 'Creating…',
47
64
  'editor input mode label': 'Editor input mode',
48
65
  'select editor input mode placeholder': 'Select editor input mode…',
49
66
  'settings editor input mode default label': 'Default',
@@ -53,16 +70,15 @@ export const translations = [
53
70
  'function panel label': 'Debug Function',
54
71
  'script test label': 'Test',
55
72
  'script logs label': 'Logs',
73
+
56
74
  'deployment dialog title': 'Default Scripts',
57
- 'deployment dialog scripts found message_one':
58
- 'We found the following script template for your new integration:',
59
- 'deployment dialog scripts found message_other':
60
- 'We found the following script templates for your new integration:',
75
+ 'deployment dialog scripts found message': 'Script templates:',
61
76
  'deployment dialog deploy functions button label_one': 'Create and deploy script',
62
77
  'deployment dialog deploy functions button label_other': 'Create and deploy scripts',
63
78
  'deployment dialog deploy functions pending button label_one': 'Deploying script',
64
79
  'deployment dialog deploy functions pending button label_other': 'Deploying scripts',
65
80
  'deployment dialog skip button label': 'Skip',
81
+
66
82
  'script deployment toast label_one': 'Script deployed',
67
83
  'script deployment toast label_other': 'Scripts deployed',
68
84
  'script deployment toast description_one': 'Your script has been deployed successfully.',
@@ -75,6 +91,17 @@ export const translations = [
75
91
  'script deployment error toast description_other': 'There was an error deploying your scripts.',
76
92
  'script deployment error toast close label_one': 'Close',
77
93
  'script deployment error toast close label_other': 'Close',
94
+
95
+ 'notebook cell placeholder': 'Enter script',
96
+ 'notebook cell delete label': 'Delete cell',
97
+ 'notebook cell prompt run label': 'Run',
98
+ 'notebook cell insert markdown label': 'Insert Markdown',
99
+ 'notebook cell insert script label': 'Insert Script',
100
+ 'notebook cell insert prompt label': 'Insert Prompt',
101
+ 'notebook cell insert query label': 'Insert Query',
102
+ 'notebook markdown placeholder': 'Enter Markdown',
103
+ 'notebook prompt placeholder': 'Enter prompt',
104
+ 'notebook cell insert label': 'Insert cell',
78
105
  },
79
106
  },
80
107
  },
@@ -0,0 +1,53 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { SpaceSchema } from '@dxos/client/echo';
8
+ import { ScriptType } from '@dxos/functions';
9
+
10
+ import { meta } from '../meta';
11
+ import { templates } from '../templates';
12
+
13
+ import { Notebook } from './schema';
14
+
15
+ export namespace ScriptAction {
16
+ export const ScriptProps = Schema.Struct({
17
+ name: Schema.optional(Schema.String),
18
+ // TODO(wittjosiah): Placeholder annotation?
19
+ gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),
20
+ initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(
21
+ Schema.annotations({ title: 'Template' }),
22
+ Schema.optional,
23
+ ),
24
+ });
25
+
26
+ export class CreateScript extends Schema.TaggedClass<CreateScript>()(`${meta.id}/action/create-script`, {
27
+ input: Schema.extend(
28
+ ScriptProps,
29
+ Schema.Struct({
30
+ space: SpaceSchema,
31
+ }),
32
+ ),
33
+ output: Schema.Struct({
34
+ object: ScriptType,
35
+ }),
36
+ }) {}
37
+
38
+ export const NotebookProps = Schema.Struct({
39
+ name: Schema.optional(Schema.String),
40
+ });
41
+
42
+ export class CreateNotebook extends Schema.TaggedClass<CreateNotebook>()(`${meta.id}/action/create-notebook`, {
43
+ input: Schema.extend(
44
+ NotebookProps,
45
+ Schema.Struct({
46
+ space: SpaceSchema,
47
+ }),
48
+ ),
49
+ output: Schema.Struct({
50
+ object: Notebook.Notebook,
51
+ }),
52
+ }) {}
53
+ }
@@ -2,4 +2,5 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ export * from './actions';
5
6
  export * from './schema';
@@ -2,36 +2,47 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
- import { SpaceSchema } from '@dxos/client/echo';
8
- import { ScriptType } from '@dxos/functions';
7
+ import { Obj, Type } from '@dxos/echo';
8
+ import { LabelAnnotation } from '@dxos/echo/internal';
9
+ import { Assistant } from '@dxos/plugin-assistant/types';
9
10
  import { EditorInputMode } from '@dxos/react-ui-editor';
11
+ import { DataType } from '@dxos/schema';
10
12
 
11
- import { meta } from '../meta';
13
+ export namespace Notebook {
14
+ export type CellType = 'markdown' | 'script' | 'query' | 'prompt' | 'view';
12
15
 
13
- export namespace ScriptAction {
14
- export const CreateScriptSchema = Schema.Struct({
15
- name: Schema.optional(Schema.String),
16
- // TODO(wittjosiah): Placeholder annotation?
17
- gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),
18
- initialTemplateId: Schema.optional(Schema.String),
19
- });
16
+ export const Cell = Schema.Struct({
17
+ id: Schema.String,
18
+ type: Schema.String,
19
+ script: Schema.optional(Type.Ref(DataType.Text)),
20
+ view: Schema.optional(Type.Ref(DataType.View)),
21
+ chat: Schema.optional(Type.Ref(Assistant.Chat)),
22
+ }).pipe(Schema.mutable);
20
23
 
21
- export type CreateScriptProps = Schema.Schema.Type<typeof CreateScriptSchema>;
24
+ export type Cell = Schema.Schema.Type<typeof Cell>;
22
25
 
23
- export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {
24
- input: Schema.extend(CreateScriptSchema, Schema.Struct({ space: SpaceSchema })),
25
- output: Schema.Struct({
26
- object: ScriptType,
26
+ export const Notebook = Schema.Struct({
27
+ name: Schema.optional(Schema.String),
28
+ cells: Schema.mutable(Schema.Array(Cell)),
29
+ }).pipe(
30
+ Type.Obj({
31
+ typename: 'dxos.org/type/Notebook',
32
+ version: '0.1.0',
27
33
  }),
28
- }) {}
34
+ LabelAnnotation.set(['name']),
35
+ );
36
+
37
+ export type Notebook = Schema.Schema.Type<typeof Notebook>;
38
+
39
+ export const make = (props: Obj.MakeProps<typeof Notebook> = { cells: [] }) => Obj.make(Notebook, props);
29
40
  }
30
41
 
31
- export const ScriptSettingsSchema = Schema.mutable(
42
+ export const ScriptSettings = Schema.mutable(
32
43
  Schema.Struct({
33
44
  editorInputMode: EditorInputMode,
34
45
  }),
35
46
  );
36
47
 
37
- export type ScriptSettingsProps = Schema.Schema.Type<typeof ScriptSettingsSchema>;
48
+ export type ScriptSettings = Schema.Schema.Type<typeof ScriptSettings>;
@@ -7,9 +7,8 @@ import { Obj, Ref } from '@dxos/echo';
7
7
  import {
8
8
  FunctionType,
9
9
  type ScriptType,
10
- getUserFunctionUrlInMetadata,
11
- makeFunctionUrl,
12
- setUserFunctionUrlInMetadata,
10
+ getUserFunctionIdInMetadata,
11
+ setUserFunctionIdInMetadata,
13
12
  } from '@dxos/functions';
14
13
  import { Bundler } from '@dxos/functions/bundler';
15
14
  import { incrementSemverPatch, uploadWorkerFunction } from '@dxos/functions/edge';
@@ -19,8 +18,8 @@ import { type Space } from '@dxos/react-client/echo';
19
18
  import { updateFunctionMetadata } from './functions';
20
19
 
21
20
  export const isScriptDeployed = ({ script, fn }: { script: ScriptType; fn: any }): boolean => {
22
- const existingFunctionUrl = fn && getUserFunctionUrlInMetadata(Obj.getMeta(fn));
23
- return Boolean(existingFunctionUrl) && !script.changed;
21
+ const existingFunctionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));
22
+ return Boolean(existingFunctionId) && !script.changed;
24
23
  };
25
24
 
26
25
  type DeployScriptProps = {
@@ -28,10 +27,10 @@ type DeployScriptProps = {
28
27
  client: Client;
29
28
  space: Space;
30
29
  fn?: FunctionType;
31
- existingFunctionUrl?: string;
30
+ existingFunctionId?: string;
32
31
  };
33
32
 
34
- type DeployScriptResult = { success: boolean; error?: Error; functionUrl?: string };
33
+ type DeployScriptResult = { success: boolean; error?: Error; functionId?: string };
35
34
 
36
35
  /**
37
36
  * Deploy a script to a space, handling bundling and uploading to the FaaS infrastructure.
@@ -41,7 +40,7 @@ export const deployScript = async ({
41
40
  client,
42
41
  space,
43
42
  fn,
44
- existingFunctionUrl,
43
+ existingFunctionId,
45
44
  }: DeployScriptProps): Promise<DeployScriptResult> => {
46
45
  const validationError = validateDeployInputs(script, space);
47
46
  if (validationError) {
@@ -49,11 +48,10 @@ export const deployScript = async ({
49
48
  }
50
49
 
51
50
  try {
52
- const existingFunctionId = extractFunctionId(existingFunctionUrl);
53
-
54
- const { bundle, error } = await bundleScript(script.source!.target!.content);
55
- if (error || !bundle) {
56
- throw error || new Error('Bundle creation failed');
51
+ const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });
52
+ const buildResult = await bundler.bundle({ source: script.source!.target!.content });
53
+ if ('error' in buildResult) {
54
+ throw buildResult.error || new Error('Bundle creation failed');
57
55
  }
58
56
 
59
57
  const { functionId, version, meta } = await uploadWorkerFunction({
@@ -61,7 +59,8 @@ export const deployScript = async ({
61
59
  ownerPublicKey: space.key,
62
60
  version: fn ? incrementSemverPatch(fn.version) : '0.0.1',
63
61
  functionId: existingFunctionId,
64
- source: bundle,
62
+ entryPoint: buildResult.entryPoint,
63
+ assets: { [buildResult.entryPoint]: buildResult.asset },
65
64
  });
66
65
 
67
66
  if (functionId === undefined || version === undefined) {
@@ -72,10 +71,9 @@ export const deployScript = async ({
72
71
  script.changed = false;
73
72
  updateFunctionMetadata(script, storedFunction, meta, functionId);
74
73
 
75
- const functionUrl = makeFunctionUrl({ functionId });
76
- setUserFunctionUrlInMetadata(Obj.getMeta(storedFunction), functionUrl);
74
+ setUserFunctionIdInMetadata(Obj.getMeta(storedFunction), functionId);
77
75
 
78
- return { success: true, functionUrl };
76
+ return { success: true, functionId };
79
77
  } catch (err: any) {
80
78
  log.catch(err);
81
79
  return { success: false, error: err };
@@ -92,21 +90,6 @@ const validateDeployInputs = (script: ScriptType, space: Space): Error | null =>
92
90
  return null;
93
91
  };
94
92
 
95
- const extractFunctionId = (functionUrl?: string): string | undefined => {
96
- return functionUrl?.split('/').at(-1);
97
- };
98
-
99
- const bundleScript = async (source: string): Promise<{ bundle?: string; error?: Error }> => {
100
- const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });
101
- const buildResult = await bundler.bundle({ source });
102
-
103
- if (buildResult.error || !buildResult.bundle) {
104
- return { error: buildResult.error || new Error('Bundle creation failed') };
105
- }
106
-
107
- return { bundle: buildResult.bundle };
108
- };
109
-
110
93
  const createOrUpdateFunctionInSpace = (
111
94
  space: Space,
112
95
  fn: FunctionType | undefined,
@@ -115,9 +98,13 @@ const createOrUpdateFunctionInSpace = (
115
98
  version: string,
116
99
  ): FunctionType => {
117
100
  if (fn) {
101
+ fn.name = script.name ?? 'New Function';
118
102
  fn.version = version;
119
103
  return fn;
120
104
  } else {
121
- return space.db.add(Obj.make(FunctionType, { name: functionId, version, source: Ref.make(script) }));
105
+ const fn = Obj.make(FunctionType, { name: script.name ?? 'New Function', version, source: Ref.make(script) });
106
+ space.db.add(fn);
107
+ setUserFunctionIdInMetadata(Obj.getMeta(fn), functionId);
108
+ return fn;
122
109
  }
123
110
  };
@@ -2,10 +2,11 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
5
+ import { type FunctionType, type ScriptType, getInvocationUrl, getUserFunctionIdInMetadata } from '@dxos/functions';
6
+ import { type PublicKey } from '@dxos/keys';
6
7
  import { log } from '@dxos/log';
8
+ import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
7
9
  import { getMeta, getSpace } from '@dxos/react-client/echo';
8
-
9
10
  /**
10
11
  * Get the function URL for a given script and client configuration
11
12
  */
@@ -19,18 +20,23 @@ export const getFunctionUrl = ({
19
20
  edgeUrl: string;
20
21
  }): string | undefined => {
21
22
  const space = getSpace(script);
22
- const existingFunctionUrl = fn && getUserFunctionUrlInMetadata(getMeta(fn));
23
+ const existingFunctionId = fn && getUserFunctionIdInMetadata(getMeta(fn));
23
24
 
24
- if (!existingFunctionUrl) {
25
+ if (!existingFunctionId) {
25
26
  return undefined;
26
27
  }
27
28
 
28
- return getInvocationUrl(existingFunctionUrl, edgeUrl, {
29
+ return getInvocationUrl(existingFunctionId, edgeUrl, {
29
30
  spaceId: space?.id,
30
31
  });
31
32
  };
32
33
 
33
- export const updateFunctionMetadata = (script: ScriptType, storedFunction: any, meta: any, functionId: string) => {
34
+ export const updateFunctionMetadata = (
35
+ script: ScriptType,
36
+ storedFunction: FunctionType,
37
+ meta: any,
38
+ functionId: string,
39
+ ) => {
34
40
  if (script.description !== undefined && script.description.trim() !== '') {
35
41
  storedFunction.description = script.description;
36
42
  } else if (meta.description) {
@@ -50,4 +56,27 @@ export const updateFunctionMetadata = (script: ScriptType, storedFunction: any,
50
56
  } else {
51
57
  log.verbose('no output schema in function metadata', { functionId });
52
58
  }
59
+
60
+ if (meta.key) {
61
+ storedFunction.key = meta.key;
62
+ } else {
63
+ log.verbose('no key in function metadata', { functionId });
64
+ }
65
+ };
66
+
67
+ export const getAccessCredential = (identityKey: PublicKey): Credential => {
68
+ return {
69
+ issuer: identityKey,
70
+ issuanceDate: new Date(),
71
+ subject: {
72
+ id: identityKey,
73
+ assertion: {
74
+ '@type': 'dxos.halo.credentials.ServiceAccess',
75
+ serverName: 'hub.dxos.network',
76
+ serverKey: identityKey,
77
+ identityKey,
78
+ capabilities: ['composer:beta'],
79
+ },
80
+ },
81
+ };
53
82
  };
@@ -1,12 +0,0 @@
1
- import {
2
- DEPLOYMENT_DIALOG,
3
- DeploymentDialog_default
4
- } from "./chunk-OAVS36Q3.mjs";
5
- import "./chunk-SUOLJH55.mjs";
6
- import "./chunk-IS4OG2UW.mjs";
7
- import "./chunk-QYAREHGH.mjs";
8
- export {
9
- DEPLOYMENT_DIALOG,
10
- DeploymentDialog_default as default
11
- };
12
- //# sourceMappingURL=DeploymentDialog-C3XH2Z56.mjs.map