@dxos/plugin-script 0.9.1-staging.ee54ba693a → 0.11.0

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 (295) hide show
  1. package/dist/lib/ScriptPlugin.mjs +25 -0
  2. package/dist/lib/ScriptPlugin.mjs.map +1 -0
  3. package/dist/lib/ScriptPlugin.node.mjs +11 -0
  4. package/dist/lib/ScriptPlugin.node.mjs.map +1 -0
  5. package/dist/lib/ScriptPlugin.workerd.mjs +11 -0
  6. package/dist/lib/ScriptPlugin.workerd.mjs.map +1 -0
  7. package/dist/lib/capabilities/node.mjs +11 -0
  8. package/dist/lib/capabilities/node.mjs.map +1 -0
  9. package/dist/lib/capabilities.mjs +13 -0
  10. package/dist/lib/capabilities.mjs.map +1 -0
  11. package/dist/lib/chunk-DeploymentDialog.mjs +85 -0
  12. package/dist/lib/chunk-DeploymentDialog.mjs.map +1 -0
  13. package/dist/lib/chunk-NotebookArticle.mjs +719 -0
  14. package/dist/lib/chunk-NotebookArticle.mjs.map +1 -0
  15. package/dist/lib/chunk-ScriptArticle.mjs +67 -0
  16. package/dist/lib/chunk-ScriptArticle.mjs.map +1 -0
  17. package/dist/lib/chunk-ScriptProperties.mjs +240 -0
  18. package/dist/lib/chunk-ScriptProperties.mjs.map +1 -0
  19. package/dist/lib/chunk-ScriptSettings.mjs +40 -0
  20. package/dist/lib/chunk-ScriptSettings.mjs.map +1 -0
  21. package/dist/lib/chunk-TestContainer.mjs +40 -0
  22. package/dist/lib/chunk-TestContainer.mjs.map +1 -0
  23. package/dist/lib/chunk-app-graph-builder.mjs +33 -0
  24. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  25. package/dist/lib/chunk-compiler.mjs +60 -0
  26. package/dist/lib/chunk-compiler.mjs.map +1 -0
  27. package/dist/lib/chunk-compiler2.mjs +76 -0
  28. package/dist/lib/chunk-compiler2.mjs.map +1 -0
  29. package/dist/lib/chunk-create-object.mjs +36 -0
  30. package/dist/lib/chunk-create-object.mjs.map +1 -0
  31. package/dist/lib/chunk-create-script.mjs +32 -0
  32. package/dist/lib/chunk-create-script.mjs.map +1 -0
  33. package/dist/lib/chunk-create.mjs +34 -0
  34. package/dist/lib/chunk-create.mjs.map +1 -0
  35. package/dist/lib/chunk-delete.mjs +15 -0
  36. package/dist/lib/chunk-delete.mjs.map +1 -0
  37. package/dist/lib/chunk-deploy.mjs +53 -0
  38. package/dist/lib/chunk-deploy.mjs.map +1 -0
  39. package/dist/lib/chunk-functions.mjs +238 -0
  40. package/dist/lib/chunk-functions.mjs.map +1 -0
  41. package/dist/lib/chunk-inspect-invocations.mjs +42 -0
  42. package/dist/lib/chunk-inspect-invocations.mjs.map +1 -0
  43. package/dist/lib/chunk-install-function.mjs +40 -0
  44. package/dist/lib/chunk-install-function.mjs.map +1 -0
  45. package/dist/lib/chunk-invoke.mjs +25 -0
  46. package/dist/lib/chunk-invoke.mjs.map +1 -0
  47. package/dist/lib/chunk-meta.mjs +33 -0
  48. package/dist/lib/chunk-meta.mjs.map +1 -0
  49. package/dist/lib/chunk-operation-handler.mjs +13 -0
  50. package/dist/lib/chunk-operation-handler.mjs.map +1 -0
  51. package/dist/lib/chunk-query-deployed-functions.mjs +31 -0
  52. package/dist/lib/chunk-query-deployed-functions.mjs.map +1 -0
  53. package/dist/lib/chunk-react-surface.mjs +140 -0
  54. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  55. package/dist/lib/chunk-read.mjs +20 -0
  56. package/dist/lib/chunk-read.mjs.map +1 -0
  57. package/dist/lib/chunk-settings.mjs +23 -0
  58. package/dist/lib/chunk-settings.mjs.map +1 -0
  59. package/dist/lib/chunk-skill-definition.mjs +10 -0
  60. package/dist/lib/chunk-skill-definition.mjs.map +1 -0
  61. package/dist/lib/chunk-skills.mjs +35 -0
  62. package/dist/lib/chunk-skills.mjs.map +1 -0
  63. package/dist/lib/{neutral/chunk-WAGQ77UQ.mjs → chunk-templates.mjs} +82 -84
  64. package/dist/lib/chunk-templates.mjs.map +1 -0
  65. package/dist/lib/chunk-types.mjs +90 -0
  66. package/dist/lib/chunk-types.mjs.map +1 -0
  67. package/dist/lib/chunk-update.mjs +27 -0
  68. package/dist/lib/chunk-update.mjs.map +1 -0
  69. package/dist/lib/chunk-util.mjs +146 -0
  70. package/dist/lib/chunk-util.mjs.map +1 -0
  71. package/dist/lib/components.mjs +618 -0
  72. package/dist/lib/components.mjs.map +1 -0
  73. package/dist/lib/containers.mjs +12 -0
  74. package/dist/lib/containers.mjs.map +1 -0
  75. package/dist/lib/hooks.mjs +307 -0
  76. package/dist/lib/hooks.mjs.map +1 -0
  77. package/dist/lib/index.mjs +5 -0
  78. package/dist/lib/meta.mjs +2 -0
  79. package/dist/lib/operations.mjs +7 -0
  80. package/dist/lib/operations.mjs.map +1 -0
  81. package/dist/lib/plugin.mjs +9 -0
  82. package/dist/lib/plugin.mjs.map +1 -0
  83. package/dist/lib/skills.mjs +2 -0
  84. package/dist/lib/templates.mjs +2 -0
  85. package/dist/lib/testing.mjs +75 -0
  86. package/dist/lib/testing.mjs.map +1 -0
  87. package/dist/lib/translations.mjs +98 -0
  88. package/dist/lib/translations.mjs.map +1 -0
  89. package/dist/lib/types.mjs +2 -0
  90. package/dist/types/src/capabilities/ScriptSurfaces.d.ts +28 -0
  91. package/dist/types/src/capabilities/ScriptSurfaces.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  93. package/dist/types/src/capabilities/compiler.d.ts +1 -1
  94. package/dist/types/src/capabilities/create-object.d.ts +1 -1
  95. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  96. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  97. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  98. package/dist/types/src/capabilities/settings.d.ts +1 -1
  99. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +1 -1
  100. package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
  101. package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
  102. package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
  103. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
  104. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  105. package/dist/types/src/components/TestPanel/TestPanel.d.ts +1 -1
  106. package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
  107. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +1 -1
  108. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  109. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -1
  110. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts +5 -2
  111. package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  112. package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +4 -1
  113. package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -1
  114. package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts +4 -1
  115. package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -1
  116. package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -1
  117. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +4 -1
  118. package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -1
  119. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +4 -1
  120. package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -1
  121. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +4 -1
  122. package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
  123. package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
  124. package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts +4 -1
  125. package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts.map +1 -1
  126. package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts +4 -1
  127. package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts.map +1 -1
  128. package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts +4 -1
  129. package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts.map +1 -1
  130. package/dist/types/src/containers/TestContainer/TestContainer.d.ts +4 -1
  131. package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -1
  132. package/dist/types/src/hooks/deploy.d.ts +2 -35
  133. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  134. package/dist/types/src/hooks/format.d.ts +2 -23
  135. package/dist/types/src/hooks/format.d.ts.map +1 -1
  136. package/dist/types/src/hooks/template.d.ts +2 -18
  137. package/dist/types/src/hooks/template.d.ts.map +1 -1
  138. package/dist/types/src/hooks/useToolbarState.d.ts +1 -1
  139. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
  140. package/dist/types/src/notebook/compute-graph.d.ts +1 -1
  141. package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
  142. package/dist/types/src/skills/functions/deploy.d.ts.map +1 -1
  143. package/dist/types/src/skills/functions/inspect-invocations.d.ts.map +1 -1
  144. package/dist/types/src/templates/chess-bot.d.ts +2 -2
  145. package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
  146. package/dist/types/src/templates/commentary.d.ts +2 -2
  147. package/dist/types/src/templates/commentary.d.ts.map +1 -1
  148. package/dist/types/src/types/ScriptCapabilities.d.ts +1 -1
  149. package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -1
  150. package/dist/types/tsconfig.tsbuildinfo +1 -1
  151. package/package.json +88 -82
  152. package/src/capabilities/ScriptSurfaces.tsx +96 -0
  153. package/src/capabilities/app-graph-builder.ts +2 -2
  154. package/src/capabilities/compiler.ts +1 -1
  155. package/src/capabilities/react-surface.ts +82 -0
  156. package/src/components/NotebookStack/NotebookCell.tsx +9 -2
  157. package/src/components/NotebookStack/NotebookStack.stories.tsx +2 -0
  158. package/src/components/NotebookStack/NotebookStack.tsx +22 -14
  159. package/src/components/QueryEditor/QueryEditor.stories.tsx +1 -1
  160. package/src/components/QueryEditor/QueryEditor.tsx +1 -0
  161. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +1 -1
  162. package/src/components/ScriptToolbar/ScriptToolbar.tsx +1 -1
  163. package/src/components/TestPanel/TestPanel.tsx +2 -2
  164. package/src/components/TypescriptEditor/TypescriptEditor.tsx +1 -1
  165. package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +1 -1
  166. package/src/containers/DeploymentDialog/DeploymentDialog.tsx +3 -1
  167. package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +1 -1
  168. package/src/containers/NotebookArticle/NotebookArticle.tsx +4 -2
  169. package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +2 -1
  170. package/src/containers/ScriptArticle/ScriptArticle.tsx +3 -1
  171. package/src/containers/ScriptProperties/FunctionBinding.tsx +5 -3
  172. package/src/containers/ScriptProperties/FunctionPublishing.tsx +4 -2
  173. package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +2 -1
  174. package/src/containers/ScriptProperties/ScriptProperties.tsx +2 -0
  175. package/src/containers/ScriptProperties/SkillEditor.tsx +3 -1
  176. package/src/containers/ScriptSettings/ScriptSettings.tsx +2 -0
  177. package/src/containers/TestContainer/TestContainer.tsx +4 -2
  178. package/src/e2e/ai.test.ts +2 -2
  179. package/src/e2e/deploy.test.ts +2 -2
  180. package/src/hooks/deploy.ts +13 -4
  181. package/src/hooks/format.ts +2 -2
  182. package/src/hooks/template.ts +3 -3
  183. package/src/hooks/useToolbarState.ts +1 -1
  184. package/src/notebook/compute-graph.test.ts +1 -1
  185. package/src/notebook/compute-graph.ts +1 -1
  186. package/src/skills/functions/deploy.ts +5 -6
  187. package/src/skills/functions/inspect-invocations.ts +2 -2
  188. package/src/skills/functions/install-function.ts +1 -1
  189. package/src/skills/functions/invoke.ts +1 -1
  190. package/src/skills/functions/query-deployed-functions.ts +1 -1
  191. package/src/templates/chess-bot.ts +3 -3
  192. package/src/templates/commentary.ts +3 -3
  193. package/src/testing/simulator.test.ts +1 -1
  194. package/src/types/ScriptCapabilities.ts +1 -1
  195. package/src/util/deploy.ts +3 -3
  196. package/src/util/functions.ts +2 -2
  197. package/dist/lib/neutral/DeploymentDialog-7OIIL7LB.mjs +0 -114
  198. package/dist/lib/neutral/DeploymentDialog-7OIIL7LB.mjs.map +0 -7
  199. package/dist/lib/neutral/NotebookArticle-AOBB3XGD.mjs +0 -745
  200. package/dist/lib/neutral/NotebookArticle-AOBB3XGD.mjs.map +0 -7
  201. package/dist/lib/neutral/ScriptArticle-I3DOJARR.mjs +0 -79
  202. package/dist/lib/neutral/ScriptArticle-I3DOJARR.mjs.map +0 -7
  203. package/dist/lib/neutral/ScriptPlugin.mjs +0 -51
  204. package/dist/lib/neutral/ScriptPlugin.mjs.map +0 -7
  205. package/dist/lib/neutral/ScriptPlugin.node.mjs +0 -27
  206. package/dist/lib/neutral/ScriptPlugin.node.mjs.map +0 -7
  207. package/dist/lib/neutral/ScriptPlugin.workerd.mjs +0 -21
  208. package/dist/lib/neutral/ScriptPlugin.workerd.mjs.map +0 -7
  209. package/dist/lib/neutral/ScriptProperties-RHDQGMGT.mjs +0 -296
  210. package/dist/lib/neutral/ScriptProperties-RHDQGMGT.mjs.map +0 -7
  211. package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs +0 -35
  212. package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs.map +0 -7
  213. package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs +0 -44
  214. package/dist/lib/neutral/TestContainer-AFVTBYSJ.mjs.map +0 -7
  215. package/dist/lib/neutral/app-graph-builder-POP3CX6G.mjs +0 -52
  216. package/dist/lib/neutral/app-graph-builder-POP3CX6G.mjs.map +0 -7
  217. package/dist/lib/neutral/capabilities/index.mjs +0 -21
  218. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  219. package/dist/lib/neutral/capabilities/node.mjs +0 -17
  220. package/dist/lib/neutral/capabilities/node.mjs.map +0 -7
  221. package/dist/lib/neutral/chunk-2REUEDUA.mjs +0 -56
  222. package/dist/lib/neutral/chunk-2REUEDUA.mjs.map +0 -7
  223. package/dist/lib/neutral/chunk-652CIABA.mjs +0 -124
  224. package/dist/lib/neutral/chunk-652CIABA.mjs.map +0 -7
  225. package/dist/lib/neutral/chunk-6DOWVKIW.mjs +0 -344
  226. package/dist/lib/neutral/chunk-6DOWVKIW.mjs.map +0 -7
  227. package/dist/lib/neutral/chunk-CHNFYLKW.mjs +0 -52
  228. package/dist/lib/neutral/chunk-CHNFYLKW.mjs.map +0 -7
  229. package/dist/lib/neutral/chunk-INFWOSTM.mjs +0 -156
  230. package/dist/lib/neutral/chunk-INFWOSTM.mjs.map +0 -7
  231. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  232. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  233. package/dist/lib/neutral/chunk-KSVKXCTX.mjs +0 -8
  234. package/dist/lib/neutral/chunk-KSVKXCTX.mjs.map +0 -7
  235. package/dist/lib/neutral/chunk-NVV5UYY4.mjs +0 -50
  236. package/dist/lib/neutral/chunk-NVV5UYY4.mjs.map +0 -7
  237. package/dist/lib/neutral/chunk-USJ44FIU.mjs +0 -8
  238. package/dist/lib/neutral/chunk-USJ44FIU.mjs.map +0 -7
  239. package/dist/lib/neutral/chunk-WAGQ77UQ.mjs.map +0 -7
  240. package/dist/lib/neutral/compiler-ODK4UA2N.mjs +0 -101
  241. package/dist/lib/neutral/compiler-ODK4UA2N.mjs.map +0 -7
  242. package/dist/lib/neutral/components/index.mjs +0 -695
  243. package/dist/lib/neutral/components/index.mjs.map +0 -7
  244. package/dist/lib/neutral/containers/index.mjs +0 -19
  245. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  246. package/dist/lib/neutral/create-SGHWWTET.mjs +0 -46
  247. package/dist/lib/neutral/create-SGHWWTET.mjs.map +0 -7
  248. package/dist/lib/neutral/create-object-QW66KQWS.mjs +0 -43
  249. package/dist/lib/neutral/create-object-QW66KQWS.mjs.map +0 -7
  250. package/dist/lib/neutral/create-script-CIEJOBIU.mjs +0 -45
  251. package/dist/lib/neutral/create-script-CIEJOBIU.mjs.map +0 -7
  252. package/dist/lib/neutral/delete-72RXVLVI.mjs +0 -21
  253. package/dist/lib/neutral/delete-72RXVLVI.mjs.map +0 -7
  254. package/dist/lib/neutral/deploy-PJTJAQZY.mjs +0 -67
  255. package/dist/lib/neutral/deploy-PJTJAQZY.mjs.map +0 -7
  256. package/dist/lib/neutral/hooks/index.mjs +0 -369
  257. package/dist/lib/neutral/hooks/index.mjs.map +0 -7
  258. package/dist/lib/neutral/index.mjs +0 -41
  259. package/dist/lib/neutral/index.mjs.map +0 -7
  260. package/dist/lib/neutral/inspect-invocations-ZUXVUAML.mjs +0 -59
  261. package/dist/lib/neutral/inspect-invocations-ZUXVUAML.mjs.map +0 -7
  262. package/dist/lib/neutral/install-function-YFDZLVMJ.mjs +0 -49
  263. package/dist/lib/neutral/install-function-YFDZLVMJ.mjs.map +0 -7
  264. package/dist/lib/neutral/invoke-CDRBQ2WA.mjs +0 -32
  265. package/dist/lib/neutral/invoke-CDRBQ2WA.mjs.map +0 -7
  266. package/dist/lib/neutral/meta.json +0 -1
  267. package/dist/lib/neutral/meta.mjs +0 -10
  268. package/dist/lib/neutral/meta.mjs.map +0 -7
  269. package/dist/lib/neutral/operation-handler-M3B6IRMV.mjs +0 -18
  270. package/dist/lib/neutral/operation-handler-M3B6IRMV.mjs.map +0 -7
  271. package/dist/lib/neutral/operations/index.mjs +0 -8
  272. package/dist/lib/neutral/operations/index.mjs.map +0 -7
  273. package/dist/lib/neutral/plugin.mjs +0 -16
  274. package/dist/lib/neutral/plugin.mjs.map +0 -7
  275. package/dist/lib/neutral/query-deployed-functions-RBQMGON2.mjs +0 -34
  276. package/dist/lib/neutral/query-deployed-functions-RBQMGON2.mjs.map +0 -7
  277. package/dist/lib/neutral/react-surface-GEXOZLBC.mjs +0 -120
  278. package/dist/lib/neutral/react-surface-GEXOZLBC.mjs.map +0 -7
  279. package/dist/lib/neutral/read-OY3K5R3V.mjs +0 -26
  280. package/dist/lib/neutral/read-OY3K5R3V.mjs.map +0 -7
  281. package/dist/lib/neutral/settings-FD7HXEY6.mjs +0 -30
  282. package/dist/lib/neutral/settings-FD7HXEY6.mjs.map +0 -7
  283. package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs +0 -15
  284. package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs.map +0 -7
  285. package/dist/lib/neutral/skills/index.mjs +0 -10
  286. package/dist/lib/neutral/skills/index.mjs.map +0 -7
  287. package/dist/lib/neutral/templates/index.mjs +0 -10
  288. package/dist/lib/neutral/templates/index.mjs.map +0 -7
  289. package/dist/lib/neutral/translations.mjs +0 -104
  290. package/dist/lib/neutral/translations.mjs.map +0 -7
  291. package/dist/lib/neutral/types/index.mjs +0 -17
  292. package/dist/lib/neutral/types/index.mjs.map +0 -7
  293. package/dist/lib/neutral/update-Z5VGOLBN.mjs +0 -44
  294. package/dist/lib/neutral/update-Z5VGOLBN.mjs.map +0 -7
  295. package/src/capabilities/react-surface.tsx +0 -132
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/compiler/compiler.ts"],
4
- "sourcesContent": ["//\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 GLOBALS = 'globals.d.ts';\n\n/** TS version hosted on playgroundcdn.typescriptlang.org used to fetch lib .d.ts files.\n * Pinned to 5.6.3 because 5.7+ removed lib.es2022.sharedmemory.d.ts from the CDN.\n * The remaining 404s (lib.core.d.ts, lib.core.es6/7.d.ts, lib.es7.d.ts) are phantom\n * entries in @typescript/vfs's hardcoded file list and are harmlessly caught.\n */\nconst CDN_TS_VERSION = '5.6.3';\n\nconst defaultOptions: ts.CompilerOptions = {\n lib: ['DOM', 'es2022'],\n target: ts.ScriptTarget.ES2022,\n // Override `@typescript/vfs`'s default of `NodeJs` (== deprecated `node10`).\n // TypeScript 6 throws on that as a `getCompilerOptionsDiagnostics()` error,\n // which surfaces as an unhandled rejection inside the storybook task.\n moduleResolution: ts.ModuleResolutionKind.Bundler,\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(globals?: string): 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, CDN_TS_VERSION, true, ts);\n if (globals) {\n this._fsMap.set(GLOBALS, globals);\n }\n\n const rootFiles = globals ? [GLOBALS] : [];\n const system = createSystem(this._fsMap);\n this._env = createVirtualTypeScriptEnvironment(system, rootFiles, 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": ";AAIA,SAEEA,yBACAC,cACAC,0CACK;AACP,OAAOC,QAAQ;AAEf,SAASC,iBAAiB;AAE1B,IAAA,eAAgB;;AAUdC,IAAK,iBAAA;qBAAC;OAAO;IAAS;IACtBC;EACA;EACA,QAAA,GAAA,aAAA;;;;EAKF,kBAAaC,GAAAA,qBAAAA;;AACHC,IAA+C,WAA/CA,MAA+C;EAC/CC;EAER;;EAA6E,YAAA,WAAA,gBAAA;AAE7E,SAAMC,WAAWC;;mBAEb,SAAA;AACF,QAAA,KAAA,MAAA;AAEA;IACA;SAGE,SAAKF,MAAWG,wBAASD,KAAAA,UAAAA,gBAAAA,MAAAA,EAAAA;AAC3B,QAAA,SAAA;AAEA,WAAME,OAAAA,IAAYF,SAAU,OAAA;;UAAc,YAAA,UAAA;MAC1C;IACA,IAAI,CAACH;AACP,UAAA,SAAA,aAAA,KAAA,MAAA;AAEIM,SAAAA,OAAAA,mCAAc,QAAA,WAAA,IAAA,KAAA,QAAA;;MAEhB,cAAYN;AACd,cAAA,KAAA,MAAA,yCAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,aAAA,yCAAA,EAAA,CAAA;AAEAO,WAAQC,KAAgB;;UAElB,UAACF,SAAYG;AACnB,cAAA,KAAA,QAAA,oCAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,eAAA,oCAAA,EAAA,CAAA;AAEAC,SAAQF,YAAiC,WAAA,UAAA,OAAA;;EAEzC,QAAA,UAAA;AACF,WAAA,KAAA,YAAA,gBAAA,cAAA,QAAA;;;",
6
- "names": ["createDefaultMapFromCDN", "createSystem", "createVirtualTypeScriptEnvironment", "ts", "invariant", "lib", "target", "Compiler", "_env", "_fsMap", "initialize", "globals", "GLOBALS", "rootFiles", "environment", "setFile", "fileName", "createFile", "compile"]
7
- }
@@ -1,124 +0,0 @@
1
- import {
2
- templates
3
- } from "./chunk-WAGQ77UQ.mjs";
4
- import {
5
- __export
6
- } from "./chunk-J5LGTIGS.mjs";
7
-
8
- // src/types/Settings.ts
9
- var Settings_exports = {};
10
- __export(Settings_exports, {
11
- Settings: () => Settings
12
- });
13
- import * as Schema from "effect/Schema";
14
- import { EditorInputMode } from "@dxos/ui-editor/types";
15
- var Settings = Schema.mutable(Schema.Struct({
16
- editorInputMode: EditorInputMode.annotations({
17
- title: "Editor input mode",
18
- description: "Choose the keybinding style for the script editor."
19
- })
20
- }));
21
-
22
- // src/types/Notebook.ts
23
- var Notebook_exports = {};
24
- __export(Notebook_exports, {
25
- Cell: () => Cell,
26
- Notebook: () => Notebook,
27
- make: () => make
28
- });
29
- import * as Schema2 from "effect/Schema";
30
- import { Instructions } from "@dxos/compute";
31
- import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
32
- import { FormInputAnnotation } from "@dxos/echo/Annotation";
33
- import { LabelAnnotation } from "@dxos/echo/Annotation";
34
- import { Graph } from "@dxos/plugin-explorer";
35
- import { Text } from "@dxos/schema";
36
- var Cell = Schema2.Struct({
37
- id: Schema2.String,
38
- type: Schema2.String,
39
- name: Schema2.optional(Schema2.String),
40
- // TODO(burdon): Union type.
41
- source: Schema2.optional(Ref.Ref(Text.Text)),
42
- prompt: Schema2.optional(Ref.Ref(Instructions.Instructions)),
43
- graph: Schema2.optional(Ref.Ref(Graph.Graph))
44
- });
45
- var Notebook = class extends Type.makeObject(DXN.make("org.dxos.type.notebook", "0.1.0"))(Schema2.Struct({
46
- name: Schema2.String.pipe(Schema2.optional),
47
- cells: Cell.pipe(Schema2.Array, FormInputAnnotation.set(false))
48
- }).pipe(LabelAnnotation.set([
49
- "name"
50
- ]), Annotation.IconAnnotation.set({
51
- icon: "ph--notebook--regular",
52
- hue: "sky"
53
- }))) {
54
- };
55
- var make = (props = {
56
- cells: []
57
- }) => Obj.make(Notebook, props);
58
-
59
- // src/types/ScriptCapabilities.ts
60
- var ScriptCapabilities_exports = {};
61
- __export(ScriptCapabilities_exports, {
62
- Compiler: () => Compiler,
63
- Settings: () => Settings2
64
- });
65
- import { Capability } from "@dxos/app-framework";
66
- import { meta } from "#meta";
67
- var Settings2 = Capability.make(`${meta.profile.key}.capability.settings`);
68
- var Compiler = Capability.make(`${meta.profile.key}.capability.compiler`);
69
-
70
- // src/types/ScriptEvents.ts
71
- var ScriptEvents_exports = {};
72
- __export(ScriptEvents_exports, {
73
- SetupCompiler: () => SetupCompiler
74
- });
75
- import { ActivationEvent } from "@dxos/app-framework";
76
- import { meta as meta2 } from "#meta";
77
- var SetupCompiler = ActivationEvent.make(`${meta2.profile.key}.event.setupCompiler`);
78
-
79
- // src/types/ScriptOperation.ts
80
- var ScriptOperation_exports = {};
81
- __export(ScriptOperation_exports, {
82
- CreateScript: () => CreateScript,
83
- NotebookProps: () => NotebookProps,
84
- ScriptProps: () => ScriptProps
85
- });
86
- import * as Schema3 from "effect/Schema";
87
- import { Operation, Script } from "@dxos/compute";
88
- import { Database, DXN as DXN2, Type as Type2 } from "@dxos/echo";
89
- import { meta as meta3 } from "#meta";
90
- var makeKey = (name) => DXN2.make(`${meta3.profile.key}.operation.${name}`);
91
- var ScriptProps = Schema3.Struct({
92
- name: Schema3.optional(Schema3.String),
93
- gistUrl: Schema3.optional(Schema3.String.annotations({
94
- title: "Import from Gist (url)"
95
- })),
96
- initialTemplateId: Schema3.Literal(...templates.map(({ id }) => id)).pipe(Schema3.annotations({
97
- title: "Template"
98
- }), Schema3.optional)
99
- });
100
- var NotebookProps = Schema3.Struct({
101
- name: Schema3.optional(Schema3.String)
102
- });
103
- var CreateScript = Operation.make({
104
- meta: {
105
- key: makeKey("createScript"),
106
- name: "Create Script",
107
- icon: "ph--code--regular"
108
- },
109
- input: Schema3.extend(ScriptProps, Schema3.Struct({
110
- db: Database.Database
111
- })),
112
- output: Schema3.Struct({
113
- object: Type2.getSchema(Script.Script)
114
- })
115
- });
116
-
117
- export {
118
- Settings_exports,
119
- Notebook_exports,
120
- ScriptCapabilities_exports,
121
- ScriptEvents_exports,
122
- ScriptOperation_exports
123
- };
124
- //# sourceMappingURL=chunk-652CIABA.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Settings.ts", "../../../src/types/Notebook.ts", "../../../src/types/ScriptCapabilities.ts", "../../../src/types/ScriptEvents.ts", "../../../src/types/ScriptOperation.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { EditorInputMode } from '@dxos/ui-editor/types';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n editorInputMode: EditorInputMode.annotations({\n title: 'Editor input mode',\n description: 'Choose the keybinding style for the script editor.',\n }),\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Instructions } from '@dxos/compute';\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/Annotation';\nimport { LabelAnnotation } from '@dxos/echo/Annotation';\nimport { Graph } from '@dxos/plugin-explorer';\nimport { Text } from '@dxos/schema';\n\nexport type CellType = 'markdown' | 'script' | 'query' | 'prompt' | 'view';\n\nexport const Cell = Schema.Struct({\n id: Schema.String,\n type: Schema.String,\n name: Schema.optional(Schema.String),\n // TODO(burdon): Union type.\n source: Schema.optional(Ref.Ref(Text.Text)),\n prompt: Schema.optional(Ref.Ref(Instructions.Instructions)),\n graph: Schema.optional(Ref.Ref(Graph.Graph)),\n});\n\nexport type Cell = Schema.Schema.Type<typeof Cell>;\n\nexport class Notebook extends Type.makeObject<Notebook>(DXN.make('org.dxos.type.notebook', '0.1.0'))(\n Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n cells: Cell.pipe(Schema.Array, FormInputAnnotation.set(false)),\n }).pipe(LabelAnnotation.set(['name']), Annotation.IconAnnotation.set({ icon: 'ph--notebook--regular', hue: 'sky' })),\n) {}\n\nexport const make = (props: Obj.MakeProps<typeof Notebook> = { cells: [] }): Notebook => Obj.make(Notebook, props);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport { type Compiler as CompilerType } from '../compiler';\n\n// Inline import to avoid `Settings` namespace alias colliding with the\n// `Settings` capability export below.\nexport const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(\n `${meta.profile.key}.capability.settings`,\n);\nexport const Compiler = Capability.make<CompilerType>(`${meta.profile.key}.capability.compiler`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport const SetupCompiler = ActivationEvent.make(`${meta.profile.key}.event.setupCompiler`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation, Script } from '@dxos/compute';\nimport { Database, DXN, Type } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nimport { templates } from '../templates';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const ScriptProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),\n initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(\n Schema.annotations({ title: 'Template' }),\n Schema.optional,\n ),\n});\n\nexport const NotebookProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n});\n\nexport const CreateScript = Operation.make({\n meta: { key: makeKey('createScript'), name: 'Create Script', icon: 'ph--code--regular' },\n input: Schema.extend(\n ScriptProps,\n Schema.Struct({\n db: Database.Database,\n }),\n ),\n output: Schema.Struct({\n object: Type.getSchema(Script.Script),\n }),\n});\n"],
5
- "mappings": ";;;;;;;;AAAA;;;;AAMA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAEzB,IAAMC,WAAkBC,eACtBC,cAAO;EACZC,iBAAiBJ,gBAAgBK,YAAY;IAC3CC,OAAO;IACPC,aAAa;EACf,CAAA;AACF,CAAA,CAAA;;;AChBF;;;;;;AAIA,YAAYC,aAAY;AAExB,SAASC,oBAAoB;AAC7B,SAASC,YAAYC,KAA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,OAAAA,MAAKC,QAAAA,aAAY;AAEpC,SAASC,QAAAA,aAAY;AAIrB,IAAMC,UAAU,CAACC,SAAiBC,KAAIC,KAAK,GAAGC,MAAKC,QAAQC,GAAG,cAAcL,IAAAA,EAAM;AAE3E,IAAMM,cAAqBC,eAAO;EACvCP,MAAaQ,iBAAgBC,cAAM;EACnCC,SAAgBF,iBAAgBC,eAAOE,YAAY;IAAEC,OAAO;EAAyB,CAAA,CAAA;EACrFC,mBAA0BC,gBAAO,GAAIC,UAAUC,IAAI,CAAC,EAAEC,GAAE,MAAOA,EAAAA,CAAAA,EAAKC,KAC3DP,oBAAY;IAAEC,OAAO;EAAW,CAAA,GAChCJ,gBAAQ;AAEnB,CAAA;AAEO,IAAMW,gBAAuBZ,eAAO;EACzCP,MAAaQ,iBAAgBC,cAAM;AACrC,CAAA;AAEO,IAAMW,eAAeC,UAAUnB,KAAK;EACzCC,MAAM;IAAEE,KAAKN,QAAQ,cAAA;IAAiBC,MAAM;IAAiBsB,MAAM;EAAoB;EACvFC,OAAcC,eACZlB,aACOC,eAAO;IACZkB,IAAIC,SAASA;EACf,CAAA,CAAA;EAEFC,QAAepB,eAAO;IACpBqB,QAAQC,MAAKC,UAAUC,OAAOA,MAAM;EACtC,CAAA;AACF,CAAA;",
6
- "names": ["Schema", "EditorInputMode", "Settings", "mutable", "Struct", "editorInputMode", "annotations", "title", "description", "Schema", "Instructions", "Annotation", "DXN", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Graph", "Text", "Cell", "Struct", "id", "String", "type", "name", "optional", "source", "prompt", "graph", "Notebook", "makeObject", "make", "pipe", "cells", "Array", "set", "IconAnnotation", "icon", "hue", "props", "Settings", "Capability", "meta", "make", "profile", "key", "Compiler", "ActivationEvent", "meta", "SetupCompiler", "make", "profile", "key", "Schema", "Operation", "Script", "Database", "DXN", "Type", "meta", "makeKey", "name", "DXN", "make", "meta", "profile", "key", "ScriptProps", "Struct", "optional", "String", "gistUrl", "annotations", "title", "initialTemplateId", "Literal", "templates", "map", "id", "pipe", "NotebookProps", "CreateScript", "Operation", "icon", "input", "extend", "db", "Database", "output", "object", "Type", "getSchema", "Script"]
7
- }
@@ -1,344 +0,0 @@
1
- // src/skills/functions/definitions.ts
2
- import * as Schema from "effect/Schema";
3
- import { ClientService } from "@dxos/client";
4
- import { Operation } from "@dxos/compute";
5
- import { Database, DXN, Ref } from "@dxos/echo";
6
- import { trim } from "@dxos/util";
7
- var FunctionRef = Ref.Ref(Operation.PersistentOperation).annotations({
8
- description: "The ID of the function."
9
- });
10
- var FunctionId = Schema.String.annotations({
11
- description: "The ID of the function. Can be passed as the function parameter to other operations."
12
- });
13
- var FUNCTION_FORMAT = trim`
14
- IMPORTANT: Every function MUST follow this exact pattern — define an Operation, then export default the handler:
15
-
16
- \`\`\`typescript
17
- import * as Effect from 'effect/Effect';
18
- import * as Schema from 'effect/Schema';
19
-
20
- import { Operation } from '@dxos/compute';
21
-
22
- const MyFunction = Operation.make({
23
- meta: {
24
- key: DXN.make('org.dxos.script.myFunction'),
25
- name: 'My Function',
26
- },
27
- input: Schema.Struct({
28
- city: Schema.String.annotations({ description: 'City name' }),
29
- }),
30
- output: Schema.Any,
31
- });
32
-
33
- export default MyFunction.pipe(
34
- Operation.withHandler(
35
- Effect.fn(function* ({ city }) {
36
- const res = yield* Effect.promise(() =>
37
- fetch(\`https://wttr.in/\${city}?format=j1\`)
38
- );
39
- const data = yield* Effect.promise(() => res.json());
40
- return data;
41
- }),
42
- ),
43
- );
44
- \`\`\`
45
-
46
- Key rules:
47
- - The file MUST have a single \`export default\` of Operation.pipe(Operation.withHandler(...)).
48
- - Use \`Effect.fn(function* (...) { ... })\` for the handler body.
49
- - Wrap async calls with \`yield* Effect.promise(() => ...)\`.
50
- - Do NOT use top-level await; do NOT export named functions; do NOT use module.exports.
51
- `;
52
- var AVAILABLE_PACKAGES = trim`
53
- Scripts run in an Edge runtime (Cloudflare Workers) with the following pre-bundled packages:
54
-
55
- DXOS SDK:
56
- - \`@dxos/echo\` — Reactive local-first database: query, filter, and mutate ECHO objects in spaces.
57
- - \`@dxos/functions\` — Edge function framework: triggers, queues, and function definitions.
58
- - \`@dxos/ai\` — AI/LLM integration via AiService (access models like Claude, GPT).
59
- - \`@dxos/schema\` — Schema utilities and built-in DXOS types.
60
- - \`@dxos/types\` — DXOS type definitions.
61
- - \`@dxos/operation\` — Define and handle typed operations with input/output schemas.
62
- - \`@dxos/util\` — General utility functions.
63
- - \`@dxos/log\` — Structured logging.
64
-
65
- Effect-TS (functional programming toolkit):
66
- - \`effect\` — Core effect system with sub-modules: Effect, Schema, Stream, Schedule, Array, Record, Option, Either, Match, etc.
67
- - \`@effect/platform\` — HTTP client (\`HttpClient\`), platform abstractions for making typed API requests.
68
-
69
- Data format parsing & querying:
70
- - \`jsonata\` — Powerful query and transformation expressions for JSON data (filter, sort, group, aggregate, reshape).
71
- - \`yaml\` — Parse and stringify YAML documents.
72
- - \`fast-xml-parser\` — Fast XML parser and builder; convert between XML and JSON.
73
- - \`papaparse\` — CSV parsing and serialization; stream large files, auto-detect delimiters.
74
-
75
- Text & markup processing:
76
- - \`turndown\` — HTML to Markdown converter (useful for feeding web content to LLMs).
77
-
78
- HTML/DOM parsing:
79
- - \`linkedom\` — Lightweight DOM parser for worker environments; parse and query HTML documents.
80
-
81
- Data processing & utilities:
82
- - \`date-fns\` — Comprehensive date utility library: parsing, formatting, comparison, arithmetic, time zones.
83
-
84
- Other:
85
- - \`@automerge/automerge\` — CRDT library for conflict-free collaborative data structures.
86
- - \`chess.js\` — Chess game logic, move generation, and validation.
87
- `;
88
- var Create = Operation.make({
89
- meta: {
90
- key: DXN.make("org.dxos.function.script.create"),
91
- name: "Create",
92
- description: `Creates a new function with TypeScript source code and adds it to the space. ${FUNCTION_FORMAT} ${AVAILABLE_PACKAGES}`,
93
- icon: "ph--code--regular"
94
- },
95
- input: Schema.Struct({
96
- name: Schema.String.annotations({
97
- description: "Name of the function."
98
- }),
99
- source: Schema.optional(Schema.String).annotations({
100
- description: "TypeScript source code for the function."
101
- }),
102
- templateId: Schema.optional(Schema.String).annotations({
103
- description: "ID of a template to use as the initial source."
104
- })
105
- }),
106
- output: Schema.Struct({
107
- function: FunctionId
108
- }),
109
- services: [
110
- Database.Service
111
- ]
112
- });
113
- var Read = Operation.make({
114
- meta: {
115
- key: DXN.make("org.dxos.function.script.read"),
116
- name: "Read",
117
- description: "Reads the source code and metadata of a function.",
118
- icon: "ph--file-text--regular"
119
- },
120
- input: Schema.Struct({
121
- function: FunctionRef
122
- }),
123
- output: Schema.Struct({
124
- name: Schema.optional(Schema.String),
125
- source: Schema.String,
126
- description: Schema.optional(Schema.String)
127
- }),
128
- services: [
129
- Database.Service
130
- ]
131
- });
132
- var Edit = Schema.Struct({
133
- oldString: Schema.String.annotations({
134
- description: "The text to find in the source."
135
- }),
136
- newString: Schema.String.annotations({
137
- description: "The text to replace it with."
138
- }),
139
- replaceAll: Schema.optional(Schema.Boolean).annotations({
140
- description: "If true, replaces all occurrences. Defaults to false (first occurrence only)."
141
- })
142
- });
143
- var Update = Operation.make({
144
- meta: {
145
- key: DXN.make("org.dxos.function.script.update"),
146
- name: "Update",
147
- description: `Updates the source code or metadata of a function. ${FUNCTION_FORMAT}`,
148
- icon: "ph--pencil--regular"
149
- },
150
- input: Schema.Struct({
151
- function: FunctionRef,
152
- name: Schema.optional(Schema.String).annotations({
153
- description: "New name for the function."
154
- }),
155
- description: Schema.optional(Schema.String).annotations({
156
- description: "New description for the function."
157
- }),
158
- edits: Schema.optional(Schema.Array(Edit)).annotations({
159
- description: "Edits to apply to the source. Each edit finds oldString and replaces it with newString."
160
- })
161
- }),
162
- output: Schema.Struct({
163
- function: FunctionId
164
- }),
165
- services: [
166
- Database.Service
167
- ]
168
- });
169
- var Delete = Operation.make({
170
- meta: {
171
- key: DXN.make("org.dxos.function.script.delete"),
172
- name: "Delete",
173
- description: "Deletes a function and its source from the space.",
174
- icon: "ph--trash--regular"
175
- },
176
- input: Schema.Struct({
177
- function: FunctionRef
178
- }),
179
- output: Schema.Void,
180
- services: [
181
- Database.Service
182
- ]
183
- });
184
- var Deploy = Operation.make({
185
- meta: {
186
- key: DXN.make("org.dxos.function.script.deploy"),
187
- name: "Deploy",
188
- description: `Deploys a function to the Edge runtime. The function source must follow the required format: a single export default of Operation.pipe(Operation.withHandler(Effect.fn(function* (...) { ... }))). See the Create operation description for a full example.`,
189
- icon: "ph--rocket-launch--regular"
190
- },
191
- input: Schema.Struct({
192
- function: FunctionRef
193
- }),
194
- output: Schema.Struct({
195
- function: FunctionId,
196
- functionUrl: Schema.optional(Schema.String).annotations({
197
- description: "The URL of the deployed function."
198
- })
199
- }),
200
- services: [
201
- Database.Service,
202
- ClientService
203
- ]
204
- });
205
- var Invoke = Operation.make({
206
- meta: {
207
- key: DXN.make("org.dxos.function.script.invoke"),
208
- name: "Invoke",
209
- description: "Invokes a deployed Edge function with the given payload.",
210
- icon: "ph--play--regular"
211
- },
212
- input: Schema.Struct({
213
- function: FunctionRef,
214
- payload: Schema.optional(Schema.Unknown).annotations({
215
- description: "The input payload to pass to the function."
216
- })
217
- }),
218
- output: Schema.Struct({
219
- response: Schema.Unknown.annotations({
220
- description: "The response from the function."
221
- })
222
- }),
223
- services: [
224
- Database.Service,
225
- ClientService
226
- ]
227
- });
228
- var InvocationSpanSchema = Schema.Struct({
229
- id: Schema.String.annotations({
230
- description: "The invocation ID."
231
- }),
232
- timestamp: Schema.Number.annotations({
233
- description: "Start time of the invocation (epoch ms)."
234
- }),
235
- duration: Schema.Number.annotations({
236
- description: "Duration in milliseconds."
237
- }),
238
- outcome: Schema.String.annotations({
239
- description: "Invocation outcome: success, failure, or pending."
240
- }),
241
- input: Schema.Object.annotations({
242
- description: "The input payload passed to the function."
243
- }),
244
- error: Schema.optional(Schema.Object).annotations({
245
- description: "Error details if the invocation failed."
246
- })
247
- });
248
- var InspectInvocations = Operation.make({
249
- meta: {
250
- key: DXN.make("org.dxos.function.script.inspectInvocations"),
251
- name: "InspectInvocations",
252
- description: "Queries the invocation trace feed for a function, returning its invocation history.",
253
- icon: "ph--magnifying-glass--regular"
254
- },
255
- input: Schema.Struct({
256
- function: FunctionRef,
257
- limit: Schema.optional(Schema.Number).annotations({
258
- description: "Maximum number of invocations to return. Defaults to 20."
259
- })
260
- }),
261
- output: Schema.Struct({
262
- invocations: Schema.Array(InvocationSpanSchema).annotations({
263
- description: "List of invocation spans, most recent first."
264
- }),
265
- total: Schema.Number.annotations({
266
- description: "Total number of invocations found."
267
- })
268
- }),
269
- services: [
270
- Database.Service
271
- ]
272
- });
273
- var DeployedFunctionSchema = Schema.Struct({
274
- key: Schema.optional(Schema.String).annotations({
275
- description: "Unique key identifying the function. Pass to InstallFunction to install it."
276
- }),
277
- name: Schema.String.annotations({
278
- description: "Display name of the function."
279
- }),
280
- version: Schema.String.annotations({
281
- description: "Semantic version of the deployed function."
282
- }),
283
- description: Schema.optional(Schema.String).annotations({
284
- description: "Description of what the function does."
285
- }),
286
- updated: Schema.optional(Schema.String).annotations({
287
- description: "ISO timestamp of the last deployment."
288
- })
289
- });
290
- var QueryDeployedFunctions = Operation.make({
291
- meta: {
292
- key: DXN.make("org.dxos.function.script.queryDeployed"),
293
- name: "QueryDeployedFunctions",
294
- description: "Lists all functions deployed to the EDGE runtime. Use InstallFunction to add one to the space.",
295
- icon: "ph--list--regular"
296
- },
297
- input: Schema.Void,
298
- output: Schema.Struct({
299
- functions: Schema.Array(DeployedFunctionSchema).annotations({
300
- description: "List of deployed functions."
301
- })
302
- }),
303
- services: [
304
- ClientService
305
- ]
306
- });
307
- var InstallFunction = Operation.make({
308
- meta: {
309
- key: DXN.make("org.dxos.function.script.install"),
310
- name: "InstallFunction",
311
- description: "Installs a deployed EDGE function into the current space by key. The returned function ID can be passed directly to Invoke.",
312
- icon: "ph--download--regular"
313
- },
314
- input: Schema.Struct({
315
- key: Schema.String.annotations({
316
- description: "The unique key of the deployed function to install (from QueryDeployedFunctions)."
317
- })
318
- }),
319
- output: Schema.Struct({
320
- function: FunctionId,
321
- name: Schema.String.annotations({
322
- description: "Name of the installed function."
323
- }),
324
- version: Schema.String.annotations({
325
- description: "Version of the installed function."
326
- })
327
- }),
328
- services: [
329
- ClientService
330
- ]
331
- });
332
-
333
- export {
334
- Create,
335
- Read,
336
- Update,
337
- Delete,
338
- Deploy,
339
- Invoke,
340
- InspectInvocations,
341
- QueryDeployedFunctions,
342
- InstallFunction
343
- };
344
- //# sourceMappingURL=chunk-6DOWVKIW.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/skills/functions/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { ClientService } from '@dxos/client';\nimport { Operation } from '@dxos/compute';\nimport { Database, DXN, Ref } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nconst FunctionRef = Ref.Ref(Operation.PersistentOperation).annotations({\n description: 'The ID of the function.',\n});\n\nconst FunctionId = Schema.String.annotations({\n description: 'The ID of the function. Can be passed as the function parameter to other operations.',\n});\n\nconst FUNCTION_FORMAT = trim`\n IMPORTANT: Every function MUST follow this exact pattern — define an Operation, then export default the handler:\n\n \\`\\`\\`typescript\n import * as Effect from 'effect/Effect';\n import * as Schema from 'effect/Schema';\n\n import { Operation } from '@dxos/compute';\n\n const MyFunction = Operation.make({\n meta: {\n key: DXN.make('org.dxos.script.myFunction'),\n name: 'My Function',\n },\n input: Schema.Struct({\n city: Schema.String.annotations({ description: 'City name' }),\n }),\n output: Schema.Any,\n });\n\n export default MyFunction.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ city }) {\n const res = yield* Effect.promise(() =>\n fetch(\\`https://wttr.in/\\${city}?format=j1\\`)\n );\n const data = yield* Effect.promise(() => res.json());\n return data;\n }),\n ),\n );\n \\`\\`\\`\n\n Key rules:\n - The file MUST have a single \\`export default\\` of Operation.pipe(Operation.withHandler(...)).\n - Use \\`Effect.fn(function* (...) { ... })\\` for the handler body.\n - Wrap async calls with \\`yield* Effect.promise(() => ...)\\`.\n - Do NOT use top-level await; do NOT export named functions; do NOT use module.exports.\n`;\n\nconst AVAILABLE_PACKAGES = trim`\n Scripts run in an Edge runtime (Cloudflare Workers) with the following pre-bundled packages:\n\n DXOS SDK:\n - \\`@dxos/echo\\` — Reactive local-first database: query, filter, and mutate ECHO objects in spaces.\n - \\`@dxos/functions\\` — Edge function framework: triggers, queues, and function definitions.\n - \\`@dxos/ai\\` — AI/LLM integration via AiService (access models like Claude, GPT).\n - \\`@dxos/schema\\` — Schema utilities and built-in DXOS types.\n - \\`@dxos/types\\` — DXOS type definitions.\n - \\`@dxos/operation\\` — Define and handle typed operations with input/output schemas.\n - \\`@dxos/util\\` — General utility functions.\n - \\`@dxos/log\\` — Structured logging.\n\n Effect-TS (functional programming toolkit):\n - \\`effect\\` — Core effect system with sub-modules: Effect, Schema, Stream, Schedule, Array, Record, Option, Either, Match, etc.\n - \\`@effect/platform\\` — HTTP client (\\`HttpClient\\`), platform abstractions for making typed API requests.\n\n Data format parsing & querying:\n - \\`jsonata\\` — Powerful query and transformation expressions for JSON data (filter, sort, group, aggregate, reshape).\n - \\`yaml\\` — Parse and stringify YAML documents.\n - \\`fast-xml-parser\\` — Fast XML parser and builder; convert between XML and JSON.\n - \\`papaparse\\` — CSV parsing and serialization; stream large files, auto-detect delimiters.\n\n Text & markup processing:\n - \\`turndown\\` — HTML to Markdown converter (useful for feeding web content to LLMs).\n\n HTML/DOM parsing:\n - \\`linkedom\\` — Lightweight DOM parser for worker environments; parse and query HTML documents.\n\n Data processing & utilities:\n - \\`date-fns\\` — Comprehensive date utility library: parsing, formatting, comparison, arithmetic, time zones.\n\n Other:\n - \\`@automerge/automerge\\` — CRDT library for conflict-free collaborative data structures.\n - \\`chess.js\\` — Chess game logic, move generation, and validation.\n`;\n\nexport const Create = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.create'),\n name: 'Create',\n description: `Creates a new function with TypeScript source code and adds it to the space. ${FUNCTION_FORMAT} ${AVAILABLE_PACKAGES}`,\n icon: 'ph--code--regular',\n },\n input: Schema.Struct({\n name: Schema.String.annotations({\n description: 'Name of the function.',\n }),\n source: Schema.optional(Schema.String).annotations({\n description: 'TypeScript source code for the function.',\n }),\n templateId: Schema.optional(Schema.String).annotations({\n description: 'ID of a template to use as the initial source.',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n }),\n services: [Database.Service],\n});\n\nexport const Read = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.read'),\n name: 'Read',\n description: 'Reads the source code and metadata of a function.',\n icon: 'ph--file-text--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Struct({\n name: Schema.optional(Schema.String),\n source: Schema.String,\n description: Schema.optional(Schema.String),\n }),\n services: [Database.Service],\n});\n\n// The edit descriptions feed the script skill's LLM tool definition (and its memoized\n// fixtures), so the schema stays local and context-tuned; the apply logic is shared via `Doc.applyEdits`.\nconst Edit = Schema.Struct({\n oldString: Schema.String.annotations({\n description: 'The text to find in the source.',\n }),\n newString: Schema.String.annotations({\n description: 'The text to replace it with.',\n }),\n replaceAll: Schema.optional(Schema.Boolean).annotations({\n description: 'If true, replaces all occurrences. Defaults to false (first occurrence only).',\n }),\n});\n\nexport const Update = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.update'),\n name: 'Update',\n description: `Updates the source code or metadata of a function. ${FUNCTION_FORMAT}`,\n icon: 'ph--pencil--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n name: Schema.optional(Schema.String).annotations({\n description: 'New name for the function.',\n }),\n description: Schema.optional(Schema.String).annotations({\n description: 'New description for the function.',\n }),\n edits: Schema.optional(Schema.Array(Edit)).annotations({\n description: 'Edits to apply to the source. Each edit finds oldString and replaces it with newString.',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n }),\n services: [Database.Service],\n});\n\nexport const Delete = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.delete'),\n name: 'Delete',\n description: 'Deletes a function and its source from the space.',\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n\nexport const Deploy = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.deploy'),\n name: 'Deploy',\n description: `Deploys a function to the Edge runtime. The function source must follow the required format: a single export default of Operation.pipe(Operation.withHandler(Effect.fn(function* (...) { ... }))). See the Create operation description for a full example.`,\n icon: 'ph--rocket-launch--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Struct({\n function: FunctionId,\n functionUrl: Schema.optional(Schema.String).annotations({\n description: 'The URL of the deployed function.',\n }),\n }),\n services: [Database.Service, ClientService],\n});\n\nexport const Invoke = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.invoke'),\n name: 'Invoke',\n description: 'Invokes a deployed Edge function with the given payload.',\n icon: 'ph--play--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n payload: Schema.optional(Schema.Unknown).annotations({\n description: 'The input payload to pass to the function.',\n }),\n }),\n output: Schema.Struct({\n response: Schema.Unknown.annotations({\n description: 'The response from the function.',\n }),\n }),\n services: [Database.Service, ClientService],\n});\n\nconst InvocationSpanSchema = Schema.Struct({\n id: Schema.String.annotations({\n description: 'The invocation ID.',\n }),\n timestamp: Schema.Number.annotations({\n description: 'Start time of the invocation (epoch ms).',\n }),\n duration: Schema.Number.annotations({\n description: 'Duration in milliseconds.',\n }),\n outcome: Schema.String.annotations({\n description: 'Invocation outcome: success, failure, or pending.',\n }),\n input: Schema.Object.annotations({\n description: 'The input payload passed to the function.',\n }),\n error: Schema.optional(Schema.Object).annotations({\n description: 'Error details if the invocation failed.',\n }),\n});\n\nexport const InspectInvocations = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.inspectInvocations'),\n name: 'InspectInvocations',\n description: 'Queries the invocation trace feed for a function, returning its invocation history.',\n icon: 'ph--magnifying-glass--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n limit: Schema.optional(Schema.Number).annotations({\n description: 'Maximum number of invocations to return. Defaults to 20.',\n }),\n }),\n output: Schema.Struct({\n invocations: Schema.Array(InvocationSpanSchema).annotations({\n description: 'List of invocation spans, most recent first.',\n }),\n total: Schema.Number.annotations({\n description: 'Total number of invocations found.',\n }),\n }),\n services: [Database.Service],\n});\n\nconst DeployedFunctionSchema = Schema.Struct({\n key: Schema.optional(Schema.String).annotations({\n description: 'Unique key identifying the function. Pass to InstallFunction to install it.',\n }),\n name: Schema.String.annotations({\n description: 'Display name of the function.',\n }),\n version: Schema.String.annotations({\n description: 'Semantic version of the deployed function.',\n }),\n description: Schema.optional(Schema.String).annotations({\n description: 'Description of what the function does.',\n }),\n updated: Schema.optional(Schema.String).annotations({\n description: 'ISO timestamp of the last deployment.',\n }),\n});\n\nexport const QueryDeployedFunctions = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.queryDeployed'),\n name: 'QueryDeployedFunctions',\n description: 'Lists all functions deployed to the EDGE runtime. Use InstallFunction to add one to the space.',\n icon: 'ph--list--regular',\n },\n input: Schema.Void,\n output: Schema.Struct({\n functions: Schema.Array(DeployedFunctionSchema).annotations({\n description: 'List of deployed functions.',\n }),\n }),\n services: [ClientService],\n});\n\nexport const InstallFunction = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.install'),\n name: 'InstallFunction',\n description:\n 'Installs a deployed EDGE function into the current space by key. The returned function ID can be passed directly to Invoke.',\n icon: 'ph--download--regular',\n },\n input: Schema.Struct({\n key: Schema.String.annotations({\n description: 'The unique key of the deployed function to install (from QueryDeployedFunctions).',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n name: Schema.String.annotations({\n description: 'Name of the installed function.',\n }),\n version: Schema.String.annotations({\n description: 'Version of the installed function.',\n }),\n }),\n services: [ClientService],\n});\n"],
5
- "mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SA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EH,YAAY;IAC9CC,aAAa;EACf,CAAA;EACAS,MAAaP,cAAOH,YAAY;IAC9BC,aAAa;EACf,CAAA;EACAkD,SAAgBhD,cAAOH,YAAY;IACjCC,aAAa;EACf,CAAA;EACAA,aAAoBc,gBAAgBZ,aAAM,EAAEH,YAAY;IACtDC,aAAa;EACf,CAAA;EACAmD,SAAgBrC,gBAAgBZ,aAAM,EAAEH,YAAY;IAClDC,aAAa;EACf,CAAA;AACF,CAAA;AAEO,IAAMoD,yBAAyB5D,UAAUc,KAAK;EACnDC,MAAM;IACJC,KAAKd,IAAIY,KAAK,wCAAA;IACdG,MAAM;IACNT,aAAa;IACbU,MAAM;EACR;EACAC,OAAcmB;EACdd,QAAeJ,cAAO;IACpByC,WAAkBzB,aAAMqB,sBAAAA,EAAwBlD,YAAY;MAC1DC,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,UAAU;IAAC3B;;AACb,CAAA;AAEO,IAAM+D,kBAAkB9D,UAAUc,KAAK;EAC5CC,MAAM;IACJC,KAAKd,IAAIY,KAAK,kCAAA;IACdG,MAAM;IACNT,aACE;IACFU,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBJ,KAAYN,cAAOH,YAAY;MAC7BC,aAAa;IACf,CAAA;EACF,CAAA;EACAgB,QAAeJ,cAAO;IACpBK,UAAUhB;IACVQ,MAAaP,cAAOH,YAAY;MAC9BC,aAAa;IACf,CAAA;IACAkD,SAAgBhD,cAAOH,YAAY;MACjCC,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,UAAU;IAAC3B;;AACb,CAAA;",
6
- "names": ["Schema", "ClientService", "Operation", "Database", "DXN", "Ref", "trim", "FunctionRef", "PersistentOperation", "annotations", "description", "FunctionId", "String", "FUNCTION_FORMAT", "AVAILABLE_PACKAGES", "Create", "make", "meta", "key", "name", "icon", "input", "Struct", "source", "optional", "templateId", "output", "function", "services", "Service", "Read", "Edit", "oldString", "newString", "replaceAll", "Boolean", "Update", "edits", "Array", "Delete", "Void", "Deploy", "functionUrl", "Invoke", "payload", "Unknown", "response", "InvocationSpanSchema", "id", "timestamp", "Number", "duration", "outcome", "Object", "error", "InspectInvocations", "limit", "invocations", "total", "DeployedFunctionSchema", "version", "updated", "QueryDeployedFunctions", "functions", "InstallFunction"]
7
- }
@@ -1,52 +0,0 @@
1
- import {
2
- Create,
3
- Delete,
4
- Deploy,
5
- InspectInvocations,
6
- InstallFunction,
7
- Invoke,
8
- QueryDeployedFunctions,
9
- Read,
10
- Update
11
- } from "./chunk-6DOWVKIW.mjs";
12
-
13
- // src/skills/script-skill.ts
14
- import { Skill, Template } from "@dxos/compute";
15
- import { trim } from "@dxos/util";
16
- var SKILL_KEY = "org.dxos.skill.script";
17
- var make = () => Skill.make({
18
- key: SKILL_KEY,
19
- name: "Script",
20
- agentCanEnable: true,
21
- tools: Skill.toolDefinitions({
22
- operations: [
23
- Create,
24
- Read,
25
- Update,
26
- Delete,
27
- Deploy,
28
- Invoke,
29
- InspectInvocations,
30
- QueryDeployedFunctions,
31
- InstallFunction
32
- ]
33
- }),
34
- instructions: Template.make({
35
- source: trim`
36
- You can create, read, update, and delete scripts which contain TypeScript code.
37
- You can deploy scripts to the Edge runtime and invoke deployed scripts.
38
- You can inspect the invocation history of a deployed script.
39
- You can query all functions deployed to the EDGE runtime and install them into the current space.
40
- `
41
- })
42
- });
43
- var skill = {
44
- key: SKILL_KEY,
45
- make
46
- };
47
- var script_skill_default = skill;
48
-
49
- export {
50
- script_skill_default
51
- };
52
- //# sourceMappingURL=chunk-CHNFYLKW.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/skills/script-skill.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Skill, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport {\n Create,\n Delete,\n Deploy,\n InspectInvocations,\n InstallFunction,\n Invoke,\n QueryDeployedFunctions,\n Read,\n Update,\n} from './functions';\n\nconst SKILL_KEY = 'org.dxos.skill.script';\n\nconst make = () =>\n Skill.make({\n key: SKILL_KEY,\n name: 'Script',\n agentCanEnable: true,\n tools: Skill.toolDefinitions({\n operations: [\n Create,\n Read,\n Update,\n Delete,\n Deploy,\n Invoke,\n InspectInvocations,\n QueryDeployedFunctions,\n InstallFunction,\n ],\n }),\n instructions: Template.make({\n source: trim`\n You can create, read, update, and delete scripts which contain TypeScript code.\n You can deploy scripts to the Edge runtime and invoke deployed scripts.\n You can inspect the invocation history of a deployed script.\n You can query all functions deployed to the EDGE runtime and install them into the current space.\n `,\n }),\n });\n\nconst skill: Skill.Definition = {\n key: SKILL_KEY,\n make,\n};\n\nexport default skill;\n"],
5
- "mappings": ";;;;;;;;;;;;;AAIA,SAASA,OAAOC,gBAAgB;AAChC,SAASC,YAAY;AAcrB,IAAMC,YAAY;AAElB,IAAMC,OAAO,MACXC,MAAMD,KAAK;EACTE,KAAKH;EACLI,MAAM;EACNC,gBAAgB;EAChBC,OAAOJ,MAAMK,gBAAgB;IAC3BC,YAAY;MACVC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;;EAEJ,CAAA;EACAC,cAAcC,SAASlB,KAAK;IAC1BmB,QAAQC;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMC,QAA0B;EAC9BnB,KAAKH;EACLC;AACF;AAEA,IAAA,uBAAeqB;",
6
- "names": ["Skill", "Template", "trim", "SKILL_KEY", "make", "Skill", "key", "name", "agentCanEnable", "tools", "toolDefinitions", "operations", "Create", "Read", "Update", "Delete", "Deploy", "Invoke", "InspectInvocations", "QueryDeployedFunctions", "InstallFunction", "instructions", "Template", "source", "trim", "skill"]
7
- }