@dxos/plugin-script 0.8.4-main.2e9d522 → 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 (287) 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-HLQ7K3BT.mjs → app-graph-builder-DPYULSME.mjs} +9 -8
  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-3U6DTUH3.mjs → chunk-E7DXDICD.mjs} +29 -30
  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-FIM2MVNJ.mjs → chunk-I3QSGUFJ.mjs} +159 -68
  19. package/dist/lib/browser/chunk-I3QSGUFJ.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-FMDXKOP7.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-P4HQKUCP.mjs → chunk-NM4WQS4F.mjs} +15 -15
  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-CXCUA4UQ.mjs → compiler-G2N2CG63.mjs} +24 -8
  30. package/dist/lib/browser/compiler-G2N2CG63.mjs.map +7 -0
  31. package/dist/lib/browser/index.mjs +109 -39
  32. package/dist/lib/browser/index.mjs.map +3 -3
  33. package/dist/lib/browser/{intent-resolver-7B77IG3N.mjs → intent-resolver-JLU7DVLQ.mjs} +33 -19
  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-FYYXZA7C.mjs → react-surface-76SDTUYG.mjs} +36 -13
  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-3KPRWFE7.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-7EYIHWH4.mjs → app-graph-builder-UXJGHXSL.mjs} +9 -8
  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-QKK3NDHW.mjs → chunk-C2ORIPKH.mjs} +15 -15
  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-7NMI4CEU.mjs → chunk-SMFPSKQT.mjs} +159 -68
  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-RT43MACC.mjs → chunk-VZAFGLD7.mjs} +29 -30
  67. package/dist/lib/node-esm/chunk-VZAFGLD7.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-XJPK3IYI.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-EPFKQXPE.mjs → compiler-PLDAZ5GJ.mjs} +24 -8
  71. package/dist/lib/node-esm/compiler-PLDAZ5GJ.mjs.map +7 -0
  72. package/dist/lib/node-esm/index.mjs +109 -39
  73. package/dist/lib/node-esm/index.mjs.map +3 -3
  74. package/dist/lib/node-esm/{intent-resolver-FRZGS4TB.mjs → intent-resolver-SFGTIFOG.mjs} +33 -19
  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-V32NWHKN.mjs → react-surface-SHEBNW4R.mjs} +36 -13
  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/artifact-definition.d.ts +1 -1
  88. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
  90. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/compiler.d.ts +1 -1
  92. package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/index.d.ts +6 -6
  94. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  96. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  97. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  98. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/settings.d.ts +1 -1
  100. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  101. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +2 -2
  102. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  103. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +246 -13
  104. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
  105. package/dist/types/src/components/DeploymentDialog/index.d.ts +1 -1
  106. package/dist/types/src/components/DeploymentDialog/index.d.ts.map +1 -1
  107. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  108. package/dist/types/src/components/NotebookContainer.d.ts +10 -0
  109. package/dist/types/src/components/NotebookContainer.d.ts.map +1 -0
  110. package/dist/types/src/components/NotebookContainer.stories.d.ts +248 -0
  111. package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
  112. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +14 -0
  113. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
  114. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
  115. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
  116. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
  117. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
  118. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +248 -0
  119. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
  120. package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
  121. package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
  122. package/dist/types/src/components/ScriptContainer.d.ts +2 -2
  123. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  124. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  125. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +245 -10
  126. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  127. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
  128. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +2 -2
  129. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
  130. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
  131. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +4 -2
  132. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  133. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +11 -4
  134. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  135. package/dist/types/src/components/index.d.ts +3 -4
  136. package/dist/types/src/components/index.d.ts.map +1 -1
  137. package/dist/types/src/events.d.ts.map +1 -1
  138. package/dist/types/src/hooks/deploy.d.ts +11 -10
  139. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  140. package/dist/types/src/hooks/template.d.ts.map +1 -1
  141. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  142. package/dist/types/src/index.d.ts +1 -0
  143. package/dist/types/src/index.d.ts.map +1 -1
  144. package/dist/types/src/meta.d.ts +0 -1
  145. package/dist/types/src/meta.d.ts.map +1 -1
  146. package/dist/types/src/notebook/eval.d.ts +13 -0
  147. package/dist/types/src/notebook/eval.d.ts.map +1 -0
  148. package/dist/types/src/notebook/index.d.ts +2 -0
  149. package/dist/types/src/notebook/index.d.ts.map +1 -0
  150. package/dist/types/src/notebook/notebook.d.ts +35 -0
  151. package/dist/types/src/notebook/notebook.d.ts.map +1 -0
  152. package/dist/types/src/notebook/notebook.test.d.ts +2 -0
  153. package/dist/types/src/notebook/notebook.test.d.ts.map +1 -0
  154. package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
  155. package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
  156. package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
  157. package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
  158. package/dist/types/src/templates/chess.d.ts.map +1 -1
  159. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  160. package/dist/types/src/templates/discord.d.ts.map +1 -1
  161. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  162. package/dist/types/src/templates/forex.d.ts.map +1 -1
  163. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  164. package/dist/types/src/templates/index.d.ts +43 -1
  165. package/dist/types/src/templates/index.d.ts.map +1 -1
  166. package/dist/types/src/templates/{echo.d.ts → ping.d.ts} +1 -1
  167. package/dist/types/src/templates/ping.d.ts.map +1 -0
  168. package/dist/types/src/testing/data.d.ts +19 -0
  169. package/dist/types/src/testing/data.d.ts.map +1 -0
  170. package/dist/types/src/testing/index.d.ts +2 -0
  171. package/dist/types/src/testing/index.d.ts.map +1 -0
  172. package/dist/types/src/translations.d.ts +28 -2
  173. package/dist/types/src/translations.d.ts.map +1 -1
  174. package/dist/types/src/types/actions.d.ts +66 -0
  175. package/dist/types/src/types/actions.d.ts.map +1 -0
  176. package/dist/types/src/types/index.d.ts +1 -0
  177. package/dist/types/src/types/index.d.ts.map +1 -1
  178. package/dist/types/src/types/schema.d.ts +54 -31
  179. package/dist/types/src/types/schema.d.ts.map +1 -1
  180. package/dist/types/src/util/deploy.d.ts +3 -3
  181. package/dist/types/src/util/deploy.d.ts.map +1 -1
  182. package/dist/types/src/util/functions.d.ts +5 -2
  183. package/dist/types/src/util/functions.d.ts.map +1 -1
  184. package/dist/types/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +76 -69
  186. package/src/ScriptPlugin.tsx +93 -70
  187. package/src/capabilities/app-graph-builder.ts +6 -5
  188. package/src/capabilities/artifact-definition.ts +8 -12
  189. package/src/capabilities/blueprint-definition.ts +30 -0
  190. package/src/capabilities/compiler.ts +2 -1
  191. package/src/capabilities/index.ts +1 -1
  192. package/src/capabilities/intent-resolver.ts +16 -9
  193. package/src/capabilities/react-surface.tsx +20 -7
  194. package/src/capabilities/settings.ts +3 -3
  195. package/src/compiler/compiler.ts +1 -1
  196. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +34 -20
  197. package/src/components/DeploymentDialog/DeploymentDialog.tsx +16 -22
  198. package/src/components/DeploymentDialog/index.ts +1 -1
  199. package/src/components/FrameContainer/FrameContainer.tsx +3 -2
  200. package/src/components/NotebookContainer.stories.tsx +32 -0
  201. package/src/components/NotebookContainer.tsx +124 -0
  202. package/src/components/NotebookStack/NotebookCell.tsx +217 -0
  203. package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
  204. package/src/components/NotebookStack/NotebookStack.stories.tsx +32 -0
  205. package/src/components/NotebookStack/NotebookStack.tsx +79 -0
  206. package/src/components/NotebookStack/index.ts +6 -0
  207. package/src/components/ScriptContainer.tsx +4 -3
  208. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +34 -17
  209. package/src/components/ScriptToolbar/ScriptToolbar.tsx +30 -23
  210. package/src/components/Settings/ScriptObjectSettings.tsx +111 -31
  211. package/src/components/Settings/ScriptPluginSettings.tsx +37 -47
  212. package/src/components/TestPanel/TestContainer.tsx +2 -1
  213. package/src/components/TestPanel/TestPanel.tsx +6 -6
  214. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +79 -31
  215. package/src/components/TypescriptEditor/TypescriptEditor.tsx +32 -25
  216. package/src/components/index.ts +3 -0
  217. package/src/events.ts +2 -2
  218. package/src/hooks/deploy.ts +18 -19
  219. package/src/hooks/format.ts +2 -2
  220. package/src/hooks/template.ts +5 -4
  221. package/src/hooks/useCreateAndDeployScriptTemplates.ts +4 -3
  222. package/src/index.ts +1 -0
  223. package/src/meta.ts +2 -4
  224. package/src/notebook/eval.ts +105 -0
  225. package/src/notebook/index.ts +5 -0
  226. package/src/notebook/notebook.test.ts +70 -0
  227. package/src/notebook/notebook.ts +183 -0
  228. package/src/notebook/vfs-parser.test.ts +149 -0
  229. package/src/notebook/vfs-parser.ts +451 -0
  230. package/src/templates/chess.ts +3 -1
  231. package/src/templates/data-generator.ts +9 -3
  232. package/src/templates/discord.ts +12 -4
  233. package/src/templates/forex-effect.ts +7 -3
  234. package/src/templates/forex.ts +3 -1
  235. package/src/templates/gmail.ts +33 -62
  236. package/src/templates/index.ts +6 -6
  237. package/src/testing/data.ts +47 -0
  238. package/src/testing/index.ts +5 -0
  239. package/src/translations.ts +31 -4
  240. package/src/types/actions.ts +53 -0
  241. package/src/types/index.ts +1 -0
  242. package/src/types/schema.ts +30 -19
  243. package/src/util/deploy.ts +20 -33
  244. package/src/util/functions.ts +35 -6
  245. package/dist/lib/browser/DeploymentDialog-M4QIHTDR.mjs +0 -12
  246. package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs +0 -262
  247. package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
  248. package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
  249. package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs +0 -249
  250. package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs.map +0 -7
  251. package/dist/lib/browser/chunk-3U6DTUH3.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-FIM2MVNJ.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-FMDXKOP7.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
  255. package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
  256. package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
  257. package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
  258. package/dist/lib/browser/chunk-R4R7VOFY.mjs +0 -88
  259. package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
  260. package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
  261. package/dist/lib/browser/intent-resolver-7B77IG3N.mjs.map +0 -7
  262. package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
  263. package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
  264. package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs +0 -263
  265. package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
  266. package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
  267. package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs +0 -250
  268. package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs.map +0 -7
  269. package/dist/lib/node-esm/chunk-7NMI4CEU.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
  271. package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs +0 -90
  272. package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
  273. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
  274. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
  275. package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-RT43MACC.mjs.map +0 -7
  277. package/dist/lib/node-esm/chunk-XJPK3IYI.mjs.map +0 -7
  278. package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
  279. package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs.map +0 -7
  280. package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
  281. package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
  282. package/dist/types/src/templates/echo.d.ts.map +0 -1
  283. /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → DeploymentDialog-65TWT6S5.mjs.map} +0 -0
  284. /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-OKXN2N7M.mjs.map} +0 -0
  285. /package/dist/lib/node-esm/{DeploymentDialog-3KPRWFE7.mjs.map → DeploymentDialog-I63ZC2HH.mjs.map} +0 -0
  286. /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-NUXZQQ6P.mjs.map} +0 -0
  287. /package/src/templates/{echo.ts → ping.ts} +0 -0
