@dxos/plugin-script 0.8.4-main.67995b8 → 0.8.4-main.72ec0f3

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 (306) hide show
  1. package/dist/lib/browser/DeploymentDialog-MZX4T77L.mjs +14 -0
  2. package/dist/lib/browser/NotebookContainer-RTESC4OV.mjs +817 -0
  3. package/dist/lib/browser/NotebookContainer-RTESC4OV.mjs.map +7 -0
  4. package/dist/lib/browser/ScriptContainer-T2BAZDJ4.mjs +147 -0
  5. package/dist/lib/browser/ScriptContainer-T2BAZDJ4.mjs.map +7 -0
  6. package/dist/lib/browser/{app-graph-builder-HLQ7K3BT.mjs → app-graph-builder-2WR2ATTJ.mjs} +12 -10
  7. package/dist/lib/browser/app-graph-builder-2WR2ATTJ.mjs.map +7 -0
  8. package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs +30 -0
  9. package/dist/lib/browser/blueprint-definition-6PZWZM2Y.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-2G2NA6DQ.mjs +88 -0
  11. package/dist/lib/browser/chunk-2G2NA6DQ.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-P4HQKUCP.mjs → chunk-3IJASGG5.mjs} +23 -21
  13. package/dist/lib/browser/chunk-3IJASGG5.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-4M7U2WVT.mjs +304 -0
  15. package/dist/lib/browser/chunk-4M7U2WVT.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-5JSNQYZZ.mjs +517 -0
  17. package/dist/lib/browser/chunk-5JSNQYZZ.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-QYAREHGH.mjs → chunk-EB6AXFXO.mjs} +8 -5
  19. package/dist/lib/browser/chunk-EB6AXFXO.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-FIM2MVNJ.mjs → chunk-GAFCKEII.mjs} +179 -88
  21. package/dist/lib/browser/chunk-GAFCKEII.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  23. package/dist/lib/browser/chunk-LNNCD2H4.mjs +102 -0
  24. package/dist/lib/browser/chunk-LNNCD2H4.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-M6KJPUJK.mjs +111 -0
  26. package/dist/lib/browser/chunk-M6KJPUJK.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-5TVBECWH.mjs → chunk-UOQ6NCH3.mjs} +2 -2
  28. package/dist/lib/browser/{compiler-CXCUA4UQ.mjs → compiler-4KHRSX7J.mjs} +10 -6
  29. package/dist/lib/browser/compiler-4KHRSX7J.mjs.map +7 -0
  30. package/dist/lib/browser/index.mjs +108 -44
  31. package/dist/lib/browser/index.mjs.map +3 -3
  32. package/dist/lib/browser/{intent-resolver-S3H2SMUY.mjs → intent-resolver-AFJ575VK.mjs} +39 -24
  33. package/dist/lib/browser/intent-resolver-AFJ575VK.mjs.map +7 -0
  34. package/dist/lib/browser/meta.json +1 -1
  35. package/dist/lib/browser/{react-surface-FYYXZA7C.mjs → react-surface-QEQ3QUQA.mjs} +45 -21
  36. package/dist/lib/browser/react-surface-QEQ3QUQA.mjs.map +7 -0
  37. package/dist/lib/browser/{settings-KCTBK5TY.mjs → settings-LNLSTZM4.mjs} +10 -8
  38. package/dist/lib/browser/settings-LNLSTZM4.mjs.map +7 -0
  39. package/dist/lib/browser/templates/index.mjs +2 -1
  40. package/dist/lib/browser/types/index.mjs +8 -4
  41. package/dist/lib/node-esm/DeploymentDialog-GL5AUWMR.mjs +15 -0
  42. package/dist/lib/node-esm/DeploymentDialog-GL5AUWMR.mjs.map +7 -0
  43. package/dist/lib/node-esm/NotebookContainer-SVD3A3D6.mjs +818 -0
  44. package/dist/lib/node-esm/NotebookContainer-SVD3A3D6.mjs.map +7 -0
  45. package/dist/lib/node-esm/ScriptContainer-2CE3H3JJ.mjs +148 -0
  46. package/dist/lib/node-esm/ScriptContainer-2CE3H3JJ.mjs.map +7 -0
  47. package/dist/lib/node-esm/{app-graph-builder-7EYIHWH4.mjs → app-graph-builder-NCVLUL5R.mjs} +12 -10
  48. package/dist/lib/node-esm/app-graph-builder-NCVLUL5R.mjs.map +7 -0
  49. package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs +31 -0
  50. package/dist/lib/node-esm/blueprint-definition-5R6YCSZZ.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-35M3CHYE.mjs → chunk-55JZVM6K.mjs} +2 -2
  52. package/dist/lib/node-esm/chunk-57JA6XL5.mjs +90 -0
  53. package/dist/lib/node-esm/chunk-57JA6XL5.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-HDKR5WCD.mjs +113 -0
  55. package/dist/lib/node-esm/chunk-HDKR5WCD.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  57. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  58. package/dist/lib/node-esm/{chunk-AHXJ6NQU.mjs → chunk-IBV2DR36.mjs} +8 -5
  59. package/dist/lib/node-esm/chunk-IBV2DR36.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-IQTBVH4L.mjs +518 -0
  61. package/dist/lib/node-esm/chunk-IQTBVH4L.mjs.map +7 -0
  62. package/dist/lib/node-esm/{chunk-7NMI4CEU.mjs → chunk-KJKZ4KNO.mjs} +179 -88
  63. package/dist/lib/node-esm/chunk-KJKZ4KNO.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-NNHWLRHT.mjs +103 -0
  65. package/dist/lib/node-esm/chunk-NNHWLRHT.mjs.map +7 -0
  66. package/dist/lib/node-esm/{chunk-QKK3NDHW.mjs → chunk-RIE676OW.mjs} +23 -21
  67. package/dist/lib/node-esm/chunk-RIE676OW.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-YRTA4EHU.mjs +305 -0
  69. package/dist/lib/node-esm/chunk-YRTA4EHU.mjs.map +7 -0
  70. package/dist/lib/node-esm/{compiler-EPFKQXPE.mjs → compiler-DU5NQISX.mjs} +10 -6
  71. package/dist/lib/node-esm/compiler-DU5NQISX.mjs.map +7 -0
  72. package/dist/lib/node-esm/index.mjs +108 -44
  73. package/dist/lib/node-esm/index.mjs.map +3 -3
  74. package/dist/lib/node-esm/{intent-resolver-OHKNJFCC.mjs → intent-resolver-A5VVK746.mjs} +39 -24
  75. package/dist/lib/node-esm/intent-resolver-A5VVK746.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-U77YT7VF.mjs} +45 -21
  78. package/dist/lib/node-esm/react-surface-U77YT7VF.mjs.map +7 -0
  79. package/dist/lib/node-esm/{settings-DXZ334A3.mjs → settings-IUFMOCXY.mjs} +10 -8
  80. package/dist/lib/node-esm/settings-IUFMOCXY.mjs.map +7 -0
  81. package/dist/lib/node-esm/templates/index.mjs +2 -1
  82. package/dist/lib/node-esm/types/index.mjs +8 -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 +4 -4
  102. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  103. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.stories.d.ts +243 -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 +1 -1
  108. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  109. package/dist/types/src/components/NotebookContainer.d.ts +10 -0
  110. package/dist/types/src/components/NotebookContainer.d.ts.map +1 -0
  111. package/dist/types/src/components/NotebookContainer.stories.d.ts +251 -0
  112. package/dist/types/src/components/NotebookContainer.stories.d.ts.map +1 -0
  113. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +15 -0
  114. package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -0
  115. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +9 -0
  116. package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -0
  117. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +14 -0
  118. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -0
  119. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +245 -0
  120. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -0
  121. package/dist/types/src/components/NotebookStack/index.d.ts +3 -0
  122. package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -0
  123. package/dist/types/src/components/ScriptContainer.d.ts +4 -4
  124. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  125. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +5 -6
  126. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  127. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +242 -10
  128. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  129. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +2 -2
  130. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
  131. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts +2 -2
  132. package/dist/types/src/components/Settings/ScriptPluginSettings.d.ts.map +1 -1
  133. package/dist/types/src/components/TestPanel/TestContainer.d.ts +2 -2
  134. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
  135. package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
  136. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +4 -2
  137. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  138. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +11 -4
  139. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  140. package/dist/types/src/components/index.d.ts +3 -4
  141. package/dist/types/src/components/index.d.ts.map +1 -1
  142. package/dist/types/src/events.d.ts.map +1 -1
  143. package/dist/types/src/hooks/deploy.d.ts +19 -16
  144. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  145. package/dist/types/src/hooks/format.d.ts +2 -2
  146. package/dist/types/src/hooks/format.d.ts.map +1 -1
  147. package/dist/types/src/hooks/template.d.ts +4 -14
  148. package/dist/types/src/hooks/template.d.ts.map +1 -1
  149. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  150. package/dist/types/src/index.d.ts +1 -0
  151. package/dist/types/src/index.d.ts.map +1 -1
  152. package/dist/types/src/meta.d.ts +0 -1
  153. package/dist/types/src/meta.d.ts.map +1 -1
  154. package/dist/types/src/notebook/compute-graph.d.ts +45 -0
  155. package/dist/types/src/notebook/compute-graph.d.ts.map +1 -0
  156. package/dist/types/src/notebook/compute-graph.test.d.ts +2 -0
  157. package/dist/types/src/notebook/compute-graph.test.d.ts.map +1 -0
  158. package/dist/types/src/notebook/eval.d.ts +13 -0
  159. package/dist/types/src/notebook/eval.d.ts.map +1 -0
  160. package/dist/types/src/notebook/index.d.ts +2 -0
  161. package/dist/types/src/notebook/index.d.ts.map +1 -0
  162. package/dist/types/src/notebook/vfs-parser.d.ts +74 -0
  163. package/dist/types/src/notebook/vfs-parser.d.ts.map +1 -0
  164. package/dist/types/src/notebook/vfs-parser.test.d.ts +2 -0
  165. package/dist/types/src/notebook/vfs-parser.test.d.ts.map +1 -0
  166. package/dist/types/src/templates/chess.d.ts.map +1 -1
  167. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  168. package/dist/types/src/templates/discord.d.ts.map +1 -1
  169. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  170. package/dist/types/src/templates/forex.d.ts.map +1 -1
  171. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  172. package/dist/types/src/templates/index.d.ts +43 -1
  173. package/dist/types/src/templates/index.d.ts.map +1 -1
  174. package/dist/types/src/templates/{echo.d.ts → ping.d.ts} +1 -1
  175. package/dist/types/src/templates/ping.d.ts.map +1 -0
  176. package/dist/types/src/testing/data.d.ts +3 -0
  177. package/dist/types/src/testing/data.d.ts.map +1 -0
  178. package/dist/types/src/testing/index.d.ts +2 -0
  179. package/dist/types/src/testing/index.d.ts.map +1 -0
  180. package/dist/types/src/translations.d.ts +30 -5
  181. package/dist/types/src/translations.d.ts.map +1 -1
  182. package/dist/types/src/types/Notebook.d.ts +31 -0
  183. package/dist/types/src/types/Notebook.d.ts.map +1 -0
  184. package/dist/types/src/types/actions.d.ts +54 -0
  185. package/dist/types/src/types/actions.d.ts.map +1 -0
  186. package/dist/types/src/types/index.d.ts +3 -1
  187. package/dist/types/src/types/index.d.ts.map +1 -1
  188. package/dist/types/src/types/types.d.ts +6 -0
  189. package/dist/types/src/types/types.d.ts.map +1 -0
  190. package/dist/types/src/util/deploy.d.ts +7 -7
  191. package/dist/types/src/util/deploy.d.ts.map +1 -1
  192. package/dist/types/src/util/functions.d.ts +6 -3
  193. package/dist/types/src/util/functions.d.ts.map +1 -1
  194. package/dist/types/tsconfig.tsbuildinfo +1 -1
  195. package/package.json +85 -76
  196. package/src/ScriptPlugin.tsx +90 -71
  197. package/src/capabilities/app-graph-builder.ts +12 -11
  198. package/src/capabilities/artifact-definition.ts +8 -6
  199. package/src/capabilities/blueprint-definition.ts +30 -0
  200. package/src/capabilities/compiler.ts +3 -2
  201. package/src/capabilities/index.ts +1 -1
  202. package/src/capabilities/intent-resolver.ts +21 -12
  203. package/src/capabilities/react-surface.tsx +33 -19
  204. package/src/capabilities/settings.ts +3 -3
  205. package/src/compiler/compiler.ts +1 -1
  206. package/src/components/DeploymentDialog/DeploymentDialog.stories.tsx +39 -20
  207. package/src/components/DeploymentDialog/DeploymentDialog.tsx +45 -34
  208. package/src/components/DeploymentDialog/index.ts +1 -1
  209. package/src/components/FrameContainer/FrameContainer.tsx +5 -4
  210. package/src/components/NotebookContainer.stories.tsx +83 -0
  211. package/src/components/NotebookContainer.tsx +263 -0
  212. package/src/components/NotebookStack/NotebookCell.tsx +214 -0
  213. package/src/components/NotebookStack/NotebookMenu.tsx +47 -0
  214. package/src/components/NotebookStack/NotebookStack.stories.tsx +54 -0
  215. package/src/components/NotebookStack/NotebookStack.tsx +86 -0
  216. package/src/components/NotebookStack/index.ts +6 -0
  217. package/src/components/ScriptContainer.tsx +7 -6
  218. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +34 -17
  219. package/src/components/ScriptToolbar/ScriptToolbar.tsx +37 -30
  220. package/src/components/Settings/ScriptObjectSettings.tsx +127 -36
  221. package/src/components/Settings/ScriptPluginSettings.tsx +37 -47
  222. package/src/components/TestPanel/TestContainer.tsx +4 -3
  223. package/src/components/TestPanel/TestPanel.tsx +42 -19
  224. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +79 -31
  225. package/src/components/TypescriptEditor/TypescriptEditor.tsx +37 -35
  226. package/src/components/index.ts +3 -0
  227. package/src/events.ts +2 -2
  228. package/src/hooks/deploy.ts +23 -24
  229. package/src/hooks/format.ts +4 -4
  230. package/src/hooks/template.ts +6 -15
  231. package/src/hooks/useCreateAndDeployScriptTemplates.ts +11 -6
  232. package/src/index.ts +1 -0
  233. package/src/meta.ts +7 -5
  234. package/src/notebook/compute-graph.test.ts +70 -0
  235. package/src/notebook/compute-graph.ts +206 -0
  236. package/src/notebook/eval.ts +105 -0
  237. package/src/notebook/index.ts +5 -0
  238. package/src/notebook/vfs-parser.test.ts +149 -0
  239. package/src/notebook/vfs-parser.ts +451 -0
  240. package/src/templates/chess.ts +3 -1
  241. package/src/templates/data-generator.ts +9 -3
  242. package/src/templates/discord.ts +12 -4
  243. package/src/templates/forex-effect.ts +7 -3
  244. package/src/templates/forex.ts +3 -1
  245. package/src/templates/gmail.ts +34 -64
  246. package/src/templates/index.ts +6 -6
  247. package/src/testing/data.ts +72 -0
  248. package/src/testing/index.ts +5 -0
  249. package/src/translations.ts +33 -7
  250. package/src/types/Notebook.ts +41 -0
  251. package/src/types/actions.ts +53 -0
  252. package/src/types/index.ts +3 -1
  253. package/src/types/types.ts +15 -0
  254. package/src/util/deploy.ts +29 -46
  255. package/src/util/functions.ts +37 -7
  256. package/dist/lib/browser/DeploymentDialog-M4QIHTDR.mjs +0 -12
  257. package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs +0 -262
  258. package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
  259. package/dist/lib/browser/app-graph-builder-HLQ7K3BT.mjs.map +0 -7
  260. package/dist/lib/browser/artifact-definition-CK3BIBSI.mjs +0 -247
  261. package/dist/lib/browser/artifact-definition-CK3BIBSI.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-3U6DTUH3.mjs +0 -283
  263. package/dist/lib/browser/chunk-3U6DTUH3.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-FIM2MVNJ.mjs.map +0 -7
  265. package/dist/lib/browser/chunk-FMDXKOP7.mjs +0 -233
  266. package/dist/lib/browser/chunk-FMDXKOP7.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-IS4OG2UW.mjs +0 -39
  268. package/dist/lib/browser/chunk-IS4OG2UW.mjs.map +0 -7
  269. package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
  270. package/dist/lib/browser/chunk-QYAREHGH.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-R4R7VOFY.mjs +0 -88
  272. package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
  273. package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
  274. package/dist/lib/browser/intent-resolver-S3H2SMUY.mjs.map +0 -7
  275. package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
  276. package/dist/lib/browser/settings-KCTBK5TY.mjs.map +0 -7
  277. package/dist/lib/node-esm/DeploymentDialog-3KPRWFE7.mjs +0 -13
  278. package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs +0 -263
  279. package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
  280. package/dist/lib/node-esm/app-graph-builder-7EYIHWH4.mjs.map +0 -7
  281. package/dist/lib/node-esm/artifact-definition-YCBV4YX2.mjs +0 -248
  282. package/dist/lib/node-esm/artifact-definition-YCBV4YX2.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-7NMI4CEU.mjs.map +0 -7
  284. package/dist/lib/node-esm/chunk-AHXJ6NQU.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs +0 -90
  286. package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs +0 -40
  288. package/dist/lib/node-esm/chunk-JIPFLBYA.mjs.map +0 -7
  289. package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-RT43MACC.mjs +0 -284
  291. package/dist/lib/node-esm/chunk-RT43MACC.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-XJPK3IYI.mjs +0 -234
  293. package/dist/lib/node-esm/chunk-XJPK3IYI.mjs.map +0 -7
  294. package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
  295. package/dist/lib/node-esm/intent-resolver-OHKNJFCC.mjs.map +0 -7
  296. package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
  297. package/dist/lib/node-esm/settings-DXZ334A3.mjs.map +0 -7
  298. package/dist/types/src/templates/echo.d.ts.map +0 -1
  299. package/dist/types/src/types/schema.d.ts +0 -38
  300. package/dist/types/src/types/schema.d.ts.map +0 -1
  301. package/src/types/schema.ts +0 -37
  302. /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → DeploymentDialog-MZX4T77L.mjs.map} +0 -0
  303. /package/dist/lib/{node-esm/DeploymentDialog-3KPRWFE7.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
  304. /package/dist/lib/browser/{chunk-5TVBECWH.mjs.map → chunk-UOQ6NCH3.mjs.map} +0 -0
  305. /package/dist/lib/node-esm/{chunk-35M3CHYE.mjs.map → chunk-55JZVM6K.mjs.map} +0 -0
  306. /package/src/templates/{echo.ts → ping.ts} +0 -0
@@ -0,0 +1,451 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { createSystem, createVirtualTypeScriptEnvironment } from '@typescript/vfs';
6
+ import ts from 'typescript';
7
+
8
+ import { invariant } from '@dxos/invariant';
9
+
10
+ import { builtIns, systemDefinitions } from './eval';
11
+
12
+ /**
13
+ * Default system definitions.
14
+ */
15
+ const systemFiles: VirtualFile[] = [
16
+ {
17
+ filename: '/lib.d.ts',
18
+ content: systemDefinitions,
19
+ },
20
+ ];
21
+
22
+ export type ParsedExpression = {
23
+ name?: string;
24
+ type?: 'function' | 'variable' | 'class' | 'interface';
25
+ value?: any;
26
+ valueType?: string;
27
+ parameters?: Array<{ name: string; type: string }>;
28
+ returnType?: string;
29
+ references?: string[];
30
+ };
31
+
32
+ export type VirtualFile = {
33
+ filename: string;
34
+ content: string;
35
+ };
36
+
37
+ /**
38
+ * TypeScript parser using Virtual File System for browser compatibility.
39
+ * This provides full TypeScript analysis including type information.
40
+ */
41
+ export class VirtualTypeScriptParser {
42
+ protected compilerOptions: ts.CompilerOptions = {
43
+ target: ts.ScriptTarget.ES2020,
44
+ module: ts.ModuleKind.ESNext,
45
+ strict: true,
46
+ esModuleInterop: true,
47
+ skipLibCheck: true,
48
+ forceConsistentCasingInfilenames: true,
49
+ jsx: ts.JsxEmit.React,
50
+ noLib: true, // Don't automatically include default lib files.
51
+ };
52
+
53
+ /**
54
+ * Parse a single expression or statement.
55
+ */
56
+ parseExpression(input: string): ParsedExpression {
57
+ invariant(input.trim() !== '', 'input must not be empty');
58
+ const files: VirtualFile[] = [{ filename: '/temp.ts', content: input }];
59
+ const analysis = this.analyzeFiles(files);
60
+
61
+ // If no declarations found, check for standalone expression references.
62
+ if (analysis.length === 0) {
63
+ const sourcefilename = '/temp.ts';
64
+ const env = this.createEnvironment([{ filename: sourcefilename, content: input }]);
65
+ const sourceFile = env.getSourceFile(sourcefilename);
66
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
67
+
68
+ if (sourceFile && typeChecker) {
69
+ // Check for assignment expressions.
70
+ const assignmentInfo = this.findAssignmentExpression(sourceFile, typeChecker);
71
+ if (assignmentInfo) {
72
+ return assignmentInfo;
73
+ }
74
+
75
+ const references = this.findAllReferences(sourceFile, typeChecker);
76
+ return { references };
77
+ }
78
+ }
79
+
80
+ return analysis[0];
81
+ }
82
+
83
+ /**
84
+ * Analyze multiple files with full type information.
85
+ */
86
+ analyzeFiles(files: VirtualFile[]): ParsedExpression[] {
87
+ const env = this.createEnvironment(files);
88
+ const results: ParsedExpression[] = [];
89
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
90
+
91
+ // Analyze each file.
92
+ files.forEach((file) => {
93
+ const sourceFile = env.getSourceFile(file.filename);
94
+ if (!sourceFile || !typeChecker) return;
95
+
96
+ const fileResults = this.analyzeSourceFile(sourceFile, typeChecker);
97
+ results.push(...fileResults);
98
+ });
99
+
100
+ return results;
101
+ }
102
+
103
+ /**
104
+ * Analyze a source file with type information.
105
+ */
106
+ protected analyzeSourceFile(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression[] {
107
+ const results: ParsedExpression[] = [];
108
+
109
+ const visit = (node: ts.Node) => {
110
+ // Function declarations.
111
+ if (ts.isFunctionDeclaration(node) && node.name) {
112
+ const symbol = typeChecker.getSymbolAtLocation(node.name);
113
+ const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node);
114
+ const signature = type && typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call)[0];
115
+
116
+ results.push({
117
+ name: node.name.text,
118
+ type: 'function',
119
+ parameters: this.extractParameters(signature, typeChecker),
120
+ returnType: signature ? typeChecker.typeToString(signature.getReturnType()) : 'any',
121
+ references: this.findReferences(node, sourceFile, typeChecker),
122
+ });
123
+ }
124
+
125
+ // Variable declarations.
126
+ else if (ts.isVariableStatement(node)) {
127
+ node.declarationList.declarations.forEach((declaration) => {
128
+ if (ts.isIdentifier(declaration.name)) {
129
+ const symbol = typeChecker.getSymbolAtLocation(declaration.name);
130
+ const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
131
+
132
+ let kind: 'function' | 'variable' = 'variable';
133
+ let parameters: Array<{ name: string; type: string }> | undefined;
134
+ let returnType: string | undefined;
135
+ let value: any;
136
+
137
+ // Get the type string.
138
+ const typeString = type ? typeChecker.typeToString(type) : 'any';
139
+
140
+ // Check if it's a function.
141
+ if (declaration.initializer) {
142
+ if (ts.isArrowFunction(declaration.initializer) || ts.isFunctionExpression(declaration.initializer)) {
143
+ kind = 'function';
144
+ const funcType = typeChecker.getTypeAtLocation(declaration.initializer);
145
+ const signature = typeChecker.getSignaturesOfType(funcType, ts.SignatureKind.Call)[0];
146
+ if (signature) {
147
+ parameters = this.extractParameters(signature, typeChecker);
148
+ returnType = typeChecker.typeToString(signature.getReturnType());
149
+ }
150
+ } else {
151
+ // Extract literal values
152
+ if (ts.isNumericLiteral(declaration.initializer)) {
153
+ value = Number(declaration.initializer.text);
154
+ } else if (ts.isStringLiteral(declaration.initializer)) {
155
+ value = declaration.initializer.text;
156
+ }
157
+ }
158
+ }
159
+
160
+ // Find references in the initializer only.
161
+ const refs = declaration.initializer
162
+ ? this.findReferences(declaration.initializer, sourceFile, typeChecker)
163
+ : [];
164
+
165
+ results.push({
166
+ name: declaration.name.text,
167
+ type: kind,
168
+ valueType: typeString,
169
+ value,
170
+ parameters,
171
+ returnType,
172
+ references: refs,
173
+ });
174
+ }
175
+ });
176
+ }
177
+
178
+ // Class declarations.
179
+ else if (ts.isClassDeclaration(node) && node.name) {
180
+ results.push({
181
+ name: node.name.text,
182
+ type: 'class',
183
+ references: this.findReferences(node, sourceFile, typeChecker),
184
+ });
185
+ }
186
+
187
+ // Interface declarations.
188
+ else if (ts.isInterfaceDeclaration(node)) {
189
+ results.push({
190
+ name: node.name.text,
191
+ type: 'interface',
192
+ references: this.findReferences(node, sourceFile, typeChecker),
193
+ });
194
+ }
195
+
196
+ ts.forEachChild(node, visit);
197
+ };
198
+
199
+ visit(sourceFile);
200
+ return results;
201
+ }
202
+
203
+ /**
204
+ * Extract parameter information from a signature.
205
+ */
206
+ private extractParameters(
207
+ signature: ts.Signature | undefined,
208
+ typeChecker: ts.TypeChecker,
209
+ ): Array<{ name: string; type: string }> {
210
+ if (!signature) return [];
211
+
212
+ return signature.parameters.map((param) => ({
213
+ name: param.getName(),
214
+ type: typeChecker.typeToString(typeChecker.getTypeOfSymbolAtLocation(param, param.valueDeclaration!)),
215
+ }));
216
+ }
217
+
218
+ /**
219
+ * Find all references to variables used in a node.
220
+ */
221
+ private findReferences(node: ts.Node, _sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
222
+ const references = new Set<string>();
223
+ const localSymbols = new Set<string>();
224
+
225
+ // First, collect local symbols (parameters, local variables).
226
+ const collectLocalSymbols = (node: ts.Node) => {
227
+ if (ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
228
+ node.parameters.forEach((param) => {
229
+ if (ts.isIdentifier(param.name)) {
230
+ localSymbols.add(param.name.text);
231
+ }
232
+ });
233
+ }
234
+
235
+ if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {
236
+ localSymbols.add(node.name.text);
237
+ }
238
+
239
+ ts.forEachChild(node, collectLocalSymbols);
240
+ };
241
+
242
+ collectLocalSymbols(node);
243
+
244
+ // Then find all identifier references.
245
+ const findRefs = (node: ts.Node) => {
246
+ if (ts.isIdentifier(node)) {
247
+ // Skip if it's a local symbol.
248
+ if (!localSymbols.has(node.text)) {
249
+ // Check if it's a reference (not a declaration).
250
+ const parent = node.parent;
251
+ const isDeclaration =
252
+ (ts.isVariableDeclaration(parent) && parent.name === node) ||
253
+ (ts.isFunctionDeclaration(parent) && parent.name === node) ||
254
+ (ts.isParameter(parent) && parent.name === node);
255
+
256
+ if (!isDeclaration && !this.isBuiltIn(node.text)) {
257
+ references.add(node.text);
258
+ }
259
+ }
260
+ }
261
+ ts.forEachChild(node, findRefs);
262
+ };
263
+
264
+ findRefs(node);
265
+ return Array.from(references);
266
+ }
267
+
268
+ /**
269
+ * Check if a name is a built-in global.
270
+ */
271
+ protected isBuiltIn(name: string): boolean {
272
+ return builtIns.has(name);
273
+ }
274
+
275
+ /**
276
+ * Find assignment expressions in a source file.
277
+ */
278
+ private findAssignmentExpression(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): ParsedExpression | null {
279
+ let result: ParsedExpression | null = null;
280
+
281
+ const visit = (node: ts.Node) => {
282
+ if (ts.isExpressionStatement(node) && ts.isBinaryExpression(node.expression)) {
283
+ const expr = node.expression;
284
+ if (expr.operatorToken.kind === ts.SyntaxKind.EqualsToken && ts.isIdentifier(expr.left)) {
285
+ const type = typeChecker.getTypeAtLocation(expr.right);
286
+ const typeString = typeChecker.typeToString(type);
287
+
288
+ // Get the literal value if it's a literal.
289
+ let value: any;
290
+ if (ts.isNumericLiteral(expr.right)) {
291
+ value = Number(expr.right.text);
292
+ } else if (ts.isStringLiteral(expr.right)) {
293
+ value = expr.right.text;
294
+ }
295
+
296
+ // Find references in the right-hand side.
297
+ const references = this.findReferences(expr.right, sourceFile, typeChecker);
298
+
299
+ result = {
300
+ name: expr.left.text,
301
+ type: 'variable',
302
+ valueType: typeString,
303
+ value,
304
+ references,
305
+ };
306
+ }
307
+ }
308
+ if (!result) {
309
+ ts.forEachChild(node, visit);
310
+ }
311
+ };
312
+
313
+ visit(sourceFile);
314
+ return result;
315
+ }
316
+
317
+ /**
318
+ * Find all identifier references in a source file.
319
+ */
320
+ protected findAllReferences(sourceFile: ts.SourceFile, _typeChecker: ts.TypeChecker): string[] {
321
+ const references = new Set<string>();
322
+
323
+ const visit = (node: ts.Node) => {
324
+ if (ts.isIdentifier(node)) {
325
+ // Skip if it's a declaration.
326
+ const parent = node.parent;
327
+ const isDeclaration =
328
+ (ts.isVariableDeclaration(parent) && parent.name === node) ||
329
+ (ts.isFunctionDeclaration(parent) && parent.name === node) ||
330
+ (ts.isParameter(parent) && parent.name === node);
331
+
332
+ // Skip if it's the left-hand side of an assignment.
333
+ const isAssignmentTarget =
334
+ ts.isBinaryExpression(parent) &&
335
+ parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
336
+ parent.left === node;
337
+
338
+ if (!isDeclaration && !isAssignmentTarget && !this.isBuiltIn(node.text)) {
339
+ references.add(node.text);
340
+ }
341
+ }
342
+ ts.forEachChild(node, visit);
343
+ };
344
+
345
+ visit(sourceFile);
346
+ return Array.from(references);
347
+ }
348
+
349
+ protected createEnvironment(files: VirtualFile[]) {
350
+ const allFiles = [...systemFiles, ...files];
351
+
352
+ const fileMap = new Map<string, string>();
353
+ allFiles.forEach(({ filename, content }) => {
354
+ fileMap.set(filename, content);
355
+ });
356
+
357
+ const system = createSystem(fileMap);
358
+ return createVirtualTypeScriptEnvironment(
359
+ system,
360
+ allFiles.map(({ filename }) => filename),
361
+ ts,
362
+ this.compilerOptions,
363
+ );
364
+ }
365
+ }
366
+
367
+ /**
368
+ * Notebook-specific parser with dependency analysis.
369
+ */
370
+ export class NotebookVirtualParser extends VirtualTypeScriptParser {
371
+ /**
372
+ * Analyze notebook cells with full type checking.
373
+ */
374
+ analyzeNotebook(cells: Array<{ id: string; code: string }>) {
375
+ // Create cumulative environment where each cell can see previous cells.
376
+ const cumulativeCode: string[] = [];
377
+ const cellAnalysis: Map<
378
+ string,
379
+ {
380
+ exports: ParsedExpression[];
381
+ imports: string[];
382
+ errors: ts.Diagnostic[];
383
+ }
384
+ > = new Map();
385
+
386
+ cells.forEach((cell) => {
387
+ // Create files for all cells up to current.
388
+ const files: VirtualFile[] = [];
389
+
390
+ // Add previous cells as context.
391
+ if (cumulativeCode.length > 0) {
392
+ files.push({
393
+ filename: '/context.ts',
394
+ content: cumulativeCode.join('\n'),
395
+ });
396
+ }
397
+
398
+ // Add current cell.
399
+ const filename = `/cell/${cell.id}.ts`;
400
+ files.push({
401
+ filename,
402
+ content: cell.code,
403
+ });
404
+
405
+ // Create environment.
406
+ const env = this.createEnvironment(files);
407
+
408
+ // Get diagnostics (errors).
409
+ const diagnostics = env.languageService.getSemanticDiagnostics(filename);
410
+
411
+ // Analyze current cell.
412
+ const sourceFile = env.getSourceFile(filename);
413
+ const typeChecker = env.languageService.getProgram()?.getTypeChecker();
414
+
415
+ if (sourceFile && typeChecker) {
416
+ const exports = this.analyzeSourceFile(sourceFile, typeChecker);
417
+
418
+ // Find all references in the current cell.
419
+ const allRefs = new Set<string>();
420
+ exports.forEach((exp) => {
421
+ exp.references?.forEach((ref) => allRefs.add(ref));
422
+ });
423
+
424
+ // Also check for references not in exports (e.g., console.log(y)).
425
+ const additionalRefs = this.findAllReferences(sourceFile, typeChecker);
426
+ additionalRefs.forEach((ref) => allRefs.add(ref));
427
+
428
+ // Determine which references are imports from previous cells.
429
+ const previousExports = new Set<string>();
430
+ for (const [_prevCellId, prevAnalysis] of cellAnalysis) {
431
+ prevAnalysis.exports.forEach((exp) => {
432
+ if (exp.name) previousExports.add(exp.name);
433
+ });
434
+ }
435
+
436
+ const imports = Array.from(allRefs).filter((ref) => previousExports.has(ref));
437
+
438
+ cellAnalysis.set(cell.id, {
439
+ exports,
440
+ imports,
441
+ errors: diagnostics,
442
+ });
443
+ }
444
+
445
+ // Add current cell code to cumulative.
446
+ cumulativeCode.push(cell.code);
447
+ });
448
+
449
+ return cellAnalysis;
450
+ }
451
+ }
@@ -3,11 +3,13 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
6
+ import { S, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import { Chess } from 'https://esm.sh/chess.js@0.13.1?bundle=false';
9
9
 
10
10
  export default defineFunction({
11
+ key: 'dxos.org/script/chess',
12
+ name: 'Chess',
11
13
  description: 'Plays a random move in a chess game.',
12
14
 
13
15
  inputSchema: S.Struct({
@@ -3,20 +3,26 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S, create, Expando } from 'dxos:functions';
6
+ import { Expando, S, create, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import { randText } from 'https://esm.sh/@ngneat/falso@7.1.1?bundle=false';
9
9
 
10
10
  export default defineFunction({
11
+ key: 'dxos.org/script/data-generator',
12
+ name: 'Data Generator',
11
13
  inputSchema: S.Struct({
12
14
  documentAmount: S.optional(S.Number),
13
15
  textSize: S.optional(S.Number),
14
16
  mutationAmount: S.optional(S.Number),
17
+ waitAfterCreation: S.optional(S.Number),
15
18
  }),
16
19
 
17
20
  outputSchema: S.Struct({}),
18
21
 
19
- handler: async ({ data: { documentAmount = 1, textSize = 10, mutationAmount = 0 }, context: { space } }: any) => {
22
+ handler: async ({
23
+ data: { documentAmount = 1, textSize = 10, mutationAmount = 0, waitAfterCreation = 10_000 },
24
+ context: { space },
25
+ }: any) => {
20
26
  await space.db.graph.schemaRegistry.addSchema([Expando]);
21
27
  const result: Record<string, any> = {};
22
28
  const objects: Expando[] = [];
@@ -42,7 +48,7 @@ export default defineFunction({
42
48
 
43
49
  // Flush and wait for data to propagate.
44
50
  await space.db.flush();
45
- await new Promise((resolve) => setTimeout(resolve, 10_000));
51
+ await new Promise((resolve) => setTimeout(resolve, waitAfterCreation));
46
52
  return { createdObjects: objects.length };
47
53
  },
48
54
  });
@@ -3,17 +3,23 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { create, defineFunction, DXN, EchoObject, Filter, ObjectId, S } from 'dxos:functions';
6
+ import { DXN, EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
- import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.14.21&bundle=false';
8
+ import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';
9
9
  import {
10
10
  DiscordConfig,
11
11
  DiscordREST,
12
12
  DiscordRESTMemoryLive,
13
13
  // @ts-ignore
14
- } from 'https://esm.sh/dfx@0.113.0?deps=effect@3.14.21&bundle=false';
14
+ } from 'https://esm.sh/dfx@0.113.0?deps=effect@3.17.0&bundle=false';
15
15
  // @ts-ignore
16
- import { Effect, Config, Redacted, Ref } from 'https://esm.sh/effect@3.14.21?bundle=false';
16
+ import * as Config from 'https://esm.sh/effect@3.17.0/Config?bundle=false';
17
+ // @ts-ignore
18
+ import * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';
19
+ // @ts-ignore
20
+ import * as Redacted from 'https://esm.sh/effect@3.17.0/Redacted?bundle=false';
21
+ // @ts-ignore
22
+ import * as Ref from 'https://esm.sh/effect@3.17.0/Ref?bundle=false';
17
23
 
18
24
  const MessageSchema = S.Struct({
19
25
  id: ObjectId,
@@ -36,6 +42,8 @@ const generateSnowflake = (unixTimestamp: number): bigint => {
36
42
  };
37
43
 
38
44
  export default defineFunction({
45
+ key: 'dxos.org/script/discord',
46
+ name: 'Discord',
39
47
  inputSchema: S.Struct({
40
48
  // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
41
49
  tick: S.optional(S.String),
@@ -5,15 +5,19 @@
5
5
  // @ts-ignore
6
6
  import { S, defineFunction } from 'dxos:functions';
7
7
  import {
8
+ FetchHttpClient,
8
9
  HttpClient,
9
10
  HttpClientRequest,
10
- FetchHttpClient,
11
11
  // @ts-ignore
12
- } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.14.21&bundle=false';
12
+ } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';
13
+ // @ts-ignore
14
+ import * as Effect from 'https://esm.sh/effect@3.17.0/Effect?bundle=false';
13
15
  // @ts-ignore
14
- import { Effect, Schedule } from 'https://esm.sh/effect@3.14.21?bundle=false';
16
+ import * as Schedule from 'https://esm.sh/effect@3.17.0/Schedule?bundle=false';
15
17
 
16
18
  export default defineFunction({
19
+ key: 'dxos.org/script/forex-effect',
20
+ name: 'Forex Effect',
17
21
  description: 'Returns the exchange rate between two currencies.',
18
22
 
19
23
  inputSchema: S.Struct({
@@ -3,9 +3,11 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
6
+ import { S, defineFunction } from 'dxos:functions';
7
7
 
8
8
  export default defineFunction({
9
+ key: 'dxos.org/script/forex',
10
+ name: 'Forex',
9
11
  description: 'Returns the exchange rate between two currencies.',
10
12
 
11
13
  inputSchema: S.Struct({