@dxos/plugin-script 0.7.4 → 0.7.5-labs.401163d

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 (288) hide show
  1. package/dist/lib/browser/{AutomationPanel-PMTZROAZ.mjs → AutomationPanel-J3SZ5L3Y.mjs} +4 -11
  2. package/dist/lib/browser/AutomationPanel-J3SZ5L3Y.mjs.map +7 -0
  3. package/dist/lib/browser/ScriptContainer-JHAVO2KA.mjs +713 -0
  4. package/dist/lib/browser/ScriptContainer-JHAVO2KA.mjs.map +7 -0
  5. package/dist/lib/browser/artifact-YCIVHFSS.mjs +243 -0
  6. package/dist/lib/browser/artifact-YCIVHFSS.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-K7KY6YMG.mjs → chunk-45LXDWNF.mjs} +2 -2
  8. package/dist/lib/browser/chunk-6MOQ4BP3.mjs +15 -0
  9. package/dist/lib/browser/chunk-6MOQ4BP3.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-FVVCAWNP.mjs +21 -0
  11. package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-N46LE7FS.mjs +40 -0
  13. package/dist/lib/browser/chunk-N46LE7FS.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-UDLKK74O.mjs +69 -0
  15. package/dist/lib/browser/chunk-UDLKK74O.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-WAXHENSY.mjs +236 -0
  17. package/dist/lib/browser/chunk-WAXHENSY.mjs.map +7 -0
  18. package/dist/lib/browser/compiler-YY2XSKHQ.mjs +82 -0
  19. package/dist/lib/browser/compiler-YY2XSKHQ.mjs.map +7 -0
  20. package/dist/lib/browser/index.mjs +111 -359
  21. package/dist/lib/browser/index.mjs.map +4 -4
  22. package/dist/lib/browser/intent-resolver-RV3YXIVN.mjs +45 -0
  23. package/dist/lib/browser/intent-resolver-RV3YXIVN.mjs.map +7 -0
  24. package/dist/lib/browser/meta.json +1 -1
  25. package/dist/lib/browser/react-surface-ETY4XKFG.mjs +65 -0
  26. package/dist/lib/browser/react-surface-ETY4XKFG.mjs.map +7 -0
  27. package/dist/lib/browser/settings-SZCDKHWO.mjs +24 -0
  28. package/dist/lib/browser/settings-SZCDKHWO.mjs.map +7 -0
  29. package/dist/lib/browser/types.mjs +10 -0
  30. package/dist/lib/node/{AutomationPanel-AAGQREH7.cjs → AutomationPanel-4M55FURO.cjs} +16 -17
  31. package/dist/lib/node/AutomationPanel-4M55FURO.cjs.map +7 -0
  32. package/dist/lib/node/ScriptContainer-EBIT6CT4.cjs +719 -0
  33. package/dist/lib/node/ScriptContainer-EBIT6CT4.cjs.map +7 -0
  34. package/dist/lib/node/artifact-IPGGY2Z2.cjs +262 -0
  35. package/dist/lib/node/artifact-IPGGY2Z2.cjs.map +7 -0
  36. package/dist/lib/node/chunk-3VDHZ54A.cjs +264 -0
  37. package/dist/lib/node/chunk-3VDHZ54A.cjs.map +7 -0
  38. package/dist/lib/node/{chunk-6LYX73ZT.cjs → chunk-5UH3F7TA.cjs} +11 -8
  39. package/dist/lib/node/chunk-5UH3F7TA.cjs.map +7 -0
  40. package/dist/lib/node/{meta.cjs → chunk-ALY3N6PW.cjs} +12 -8
  41. package/dist/lib/node/chunk-ALY3N6PW.cjs.map +7 -0
  42. package/dist/lib/node/chunk-DJGLGRQV.cjs +60 -0
  43. package/dist/lib/node/chunk-DJGLGRQV.cjs.map +7 -0
  44. package/dist/lib/node/{chunk-4INUJLXL.cjs → chunk-IID7WUQS.cjs} +6 -6
  45. package/dist/lib/node/chunk-JKPNBFU2.cjs +77 -0
  46. package/dist/lib/node/chunk-JKPNBFU2.cjs.map +7 -0
  47. package/dist/lib/node/compiler-UIBLKJKG.cjs +104 -0
  48. package/dist/lib/node/compiler-UIBLKJKG.cjs.map +7 -0
  49. package/dist/lib/node/index.cjs +108 -347
  50. package/dist/lib/node/index.cjs.map +4 -4
  51. package/dist/lib/node/intent-resolver-WFLQNAID.cjs +59 -0
  52. package/dist/lib/node/intent-resolver-WFLQNAID.cjs.map +7 -0
  53. package/dist/lib/node/meta.json +1 -1
  54. package/dist/lib/node/react-surface-OIQJFA7P.cjs +84 -0
  55. package/dist/lib/node/react-surface-OIQJFA7P.cjs.map +7 -0
  56. package/dist/lib/node/settings-SZFSMSKM.cjs +38 -0
  57. package/dist/lib/node/settings-SZFSMSKM.cjs.map +7 -0
  58. package/dist/lib/node/{types/index.cjs → types.cjs} +6 -8
  59. package/dist/lib/node/types.cjs.map +7 -0
  60. package/dist/lib/node-esm/{AutomationPanel-ETQEDY5I.mjs → AutomationPanel-W6SKG35R.mjs} +4 -11
  61. package/dist/lib/node-esm/AutomationPanel-W6SKG35R.mjs.map +7 -0
  62. package/dist/lib/node-esm/ScriptContainer-QVFTCAML.mjs +714 -0
  63. package/dist/lib/node-esm/ScriptContainer-QVFTCAML.mjs.map +7 -0
  64. package/dist/lib/node-esm/artifact-7H4HGX5W.mjs +245 -0
  65. package/dist/lib/node-esm/artifact-7H4HGX5W.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-5CEKSMA5.mjs +71 -0
  67. package/dist/lib/node-esm/chunk-5CEKSMA5.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-OFYGBUNI.mjs → chunk-CGF7EOGD.mjs} +2 -2
  69. package/dist/lib/node-esm/chunk-CP5LXTK5.mjs +16 -0
  70. package/dist/lib/node-esm/chunk-CP5LXTK5.mjs.map +7 -0
  71. package/dist/lib/node-esm/{chunk-SLTZMY34.mjs → chunk-P2V2Y5LV.mjs} +7 -4
  72. package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-UNQFIERE.mjs +41 -0
  74. package/dist/lib/node-esm/chunk-UNQFIERE.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-WCAUDRF4.mjs +237 -0
  76. package/dist/lib/node-esm/chunk-WCAUDRF4.mjs.map +7 -0
  77. package/dist/lib/node-esm/compiler-XTXFGZJM.mjs +83 -0
  78. package/dist/lib/node-esm/compiler-XTXFGZJM.mjs.map +7 -0
  79. package/dist/lib/node-esm/index.mjs +111 -359
  80. package/dist/lib/node-esm/index.mjs.map +4 -4
  81. package/dist/lib/node-esm/intent-resolver-CYT6IYYH.mjs +46 -0
  82. package/dist/lib/node-esm/intent-resolver-CYT6IYYH.mjs.map +7 -0
  83. package/dist/lib/node-esm/meta.json +1 -1
  84. package/dist/lib/node-esm/react-surface-N67GNKC2.mjs +66 -0
  85. package/dist/lib/node-esm/react-surface-N67GNKC2.mjs.map +7 -0
  86. package/dist/lib/node-esm/settings-GR4O2WHZ.mjs +25 -0
  87. package/dist/lib/node-esm/settings-GR4O2WHZ.mjs.map +7 -0
  88. package/dist/lib/node-esm/types.mjs +11 -0
  89. package/dist/types/src/ScriptPlugin.d.ts +1 -3
  90. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/artifact.d.ts +11 -0
  92. package/dist/types/src/capabilities/artifact.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/capabilities.d.ts +5 -0
  94. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/compiler.d.ts +4 -0
  96. package/dist/types/src/capabilities/compiler.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/index.d.ts +7 -0
  98. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  100. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  102. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/settings.d.ts +4 -0
  104. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  105. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +2 -2
  106. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  107. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +2 -2
  108. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  109. package/dist/types/src/components/ScriptContainer.d.ts +10 -2
  110. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  111. package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts.map +1 -1
  112. package/dist/types/src/components/ScriptSettingsPanel.d.ts +1 -1
  113. package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -1
  114. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +11 -0
  115. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -0
  116. package/dist/types/src/components/{Toolbar/Toolbar.stories.d.ts → ScriptToolbar/ScriptToolbar.stories.d.ts} +1 -1
  117. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -0
  118. package/dist/types/src/components/ScriptToolbar/index.d.ts +2 -0
  119. package/dist/types/src/components/ScriptToolbar/index.d.ts.map +1 -0
  120. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +4 -2
  121. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  122. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  123. package/dist/types/src/components/index.d.ts +1 -1
  124. package/dist/types/src/components/index.d.ts.map +1 -1
  125. package/dist/types/src/hooks/deploy.d.ts +48 -0
  126. package/dist/types/src/hooks/deploy.d.ts.map +1 -0
  127. package/dist/types/src/hooks/format.d.ts +25 -0
  128. package/dist/types/src/hooks/format.d.ts.map +1 -0
  129. package/dist/types/src/hooks/index.d.ts +7 -0
  130. package/dist/types/src/hooks/index.d.ts.map +1 -0
  131. package/dist/types/src/hooks/template.d.ts +31 -0
  132. package/dist/types/src/hooks/template.d.ts.map +1 -0
  133. package/dist/types/src/hooks/useToolbarAction.d.ts +14 -0
  134. package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -0
  135. package/dist/types/src/hooks/useToolbarState.d.ts +10 -0
  136. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -0
  137. package/dist/types/src/hooks/view.d.ts +33 -0
  138. package/dist/types/src/hooks/view.d.ts.map +1 -0
  139. package/dist/types/src/index.d.ts +2 -5
  140. package/dist/types/src/index.d.ts.map +1 -1
  141. package/dist/types/src/meta.d.ts +2 -2
  142. package/dist/types/src/meta.d.ts.map +1 -1
  143. package/dist/types/src/templates/discord.d.ts +3 -0
  144. package/dist/types/src/templates/discord.d.ts.map +1 -0
  145. package/dist/types/src/templates/echo.d.ts.map +1 -1
  146. package/dist/types/src/templates/email.d.ts +2 -1
  147. package/dist/types/src/templates/email.d.ts.map +1 -1
  148. package/dist/types/src/templates/forex-effect.d.ts +6 -0
  149. package/dist/types/src/templates/forex-effect.d.ts.map +1 -0
  150. package/dist/types/src/templates/forex.d.ts +1 -1
  151. package/dist/types/src/templates/forex.d.ts.map +1 -1
  152. package/dist/types/src/{templates.d.ts → templates/index.d.ts} +1 -1
  153. package/dist/types/src/templates/index.d.ts.map +1 -0
  154. package/dist/types/src/translations.d.ts +54 -0
  155. package/dist/types/src/translations.d.ts.map +1 -1
  156. package/dist/types/src/types.d.ts +30 -0
  157. package/dist/types/src/types.d.ts.map +1 -0
  158. package/dist/types/tsconfig.tsbuildinfo +1 -0
  159. package/package.json +45 -55
  160. package/src/ScriptPlugin.tsx +62 -145
  161. package/src/capabilities/artifact.ts +219 -0
  162. package/src/capabilities/capabilities.ts +12 -0
  163. package/src/capabilities/compiler.ts +33 -0
  164. package/src/capabilities/index.ts +13 -0
  165. package/src/capabilities/intent-resolver.ts +46 -0
  166. package/src/capabilities/react-surface.tsx +54 -0
  167. package/src/capabilities/settings.ts +14 -0
  168. package/src/compiler/compiler.browser.test.ts +1 -1
  169. package/src/components/AutomationPanel/AutomationPanel.tsx +2 -4
  170. package/src/components/FrameContainer/FrameContainer.tsx +5 -4
  171. package/src/components/ScriptContainer.tsx +69 -9
  172. package/src/components/ScriptSettings/ScriptSettings.tsx +28 -4
  173. package/src/components/ScriptSettingsPanel.tsx +140 -53
  174. package/src/components/{Toolbar/Toolbar.stories.tsx → ScriptToolbar/ScriptToolbar.stories.tsx} +2 -2
  175. package/src/components/ScriptToolbar/ScriptToolbar.tsx +53 -0
  176. package/src/{bundler → components/ScriptToolbar}/index.ts +1 -1
  177. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +2 -0
  178. package/src/components/TypescriptEditor/TypescriptEditor.tsx +75 -10
  179. package/src/hooks/deploy.ts +169 -0
  180. package/src/hooks/format.ts +47 -0
  181. package/src/hooks/index.ts +11 -0
  182. package/src/hooks/template.ts +64 -0
  183. package/src/hooks/useToolbarAction.ts +54 -0
  184. package/src/hooks/useToolbarState.ts +16 -0
  185. package/src/hooks/view.ts +52 -0
  186. package/src/index.ts +2 -7
  187. package/src/meta.ts +4 -2
  188. package/src/templates/discord.ts +88 -0
  189. package/src/templates/echo.ts +5 -1
  190. package/src/templates/email.ts +26 -23
  191. package/src/templates/forex-effect.ts +44 -0
  192. package/src/templates/forex.ts +21 -13
  193. package/src/{templates.ts → templates/index.ts} +20 -5
  194. package/src/translations.ts +20 -1
  195. package/src/types.ts +39 -0
  196. package/dist/lib/browser/AutomationPanel-PMTZROAZ.mjs.map +0 -7
  197. package/dist/lib/browser/ScriptContainer-RYZFYCNK.mjs +0 -425
  198. package/dist/lib/browser/ScriptContainer-RYZFYCNK.mjs.map +0 -7
  199. package/dist/lib/browser/chunk-4UTRJLQ3.mjs +0 -286
  200. package/dist/lib/browser/chunk-4UTRJLQ3.mjs.map +0 -7
  201. package/dist/lib/browser/chunk-C7VBULMK.mjs +0 -18
  202. package/dist/lib/browser/chunk-C7VBULMK.mjs.map +0 -7
  203. package/dist/lib/browser/chunk-QFZUFT5G.mjs +0 -48
  204. package/dist/lib/browser/chunk-QFZUFT5G.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-U3OP64V4.mjs +0 -123
  206. package/dist/lib/browser/chunk-U3OP64V4.mjs.map +0 -7
  207. package/dist/lib/browser/edge/index.mjs +0 -19
  208. package/dist/lib/browser/meta.mjs +0 -9
  209. package/dist/lib/browser/types/index.mjs +0 -12
  210. package/dist/lib/browser/types/index.mjs.map +0 -7
  211. package/dist/lib/node/AutomationPanel-AAGQREH7.cjs.map +0 -7
  212. package/dist/lib/node/ScriptContainer-FZ44UIRC.cjs +0 -427
  213. package/dist/lib/node/ScriptContainer-FZ44UIRC.cjs.map +0 -7
  214. package/dist/lib/node/chunk-6LYX73ZT.cjs.map +0 -7
  215. package/dist/lib/node/chunk-CS25QNKZ.cjs +0 -151
  216. package/dist/lib/node/chunk-CS25QNKZ.cjs.map +0 -7
  217. package/dist/lib/node/chunk-DQYAU2CJ.cjs +0 -67
  218. package/dist/lib/node/chunk-DQYAU2CJ.cjs.map +0 -7
  219. package/dist/lib/node/chunk-WPP65EYS.cjs +0 -298
  220. package/dist/lib/node/chunk-WPP65EYS.cjs.map +0 -7
  221. package/dist/lib/node/edge/index.cjs +0 -41
  222. package/dist/lib/node/edge/index.cjs.map +0 -7
  223. package/dist/lib/node/meta.cjs.map +0 -7
  224. package/dist/lib/node/types/index.cjs.map +0 -7
  225. package/dist/lib/node-esm/AutomationPanel-ETQEDY5I.mjs.map +0 -7
  226. package/dist/lib/node-esm/ScriptContainer-3PKDW34A.mjs +0 -426
  227. package/dist/lib/node-esm/ScriptContainer-3PKDW34A.mjs.map +0 -7
  228. package/dist/lib/node-esm/chunk-36DLLQ6E.mjs +0 -125
  229. package/dist/lib/node-esm/chunk-36DLLQ6E.mjs.map +0 -7
  230. package/dist/lib/node-esm/chunk-4SRPREUK.mjs +0 -288
  231. package/dist/lib/node-esm/chunk-4SRPREUK.mjs.map +0 -7
  232. package/dist/lib/node-esm/chunk-GMVPKT6A.mjs +0 -49
  233. package/dist/lib/node-esm/chunk-GMVPKT6A.mjs.map +0 -7
  234. package/dist/lib/node-esm/chunk-SLTZMY34.mjs.map +0 -7
  235. package/dist/lib/node-esm/edge/index.mjs +0 -20
  236. package/dist/lib/node-esm/edge/index.mjs.map +0 -7
  237. package/dist/lib/node-esm/meta.mjs +0 -10
  238. package/dist/lib/node-esm/meta.mjs.map +0 -7
  239. package/dist/lib/node-esm/types/index.mjs +0 -13
  240. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  241. package/dist/types/src/bundler/bundler.d.ts +0 -39
  242. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  243. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  244. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  245. package/dist/types/src/bundler/index.d.ts +0 -2
  246. package/dist/types/src/bundler/index.d.ts.map +0 -1
  247. package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts +0 -12
  248. package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts.map +0 -1
  249. package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts +0 -6
  250. package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts.map +0 -1
  251. package/dist/types/src/components/ScriptBlock/index.d.ts +0 -2
  252. package/dist/types/src/components/ScriptBlock/index.d.ts.map +0 -1
  253. package/dist/types/src/components/ScriptEditor.d.ts +0 -9
  254. package/dist/types/src/components/ScriptEditor.d.ts.map +0 -1
  255. package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -23
  256. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
  257. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +0 -1
  258. package/dist/types/src/components/Toolbar/index.d.ts +0 -2
  259. package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
  260. package/dist/types/src/edge/functions.d.ts +0 -25
  261. package/dist/types/src/edge/functions.d.ts.map +0 -1
  262. package/dist/types/src/edge/index.d.ts +0 -2
  263. package/dist/types/src/edge/index.d.ts.map +0 -1
  264. package/dist/types/src/templates.d.ts.map +0 -1
  265. package/dist/types/src/types/index.d.ts +0 -3
  266. package/dist/types/src/types/index.d.ts.map +0 -1
  267. package/dist/types/src/types/schema.d.ts +0 -71
  268. package/dist/types/src/types/schema.d.ts.map +0 -1
  269. package/dist/types/src/types/types.d.ts +0 -8
  270. package/dist/types/src/types/types.d.ts.map +0 -1
  271. package/src/bundler/bundler.test.ts +0 -54
  272. package/src/bundler/bundler.ts +0 -250
  273. package/src/components/ScriptBlock/ScriptBlock.stories.tsx +0 -52
  274. package/src/components/ScriptBlock/ScriptBlock.tsx +0 -102
  275. package/src/components/ScriptBlock/index.ts +0 -5
  276. package/src/components/ScriptEditor.tsx +0 -191
  277. package/src/components/Toolbar/Toolbar.tsx +0 -177
  278. package/src/components/Toolbar/index.ts +0 -5
  279. package/src/edge/functions.ts +0 -116
  280. package/src/edge/index.ts +0 -7
  281. package/src/types/index.ts +0 -6
  282. package/src/types/schema.ts +0 -44
  283. package/src/types/types.ts +0 -29
  284. /package/dist/lib/browser/{chunk-K7KY6YMG.mjs.map → chunk-45LXDWNF.mjs.map} +0 -0
  285. /package/dist/lib/browser/{edge/index.mjs.map → types.mjs.map} +0 -0
  286. /package/dist/lib/node/{chunk-4INUJLXL.cjs.map → chunk-IID7WUQS.cjs.map} +0 -0
  287. /package/dist/lib/node-esm/{chunk-OFYGBUNI.mjs.map → chunk-CGF7EOGD.mjs.map} +0 -0
  288. /package/dist/lib/{browser/meta.mjs.map → node-esm/types.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-script",
3
- "version": "0.7.4",
3
+ "version": "0.7.5-labs.401163d",
4
4
  "description": "Braneframe notebook plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -8,21 +8,11 @@
8
8
  "author": "DXOS.org",
9
9
  "sideEffects": true,
10
10
  "exports": {
11
- "./edge": {
12
- "types": "./dist/types/src/edge/index.d.ts",
13
- "browser": "./dist/lib/browser/edge/index.mjs",
14
- "node": "./dist/lib/node-esm/edge/index.mjs"
15
- },
16
11
  ".": {
17
12
  "types": "./dist/types/src/index.d.ts",
18
13
  "browser": "./dist/lib/browser/index.mjs",
19
14
  "node": "./dist/lib/node-esm/index.mjs"
20
15
  },
21
- "./meta": {
22
- "types": "./dist/types/src/meta.d.ts",
23
- "browser": "./dist/lib/browser/meta.mjs",
24
- "node": "./dist/lib/node-esm/meta.mjs"
25
- },
26
16
  "./types": {
27
17
  "types": "./dist/types/src/types/index.d.ts",
28
18
  "browser": "./dist/lib/browser/types/index.mjs",
@@ -32,12 +22,6 @@
32
22
  "types": "dist/types/src/index.d.ts",
33
23
  "typesVersions": {
34
24
  "*": {
35
- "edge": [
36
- "dist/types/src/edge/index.d.ts"
37
- ],
38
- "meta": [
39
- "dist/types/src/meta.d.ts"
40
- ],
41
25
  "types": [
42
26
  "dist/types/src/types/index.d.ts"
43
27
  ]
@@ -57,44 +41,52 @@
57
41
  "@codemirror/view": "^6.34.1",
58
42
  "@effect/schema": "^0.75.5",
59
43
  "@lezer/common": "^1.2.2",
44
+ "@lezer/highlight": "^1.2.1",
45
+ "@octokit/core": "^4.0.4",
60
46
  "@preact/signals-core": "^1.6.0",
61
47
  "@typescript/vfs": "^1.6.0",
48
+ "@valtown/codemirror-continue": "^2.3.1",
62
49
  "@valtown/codemirror-ts": "^2.2.0",
63
50
  "codemirror": "^6.0.1",
64
51
  "esbuild-wasm": "^0.16.14",
65
- "iso-did": "^1.6.0",
66
52
  "lodash.get": "^4.4.2",
67
53
  "prettier": "^3.2.4",
68
54
  "react-syntax-highlighter": "^15.5.0",
69
- "typescript": "^5.6.2",
70
- "@dxos/app-framework": "0.7.4",
71
- "@dxos/async": "0.7.4",
72
- "@dxos/client-protocol": "0.7.4",
73
- "@dxos/crypto": "0.7.4",
74
- "@dxos/client": "0.7.4",
75
- "@dxos/debug": "0.7.4",
76
- "@dxos/echo-schema": "0.7.4",
77
- "@dxos/invariant": "0.7.4",
78
- "@dxos/keys": "0.7.4",
79
- "@dxos/edge-client": "0.7.4",
80
- "@dxos/live-object": "0.7.4",
81
- "@dxos/log": "0.7.4",
82
- "@dxos/plugin-client": "0.7.4",
83
- "@dxos/plugin-graph": "0.7.4",
84
- "@dxos/plugin-explorer": "0.7.4",
85
- "@dxos/plugin-space": "0.7.4",
86
- "@dxos/plugin-markdown": "0.7.4",
87
- "@dxos/plugin-stack": "0.7.4",
88
- "@dxos/react-client": "0.7.4",
89
- "@dxos/protocols": "0.7.4",
90
- "@dxos/plugin-theme": "0.7.4",
91
- "@dxos/react-ui-attention": "0.7.4",
92
- "@dxos/react-ui-form": "0.7.4",
93
- "@dxos/react-ui-editor": "0.7.4",
94
- "@dxos/react-ui-syntax-highlighter": "0.7.4",
95
- "@dxos/rpc": "0.7.4",
96
- "@dxos/rpc-tunnel": "0.7.4",
97
- "@dxos/util": "0.7.4"
55
+ "typescript": "^5.7.2",
56
+ "@dxos/app-framework": "0.7.5-labs.401163d",
57
+ "@dxos/artifact": "0.7.5-labs.401163d",
58
+ "@dxos/async": "0.7.5-labs.401163d",
59
+ "@dxos/assistant": "0.7.5-labs.401163d",
60
+ "@dxos/client": "0.7.5-labs.401163d",
61
+ "@dxos/compute": "0.7.5-labs.401163d",
62
+ "@dxos/client-protocol": "0.7.5-labs.401163d",
63
+ "@dxos/debug": "0.7.5-labs.401163d",
64
+ "@dxos/echo-schema": "0.7.5-labs.401163d",
65
+ "@dxos/functions": "0.7.5-labs.401163d",
66
+ "@dxos/invariant": "0.7.5-labs.401163d",
67
+ "@dxos/keys": "0.7.5-labs.401163d",
68
+ "@dxos/live-object": "0.7.5-labs.401163d",
69
+ "@dxos/local-storage": "0.7.5-labs.401163d",
70
+ "@dxos/log": "0.7.5-labs.401163d",
71
+ "@dxos/plugin-graph": "0.7.5-labs.401163d",
72
+ "@dxos/plugin-client": "0.7.5-labs.401163d",
73
+ "@dxos/plugin-explorer": "0.7.5-labs.401163d",
74
+ "@dxos/plugin-markdown": "0.7.5-labs.401163d",
75
+ "@dxos/plugin-space": "0.7.5-labs.401163d",
76
+ "@dxos/plugin-theme": "0.7.5-labs.401163d",
77
+ "@dxos/protocols": "0.7.5-labs.401163d",
78
+ "@dxos/plugin-stack": "0.7.5-labs.401163d",
79
+ "@dxos/react-client": "0.7.5-labs.401163d",
80
+ "@dxos/react-ui-attention": "0.7.5-labs.401163d",
81
+ "@dxos/react-ui-editor": "0.7.5-labs.401163d",
82
+ "@dxos/react-ui-form": "0.7.5-labs.401163d",
83
+ "@dxos/react-ui-stack": "0.7.5-labs.401163d",
84
+ "@dxos/react-ui-menu": "0.7.5-labs.401163d",
85
+ "@dxos/rpc": "0.7.5-labs.401163d",
86
+ "@dxos/react-ui-syntax-highlighter": "0.7.5-labs.401163d",
87
+ "@dxos/rpc-tunnel": "0.7.5-labs.401163d",
88
+ "@dxos/schema": "0.7.5-labs.401163d",
89
+ "@dxos/util": "0.7.5-labs.401163d"
98
90
  },
99
91
  "devDependencies": {
100
92
  "@phosphor-icons/react": "^2.1.5",
@@ -104,19 +96,17 @@
104
96
  "react": "~18.2.0",
105
97
  "react-dom": "~18.2.0",
106
98
  "vite": "5.4.7",
107
- "@dxos/random": "0.7.4",
108
- "@dxos/react-ui-mosaic": "0.7.4",
109
- "@dxos/react-ui-theme": "0.7.4",
110
- "@dxos/react-ui": "0.7.4",
111
- "@dxos/storybook-utils": "0.7.4"
99
+ "@dxos/random": "0.7.5-labs.401163d",
100
+ "@dxos/react-ui": "0.7.5-labs.401163d",
101
+ "@dxos/storybook-utils": "0.7.5-labs.401163d",
102
+ "@dxos/react-ui-theme": "0.7.5-labs.401163d"
112
103
  },
113
104
  "peerDependencies": {
114
105
  "@phosphor-icons/react": "^2.1.5",
115
106
  "react": "~18.2.0",
116
107
  "react-dom": "~18.2.0",
117
- "@dxos/react-ui-mosaic": "0.7.4",
118
- "@dxos/react-ui-theme": "0.7.4",
119
- "@dxos/react-ui": "0.7.4"
108
+ "@dxos/react-ui": "0.7.5-labs.401163d",
109
+ "@dxos/react-ui-theme": "0.7.5-labs.401163d"
120
110
  },
121
111
  "publishConfig": {
122
112
  "access": "public"
@@ -3,156 +3,73 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
7
- import React from 'react';
8
6
 
9
- import { NavigationAction, parseIntentPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';
10
- import { create } from '@dxos/live-object';
11
- import { parseClientPlugin } from '@dxos/plugin-client';
12
- import { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';
13
- import { TextType } from '@dxos/plugin-markdown/types';
14
- import { SpaceAction } from '@dxos/plugin-space';
15
- import { loadObjectReferences } from '@dxos/react-client/echo';
7
+ import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
8
+ import { type Space } from '@dxos/client/echo';
9
+ import { FunctionType, ScriptType } from '@dxos/functions';
10
+ import { RefArray } from '@dxos/live-object';
11
+ import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
16
12
 
17
- import { initializeBundler } from './bundler';
18
- import { Compiler } from './compiler';
19
- import { AutomationPanel, ScriptContainer, ScriptSettings, ScriptSettingsPanel } from './components';
20
- import meta, { SCRIPT_PLUGIN } from './meta';
21
- import { templates } from './templates';
13
+ import { Artifact, Compiler, IntentResolver, ReactSurface, ScriptSettings } from './capabilities';
14
+ import { meta, SCRIPT_PLUGIN } from './meta';
22
15
  import translations from './translations';
23
- import { FunctionType, ScriptAction, type ScriptPluginProvides, ScriptType } from './types';
16
+ import { ScriptAction } from './types';
24
17
 
25
- export const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {
26
- const compiler = new Compiler();
27
-
28
- return {
29
- meta,
30
- initialize: async () => {
31
- await compiler.initialize();
32
- // TODO(wittjosiah): Fetch types for https modules.
33
- compiler.setFile('/src/typings.d.ts', "declare module 'https://*';");
34
- // TODO(wittjosiah): Proper function handler types.
35
- // TODO(wittjosiah): Remove.
36
- compiler.setFile(
37
- '/src/runtime.ts',
38
- `
39
- export const Filter: any = {};
40
- export type FunctionHandler = ({ event, context }: { event: any; context: any }) => Promise<Response>;
41
- export const functionHandler = (handler: FunctionHandler) => handler;
42
- `,
43
- );
44
- await initializeBundler({ wasmUrl });
45
- },
46
- provides: {
47
- settings: {},
48
- metadata: {
49
- records: {
50
- [ScriptType.typename]: {
51
- createObject: ScriptAction.CREATE,
18
+ export const ScriptPlugin = () =>
19
+ definePlugin(meta, [
20
+ defineModule({
21
+ id: `${meta.id}/module/settings`,
22
+ activatesOn: Events.SetupSettings,
23
+ activate: ScriptSettings,
24
+ }),
25
+ defineModule({
26
+ id: `${meta.id}/module/compiler`,
27
+ activatesOn: Events.Startup,
28
+ activate: Compiler,
29
+ }),
30
+ defineModule({
31
+ id: `${meta.id}/module/translations`,
32
+ activatesOn: Events.SetupTranslations,
33
+ activate: () => contributes(Capabilities.Translations, translations),
34
+ }),
35
+ defineModule({
36
+ id: `${meta.id}/module/metadata`,
37
+ activatesOn: Events.SetupMetadata,
38
+ activate: () =>
39
+ contributes(Capabilities.Metadata, {
40
+ id: ScriptType.typename,
41
+ metadata: {
42
+ creationSchema: ScriptAction.CreateScriptSchema,
43
+ createObject: (props: ScriptAction.CreateScriptProps, { space }: { space: Space }) =>
44
+ createIntent(ScriptAction.Create, { ...props, space }),
52
45
  placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
53
46
  icon: 'ph--code--regular',
54
47
  // TODO(wittjosiah): Move out of metadata.
55
- loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),
48
+ loadReferences: async (script: ScriptType) => await RefArray.loadAll([script.source]),
56
49
  },
57
- },
58
- },
59
- translations,
60
- echo: {
61
- schema: [ScriptType],
62
- system: [FunctionType],
63
- },
64
- graph: {
65
- builder: (plugins) => {
66
- const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
67
- const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;
68
- if (!client || !dispatch) {
69
- return [];
70
- }
71
-
72
- return createExtension({
73
- id: ScriptAction.CREATE,
74
- filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),
75
- actions: ({ node }) => {
76
- const id = node.id.split('/').at(-1);
77
- const [spaceId, objectId] = id?.split(':') ?? [];
78
- const space = client.spaces.get().find((space) => space.id === spaceId);
79
- const object = objectId && space?.db.getObjectById(objectId);
80
- const target = objectId ? object : space;
81
- if (!target) {
82
- return;
83
- }
84
-
85
- return [
86
- {
87
- id: `${SCRIPT_PLUGIN}/create/${node.id}`,
88
- data: async () => {
89
- await dispatch([
90
- { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },
91
- { action: SpaceAction.ADD_OBJECT, data: { target } },
92
- { action: NavigationAction.OPEN },
93
- ]);
94
- },
95
- properties: {
96
- label: ['create object label', { ns: SCRIPT_PLUGIN }],
97
- icon: 'ph--code--regular',
98
- testId: 'scriptPlugin.createObject',
99
- },
100
- },
101
- ];
102
- },
103
- });
104
- },
105
- },
106
- surface: {
107
- component: ({ data, role }) => {
108
- switch (role) {
109
- case 'settings': {
110
- return data.plugin === meta.id ? <ScriptSettings settings={{}} /> : null;
111
- }
112
-
113
- case 'article': {
114
- if (data.object instanceof ScriptType) {
115
- return <ScriptContainer script={data.object} env={compiler.environment} />;
116
- }
117
- break;
118
- }
119
-
120
- case 'complementary--automation': {
121
- if (data.subject instanceof ScriptType) {
122
- return {
123
- node: <AutomationPanel subject={data.subject as any} />,
124
- disposition: 'hoist',
125
- };
126
- }
127
- break;
128
- }
129
-
130
- case 'complementary--settings': {
131
- if (data.subject instanceof ScriptType) {
132
- return <ScriptSettingsPanel script={data.subject} />;
133
- }
134
- break;
135
- }
136
- }
137
-
138
- return null;
139
- },
140
- },
141
- intent: {
142
- resolver: (intent) => {
143
- switch (intent.action) {
144
- case ScriptAction.CREATE: {
145
- return {
146
- data: create(ScriptType, {
147
- source: create(TextType, {
148
- content: templates[0].source,
149
- }),
150
- }),
151
- };
152
- }
153
- }
154
- },
155
- },
156
- },
157
- };
158
- };
50
+ }),
51
+ }),
52
+ defineModule({
53
+ id: `${meta.id}/module/schema`,
54
+ activatesOn: ClientEvents.SetupSchema,
55
+ activate: () => [
56
+ contributes(ClientCapabilities.SystemSchema, [FunctionType]),
57
+ contributes(ClientCapabilities.Schema, [ScriptType]),
58
+ ],
59
+ }),
60
+ defineModule({
61
+ id: `${meta.id}/module/react-surface`,
62
+ activatesOn: Events.SetupSurfaces,
63
+ activate: ReactSurface,
64
+ }),
65
+ defineModule({
66
+ id: `${meta.id}/module/intent-resolver`,
67
+ activatesOn: Events.SetupIntents,
68
+ activate: IntentResolver,
69
+ }),
70
+ defineModule({
71
+ id: `${meta.id}/module/artifact`,
72
+ activatesOn: Events.Startup,
73
+ activate: Artifact,
74
+ }),
75
+ ]);
@@ -0,0 +1,219 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
6
+ import { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';
7
+ import { createArtifactElement } from '@dxos/assistant';
8
+ import { ObjectId, S } from '@dxos/echo-schema';
9
+ import { ScriptType } from '@dxos/functions';
10
+ import { invariant } from '@dxos/invariant';
11
+ import { SpaceAction } from '@dxos/plugin-space/types';
12
+ import { create, makeRef, type Space } from '@dxos/react-client/echo';
13
+ import { TextType } from '@dxos/schema';
14
+
15
+ // TODO(burdon): Factor out.
16
+ declare global {
17
+ interface ToolContextExtensions {
18
+ space?: Space;
19
+ dispatch?: PromiseIntentDispatcher;
20
+ }
21
+ }
22
+
23
+ export default () => {
24
+ const definition = defineArtifact({
25
+ id: 'plugin-script',
26
+ // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
27
+ // we should offload the work of synthesizing the code to a separate model.
28
+ // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
29
+ instructions: `
30
+ If the user explicitly requests you to write a script, you can create one.
31
+ If the user requests you to change one of the existing script, you can update it.
32
+ Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.
33
+ Each script must follow as strict shape for the definition but the body can contain any valid executable code.
34
+ Scripts are written in JavaScript or TypeScript.
35
+ Each script must define an input schema and output schema.
36
+ Each script must have its own detailed description.
37
+
38
+ Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.
39
+
40
+ Description:
41
+ The description is a detailed description of the script.
42
+ It is used to describe the script's purpose, input, and output.
43
+ The description is used to generate the script's documentation.
44
+ The description is also goes into the script metadata.
45
+ The description is used by AI to understand the script and its purpose.
46
+ The description must provide cases on when the script should be used.
47
+
48
+ Schema:
49
+ The schema is defined using a schema-DSL library called Effect Schema.
50
+ The input schema describes the arguments that the script accepts.
51
+ The output schema describes the result that the script produces.
52
+ The schema is used to validate the script's input and output.
53
+ The schema is also goes into the script metadata.
54
+ The properties in the schema must have valid descriptions.
55
+ The input and output schemas must both be a struct of fields.
56
+
57
+ Restricts:
58
+ The scripts can only import code from "dxos:functions" module. No other modules are allowed.
59
+ Some web APIs are available - like fetch.
60
+
61
+ Reasoning:
62
+ Before writing a script, synthesize the following information:
63
+ - Description
64
+ - What APIs will be used.
65
+ - Detailed input schema
66
+ - Detailed output schema
67
+
68
+ <apis>
69
+ export function defineFunction(params: {
70
+ description: string,
71
+ inputSchema: S.Schema,
72
+ outputSchema: S.Schema,
73
+ handler: (params: { event: { data: TInput } }) => Promise<TOutput>
74
+ }): FunctionDefinition
75
+ /**
76
+ * Effect Schema
77
+ */
78
+ export const S;
79
+
80
+ // Examples:
81
+
82
+ S.String
83
+ S.Number
84
+ S.Boolean
85
+ S.Struct({
86
+ from: S.String.annotations({ description: 'The source currency' }),
87
+ to: S.String.annotations({ description: 'The target currency' }),
88
+ })
89
+ S.Array(S.String)
90
+ S.Union(S.String, S.Number)
91
+ S.optional(S.String)
92
+ S.String.annotations({ description: 'The source currency' })
93
+ </apis>
94
+
95
+ <handler_function>
96
+ Async function that takes the argument in the form of:
97
+
98
+ type HandlerFunctionParam = {
99
+ event: {
100
+ data: T // The input schema
101
+ },
102
+ }
103
+
104
+ The function must return the result that matches the output schema.
105
+ </handler_function>
106
+
107
+ <example>
108
+ import { defineFunction, S } from 'dxos:functions';
109
+
110
+ export default defineFunction({
111
+ description: 'Returns the exchange rate between two currencies.',
112
+
113
+ inputSchema: S.Struct({
114
+ from: S.String.annotations({ description: 'The source currency' }),
115
+ to: S.String.annotations({ description: 'The target currency' }),
116
+ }),
117
+
118
+ outputSchema: S.Struct({
119
+ rate: S.String.annotations({ description: 'The exchange rate' }),
120
+ }),
121
+
122
+ handler: async ({
123
+ event: {
124
+ data: { from, to },
125
+ },
126
+ }: any) => {
127
+ const res = await fetch(\`https://free.ratesdb.com/v1/rates?from=\${from}&to=\${to}\`);
128
+ const {
129
+ data: { rates },
130
+ } = await res.json();
131
+
132
+ return { rate: rates[to].toString() };
133
+ },
134
+ });
135
+ </example>
136
+ `,
137
+ schema: ScriptType,
138
+ tools: [
139
+ defineTool({
140
+ name: 'script_new',
141
+ description: 'Create a new script. Returns the artifact definition for the script',
142
+ schema: S.Struct({
143
+ name: S.String.annotations({ description: 'The name of the script' }),
144
+ code: S.String.annotations({
145
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
146
+ }),
147
+ }),
148
+ execute: async ({ name, code }, { extensions }) => {
149
+ invariant(extensions?.space, 'No space');
150
+ invariant(extensions?.dispatch, 'No intent dispatcher');
151
+ const script = create(ScriptType, {
152
+ name,
153
+ source: makeRef(
154
+ create(TextType, {
155
+ content: code,
156
+ }),
157
+ ),
158
+ });
159
+ extensions.space.db.add(script);
160
+ await extensions.space.db.flush();
161
+
162
+ const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });
163
+ const { data, error } = await extensions.dispatch(intent);
164
+ if (!data || error) {
165
+ return ToolResult.Error(error?.message ?? 'Failed to create chess game');
166
+ }
167
+
168
+ return ToolResult.Success(createArtifactElement(script.id));
169
+ },
170
+ }),
171
+ defineTool({
172
+ name: 'script_inspect',
173
+ description: 'Inspect a script. Returns the artifact definition for the script',
174
+ schema: S.Struct({
175
+ id: ObjectId,
176
+ }),
177
+ execute: async ({ id }, { extensions }) => {
178
+ invariant(extensions?.space, 'No space');
179
+
180
+ const script = (await extensions.space.db.query({ id }).first()) as ScriptType;
181
+ const { content } = await script.source.load();
182
+
183
+ return ToolResult.Success({
184
+ name: script.name,
185
+ code: content,
186
+ });
187
+ },
188
+ }),
189
+ defineTool({
190
+ name: 'script_update',
191
+ description: 'Update a script. Returns the artifact definition for the script',
192
+ schema: S.Struct({
193
+ id: ObjectId,
194
+ code: S.String.annotations({
195
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
196
+ }),
197
+ }),
198
+ execute: async ({ id, code }, { extensions }) => {
199
+ invariant(extensions?.space, 'No space');
200
+
201
+ const script = (await extensions.space.db.query({ id }).first()) as ScriptType;
202
+ const source = await script.source.load();
203
+ if (!source) {
204
+ return ToolResult.Error('Script not found');
205
+ }
206
+
207
+ source.content = code;
208
+ await extensions.space?.db.flush();
209
+
210
+ return ToolResult.Success({
211
+ name: script.name,
212
+ });
213
+ },
214
+ }),
215
+ ],
216
+ });
217
+
218
+ return contributes(Capabilities.ArtifactDefinition, definition);
219
+ };
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { defineCapability } from '@dxos/app-framework';
6
+
7
+ import { type Compiler } from '../compiler';
8
+ import { SCRIPT_PLUGIN } from '../meta';
9
+
10
+ export namespace ScriptCapabilities {
11
+ export const Compiler = defineCapability<Compiler>(`${SCRIPT_PLUGIN}/capability/compiler`);
12
+ }
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @ts-ignore
6
+ import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
7
+
8
+ import { contributes } from '@dxos/app-framework';
9
+ import { initializeBundler } from '@dxos/functions/bundler';
10
+
11
+ import { ScriptCapabilities } from './capabilities';
12
+ import { Compiler } from '../compiler';
13
+
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
+ `,
29
+ );
30
+ await initializeBundler({ wasmUrl });
31
+
32
+ return contributes(ScriptCapabilities.Compiler, compiler);
33
+ };
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { lazy } from '@dxos/app-framework';
6
+
7
+ export const Compiler = lazy(() => import('./compiler'));
8
+ export const IntentResolver = lazy(() => import('./intent-resolver'));
9
+ export const ReactSurface = lazy(() => import('./react-surface'));
10
+ export const ScriptSettings = lazy(() => import('./settings'));
11
+ export const Artifact = lazy(() => import('./artifact'));
12
+
13
+ export * from './capabilities';