@@ -0,0 +1,88 @@
1
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/chat.ts?raw
2
+ var chat_default = "//\n// Copyright 2024 DXOS.org\n//\n\n// @ts-ignore\nimport { transformServerSentEvents } from 'https://esm.sh/@dxos/script-toolbox?bundle=false';\n\n/**\n * Chatbot that answers questions based on the context data.\n */\nexport default async ({ data: { bodyText }, context: { space, ai } }: any) => {\n let parsedRequest: any;\n try {\n parsedRequest = JSON.parse(bodyText);\n } catch (err) {\n const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {\n stream: true,\n prompt: `\n Using only the context data below to answer the user's question.\n If you cannot answer the question from the provided content, then reply with \"I don't know.\"\n\n CONTEXT:\n ${await getContext({ space })}\n\n QUESTION:\n ${bodyText}\n `,\n });\n return new Response(transformServerSentEvents(answer));\n }\n\n const promptId = parsedRequest.trigger.promptId;\n const promptObject = await space.crud.query({ id: promptId }).first();\n\n if (parsedRequest.data.objects.length !== 1) {\n return new Response('Message batches not supported.');\n }\n\n const messageId = parsedRequest.data.objects[0];\n let message;\n try {\n message = await space.crud.query({ id: messageId }).first();\n } catch (err) {\n return new Response('Message not replicated yet.', { status: 409 });\n }\n\n if (message.text.includes('--------')) {\n return new Response('Message was already processed.');\n }\n\n let prompt = promptObject.template;\n for (const input of promptObject.inputs) {\n let value: string | null = null;\n if (input.type === TemplateInputType.VALUE) {\n value = String(input.value);\n } else if (input.type === TemplateInputType.RETRIEVER) {\n value = await getContext({ space });\n } else if (input.type === TemplateInputType.PASS_THROUGH) {\n value = message.text;\n }\n if (value) {\n prompt = prompt.replaceAll(`{${input.name}}`, value);\n }\n }\n\n const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {\n stream: false,\n prompt,\n });\n const response = { response: answer.response, prompt, message };\n const textWithAnswer = message.text + '\\n--------\\n\\n' + answer.response;\n await space.crud.update({ id: messageId }, { text: textWithAnswer });\n\n return new Response(JSON.stringify(response));\n};\n\nconst getContext = async ({ space }: any) => {\n let context = '';\n const { objects: docs } = await space.crud.query({ __typename: 'dxos.org/type/Document' }).run();\n for (const doc of docs) {\n const { content } = await space.crud.query({ id: doc.content }).first();\n context += content + '\\n\\n';\n }\n return context;\n};\n\nenum TemplateInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n";
3
+
4
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/chess.ts?raw
5
+ var chess_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { Chess } from 'https://esm.sh/chess.js@0.13.1?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/chess',\n name: 'Chess',\n description: 'Plays a random move in a chess game.',\n\n inputSchema: S.Struct({\n changedObjectId: S.String.annotations({\n description: 'The objects to play the game on.',\n }),\n player: S.optional(S.Literal('w', 'b')).annotations({\n description: 'The player to play the game as.',\n }),\n }),\n\n outputSchema: S.Struct({\n state: S.String.annotations({\n description: 'The state of the game as an ASCII art board.',\n }),\n }),\n\n handler: async ({ data: { changedObjectId, player = 'b' }, context: { space } }: any) => {\n const { pgn } = await space.db.query({ id: changedObjectId }).first();\n const game = new Chess();\n game.load_pgn(pgn);\n if (game.turn() !== player) {\n return new Response('Invalid turn', { status: 409 });\n }\n\n const moves = game.moves();\n const move = moves[Math.floor(Math.random() * moves.length)];\n if (!move) {\n return new Response('No legal moves', { status: 406 });\n }\n\n game.move(move);\n const newPgn = game.pgn();\n await space.db.update({ id: changedObjectId }, { pgn: newPgn, fen: game.fen() });\n return { state: game.ascii() };\n },\n});\n";
6
+
7
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/data-generator.ts?raw
8
+ var data_generator_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { Expando, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { randText } from 'https://esm.sh/@ngneat/falso@7.1.1?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/data-generator',\n name: 'Data Generator',\n inputSchema: S.Struct({\n documentAmount: S.optional(S.Number),\n textSize: S.optional(S.Number),\n mutationAmount: S.optional(S.Number),\n waitAfterCreation: S.optional(S.Number),\n }),\n\n outputSchema: S.Struct({}),\n\n handler: async ({\n data: { documentAmount = 1, textSize = 10, mutationAmount = 0, waitAfterCreation = 10_000 },\n context: { space },\n }: any) => {\n await space.db.graph.schemaRegistry.addSchema([Expando]);\n const result: Record<string, any> = {};\n const objects: Expando[] = [];\n\n // Create objects.\n for (let i = 0; i < documentAmount; i++) {\n const obj = space.db.add(\n create(Expando, {\n name: 'scriptGenerated',\n content: randText({ charCount: textSize }),\n }),\n );\n objects.push(obj);\n const objectResult: any = {};\n // Mutate the object.\n for (let i = 0; i < mutationAmount; i++) {\n obj.content = randText({ charCount: textSize });\n }\n objectResult.mutations = mutationAmount;\n objectResult.contentLength = obj.content.length;\n result[obj.id] = objectResult;\n }\n\n // Flush and wait for data to propagate.\n await space.db.flush();\n await new Promise((resolve) => setTimeout(resolve, waitAfterCreation));\n return { createdObjects: objects.length };\n },\n});\n";
9
+
10
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/discord.ts?raw
11
+ var discord_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { DXN, EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\nimport {\n DiscordConfig,\n DiscordREST,\n DiscordRESTMemoryLive,\n // @ts-ignore\n} from 'https://esm.sh/dfx@0.113.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport * as Config from 'https://esm.sh/effect@3.17.0/Config?bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Redacted from 'https://esm.sh/effect@3.17.0/Redacted?bundle=false';\n// @ts-ignore\nimport * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';\n\nconst MessageSchema = S.Struct({\n id: ObjectId,\n foreignId: S.Any, // bigint?\n from: S.String,\n created: S.String,\n content: S.String,\n}).pipe(\n EchoObject({\n typename: 'example.com/type/Message',\n version: '0.1.0',\n }),\n);\n\nconst DEFAULT_AFTER = 1704067200; // 2024-01-01\n\nconst generateSnowflake = (unixTimestamp: number): bigint => {\n const discordEpoch = 1420070400000n; // Discord Epoch (ms)\n return (BigInt(unixTimestamp * 1000) - discordEpoch) << 22n;\n};\n\nexport default defineFunction({\n key: 'dxos.org/script/discord',\n name: 'Discord',\n inputSchema: S.Struct({\n // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.\n tick: S.optional(S.String),\n channelId: S.String,\n after: S.optional(S.Number),\n pageSize: S.optional(S.Number),\n queueId: S.String,\n }),\n\n outputSchema: S.Struct({\n newMessages: S.Number,\n }),\n\n handler: ({ data: { channelId, queueId, after = DEFAULT_AFTER, pageSize = 5 }, context: { space } }: any) =>\n Effect.gen(function* () {\n const { token } = yield* Effect.tryPromise({\n try: () => space.db.query(Filter.typename('dxos.org/type/AccessToken', { source: 'discord.com' })).first(),\n catch: (e: any) => e,\n });\n const { objects } = yield* Effect.tryPromise({\n try: () => space.queues.queryQueue(DXN.parse(queueId)),\n catch: (e: any) => e,\n });\n const backfill = objects.length === 0;\n const newMessages = yield* Ref.make(0);\n const lastMessage = yield* Ref.make(objects.at(-1));\n\n const enqueueMessages = Effect.gen(function* () {\n const rest = yield* DiscordREST;\n\n while (true) {\n const last = yield* Ref.get(lastMessage);\n const options = {\n after: backfill && !last ? `${generateSnowflake(after)}` : last?.foreignId,\n limit: pageSize,\n };\n const messages = yield* rest.getChannelMessages(channelId, options).pipe((res: any) => res.json);\n const queueMessages = messages\n .map((message: any) =>\n create(MessageSchema, {\n id: ObjectId.random(),\n foreignId: message.id,\n from: message.author.username,\n created: message.timestamp,\n content: message.content,\n }),\n )\n .toReversed();\n if (queueMessages.length > 0) {\n yield* Effect.tryPromise({\n try: () => space.queues.insertIntoQueue(DXN.parse(queueId), queueMessages),\n catch: (e: any) => e,\n });\n yield* Ref.update(newMessages, (n: any) => n + queueMessages.length);\n yield* Ref.update(lastMessage, (m: any) => queueMessages.at(-1));\n }\n if (messages.length < pageSize) {\n break;\n }\n }\n }).pipe(\n Effect.provide(DiscordRESTMemoryLive),\n Effect.provide(\n DiscordConfig.layerConfig({\n token: Config.succeed(Redacted.make(token)),\n }),\n ),\n Effect.provide(FetchHttpClient.layer),\n );\n\n yield* enqueueMessages;\n return { newMessages: yield* Ref.get(newMessages) };\n }),\n});\n";
12
+
13
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/email.ts?raw
14
+ var email_default = "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Appends a message to the end of a Document configured through a trigger.\n * Trigger must have a targetDocumentId field set in Meta.\n */\nexport default async ({ data: { bodyText }, context: { space } }: any) => {\n const { email, targetDocumentId: documentId } = JSON.parse(bodyText) as RequestPayload;\n\n const document = await space.db.query({ id: documentId }).first();\n\n const contentId = document.content['/'].split(':')[3];\n const documentContent = await space.db.query({ id: contentId }).first();\n const modifiedContent = [\n documentContent.content,\n '',\n '---',\n `**From:** ${email.from}`,\n `**Subject:** ${email.subject}`,\n `**Date:** ${email.created}`,\n '',\n email.body,\n ].join('\\n');\n\n await space.db.update({ id: contentId }, { content: modifiedContent });\n\n return new Response(JSON.stringify({ success: true }));\n};\n\ntype RequestPayload = {\n email: { from: string; subject: string; created: string; body: string };\n targetDocumentId: string;\n};\n";
15
+
16
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/forex-effect.ts?raw
17
+ var forex_effect_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\nimport {\n FetchHttpClient,\n HttpClient,\n HttpClientRequest,\n // @ts-ignore\n} from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/forex-effect',\n name: 'Forex Effect',\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n }),\n\n outputSchema: S.String.annotations({ description: 'The exchange rate between the two currencies' }),\n\n handler: async ({ data: { from, to } }: any) =>\n Effect.gen(function* () {\n const res = yield* HttpClientRequest.get(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`).pipe(\n HttpClient.execute,\n Effect.flatMap((res: any) => res.json),\n Effect.timeout('1 second'),\n Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),\n Effect.scoped,\n );\n\n return res.data.rates[to].toString();\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n});\n";
18
+
19
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/forex.ts?raw
20
+ var forex_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\n\nexport default defineFunction({\n key: 'dxos.org/script/forex',\n name: 'Forex',\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n }),\n\n handler: async ({ data: { from, to } }: any) => {\n const res = await fetch(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`);\n const {\n data: { rates },\n } = await res.json();\n\n return rates[to].toString();\n },\n});\n";
21
+
22
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/gmail.ts?raw
23
+ var gmail_default = "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport {\n FetchHttpClient,\n HttpClient,\n HttpClientRequest,\n // @ts-ignore\n} from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport { format, subDays } from 'https://esm.sh/date-fns@3.3.1?bundle=false';\n// @ts-ignore\nimport * as Chunk from 'https://esm.sh/effect@3.17.0/Chunk?bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Function from 'https://esm.sh/effect@3.17.0/Function?bundle=false';\n// @ts-ignore\nimport * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';\n// @ts-ignore\nimport * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';\n// @ts-ignore\nimport * as Stream from 'https://esm.sh/effect@3.17.0/Stream?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/gmail',\n name: 'Gmail',\n inputSchema: S.Struct({\n mailboxId: S.String,\n userId: S.optional(S.String).pipe(S.withDecodingDefault(() => 'me')),\n after: S.optional(S.Union(S.Number, S.String)).pipe(\n S.withDecodingDefault(() => format(subDays(new Date(), 30), 'yyyy-MM-dd')),\n ),\n pageSize: S.optional(S.Number).pipe(S.withDecodingDefault(() => 100)),\n // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.\n tick: S.optional(S.String),\n }),\n\n outputSchema: S.Struct({\n newMessages: S.Number,\n }),\n\n handler: ({ context: { space }, data: { mailboxId, userId, after, pageSize } }: any) =>\n Effect.gen(function* () {\n const { token } = yield* Effect.tryPromise({\n try: () => space.db.query(Filter.typename('dxos.org/type/AccessToken', { source: 'gmail.com' })).first(),\n catch: (e: any) => e,\n });\n\n // NOTE: Google API bundles size is v. large and caused runtime issues.\n const makeRequest = (url: string) =>\n Function.pipe(\n url,\n HttpClientRequest.get,\n HttpClientRequest.setHeaders({ Authorization: `Bearer ${token}`, Accept: 'application/json' }),\n HttpClient.execute,\n Effect.flatMap((res: any) => res.json),\n Effect.timeout('1 second'),\n Effect.retry(Schedule.exponential(1000).pipe(Schedule.compose(Schedule.recurs(3)))),\n Effect.scoped,\n );\n\n const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) =>\n makeRequest(getUrl(userId, undefined, { q, pageSize, pageToken }));\n\n const getMessage = (userId: string, messageId: string) => makeRequest(getUrl(userId, messageId));\n\n const mailbox = yield* Effect.tryPromise({\n try: () => space.db.query({ id: mailboxId }).first(),\n catch: (e: any) => e,\n });\n const { objects } = yield* Effect.tryPromise({\n try: () => space.queues.queryQueue(mailbox.queue.dxn),\n catch: (e: any) => e,\n });\n const newMessages = yield* Ref.make([]);\n const nextPage = yield* Ref.make(null);\n\n do {\n const last = objects.at(-1);\n const q = last\n ? `in:inbox after:${Math.floor(new Date(last.created).getTime() / 1000)}`\n : `in:inbox after:${after}`;\n const pageToken = yield* Ref.get(nextPage);\n const { messages, nextPageToken } = yield* listMessages(userId, q, pageSize, pageToken);\n yield* Ref.update(nextPage, () => nextPageToken);\n for (const message of messages) {\n const messageDetails = yield* getMessage(userId, message.id);\n const created = new Date(parseInt(messageDetails.internalDate)).toISOString();\n const from = messageDetails.payload.headers.find((h: any) => h.name === 'From');\n const sender = from && parseFromHeader(from.value);\n // TODO(wittjosiah): Improve parsing of email contents.\n const content =\n messageDetails.payload.body?.data ??\n messageDetails.payload.parts?.find((p: any) => p.mimeType === 'text/plain')?.body.data;\n // Skip the message if content or sender is missing.\n // Skip the message if it's the same as the last message.\n // TODO(wittjosiah): This comparison should be done via foreignId probably.\n if (!content || !sender || created === last?.created) {\n continue;\n }\n const subject = messageDetails.payload.headers.find((h: any) => h.name === 'Subject')?.value;\n const object = create(MessageType, {\n id: ObjectId.random(),\n created,\n sender,\n blocks: [\n {\n _tag: 'text',\n text: Buffer.from(content, 'base64').toString('utf-8'),\n },\n ],\n properties: {\n subject,\n threadId: message.threadId,\n },\n });\n // TODO(wittjosiah): Set foreignId in object meta.\n yield* Ref.update(newMessages, (n: any) => [object, ...n]);\n }\n } while (yield* Ref.get(nextPage));\n\n const queueMessages = yield* Ref.get(newMessages);\n if (queueMessages.length > 0) {\n yield* Function.pipe(\n queueMessages,\n Stream.fromIterable,\n Stream.grouped(10),\n Stream.flatMap((batch: any) =>\n Effect.tryPromise({\n try: () => space.queues.insertIntoQueue(mailbox.queue.dxn, Chunk.toReadonlyArray(batch)),\n catch: (e: any) => e,\n }),\n ),\n Stream.runDrain,\n );\n }\n\n return { newMessages: queueMessages.length };\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n});\n\nconst getUrl = (userId: string, messageId?: string, params?: Record<string, any>) => {\n const api = new URL(\n [`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages`, messageId].filter(Boolean).join('/'),\n );\n Object.entries(params ?? {})\n .filter(([_, value]) => value != null)\n .forEach(([key, value]) => api.searchParams.set(key, value));\n return api.toString();\n};\n\n/**\n * Parses an email string in the format \"Name <email@example.com>\" into separate name and email components.\n */\nconst parseFromHeader = (value: string): { name?: string; email: string } | undefined => {\n const EMAIL_REGEX = /^([^<]+?)\\s*<([^>]+@[^>]+)>$/;\n const removeOuterQuotes = (str: string) => str.replace(/^['\"]|['\"]$/g, '');\n const match = value.match(EMAIL_REGEX);\n if (match) {\n const [, name, email] = match;\n return {\n name: removeOuterQuotes(name.trim()),\n email: email.trim(),\n };\n }\n};\n\n//\n// Schemas\n// TODO(wittjosiah): These schemas should be imported from @dxos/schema.\n//\n\nconst ActorRoles = ['user', 'assistant'] as const;\nconst ActorRole = S.Literal(...ActorRoles);\ntype ActorRole = S.Schema.Type<typeof ActorRole>;\n\nconst ActorSchema = S.Struct({\n identityKey: S.optional(S.String),\n email: S.optional(S.String),\n name: S.optional(S.String),\n role: S.optional(ActorRole),\n});\n\nconst Base = S.Struct({\n pending: S.optional(S.Boolean),\n});\ntype Base = S.Schema.Type<typeof Base>;\nconst Text = S.TaggedStruct('text', {\n mimeType: S.optional(S.String),\n text: S.String,\n ...Base.fields,\n}).pipe(S.mutable);\ninterface Text extends S.Schema.Type<typeof Text> {}\n\nconst MessageType = S.Struct({\n id: ObjectId,\n created: S.String.annotations({\n description: 'ISO date string when the message was sent.',\n }),\n sender: ActorSchema.annotations({\n description: 'Identity of the message sender.',\n }),\n blocks: S.Array(Text).annotations({\n description: 'Contents of the message.',\n }),\n properties: S.optional(\n S.mutable(\n S.Record({ key: S.String, value: S.Any }).annotations({\n description: 'Custom properties for specific message types (e.g. attention context, email subject, etc.).',\n }),\n ),\n ),\n}).pipe(\n EchoObject({\n typename: 'dxos.org/type/Message',\n version: '0.2.0',\n }),\n);\ntype MessageType = S.Schema.Type<typeof MessageType>;\n";
24
+
25
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/ping.ts?raw
26
+ var ping_default = "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Echos the request data.\n */\nexport default async ({ data }: any) => data;\n";
27
+
28
+ // src/templates/index.ts
29
+ var removeHeader = (str) => str.split("\n").slice(4).join("\n");
30
+ var templates = [
31
+ {
32
+ id: "dxos.org/script/ping",
33
+ name: "Ping",
34
+ source: removeHeader(ping_default)
35
+ },
36
+ {
37
+ id: "dxos.org/script/forex",
38
+ name: "Forex",
39
+ source: removeHeader(forex_default)
40
+ },
41
+ {
42
+ id: "dxos.org/script/forex-effect",
43
+ name: "Forex (Effect)",
44
+ source: removeHeader(forex_effect_default)
45
+ },
46
+ {
47
+ id: "dxos.org/script/gpt",
48
+ name: "Gpt",
49
+ source: removeHeader(chat_default),
50
+ presetId: "dxos.org/function/gpt"
51
+ },
52
+ {
53
+ id: "dxos.org/script/chess",
54
+ name: "Chess",
55
+ source: removeHeader(chess_default),
56
+ presetId: "dxos.org/function/chess"
57
+ },
58
+ {
59
+ id: "dxos.org/script/email",
60
+ name: "Email",
61
+ source: removeHeader(email_default),
62
+ presetId: "dxos.org/function/email"
63
+ },
64
+ {
65
+ id: "dxos.org/script/discord",
66
+ name: "Discord",
67
+ source: removeHeader(discord_default),
68
+ presetId: "dxos.org/function/discord"
69
+ },
70
+ {
71
+ id: "dxos.org/script/gmail",
72
+ name: "Gmail",
73
+ source: removeHeader(gmail_default),
74
+ presetId: "dxos.org/function/gmail"
75
+ },
76
+ {
77
+ id: "dxos.org/script/data-generator",
78
+ name: "Data Generator",
79
+ source: removeHeader(data_generator_default),
80
+ presetId: "dxos.org/function/data-generator"
81
+ }
82
+ ];
83
+
84
+ export {
85
+ data_generator_default,
86
+ templates
87
+ };
88
+ //# sourceMappingURL=chunk-ST3ACVUC.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/chat.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/chess.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/data-generator.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/discord.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/email.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/forex-effect.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/forex.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/gmail.ts?raw", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-script/src/templates/ping.ts?raw", "../../../src/templates/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n// @ts-ignore\nimport { transformServerSentEvents } from 'https://esm.sh/@dxos/script-toolbox?bundle=false';\n\n/**\n * Chatbot that answers questions based on the context data.\n */\nexport default async ({ data: { bodyText }, context: { space, ai } }: any) => {\n let parsedRequest: any;\n try {\n parsedRequest = JSON.parse(bodyText);\n } catch (err) {\n const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {\n stream: true,\n prompt: `\n Using only the context data below to answer the user's question.\n If you cannot answer the question from the provided content, then reply with \"I don't know.\"\n\n CONTEXT:\n ${await getContext({ space })}\n\n QUESTION:\n ${bodyText}\n `,\n });\n return new Response(transformServerSentEvents(answer));\n }\n\n const promptId = parsedRequest.trigger.promptId;\n const promptObject = await space.crud.query({ id: promptId }).first();\n\n if (parsedRequest.data.objects.length !== 1) {\n return new Response('Message batches not supported.');\n }\n\n const messageId = parsedRequest.data.objects[0];\n let message;\n try {\n message = await space.crud.query({ id: messageId }).first();\n } catch (err) {\n return new Response('Message not replicated yet.', { status: 409 });\n }\n\n if (message.text.includes('--------')) {\n return new Response('Message was already processed.');\n }\n\n let prompt = promptObject.template;\n for (const input of promptObject.inputs) {\n let value: string | null = null;\n if (input.type === TemplateInputType.VALUE) {\n value = String(input.value);\n } else if (input.type === TemplateInputType.RETRIEVER) {\n value = await getContext({ space });\n } else if (input.type === TemplateInputType.PASS_THROUGH) {\n value = message.text;\n }\n if (value) {\n prompt = prompt.replaceAll(`{${input.name}}`, value);\n }\n }\n\n const answer = await ai.run('@cf/meta/llama-3.1-8b-instruct', {\n stream: false,\n prompt,\n });\n const response = { response: answer.response, prompt, message };\n const textWithAnswer = message.text + '\\n--------\\n\\n' + answer.response;\n await space.crud.update({ id: messageId }, { text: textWithAnswer });\n\n return new Response(JSON.stringify(response));\n};\n\nconst getContext = async ({ space }: any) => {\n let context = '';\n const { objects: docs } = await space.crud.query({ __typename: 'dxos.org/type/Document' }).run();\n for (const doc of docs) {\n const { content } = await space.crud.query({ id: doc.content }).first();\n context += content + '\\n\\n';\n }\n return context;\n};\n\nenum TemplateInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { Chess } from 'https://esm.sh/chess.js@0.13.1?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/chess',\n name: 'Chess',\n description: 'Plays a random move in a chess game.',\n\n inputSchema: S.Struct({\n changedObjectId: S.String.annotations({\n description: 'The objects to play the game on.',\n }),\n player: S.optional(S.Literal('w', 'b')).annotations({\n description: 'The player to play the game as.',\n }),\n }),\n\n outputSchema: S.Struct({\n state: S.String.annotations({\n description: 'The state of the game as an ASCII art board.',\n }),\n }),\n\n handler: async ({ data: { changedObjectId, player = 'b' }, context: { space } }: any) => {\n const { pgn } = await space.db.query({ id: changedObjectId }).first();\n const game = new Chess();\n game.load_pgn(pgn);\n if (game.turn() !== player) {\n return new Response('Invalid turn', { status: 409 });\n }\n\n const moves = game.moves();\n const move = moves[Math.floor(Math.random() * moves.length)];\n if (!move) {\n return new Response('No legal moves', { status: 406 });\n }\n\n game.move(move);\n const newPgn = game.pgn();\n await space.db.update({ id: changedObjectId }, { pgn: newPgn, fen: game.fen() });\n return { state: game.ascii() };\n },\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { Expando, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { randText } from 'https://esm.sh/@ngneat/falso@7.1.1?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/data-generator',\n name: 'Data Generator',\n inputSchema: S.Struct({\n documentAmount: S.optional(S.Number),\n textSize: S.optional(S.Number),\n mutationAmount: S.optional(S.Number),\n waitAfterCreation: S.optional(S.Number),\n }),\n\n outputSchema: S.Struct({}),\n\n handler: async ({\n data: { documentAmount = 1, textSize = 10, mutationAmount = 0, waitAfterCreation = 10_000 },\n context: { space },\n }: any) => {\n await space.db.graph.schemaRegistry.addSchema([Expando]);\n const result: Record<string, any> = {};\n const objects: Expando[] = [];\n\n // Create objects.\n for (let i = 0; i < documentAmount; i++) {\n const obj = space.db.add(\n create(Expando, {\n name: 'scriptGenerated',\n content: randText({ charCount: textSize }),\n }),\n );\n objects.push(obj);\n const objectResult: any = {};\n // Mutate the object.\n for (let i = 0; i < mutationAmount; i++) {\n obj.content = randText({ charCount: textSize });\n }\n objectResult.mutations = mutationAmount;\n objectResult.contentLength = obj.content.length;\n result[obj.id] = objectResult;\n }\n\n // Flush and wait for data to propagate.\n await space.db.flush();\n await new Promise((resolve) => setTimeout(resolve, waitAfterCreation));\n return { createdObjects: objects.length };\n },\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { DXN, EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\nimport {\n DiscordConfig,\n DiscordREST,\n DiscordRESTMemoryLive,\n // @ts-ignore\n} from 'https://esm.sh/dfx@0.113.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport * as Config from 'https://esm.sh/effect@3.17.0/Config?bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Redacted from 'https://esm.sh/effect@3.17.0/Redacted?bundle=false';\n// @ts-ignore\nimport * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';\n\nconst MessageSchema = S.Struct({\n id: ObjectId,\n foreignId: S.Any, // bigint?\n from: S.String,\n created: S.String,\n content: S.String,\n}).pipe(\n EchoObject({\n typename: 'example.com/type/Message',\n version: '0.1.0',\n }),\n);\n\nconst DEFAULT_AFTER = 1704067200; // 2024-01-01\n\nconst generateSnowflake = (unixTimestamp: number): bigint => {\n const discordEpoch = 1420070400000n; // Discord Epoch (ms)\n return (BigInt(unixTimestamp * 1000) - discordEpoch) << 22n;\n};\n\nexport default defineFunction({\n key: 'dxos.org/script/discord',\n name: 'Discord',\n inputSchema: S.Struct({\n // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.\n tick: S.optional(S.String),\n channelId: S.String,\n after: S.optional(S.Number),\n pageSize: S.optional(S.Number),\n queueId: S.String,\n }),\n\n outputSchema: S.Struct({\n newMessages: S.Number,\n }),\n\n handler: ({ data: { channelId, queueId, after = DEFAULT_AFTER, pageSize = 5 }, context: { space } }: any) =>\n Effect.gen(function* () {\n const { token } = yield* Effect.tryPromise({\n try: () => space.db.query(Filter.typename('dxos.org/type/AccessToken', { source: 'discord.com' })).first(),\n catch: (e: any) => e,\n });\n const { objects } = yield* Effect.tryPromise({\n try: () => space.queues.queryQueue(DXN.parse(queueId)),\n catch: (e: any) => e,\n });\n const backfill = objects.length === 0;\n const newMessages = yield* Ref.make(0);\n const lastMessage = yield* Ref.make(objects.at(-1));\n\n const enqueueMessages = Effect.gen(function* () {\n const rest = yield* DiscordREST;\n\n while (true) {\n const last = yield* Ref.get(lastMessage);\n const options = {\n after: backfill && !last ? `${generateSnowflake(after)}` : last?.foreignId,\n limit: pageSize,\n };\n const messages = yield* rest.getChannelMessages(channelId, options).pipe((res: any) => res.json);\n const queueMessages = messages\n .map((message: any) =>\n create(MessageSchema, {\n id: ObjectId.random(),\n foreignId: message.id,\n from: message.author.username,\n created: message.timestamp,\n content: message.content,\n }),\n )\n .toReversed();\n if (queueMessages.length > 0) {\n yield* Effect.tryPromise({\n try: () => space.queues.insertIntoQueue(DXN.parse(queueId), queueMessages),\n catch: (e: any) => e,\n });\n yield* Ref.update(newMessages, (n: any) => n + queueMessages.length);\n yield* Ref.update(lastMessage, (m: any) => queueMessages.at(-1));\n }\n if (messages.length < pageSize) {\n break;\n }\n }\n }).pipe(\n Effect.provide(DiscordRESTMemoryLive),\n Effect.provide(\n DiscordConfig.layerConfig({\n token: Config.succeed(Redacted.make(token)),\n }),\n ),\n Effect.provide(FetchHttpClient.layer),\n );\n\n yield* enqueueMessages;\n return { newMessages: yield* Ref.get(newMessages) };\n }),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Appends a message to the end of a Document configured through a trigger.\n * Trigger must have a targetDocumentId field set in Meta.\n */\nexport default async ({ data: { bodyText }, context: { space } }: any) => {\n const { email, targetDocumentId: documentId } = JSON.parse(bodyText) as RequestPayload;\n\n const document = await space.db.query({ id: documentId }).first();\n\n const contentId = document.content['/'].split(':')[3];\n const documentContent = await space.db.query({ id: contentId }).first();\n const modifiedContent = [\n documentContent.content,\n '',\n '---',\n `**From:** ${email.from}`,\n `**Subject:** ${email.subject}`,\n `**Date:** ${email.created}`,\n '',\n email.body,\n ].join('\\n');\n\n await space.db.update({ id: contentId }, { content: modifiedContent });\n\n return new Response(JSON.stringify({ success: true }));\n};\n\ntype RequestPayload = {\n email: { from: string; subject: string; created: string; body: string };\n targetDocumentId: string;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\nimport {\n FetchHttpClient,\n HttpClient,\n HttpClientRequest,\n // @ts-ignore\n} from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/forex-effect',\n name: 'Forex Effect',\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n }),\n\n outputSchema: S.String.annotations({ description: 'The exchange rate between the two currencies' }),\n\n handler: async ({ data: { from, to } }: any) =>\n Effect.gen(function* () {\n const res = yield* HttpClientRequest.get(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`).pipe(\n HttpClient.execute,\n Effect.flatMap((res: any) => res.json),\n Effect.timeout('1 second'),\n Effect.retry(Schedule.exponential(1_000).pipe(Schedule.compose(Schedule.recurs(3)))),\n Effect.scoped,\n );\n\n return res.data.rates[to].toString();\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { S, defineFunction } from 'dxos:functions';\n\nexport default defineFunction({\n key: 'dxos.org/script/forex',\n name: 'Forex',\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: S.Struct({\n from: S.String.annotations({ description: 'The source currency' }),\n to: S.String.annotations({ description: 'The target currency' }),\n }),\n\n handler: async ({ data: { from, to } }: any) => {\n const res = await fetch(`https://free.ratesdb.com/v1/rates?from=${from}&to=${to}`);\n const {\n data: { rates },\n } = await res.json();\n\n return rates[to].toString();\n },\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport { EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';\n// @ts-ignore\nimport {\n FetchHttpClient,\n HttpClient,\n HttpClientRequest,\n // @ts-ignore\n} from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';\n// @ts-ignore\nimport { format, subDays } from 'https://esm.sh/date-fns@3.3.1?bundle=false';\n// @ts-ignore\nimport * as Chunk from 'https://esm.sh/effect@3.17.0/Chunk?bundle=false';\n// @ts-ignore\nimport * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';\n// @ts-ignore\nimport * as Function from 'https://esm.sh/effect@3.17.0/Function?bundle=false';\n// @ts-ignore\nimport * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';\n// @ts-ignore\nimport * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';\n// @ts-ignore\nimport * as Stream from 'https://esm.sh/effect@3.17.0/Stream?bundle=false';\n\nexport default defineFunction({\n key: 'dxos.org/script/gmail',\n name: 'Gmail',\n inputSchema: S.Struct({\n mailboxId: S.String,\n userId: S.optional(S.String).pipe(S.withDecodingDefault(() => 'me')),\n after: S.optional(S.Union(S.Number, S.String)).pipe(\n S.withDecodingDefault(() => format(subDays(new Date(), 30), 'yyyy-MM-dd')),\n ),\n pageSize: S.optional(S.Number).pipe(S.withDecodingDefault(() => 100)),\n // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.\n tick: S.optional(S.String),\n }),\n\n outputSchema: S.Struct({\n newMessages: S.Number,\n }),\n\n handler: ({ context: { space }, data: { mailboxId, userId, after, pageSize } }: any) =>\n Effect.gen(function* () {\n const { token } = yield* Effect.tryPromise({\n try: () => space.db.query(Filter.typename('dxos.org/type/AccessToken', { source: 'gmail.com' })).first(),\n catch: (e: any) => e,\n });\n\n // NOTE: Google API bundles size is v. large and caused runtime issues.\n const makeRequest = (url: string) =>\n Function.pipe(\n url,\n HttpClientRequest.get,\n HttpClientRequest.setHeaders({ Authorization: `Bearer ${token}`, Accept: 'application/json' }),\n HttpClient.execute,\n Effect.flatMap((res: any) => res.json),\n Effect.timeout('1 second'),\n Effect.retry(Schedule.exponential(1000).pipe(Schedule.compose(Schedule.recurs(3)))),\n Effect.scoped,\n );\n\n const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) =>\n makeRequest(getUrl(userId, undefined, { q, pageSize, pageToken }));\n\n const getMessage = (userId: string, messageId: string) => makeRequest(getUrl(userId, messageId));\n\n const mailbox = yield* Effect.tryPromise({\n try: () => space.db.query({ id: mailboxId }).first(),\n catch: (e: any) => e,\n });\n const { objects } = yield* Effect.tryPromise({\n try: () => space.queues.queryQueue(mailbox.queue.dxn),\n catch: (e: any) => e,\n });\n const newMessages = yield* Ref.make([]);\n const nextPage = yield* Ref.make(null);\n\n do {\n const last = objects.at(-1);\n const q = last\n ? `in:inbox after:${Math.floor(new Date(last.created).getTime() / 1000)}`\n : `in:inbox after:${after}`;\n const pageToken = yield* Ref.get(nextPage);\n const { messages, nextPageToken } = yield* listMessages(userId, q, pageSize, pageToken);\n yield* Ref.update(nextPage, () => nextPageToken);\n for (const message of messages) {\n const messageDetails = yield* getMessage(userId, message.id);\n const created = new Date(parseInt(messageDetails.internalDate)).toISOString();\n const from = messageDetails.payload.headers.find((h: any) => h.name === 'From');\n const sender = from && parseFromHeader(from.value);\n // TODO(wittjosiah): Improve parsing of email contents.\n const content =\n messageDetails.payload.body?.data ??\n messageDetails.payload.parts?.find((p: any) => p.mimeType === 'text/plain')?.body.data;\n // Skip the message if content or sender is missing.\n // Skip the message if it's the same as the last message.\n // TODO(wittjosiah): This comparison should be done via foreignId probably.\n if (!content || !sender || created === last?.created) {\n continue;\n }\n const subject = messageDetails.payload.headers.find((h: any) => h.name === 'Subject')?.value;\n const object = create(MessageType, {\n id: ObjectId.random(),\n created,\n sender,\n blocks: [\n {\n _tag: 'text',\n text: Buffer.from(content, 'base64').toString('utf-8'),\n },\n ],\n properties: {\n subject,\n threadId: message.threadId,\n },\n });\n // TODO(wittjosiah): Set foreignId in object meta.\n yield* Ref.update(newMessages, (n: any) => [object, ...n]);\n }\n } while (yield* Ref.get(nextPage));\n\n const queueMessages = yield* Ref.get(newMessages);\n if (queueMessages.length > 0) {\n yield* Function.pipe(\n queueMessages,\n Stream.fromIterable,\n Stream.grouped(10),\n Stream.flatMap((batch: any) =>\n Effect.tryPromise({\n try: () => space.queues.insertIntoQueue(mailbox.queue.dxn, Chunk.toReadonlyArray(batch)),\n catch: (e: any) => e,\n }),\n ),\n Stream.runDrain,\n );\n }\n\n return { newMessages: queueMessages.length };\n }).pipe(Effect.provide(FetchHttpClient.layer)),\n});\n\nconst getUrl = (userId: string, messageId?: string, params?: Record<string, any>) => {\n const api = new URL(\n [`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages`, messageId].filter(Boolean).join('/'),\n );\n Object.entries(params ?? {})\n .filter(([_, value]) => value != null)\n .forEach(([key, value]) => api.searchParams.set(key, value));\n return api.toString();\n};\n\n/**\n * Parses an email string in the format \"Name <email@example.com>\" into separate name and email components.\n */\nconst parseFromHeader = (value: string): { name?: string; email: string } | undefined => {\n const EMAIL_REGEX = /^([^<]+?)\\s*<([^>]+@[^>]+)>$/;\n const removeOuterQuotes = (str: string) => str.replace(/^['\"]|['\"]$/g, '');\n const match = value.match(EMAIL_REGEX);\n if (match) {\n const [, name, email] = match;\n return {\n name: removeOuterQuotes(name.trim()),\n email: email.trim(),\n };\n }\n};\n\n//\n// Schemas\n// TODO(wittjosiah): These schemas should be imported from @dxos/schema.\n//\n\nconst ActorRoles = ['user', 'assistant'] as const;\nconst ActorRole = S.Literal(...ActorRoles);\ntype ActorRole = S.Schema.Type<typeof ActorRole>;\n\nconst ActorSchema = S.Struct({\n identityKey: S.optional(S.String),\n email: S.optional(S.String),\n name: S.optional(S.String),\n role: S.optional(ActorRole),\n});\n\nconst Base = S.Struct({\n pending: S.optional(S.Boolean),\n});\ntype Base = S.Schema.Type<typeof Base>;\nconst Text = S.TaggedStruct('text', {\n mimeType: S.optional(S.String),\n text: S.String,\n ...Base.fields,\n}).pipe(S.mutable);\ninterface Text extends S.Schema.Type<typeof Text> {}\n\nconst MessageType = S.Struct({\n id: ObjectId,\n created: S.String.annotations({\n description: 'ISO date string when the message was sent.',\n }),\n sender: ActorSchema.annotations({\n description: 'Identity of the message sender.',\n }),\n blocks: S.Array(Text).annotations({\n description: 'Contents of the message.',\n }),\n properties: S.optional(\n S.mutable(\n S.Record({ key: S.String, value: S.Any }).annotations({\n description: 'Custom properties for specific message types (e.g. attention context, email subject, etc.).',\n }),\n ),\n ),\n}).pipe(\n EchoObject({\n typename: 'dxos.org/type/Message',\n version: '0.2.0',\n }),\n);\ntype MessageType = S.Schema.Type<typeof MessageType>;\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Echos the request data.\n */\nexport default async ({ data }: any) => data;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport chat from './chat.ts?raw';\nimport chess from './chess.ts?raw';\nimport dataGenerator from './data-generator.ts?raw';\nimport discord from './discord.ts?raw';\nimport email from './email.ts?raw';\nimport forexEffect from './forex-effect.ts?raw';\nimport forex from './forex.ts?raw';\nimport gmail from './gmail.ts?raw';\nimport ping from './ping.ts?raw';\n\nconst removeHeader = (str: string) => str.split('\\n').slice(4).join('\\n');\n\nexport { dataGenerator };\n\nexport type Template = {\n id: string;\n name: string;\n source: string;\n presetId?: string;\n};\n\nexport const templates = [\n {\n id: 'dxos.org/script/ping',\n name: 'Ping',\n source: removeHeader(ping),\n },\n {\n id: 'dxos.org/script/forex',\n name: 'Forex',\n source: removeHeader(forex),\n },\n {\n id: 'dxos.org/script/forex-effect',\n name: 'Forex (Effect)',\n source: removeHeader(forexEffect),\n },\n {\n id: 'dxos.org/script/gpt',\n name: 'Gpt',\n source: removeHeader(chat),\n presetId: 'dxos.org/function/gpt',\n },\n {\n id: 'dxos.org/script/chess',\n name: 'Chess',\n source: removeHeader(chess),\n presetId: 'dxos.org/function/chess',\n },\n {\n id: 'dxos.org/script/email',\n name: 'Email',\n source: removeHeader(email),\n presetId: 'dxos.org/function/email',\n },\n {\n id: 'dxos.org/script/discord',\n name: 'Discord',\n source: removeHeader(discord),\n presetId: 'dxos.org/function/discord',\n },\n {\n id: 'dxos.org/script/gmail',\n name: 'Gmail',\n source: removeHeader(gmail),\n presetId: 'dxos.org/function/gmail',\n },\n {\n id: 'dxos.org/script/data-generator',\n name: 'Data Generator',\n source: removeHeader(dataGenerator),\n presetId: 'dxos.org/function/data-generator',\n },\n] as const;\n"],
5
+ "mappings": ";AAAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACcA,IAAMA,eAAe,CAACC,QAAgBA,IAAIC,MAAM,IAAA,EAAMC,MAAM,CAAA,EAAGC,KAAK,IAAA;AAW7D,IAAMC,YAAY;EACvB;IACEC,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaC,YAAAA;EACvB;EACA;IACEJ,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaE,aAAAA;EACvB;EACA;IACEL,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaG,oBAAAA;EACvB;EACA;IACEN,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaI,YAAAA;IACrBC,UAAU;EACZ;EACA;IACER,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaM,aAAAA;IACrBD,UAAU;EACZ;EACA;IACER,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaO,aAAAA;IACrBF,UAAU;EACZ;EACA;IACER,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaQ,eAAAA;IACrBH,UAAU;EACZ;EACA;IACER,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaS,aAAAA;IACrBJ,UAAU;EACZ;EACA;IACER,IAAI;IACJC,MAAM;IACNC,QAAQC,aAAaU,sBAAAA;IACrBL,UAAU;EACZ;;",
6
+ "names": ["removeHeader", "str", "split", "slice", "join", "templates", "id", "name", "source", "removeHeader", "ping", "forex", "forexEffect", "chat", "presetId", "chess", "email", "discord", "gmail", "dataGenerator"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ScriptCapabilities
3
- } from "./chunk-5TVBECWH.mjs";
4
- import "./chunk-QYAREHGH.mjs";
3
+ } from "./chunk-OKXN2N7M.mjs";
4
+ import "./chunk-EZVXV6DA.mjs";
5
5
 
6
6
  // src/capabilities/compiler.ts
7
7
  import wasmUrl from "esbuild-wasm/esbuild.wasm?url";
@@ -12,6 +12,19 @@ import { initializeBundler } from "@dxos/functions/bundler";
12
12
  import { createDefaultMapFromCDN, createSystem, createVirtualTypeScriptEnvironment } from "@typescript/vfs";
13
13
  import ts from "typescript";
14
14
  import { invariant } from "@dxos/invariant";
15
+ function _define_property(obj, key, value) {
16
+ if (key in obj) {
17
+ Object.defineProperty(obj, key, {
18
+ value,
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true
22
+ });
23
+ } else {
24
+ obj[key] = value;
25
+ }
26
+ return obj;
27
+ }
15
28
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-script/src/compiler/compiler.ts";
16
29
  var defaultOptions = {
17
30
  lib: [
@@ -21,9 +34,6 @@ var defaultOptions = {
21
34
  target: ts.ScriptTarget.ES2022
22
35
  };
23
36
  var Compiler = class {
24
- constructor(_options = defaultOptions) {
25
- this._options = _options;
26
- }
27
37
  async initialize() {
28
38
  if (this._env) {
29
39
  return;
@@ -59,10 +69,16 @@ var Compiler = class {
59
69
  compile(fileName) {
60
70
  return this.environment.languageService.getEmitOutput(fileName);
61
71
  }
72
+ constructor(_options = defaultOptions) {
73
+ _define_property(this, "_options", void 0);
74
+ _define_property(this, "_env", void 0);
75
+ _define_property(this, "_fsMap", void 0);
76
+ this._options = _options;
77
+ }
62
78
  };
63
79
 
64
80
  // src/capabilities/compiler.ts
65
- var compiler_default = async () => {
81
+ var compiler_default = (async () => {
66
82
  const compiler = new Compiler();
67
83
  await compiler.initialize();
68
84
  compiler.setFile("/src/typings.d.ts", "declare module 'https://*';");
@@ -75,8 +91,8 @@ var compiler_default = async () => {
75
91
  wasmUrl
76
92
  });
77
93
  return contributes(ScriptCapabilities.Compiler, compiler);
78
- };
94
+ });
79
95
  export {
80
96
  compiler_default as default
81
97
  };
82
- //# sourceMappingURL=compiler-CXCUA4UQ.mjs.map
98
+ //# sourceMappingURL=compiler-G2N2CG63.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/compiler.ts", "../../../src/compiler/compiler.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @ts-ignore\nimport wasmUrl from 'esbuild-wasm/esbuild.wasm?url';\n\nimport { contributes } from '@dxos/app-framework';\nimport { initializeBundler } from '@dxos/functions/bundler';\n\nimport { Compiler } from '../compiler';\n\nimport { ScriptCapabilities } from './capabilities';\n\nexport default async () => {\n const compiler = new Compiler();\n\n await compiler.initialize();\n // TODO(wittjosiah): Fetch types for https modules.\n compiler.setFile('/src/typings.d.ts', \"declare module 'https://*';\");\n // TODO(wittjosiah): Proper function handler types.\n // TODO(wittjosiah): Remove.\n compiler.setFile(\n '/src/runtime.ts',\n `\n export const Filter: any = {};\n export type FunctionHandler = ({ event, context }: { event: any; context: any }) => Promise<Response>;\n export const functionHandler = (handler: FunctionHandler) => handler;\n `,\n );\n await initializeBundler({ wasmUrl });\n\n return contributes(ScriptCapabilities.Compiler, compiler);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type VirtualTypeScriptEnvironment,\n createDefaultMapFromCDN,\n createSystem,\n createVirtualTypeScriptEnvironment,\n} from '@typescript/vfs';\nimport ts from 'typescript';\n\nimport { invariant } from '@dxos/invariant';\n\nconst defaultOptions: ts.CompilerOptions = {\n lib: ['DOM', 'es2022'],\n target: ts.ScriptTarget.ES2022,\n};\n\nexport class Compiler {\n private _env: VirtualTypeScriptEnvironment | undefined;\n private _fsMap: Map<string, string> | undefined;\n\n constructor(private readonly _options: ts.CompilerOptions = defaultOptions) {}\n\n async initialize(): Promise<void> {\n if (this._env) {\n return;\n }\n\n // TODO(wittjosiah): Figure out how to get workers working in plugin packages.\n // https://github.com/val-town/codemirror-ts?tab=readme-ov-file#setup-worker\n this._fsMap = await createDefaultMapFromCDN(this._options, '5.5.4', true, ts);\n const system = createSystem(this._fsMap);\n this._env = createVirtualTypeScriptEnvironment(system, [], ts, this._options);\n }\n\n get environment() {\n invariant(this._env, 'Compiler environment not initialized.');\n return this._env;\n }\n\n setFile(fileName: string, content: string): void {\n invariant(this._fsMap, 'File system map not initialized.');\n this.environment.createFile(fileName, content);\n }\n\n compile(fileName: string): ts.EmitOutput {\n return this.environment.languageService.getEmitOutput(fileName);\n }\n}\n"],
5
+ "mappings": ";;;;;;AAKA,OAAOA,aAAa;AAEpB,SAASC,mBAAmB;AAC5B,SAASC,yBAAyB;;;ACJlC,SAEEC,yBACAC,cACAC,0CACK;AACP,OAAOC,QAAQ;AAEf,SAASC,iBAAiB;;;;;;;;;;;;;;;AAE1B,IAAMC,iBAAqC;EACzCC,KAAK;IAAC;IAAO;;EACbC,QAAQJ,GAAGK,aAAaC;AAC1B;AAEO,IAAMC,WAAN,MAAMA;EAMX,MAAMC,aAA4B;AAChC,QAAI,KAAKC,MAAM;AACb;IACF;AAIA,SAAKC,SAAS,MAAMb,wBAAwB,KAAKc,UAAU,SAAS,MAAMX,EAAAA;AAC1E,UAAMY,SAASd,aAAa,KAAKY,MAAM;AACvC,SAAKD,OAAOV,mCAAmCa,QAAQ,CAAA,GAAIZ,IAAI,KAAKW,QAAQ;EAC9E;EAEA,IAAIE,cAAc;AAChBZ,cAAU,KAAKQ,MAAM,yCAAA;;;;;;;;;AACrB,WAAO,KAAKA;EACd;EAEAK,QAAQC,UAAkBC,SAAuB;AAC/Cf,cAAU,KAAKS,QAAQ,oCAAA;;;;;;;;;AACvB,SAAKG,YAAYI,WAAWF,UAAUC,OAAAA;EACxC;EAEAE,QAAQH,UAAiC;AACvC,WAAO,KAAKF,YAAYM,gBAAgBC,cAAcL,QAAAA;EACxD;EA1BA,YAA6BJ,WAA+BT,gBAAgB;;AAH5E,qBAAA,MAAQO,QAAR,MAAA;AACA,qBAAA,MAAQC,UAAR,MAAA;SAE6BC,WAAAA;EAAgD;AA2B/E;;;ADpCA,IAAA,oBAAe,YAAA;AACb,QAAMU,WAAW,IAAIC,SAAAA;AAErB,QAAMD,SAASE,WAAU;AAEzBF,WAASG,QAAQ,qBAAqB,6BAAA;AAGtCH,WAASG,QACP,mBACA;;;;OAIG;AAEL,QAAMC,kBAAkB;IAAEC;EAAQ,CAAA;AAElC,SAAOC,YAAYC,mBAAmBN,UAAUD,QAAAA;AAClD;",
6
+ "names": ["wasmUrl", "contributes", "initializeBundler", "createDefaultMapFromCDN", "createSystem", "createVirtualTypeScriptEnvironment", "ts", "invariant", "defaultOptions", "lib", "target", "ScriptTarget", "ES2022", "Compiler", "initialize", "_env", "_fsMap", "_options", "system", "environment", "setFile", "fileName", "content", "createFile", "compile", "languageService", "getEmitOutput", "compiler", "Compiler", "initialize", "setFile", "initializeBundler", "wasmUrl", "contributes", "ScriptCapabilities"]
7
+ }
@@ -1,52 +1,64 @@
1
1
  import {
2
2
  DeploymentDialog,
3
+ NotebookContainer,
3
4
  ScriptContainer,
4
5
  ScriptObjectSettings,
5
6
  ScriptPluginSettings,
6
7
  ScriptProperties,
7
8
  TestContainer,
8
9
  TestPanel
9
- } from "./chunk-FIM2MVNJ.mjs";
10
+ } from "./chunk-I3QSGUFJ.mjs";
11
+ import {
12
+ NotebookMenu,
13
+ NotebookStack
14
+ } from "./chunk-75LH4EUR.mjs";
10
15
  import {
11
16
  ScriptCapabilities
12
- } from "./chunk-5TVBECWH.mjs";
17
+ } from "./chunk-OKXN2N7M.mjs";
13
18
  import {
14
19
  DEPLOYMENT_DIALOG
15
- } from "./chunk-P4HQKUCP.mjs";
16
- import "./chunk-3U6DTUH3.mjs";
17
- import "./chunk-R4R7VOFY.mjs";
18
- import "./chunk-FMDXKOP7.mjs";
20
+ } from "./chunk-NM4WQS4F.mjs";
21
+ import "./chunk-E7DXDICD.mjs";
22
+ import "./chunk-N6M34EUC.mjs";
23
+ import {
24
+ deployScript,
25
+ getAccessCredential,
26
+ getFunctionUrl,
27
+ isScriptDeployed,
28
+ updateFunctionMetadata
29
+ } from "./chunk-JO2O7W6J.mjs";
19
30
  import {
31
+ Notebook,
20
32
  ScriptAction
21
- } from "./chunk-IS4OG2UW.mjs";
33
+ } from "./chunk-5CYLWXRH.mjs";
34
+ import "./chunk-ST3ACVUC.mjs";
22
35
  import {
23
- SCRIPT_PLUGIN,
24
36
  defaultScriptsForIntegration,
25
37
  meta
26
- } from "./chunk-QYAREHGH.mjs";
38
+ } from "./chunk-EZVXV6DA.mjs";
27
39
 
28
40
  // src/capabilities/index.ts
29
41
  import { lazy } from "@dxos/app-framework";
30
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-HLQ7K3BT.mjs"));
31
- var ArtifactDefinition = lazy(() => import("./artifact-definition-24Q3IHOU.mjs"));
32
- var Compiler = lazy(() => import("./compiler-CXCUA4UQ.mjs"));
33
- var IntentResolver = lazy(() => import("./intent-resolver-7B77IG3N.mjs"));
34
- var ReactSurface = lazy(() => import("./react-surface-FYYXZA7C.mjs"));
35
- var ScriptSettings = lazy(() => import("./settings-KCTBK5TY.mjs"));
42
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-DPYULSME.mjs"));
43
+ var BlueprintDefinition = lazy(() => import("./blueprint-definition-ET5KZ46I.mjs"));
44
+ var Compiler = lazy(() => import("./compiler-G2N2CG63.mjs"));
45
+ var IntentResolver = lazy(() => import("./intent-resolver-JLU7DVLQ.mjs"));
46
+ var ReactSurface = lazy(() => import("./react-surface-76SDTUYG.mjs"));
47
+ var ScriptSettings = lazy(() => import("./settings-ERFKVNUK.mjs"));
36
48
 
37
49
  // src/ScriptPlugin.tsx
38
- import { Schema } from "effect";
39
- import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from "@dxos/app-framework";
50
+ import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from "@dxos/app-framework";
40
51
  import { Ref } from "@dxos/echo";
41
52
  import { ScriptType as ScriptType2 } from "@dxos/functions";
42
53
  import { ClientEvents } from "@dxos/plugin-client";
43
54
  import { SpaceCapabilities } from "@dxos/plugin-space";
44
55
  import { defineObjectForm } from "@dxos/plugin-space/types";
56
+ import { isNonNullable } from "@dxos/util";
45
57
 
46
58
  // src/events.ts
47
59
  import { defineEvent } from "@dxos/app-framework";
48
60
  (function(ScriptEvents2) {
49
- ScriptEvents2.SetupCompiler = defineEvent(`${SCRIPT_PLUGIN}/event/setup-compiler`);
61
+ ScriptEvents2.SetupCompiler = defineEvent(`${meta.id}/event/setup-compiler`);
50
62
  })(ScriptEvents || (ScriptEvents = {}));
51
63
  var ScriptEvents;
52
64
 
@@ -64,8 +76,18 @@ var translations = [
64
76
  "rename object label": "Rename script",
65
77
  "delete object label": "Delete script"
66
78
  },
79
+ [Notebook.Notebook.typename]: {
80
+ "typename label": "Notebook",
81
+ "typename label_zero": "Notebooks",
82
+ "typename label_one": "Notebook",
83
+ "typename label_other": "Notebooks",
84
+ "object name placeholder": "New notebook",
85
+ "rename object label": "Rename notebook",
86
+ "delete object label": "Delete notebook"
87
+ },
67
88
  [meta.id]: {
68
89
  "plugin name": "Scripts",
90
+ "settings title": "Scripts plugin settings",
69
91
  "description label": "Description",
70
92
  "description placeholder": "Enter description",
71
93
  "binding placeholder": "Function name",
@@ -89,6 +111,12 @@ var translations = [
89
111
  "open token manager label": "Open Token Manager",
90
112
  "publish label": "Publish",
91
113
  "publishing label": "Publishing",
114
+ "blueprint editor label": "Blueprint",
115
+ "blueprint editor description": "Create a blueprint that exposes this script as a tool.",
116
+ "blueprint instructions label": "Instructions",
117
+ "blueprint instructions placeholder": "Describe how this tool should be used.",
118
+ "create blueprint label": "Create blueprint",
119
+ "creating label": "Creating\u2026",
92
120
  "editor input mode label": "Editor input mode",
93
121
  "select editor input mode placeholder": "Select editor input mode\u2026",
94
122
  "settings editor input mode default label": "Default",
@@ -99,8 +127,7 @@ var translations = [
99
127
  "script test label": "Test",
100
128
  "script logs label": "Logs",
101
129
  "deployment dialog title": "Default Scripts",
102
- "deployment dialog scripts found message_one": "We found the following script template for your new integration:",
103
- "deployment dialog scripts found message_other": "We found the following script templates for your new integration:",
130
+ "deployment dialog scripts found message": "Script templates:",
104
131
  "deployment dialog deploy functions button label_one": "Create and deploy script",
105
132
  "deployment dialog deploy functions button label_other": "Create and deploy scripts",
106
133
  "deployment dialog deploy functions pending button label_one": "Deploying script",
@@ -117,14 +144,24 @@ var translations = [
117
144
  "script deployment error toast description_one": "There was an error deploying your script.",
118
145
  "script deployment error toast description_other": "There was an error deploying your scripts.",
119
146
  "script deployment error toast close label_one": "Close",
120
- "script deployment error toast close label_other": "Close"
147
+ "script deployment error toast close label_other": "Close",
148
+ "notebook cell placeholder": "Enter script",
149
+ "notebook cell delete label": "Delete cell",
150
+ "notebook cell prompt run label": "Run",
151
+ "notebook cell insert markdown label": "Insert Markdown",
152
+ "notebook cell insert script label": "Insert Script",
153
+ "notebook cell insert prompt label": "Insert Prompt",
154
+ "notebook cell insert query label": "Insert Query",
155
+ "notebook markdown placeholder": "Enter Markdown",
156
+ "notebook prompt placeholder": "Enter prompt",
157
+ "notebook cell insert label": "Insert cell"
121
158
  }
122
159
  }
123
160
  }
124
161
  ];
125
162
 
126
163
  // src/ScriptPlugin.tsx
127
- var ScriptPlugin = () => definePlugin(meta, [
164
+ var ScriptPlugin = definePlugin(meta, () => [
128
165
  defineModule({
129
166
  id: `${meta.id}/module/settings`,
130
167
  activatesOn: Events.SetupSettings,
@@ -143,16 +180,30 @@ var ScriptPlugin = () => definePlugin(meta, [
143
180
  defineModule({
144
181
  id: `${meta.id}/module/metadata`,
145
182
  activatesOn: Events.SetupMetadata,
146
- activate: () => contributes(Capabilities.Metadata, {
147
- id: ScriptType2.typename,
148
- metadata: {
149
- icon: "ph--code--regular",
150
- // TODO(wittjosiah): Move out of metadata.
151
- loadReferences: async (script) => await Ref.Array.loadAll([
152
- script.source
153
- ])
154
- }
155
- })
183
+ activate: () => [
184
+ contributes(Capabilities.Metadata, {
185
+ id: ScriptType2.typename,
186
+ metadata: {
187
+ icon: "ph--code--regular",
188
+ // TODO(wittjosiah): Move out of metadata.
189
+ loadReferences: async (script) => await Ref.Array.loadAll([
190
+ script.source
191
+ ])
192
+ }
193
+ }),
194
+ contributes(Capabilities.Metadata, {
195
+ id: Notebook.Notebook.typename,
196
+ metadata: {
197
+ icon: "ph--notebook--regular",
198
+ // TODO(wittjosiah): Move out of metadata.
199
+ loadReferences: async (notebook) => await Ref.Array.loadAll(notebook.cells.flatMap((cell) => [
200
+ cell.script,
201
+ cell.view,
202
+ cell.chat
203
+ ].filter(isNonNullable)))
204
+ }
205
+ })
206
+ ]
156
207
  }),
157
208
  defineModule({
158
209
  id: `${meta.id}/module/app-graph-builder`,
@@ -160,12 +211,24 @@ var ScriptPlugin = () => definePlugin(meta, [
160
211
  activate: AppGraphBuilder
161
212
  }),
162
213
  defineModule({
163
- id: `${meta.id}/module/object-form`,
214
+ id: `${meta.id}/module/script/object-form`,
164
215
  activatesOn: ClientEvents.SetupSchema,
165
216
  activate: () => contributes(SpaceCapabilities.ObjectForm, defineObjectForm({
166
217
  objectSchema: ScriptType2,
167
- formSchema: ScriptAction.CreateScriptSchema.pipe(Schema.omit("initialTemplateId")),
168
- getIntent: (props, options) => createIntent(ScriptAction.Create, {
218
+ formSchema: ScriptAction.ScriptProps,
219
+ getIntent: (props, options) => createIntent(ScriptAction.CreateScript, {
220
+ ...props,
221
+ space: options.space
222
+ })
223
+ }))
224
+ }),
225
+ defineModule({
226
+ id: `${meta.id}/module/notebook/object-form`,
227
+ activatesOn: ClientEvents.SetupSchema,
228
+ activate: () => contributes(SpaceCapabilities.ObjectForm, defineObjectForm({
229
+ objectSchema: Notebook.Notebook,
230
+ formSchema: ScriptAction.NotebookProps,
231
+ getIntent: (props, options) => createIntent(ScriptAction.CreateNotebook, {
169
232
  ...props,
170
233
  space: options.space
171
234
  })
@@ -186,15 +249,17 @@ var ScriptPlugin = () => definePlugin(meta, [
186
249
  activate: IntentResolver
187
250
  }),
188
251
  defineModule({
189
- id: `${meta.id}/module/artifact-definition`,
252
+ id: `${meta.id}/module/blueprint`,
190
253
  activatesOn: Events.SetupArtifactDefinition,
191
- activate: ArtifactDefinition
254
+ activate: BlueprintDefinition
192
255
  })
193
256
  ]);
194
257
  export {
195
258
  DEPLOYMENT_DIALOG,
196
259
  DeploymentDialog,
197
- SCRIPT_PLUGIN,
260
+ NotebookContainer,
261
+ NotebookMenu,
262
+ NotebookStack,
198
263
  ScriptCapabilities,
199
264
  ScriptContainer,
200
265
  ScriptObjectSettings,
@@ -204,6 +269,11 @@ export {
204
269
  TestContainer,
205
270
  TestPanel,
206
271
  defaultScriptsForIntegration,
207
- meta
272
+ deployScript,
273
+ getAccessCredential,
274
+ getFunctionUrl,
275
+ isScriptDeployed,
276
+ meta,
277
+ updateFunctionMetadata
208
278
  };
209
279
  //# sourceMappingURL=index.mjs.map