@dxos/app-framework 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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 (512) hide show
  1. package/.storybook/main.mts +2 -4
  2. package/.storybook/preview.mts +2 -2
  3. package/dist/lib/browser/capability-BBBBAPDI.mjs +38 -0
  4. package/dist/lib/browser/capability-BBBBAPDI.mjs.map +7 -0
  5. package/dist/lib/browser/capability-OP63CD5N.mjs +35 -0
  6. package/dist/lib/browser/capability-OP63CD5N.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2CKCJ6PN.mjs +79 -0
  8. package/dist/lib/browser/chunk-2CKCJ6PN.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-F7FW2RK2.mjs +167 -0
  10. package/dist/lib/browser/chunk-F7FW2RK2.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-FU4GAFUQ.mjs +148 -0
  12. package/dist/lib/browser/chunk-FU4GAFUQ.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-GX4TUNM6.mjs +963 -0
  14. package/dist/lib/browser/chunk-GX4TUNM6.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-I34GF4NG.mjs +34 -0
  16. package/dist/lib/browser/chunk-I34GF4NG.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  18. package/dist/lib/browser/chunk-JKWMHZP6.mjs +80 -0
  19. package/dist/lib/browser/chunk-JKWMHZP6.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-LVJW5EFU.mjs +157 -0
  21. package/dist/lib/browser/chunk-LVJW5EFU.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-QSXYHXCE.mjs +48 -0
  23. package/dist/lib/browser/chunk-QSXYHXCE.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-RFSO3JRG.mjs +1 -0
  25. package/dist/lib/browser/chunk-T3Y4AEKX.mjs +42 -0
  26. package/dist/lib/browser/chunk-T3Y4AEKX.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-TGX63LTL.mjs +8 -0
  28. package/dist/lib/browser/chunk-TGX63LTL.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-WPE6AL7I.mjs +905 -0
  30. package/dist/lib/browser/chunk-WPE6AL7I.mjs.map +7 -0
  31. package/dist/lib/browser/cli/index.mjs +90 -0
  32. package/dist/lib/browser/cli/index.mjs.map +7 -0
  33. package/dist/lib/browser/common/activation-events.mjs +24 -0
  34. package/dist/lib/browser/common/capabilities.mjs +46 -0
  35. package/dist/lib/browser/core/activation-event.mjs +20 -0
  36. package/dist/lib/browser/core/activation-event.mjs.map +7 -0
  37. package/dist/lib/browser/core/capability.mjs +30 -0
  38. package/dist/lib/browser/core/capability.mjs.map +7 -0
  39. package/dist/lib/browser/core/plugin-manager.mjs +15 -0
  40. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  41. package/dist/lib/browser/core/plugin.mjs +29 -0
  42. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  43. package/dist/lib/browser/core/url-loader.mjs +12 -0
  44. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  45. package/dist/lib/browser/index.mjs +92 -121
  46. package/dist/lib/browser/index.mjs.map +4 -4
  47. package/dist/lib/browser/invoker-capability-H5PPENOC.mjs +43 -0
  48. package/dist/lib/browser/invoker-capability-H5PPENOC.mjs.map +7 -0
  49. package/dist/lib/browser/meta.json +1 -1
  50. package/dist/lib/browser/testing/index.mjs +108 -40
  51. package/dist/lib/browser/testing/index.mjs.map +4 -4
  52. package/dist/lib/browser/ui/index.mjs +44 -0
  53. package/dist/lib/browser/ui/index.mjs.map +7 -0
  54. package/dist/lib/node-esm/capability-AWBEMRYR.mjs +39 -0
  55. package/dist/lib/node-esm/capability-AWBEMRYR.mjs.map +7 -0
  56. package/dist/lib/node-esm/capability-WFEG6CIZ.mjs +36 -0
  57. package/dist/lib/node-esm/capability-WFEG6CIZ.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-42KBWDE4.mjs +80 -0
  59. package/dist/lib/node-esm/chunk-42KBWDE4.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs +158 -0
  61. package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-BCEOLX47.mjs +964 -0
  63. package/dist/lib/node-esm/chunk-BCEOLX47.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs +2 -0
  65. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-FKE4Z3D6.mjs +10 -0
  67. package/dist/lib/node-esm/chunk-FKE4Z3D6.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-G3RTFSNG.mjs +81 -0
  69. package/dist/lib/node-esm/chunk-G3RTFSNG.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  71. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-LQKOTNJW.mjs +906 -0
  73. package/dist/lib/node-esm/chunk-LQKOTNJW.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-ULUEXB7Q.mjs +149 -0
  75. package/dist/lib/node-esm/chunk-ULUEXB7Q.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-URWHJQT2.mjs +168 -0
  77. package/dist/lib/node-esm/chunk-URWHJQT2.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-VKHGNEDB.mjs +43 -0
  79. package/dist/lib/node-esm/chunk-VKHGNEDB.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs +35 -0
  81. package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-ZZ7CKK6W.mjs +49 -0
  83. package/dist/lib/node-esm/chunk-ZZ7CKK6W.mjs.map +7 -0
  84. package/dist/lib/node-esm/cli/index.mjs +91 -0
  85. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  86. package/dist/lib/node-esm/common/activation-events.mjs +25 -0
  87. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  88. package/dist/lib/node-esm/common/capabilities.mjs +47 -0
  89. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  90. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  91. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  92. package/dist/lib/node-esm/core/capability.mjs +31 -0
  93. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  94. package/dist/lib/node-esm/core/plugin-manager.mjs +16 -0
  95. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  96. package/dist/lib/node-esm/core/plugin.mjs +30 -0
  97. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/url-loader.mjs +13 -0
  99. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  100. package/dist/lib/node-esm/index.mjs +92 -121
  101. package/dist/lib/node-esm/index.mjs.map +4 -4
  102. package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs +44 -0
  103. package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs.map +7 -0
  104. package/dist/lib/node-esm/meta.json +1 -1
  105. package/dist/lib/node-esm/testing/index.mjs +108 -40
  106. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  107. package/dist/lib/node-esm/ui/index.mjs +45 -0
  108. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  109. package/dist/plugin/node-esm/index.mjs +384 -0
  110. package/dist/plugin/node-esm/index.mjs.map +7 -0
  111. package/dist/plugin/node-esm/meta.json +1 -0
  112. package/dist/types/src/cli/cli.d.ts +39 -0
  113. package/dist/types/src/cli/cli.d.ts.map +1 -0
  114. package/dist/types/src/cli/index.d.ts +2 -0
  115. package/dist/types/src/cli/index.d.ts.map +1 -0
  116. package/dist/types/src/common/activation-events.d.ts +27 -0
  117. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  118. package/dist/types/src/common/capabilities.d.ts +109 -194
  119. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  120. package/dist/types/src/common/index.d.ts +4 -8
  121. package/dist/types/src/common/index.d.ts.map +1 -1
  122. package/dist/types/src/common/operations.d.ts +19 -0
  123. package/dist/types/src/common/operations.d.ts.map +1 -0
  124. package/dist/types/src/common/translations.d.ts +7 -7
  125. package/dist/types/src/common/translations.d.ts.map +1 -1
  126. package/dist/types/src/context.d.ts +5 -0
  127. package/dist/types/src/context.d.ts.map +1 -0
  128. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +7 -7
  129. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  130. package/dist/types/src/core/capability-manager.d.ts +48 -0
  131. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  132. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  133. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  134. package/dist/types/src/core/capability.d.ts +156 -0
  135. package/dist/types/src/core/capability.d.ts.map +1 -0
  136. package/dist/types/src/core/index.d.ts +6 -4
  137. package/dist/types/src/core/index.d.ts.map +1 -1
  138. package/dist/types/src/core/plugin-manager.d.ts +73 -0
  139. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  140. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  141. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  142. package/dist/types/src/core/plugin.d.ts +98 -35
  143. package/dist/types/src/core/plugin.d.ts.map +1 -1
  144. package/dist/types/src/core/url-loader.d.ts +25 -0
  145. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  146. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  147. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  148. package/dist/types/src/index.d.ts +3 -2
  149. package/dist/types/src/index.d.ts.map +1 -1
  150. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
  151. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
  152. package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
  153. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
  154. package/dist/types/src/plugin-operation/history/errors.d.ts +32 -0
  155. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
  156. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
  157. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
  158. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
  159. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
  160. package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
  161. package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
  162. package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
  163. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
  164. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
  165. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
  166. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
  167. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
  168. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
  169. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
  170. package/dist/types/src/plugin-operation/index.d.ts +3 -0
  171. package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
  172. package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
  173. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
  174. package/dist/types/src/plugin-operation/meta.d.ts +3 -0
  175. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
  176. package/dist/types/src/plugin-operation/testing.d.ts +58 -0
  177. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
  178. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
  179. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
  180. package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
  181. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
  182. package/dist/types/src/plugin-runtime/index.d.ts +2 -0
  183. package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
  184. package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
  185. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
  186. package/dist/types/src/testing/index.d.ts +1 -0
  187. package/dist/types/src/testing/index.d.ts.map +1 -1
  188. package/dist/types/src/testing/service.d.ts +8 -0
  189. package/dist/types/src/testing/service.d.ts.map +1 -0
  190. package/dist/types/src/testing/withPluginManager.d.ts +4 -4
  191. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  192. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  193. package/dist/types/src/ui/components/App/App.d.ts +9 -0
  194. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  195. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  196. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  197. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  198. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  199. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +2 -3
  200. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  201. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  202. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  203. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  204. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  205. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +12 -0
  206. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  207. package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
  208. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  209. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  210. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  211. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  212. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  213. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  214. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  215. package/dist/types/src/ui/components/Surface/index.d.ts +26 -0
  216. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  217. package/dist/types/src/ui/components/Surface/types.d.ts +96 -0
  218. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  219. package/dist/types/src/ui/components/index.d.ts +4 -0
  220. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  221. package/dist/types/src/ui/hooks/index.d.ts +6 -0
  222. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  223. package/dist/types/src/{react → ui/hooks}/useApp.d.ts +30 -12
  224. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  225. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  226. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  227. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  228. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  229. package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +1 -2
  230. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  231. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  232. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  233. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  234. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  235. package/dist/types/src/ui/index.d.ts +3 -0
  236. package/dist/types/src/ui/index.d.ts.map +1 -0
  237. package/dist/types/src/vite-plugin/composer-plugin.d.ts +18 -0
  238. package/dist/types/src/vite-plugin/composer-plugin.d.ts.map +1 -0
  239. package/dist/types/src/vite-plugin/import-map-plugin.d.ts +16 -0
  240. package/dist/types/src/vite-plugin/import-map-plugin.d.ts.map +1 -0
  241. package/dist/types/src/vite-plugin/index.d.ts +3 -0
  242. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  243. package/dist/types/src/vite-plugin/packages.d.ts +7 -0
  244. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  245. package/dist/types/tsconfig.tsbuildinfo +1 -1
  246. package/moon.yml +24 -6
  247. package/package.json +130 -50
  248. package/src/cli/cli.ts +107 -0
  249. package/src/{playground/debug → cli}/index.ts +1 -1
  250. package/src/common/activation-events.ts +44 -0
  251. package/src/common/capabilities.ts +168 -210
  252. package/src/common/index.ts +4 -8
  253. package/src/common/operations.ts +35 -0
  254. package/src/common/translations.ts +17 -9
  255. package/src/context.ts +9 -0
  256. package/src/core/{events.ts → activation-event.ts} +10 -7
  257. package/src/core/capability-manager.test.ts +151 -0
  258. package/src/core/capability-manager.ts +192 -0
  259. package/src/core/capability.ts +247 -0
  260. package/src/core/index.ts +6 -4
  261. package/src/core/plugin-manager.test.ts +1113 -0
  262. package/src/core/plugin-manager.ts +883 -0
  263. package/src/core/plugin.ts +230 -40
  264. package/src/core/url-loader.test.ts +79 -0
  265. package/src/core/url-loader.ts +148 -0
  266. package/src/index.ts +3 -2
  267. package/src/plugin-operation/OperationPlugin.ts +24 -0
  268. package/src/plugin-operation/history/capability.ts +36 -0
  269. package/src/plugin-operation/history/errors.ts +7 -0
  270. package/src/plugin-operation/history/history-tracker.test.ts +373 -0
  271. package/src/plugin-operation/history/history-tracker.ts +128 -0
  272. package/src/plugin-operation/history/index.ts +9 -0
  273. package/src/plugin-operation/history/types.ts +17 -0
  274. package/src/plugin-operation/history/undo-mapping.ts +135 -0
  275. package/src/plugin-operation/history/undo-registry.test.ts +72 -0
  276. package/src/plugin-operation/history/undo-registry.ts +54 -0
  277. package/src/plugin-operation/index.ts +6 -0
  278. package/src/plugin-operation/invoker-capability.ts +54 -0
  279. package/src/plugin-operation/meta.ts +11 -0
  280. package/src/plugin-operation/testing.ts +154 -0
  281. package/src/plugin-runtime/RuntimePlugin.ts +19 -0
  282. package/src/plugin-runtime/capability.ts +53 -0
  283. package/src/{playground/logger → plugin-runtime}/index.ts +1 -1
  284. package/src/plugin-runtime/meta.ts +11 -0
  285. package/src/testing/index.ts +1 -0
  286. package/src/testing/service.ts +52 -0
  287. package/src/testing/withPluginManager.stories.tsx +7 -8
  288. package/src/testing/withPluginManager.tsx +63 -38
  289. package/src/ui/components/App/App.stories.tsx +92 -0
  290. package/src/{react → ui/components/App}/App.tsx +11 -12
  291. package/src/{playground/layout → ui/components/App}/index.ts +1 -1
  292. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +183 -0
  293. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  294. package/src/ui/components/PluginManager/index.ts +5 -0
  295. package/src/{react/Surface.stories.tsx → ui/components/Surface/SurfaceComponent.stories.tsx} +55 -36
  296. package/src/ui/components/Surface/SurfaceComponent.tsx +266 -0
  297. package/src/ui/components/Surface/SurfaceInfo.tsx +107 -0
  298. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  299. package/src/ui/components/Surface/context.ts +12 -0
  300. package/src/ui/components/Surface/index.ts +35 -0
  301. package/src/ui/components/Surface/types.ts +117 -0
  302. package/src/ui/components/index.ts +7 -0
  303. package/src/ui/hooks/index.ts +9 -0
  304. package/src/ui/hooks/useApp.test.tsx +159 -0
  305. package/src/ui/hooks/useApp.tsx +289 -0
  306. package/src/ui/hooks/useCapabilities.ts +67 -0
  307. package/src/{react → ui/hooks}/useLoading.tsx +4 -6
  308. package/src/ui/hooks/useSettingsState.ts +26 -0
  309. package/src/ui/hooks/useSurface.ts +13 -0
  310. package/src/ui/index.ts +6 -0
  311. package/src/vite-plugin/composer-plugin.ts +128 -0
  312. package/src/vite-plugin/import-map-plugin.ts +314 -0
  313. package/src/vite-plugin/index.ts +6 -0
  314. package/src/vite-plugin/packages.ts +29 -0
  315. package/tsconfig.json +12 -27
  316. package/tsconfig.node.json +2 -4
  317. package/typedoc.json +2 -4
  318. package/vitest.config.ts +1 -1
  319. package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
  320. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
  321. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
  322. package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
  323. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
  324. package/dist/lib/browser/chunk-VFUKEZIN.mjs +0 -483
  325. package/dist/lib/browser/chunk-VFUKEZIN.mjs.map +0 -7
  326. package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
  327. package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
  328. package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
  329. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
  330. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
  331. package/dist/lib/browser/react/index.mjs +0 -34
  332. package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
  333. package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
  334. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
  335. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
  336. package/dist/lib/node-esm/chunk-IJOHO66N.mjs +0 -484
  337. package/dist/lib/node-esm/chunk-IJOHO66N.mjs.map +0 -7
  338. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
  339. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
  340. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
  341. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
  342. package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
  343. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
  344. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
  345. package/dist/lib/node-esm/react/index.mjs +0 -35
  346. package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
  347. package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
  348. package/dist/types/src/common/collaboration.d.ts +0 -20
  349. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  350. package/dist/types/src/common/events.d.ts +0 -52
  351. package/dist/types/src/common/events.d.ts.map +0 -1
  352. package/dist/types/src/common/file.d.ts +0 -14
  353. package/dist/types/src/common/file.d.ts.map +0 -1
  354. package/dist/types/src/common/graph.d.ts +0 -21
  355. package/dist/types/src/common/graph.d.ts.map +0 -1
  356. package/dist/types/src/common/layout.d.ts +0 -279
  357. package/dist/types/src/common/layout.d.ts.map +0 -1
  358. package/dist/types/src/common/surface.d.ts +0 -68
  359. package/dist/types/src/common/surface.d.ts.map +0 -1
  360. package/dist/types/src/core/capabilities.d.ts +0 -117
  361. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  362. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  363. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  364. package/dist/types/src/core/events.d.ts.map +0 -1
  365. package/dist/types/src/core/manager.d.ts +0 -126
  366. package/dist/types/src/core/manager.d.ts.map +0 -1
  367. package/dist/types/src/core/manager.test.d.ts +0 -2
  368. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  369. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  370. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  371. package/dist/types/src/playground/debug/index.d.ts +0 -2
  372. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  373. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  374. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  375. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  376. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  377. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  378. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  379. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  380. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  381. package/dist/types/src/playground/generator/index.d.ts +0 -3
  382. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  383. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  384. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  385. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  386. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  387. package/dist/types/src/playground/layout/index.d.ts +0 -2
  388. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  389. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  390. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  391. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  392. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  393. package/dist/types/src/playground/logger/index.d.ts +0 -2
  394. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  395. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  396. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  397. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  398. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  399. package/dist/types/src/playground/playground.stories.d.ts +0 -11
  400. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  401. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  402. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  403. package/dist/types/src/plugin-intent/actions.d.ts +0 -36
  404. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  405. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  406. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  407. package/dist/types/src/plugin-intent/index.d.ts +0 -6
  408. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  409. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  410. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  411. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  412. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  413. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  414. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  415. package/dist/types/src/plugin-intent/meta.d.ts +0 -3
  416. package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
  417. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  418. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  419. package/dist/types/src/plugin-settings/actions.d.ts +0 -25
  420. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  421. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  422. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  423. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  424. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  425. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  426. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  427. package/dist/types/src/plugin-settings/meta.d.ts +0 -3
  428. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  429. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  430. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  431. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  432. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  433. package/dist/types/src/react/App.d.ts +0 -10
  434. package/dist/types/src/react/App.d.ts.map +0 -1
  435. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  436. package/dist/types/src/react/DefaultFallback.d.ts +0 -8
  437. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  438. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  439. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  440. package/dist/types/src/react/IntentContext.d.ts +0 -8
  441. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  442. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  443. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  444. package/dist/types/src/react/Surface.d.ts +0 -12
  445. package/dist/types/src/react/Surface.d.ts.map +0 -1
  446. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  447. package/dist/types/src/react/common.d.ts +0 -13
  448. package/dist/types/src/react/common.d.ts.map +0 -1
  449. package/dist/types/src/react/index.d.ts +0 -9
  450. package/dist/types/src/react/index.d.ts.map +0 -1
  451. package/dist/types/src/react/types.d.ts +0 -14
  452. package/dist/types/src/react/types.d.ts.map +0 -1
  453. package/dist/types/src/react/useApp.d.ts.map +0 -1
  454. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  455. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  456. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  457. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  458. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  459. package/src/common/collaboration.ts +0 -18
  460. package/src/common/events.ts +0 -79
  461. package/src/common/file.ts +0 -22
  462. package/src/common/graph.ts +0 -30
  463. package/src/common/layout.ts +0 -277
  464. package/src/common/surface.ts +0 -88
  465. package/src/core/capabilities.test.ts +0 -136
  466. package/src/core/capabilities.ts +0 -263
  467. package/src/core/manager.test.ts +0 -516
  468. package/src/core/manager.ts +0 -604
  469. package/src/playground/debug/Debug.tsx +0 -39
  470. package/src/playground/debug/plugin.ts +0 -16
  471. package/src/playground/generator/Main.tsx +0 -70
  472. package/src/playground/generator/Toolbar.tsx +0 -47
  473. package/src/playground/generator/generator.ts +0 -48
  474. package/src/playground/generator/index.ts +0 -6
  475. package/src/playground/generator/plugin.ts +0 -22
  476. package/src/playground/layout/Layout.tsx +0 -33
  477. package/src/playground/layout/plugin.ts +0 -18
  478. package/src/playground/logger/Toolbar.tsx +0 -30
  479. package/src/playground/logger/plugin.ts +0 -41
  480. package/src/playground/logger/schema.ts +0 -12
  481. package/src/playground/playground.stories.tsx +0 -46
  482. package/src/plugin-intent/IntentPlugin.ts +0 -20
  483. package/src/plugin-intent/actions.ts +0 -31
  484. package/src/plugin-intent/errors.ts +0 -40
  485. package/src/plugin-intent/index.ts +0 -9
  486. package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
  487. package/src/plugin-intent/intent-dispatcher.ts +0 -342
  488. package/src/plugin-intent/intent.ts +0 -154
  489. package/src/plugin-intent/meta.ts +0 -10
  490. package/src/plugin-settings/SettingsPlugin.ts +0 -34
  491. package/src/plugin-settings/actions.ts +0 -25
  492. package/src/plugin-settings/app-graph-builder.ts +0 -160
  493. package/src/plugin-settings/index.ts +0 -6
  494. package/src/plugin-settings/intent-resolver.ts +0 -35
  495. package/src/plugin-settings/meta.ts +0 -10
  496. package/src/plugin-settings/store.ts +0 -33
  497. package/src/plugin-settings/translations.ts +0 -19
  498. package/src/react/App.stories.tsx +0 -33
  499. package/src/react/DefaultFallback.tsx +0 -26
  500. package/src/react/ErrorBoundary.tsx +0 -56
  501. package/src/react/IntentContext.tsx +0 -35
  502. package/src/react/Surface.tsx +0 -109
  503. package/src/react/common.ts +0 -13
  504. package/src/react/index.ts +0 -14
  505. package/src/react/types.ts +0 -37
  506. package/src/react/useApp.tsx +0 -165
  507. package/src/react/useCapabilities.ts +0 -31
  508. package/src/react/useIntentResolver.ts +0 -22
  509. /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  510. /package/dist/lib/browser/{react/index.mjs.map → chunk-RFSO3JRG.mjs.map} +0 -0
  511. /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/activation-events.mjs.map} +0 -0
  512. /package/dist/lib/{node-esm/react/index.mjs.map → browser/common/capabilities.mjs.map} +0 -0
@@ -1,1653 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/plugin-intent/intent-dispatcher.ts
4
- import * as Effect3 from "effect/Effect";
5
- import * as Function2 from "effect/Function";
6
- import * as Option from "effect/Option";
7
- import * as Ref2 from "effect/Ref";
8
- import { live as live2 } from "@dxos/live-object";
9
- import { log as log3 } from "@dxos/log";
10
- import { byPosition } from "@dxos/util";
11
-
12
- // src/core/capabilities.ts
13
- import { Atom } from "@effect-atom/atom-react";
14
- import * as Effect from "effect/Effect";
15
- import { Trigger } from "@dxos/async";
16
- import { invariant } from "@dxos/invariant";
17
- import { log } from "@dxos/log";
18
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/capabilities.ts";
19
- var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
20
- var defineCapability = (identifier) => {
21
- return {
22
- identifier
23
- };
24
- };
25
- var CapabilityImpl = class {
26
- moduleId;
27
- implementation;
28
- constructor(moduleId, implementation) {
29
- this.moduleId = moduleId;
30
- this.implementation = implementation;
31
- }
32
- };
33
- var contributes = (interfaceDef, implementation, deactivate) => {
34
- return {
35
- interface: interfaceDef,
36
- implementation,
37
- deactivate
38
- };
39
- };
40
- var lazy = (c) => async (props) => {
41
- const { default: getCapability } = await c();
42
- return async () => getCapability(props);
43
- };
44
- var PluginContext = class {
45
- _registry;
46
- _capabilityImpls = Atom.family(() => {
47
- return Atom.make([]).pipe(Atom.keepAlive);
48
- });
49
- _capabilities = Atom.family((id) => {
50
- return Atom.make((get) => {
51
- const current = get(this._capabilityImpls(id));
52
- return current.map((c) => c.implementation);
53
- });
54
- });
55
- _capability = Atom.family((id) => {
56
- return Atom.make((get) => {
57
- const current = get(this._capabilities(id));
58
- invariant(current.length > 0, `No capability found for ${id}`, {
59
- F: __dxlog_file,
60
- L: 126,
61
- S: this,
62
- A: [
63
- "current.length > 0",
64
- "`No capability found for ${id}`"
65
- ]
66
- });
67
- return current[0];
68
- });
69
- });
70
- /**
71
- * Activates plugins based on the activation event.
72
- * @param event The activation event.
73
- * @returns Whether the activation was successful.
74
- */
75
- activate;
76
- /**
77
- * Re-activates the modules that were activated by the event.
78
- * @param event The activation event.
79
- * @returns Whether the reset was successful.
80
- */
81
- reset;
82
- constructor({ registry, activate, reset }) {
83
- this._registry = registry;
84
- this.activate = activate;
85
- this.reset = reset;
86
- }
87
- /**
88
- * @internal
89
- */
90
- contributeCapability({ module: moduleId, interface: interfaceDef, implementation }) {
91
- const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
92
- const capability = new CapabilityImpl(moduleId, implementation);
93
- if (current.includes(capability)) {
94
- return;
95
- }
96
- this._registry.set(this._capabilityImpls(interfaceDef.identifier), [
97
- ...current,
98
- capability
99
- ]);
100
- log("capability contributed", {
101
- id: interfaceDef.identifier,
102
- moduleId,
103
- count: current.length
104
- }, {
105
- F: __dxlog_file,
106
- L: 170,
107
- S: this,
108
- C: (f, a) => f(...a)
109
- });
110
- }
111
- /**
112
- * @internal
113
- */
114
- removeCapability(interfaceDef, implementation) {
115
- const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
116
- if (current.length === 0) {
117
- return;
118
- }
119
- const next = current.filter((c) => c.implementation !== implementation);
120
- if (next.length !== current.length) {
121
- this._registry.set(this._capabilityImpls(interfaceDef.identifier), next);
122
- log("capability removed", {
123
- id: interfaceDef.identifier,
124
- count: current.length
125
- }, {
126
- F: __dxlog_file,
127
- L: 189,
128
- S: this,
129
- C: (f, a) => f(...a)
130
- });
131
- } else {
132
- log.warn("capability not removed", {
133
- id: interfaceDef.identifier
134
- }, {
135
- F: __dxlog_file,
136
- L: 191,
137
- S: this,
138
- C: (f, a) => f(...a)
139
- });
140
- }
141
- }
142
- /**
143
- * Get the Atom reference to the available capabilities for a given interface.
144
- * Primarily useful for deriving other Atom values based on the capabilities or
145
- * for subscribing to changes in the capabilities.
146
- * @returns An atom reference to the available capabilities.
147
- */
148
- capabilities(interfaceDef) {
149
- return this._capabilities(interfaceDef.identifier);
150
- }
151
- /**
152
- * Get the Atom reference to the available capabilities for a given interface.
153
- * Primarily useful for deriving other Atom values based on the capability or
154
- * for subscribing to changes in the capability.
155
- * @returns An atom reference to the available capability.
156
- * @throws If no capability is found.
157
- */
158
- capability(interfaceDef) {
159
- return this._capability(interfaceDef.identifier);
160
- }
161
- /**
162
- * Get capabilities from the plugin context.
163
- * @returns An array of capabilities.
164
- */
165
- getCapabilities(interfaceDef) {
166
- return this._registry.get(this.capabilities(interfaceDef));
167
- }
168
- /**
169
- * Requests a single capability from the plugin context.
170
- * @returns The capability.
171
- * @throws If no capability is found.
172
- */
173
- getCapability(interfaceDef) {
174
- return this._registry.get(this.capability(interfaceDef));
175
- }
176
- /**
177
- * Waits for a capability to be available.
178
- * @returns The capability.
179
- */
180
- async waitForCapability(interfaceDef) {
181
- const [capability] = this.getCapabilities(interfaceDef);
182
- if (capability) {
183
- return capability;
184
- }
185
- const trigger = new Trigger();
186
- const cancel = this._registry.subscribe(this.capabilities(interfaceDef), (capabilities) => {
187
- if (capabilities.length > 0) {
188
- trigger.wake(capabilities[0]);
189
- }
190
- });
191
- const result = await trigger.wait();
192
- cancel();
193
- return result;
194
- }
195
- async activatePromise(event) {
196
- return this.activate(event).pipe(Effect.runPromise);
197
- }
198
- async resetPromise(event) {
199
- return this.reset(event).pipe(Effect.runPromise);
200
- }
201
- };
202
-
203
- // src/core/events.ts
204
- var defineEvent = (id, specifier) => {
205
- return {
206
- id,
207
- specifier
208
- };
209
- };
210
- var eventKey = (event) => event.specifier ? `${event.id}:${event.specifier}` : event.id;
211
- var oneOf = (...events) => ({
212
- type: "one-of",
213
- events
214
- });
215
- var allOf = (...events) => ({
216
- type: "all-of",
217
- events
218
- });
219
- var isOneOf = (events) => "type" in events && events.type === "one-of";
220
- var isAllOf = (events) => "type" in events && events.type === "all-of";
221
- var getEvents = (events) => "type" in events ? events.events : [
222
- events
223
- ];
224
-
225
- // src/core/manager.ts
226
- import { Registry } from "@effect-atom/atom-react";
227
- import { untracked } from "@preact/signals-core";
228
- import * as Array from "effect/Array";
229
- import * as Duration from "effect/Duration";
230
- import * as Effect2 from "effect/Effect";
231
- import * as Fiber from "effect/Fiber";
232
- import * as Function from "effect/Function";
233
- import * as HashSet from "effect/HashSet";
234
- import * as Match from "effect/Match";
235
- import * as Ref from "effect/Ref";
236
- import { Event } from "@dxos/async";
237
- import { live } from "@dxos/live-object";
238
- import { log as log2 } from "@dxos/log";
239
- var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/manager.ts";
240
- var isPromise = (value2) => {
241
- return value2 !== null && typeof value2 === "object" && "then" in value2;
242
- };
243
- var PluginManager = class {
244
- activation = new Event();
245
- context;
246
- registry;
247
- // TODO(wittjosiah): Replace with Atom.
248
- _state;
249
- _pluginLoader;
250
- _capabilities = /* @__PURE__ */ new Map();
251
- _moduleMemoMap = /* @__PURE__ */ new Map();
252
- _activatingEvents = Effect2.runSync(Ref.make([]));
253
- _activatingModules = Effect2.runSync(Ref.make([]));
254
- constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta: meta2 }) => meta2.id), enabled = [], registry }) {
255
- this.registry = registry ?? Registry.make();
256
- this.context = new PluginContext({
257
- registry: this.registry,
258
- activate: (event) => this._activate(event),
259
- reset: (id) => this._reset(id)
260
- });
261
- this._pluginLoader = pluginLoader;
262
- this._state = live({
263
- plugins,
264
- core,
265
- enabled,
266
- modules: [],
267
- active: [],
268
- eventsFired: [],
269
- pendingReset: []
270
- });
271
- plugins.forEach((plugin) => this._addPlugin(plugin));
272
- core.forEach((id) => this.enable(id));
273
- enabled.forEach((id) => this.enable(id));
274
- }
275
- /**
276
- * Plugins that are currently registered.
277
- *
278
- * @reactive
279
- */
280
- get plugins() {
281
- return this._state.plugins;
282
- }
283
- /**
284
- * Ids of plugins that are core and cannot be removed.
285
- *
286
- * @reactive
287
- */
288
- get core() {
289
- return this._state.core;
290
- }
291
- /**
292
- * Ids of plugins that are currently enabled.
293
- *
294
- * @reactive
295
- */
296
- get enabled() {
297
- return this._state.enabled;
298
- }
299
- /**
300
- * Modules of plugins which are currently enabled.
301
- *
302
- * @reactive
303
- */
304
- get modules() {
305
- return this._state.modules;
306
- }
307
- /**
308
- * Ids of modules which are currently active.
309
- *
310
- * @reactive
311
- */
312
- get active() {
313
- return this._state.active;
314
- }
315
- /**
316
- * Ids of events which have been fired.
317
- *
318
- * @reactive
319
- */
320
- get eventsFired() {
321
- return this._state.eventsFired;
322
- }
323
- /**
324
- * Ids of modules which are pending reset.
325
- *
326
- * @reactive
327
- */
328
- get pendingReset() {
329
- return this._state.pendingReset;
330
- }
331
- /**
332
- * Adds a plugin to the manager via the plugin loader.
333
- * @param id The id of the plugin.
334
- */
335
- async add(id) {
336
- return untracked(async () => {
337
- log2("add plugin", {
338
- id
339
- }, {
340
- F: __dxlog_file2,
341
- L: 164,
342
- S: this,
343
- C: (f, a) => f(...a)
344
- });
345
- const plugin = await this._pluginLoader(id);
346
- this._addPlugin(plugin);
347
- return this.enable(id);
348
- });
349
- }
350
- /**
351
- * Enables a plugin.
352
- * @param id The id of the plugin.
353
- */
354
- enable(id) {
355
- return untracked(async () => {
356
- log2("enable plugin", {
357
- id
358
- }, {
359
- F: __dxlog_file2,
360
- L: 177,
361
- S: this,
362
- C: (f, a) => f(...a)
363
- });
364
- const plugin = this._getPlugin(id);
365
- if (!plugin) {
366
- return false;
367
- }
368
- if (!this._state.enabled.includes(id)) {
369
- this._state.enabled.push(id);
370
- }
371
- plugin.modules.forEach((module) => {
372
- this._addModule(module);
373
- this._setPendingResetByModule(module);
374
- });
375
- log2("pending reset", {
376
- events: [
377
- ...this.pendingReset
378
- ]
379
- }, {
380
- F: __dxlog_file2,
381
- L: 192,
382
- S: this,
383
- C: (f, a) => f(...a)
384
- });
385
- await Effect2.runPromise(Effect2.all(this.pendingReset.map((event) => this._activate(event)), {
386
- concurrency: "unbounded"
387
- }));
388
- return true;
389
- });
390
- }
391
- /**
392
- * Removes a plugin from the manager.
393
- * @param id The id of the plugin.
394
- */
395
- remove(id) {
396
- return untracked(() => {
397
- log2("remove plugin", {
398
- id
399
- }, {
400
- F: __dxlog_file2,
401
- L: 210,
402
- S: this,
403
- C: (f, a) => f(...a)
404
- });
405
- const result = this.disable(id);
406
- if (!result) {
407
- return false;
408
- }
409
- this._removePlugin(id);
410
- return true;
411
- });
412
- }
413
- /**
414
- * Disables a plugin.
415
- * @param id The id of the plugin.
416
- */
417
- disable(id) {
418
- return untracked(async () => {
419
- log2("disable plugin", {
420
- id
421
- }, {
422
- F: __dxlog_file2,
423
- L: 227,
424
- S: this,
425
- C: (f, a) => f(...a)
426
- });
427
- if (this._state.core.includes(id)) {
428
- return false;
429
- }
430
- const plugin = this._getPlugin(id);
431
- if (!plugin) {
432
- return false;
433
- }
434
- const enabledIndex = this._state.enabled.findIndex((enabled) => enabled === id);
435
- if (enabledIndex !== -1) {
436
- this._state.enabled.splice(enabledIndex, 1);
437
- await Effect2.runPromise(this._deactivate(id));
438
- plugin.modules.forEach((module) => {
439
- this._removeModule(module.id);
440
- });
441
- }
442
- return true;
443
- });
444
- }
445
- /**
446
- * Activates plugins based on the activation event.
447
- * @param event The activation event.
448
- * @returns Whether the activation was successful.
449
- */
450
- activate(event) {
451
- return untracked(() => Effect2.runPromise(this._activate(event)));
452
- }
453
- /**
454
- * Deactivates all of the modules for a plugin.
455
- * @param id The id of the plugin.
456
- * @returns Whether the deactivation was successful.
457
- */
458
- deactivate(id) {
459
- return untracked(() => Effect2.runPromise(this._deactivate(id)));
460
- }
461
- /**
462
- * Re-activates the modules that were activated by the event.
463
- * @param event The activation event.
464
- * @returns Whether the reset was successful.
465
- */
466
- reset(event) {
467
- return untracked(() => Effect2.runPromise(this._reset(event)));
468
- }
469
- _addPlugin(plugin) {
470
- untracked(() => {
471
- log2("add plugin", {
472
- id: plugin.meta.id
473
- }, {
474
- F: __dxlog_file2,
475
- L: 280,
476
- S: this,
477
- C: (f, a) => f(...a)
478
- });
479
- if (!this._state.plugins.includes(plugin)) {
480
- this._state.plugins.push(plugin);
481
- }
482
- });
483
- }
484
- _removePlugin(id) {
485
- untracked(() => {
486
- log2("remove plugin", {
487
- id
488
- }, {
489
- F: __dxlog_file2,
490
- L: 290,
491
- S: this,
492
- C: (f, a) => f(...a)
493
- });
494
- const pluginIndex = this._state.plugins.findIndex((plugin) => plugin.meta.id === id);
495
- if (pluginIndex !== -1) {
496
- this._state.plugins.splice(pluginIndex, 1);
497
- }
498
- });
499
- }
500
- _addModule(module) {
501
- untracked(() => {
502
- log2("add module", {
503
- id: module.id
504
- }, {
505
- F: __dxlog_file2,
506
- L: 300,
507
- S: this,
508
- C: (f, a) => f(...a)
509
- });
510
- if (!this._state.modules.includes(module)) {
511
- this._state.modules.push(module);
512
- }
513
- });
514
- }
515
- _removeModule(id) {
516
- untracked(() => {
517
- log2("remove module", {
518
- id
519
- }, {
520
- F: __dxlog_file2,
521
- L: 310,
522
- S: this,
523
- C: (f, a) => f(...a)
524
- });
525
- const moduleIndex = this._state.modules.findIndex((module) => module.id === id);
526
- if (moduleIndex !== -1) {
527
- this._state.modules.splice(moduleIndex, 1);
528
- }
529
- });
530
- }
531
- _getPlugin(id) {
532
- return this._state.plugins.find((plugin) => plugin.meta.id === id);
533
- }
534
- _getActiveModules() {
535
- return this._state.modules.filter((module) => this._state.active.includes(module.id));
536
- }
537
- _getInactiveModules() {
538
- return this._state.modules.filter((module) => !this._state.active.includes(module.id));
539
- }
540
- _getActiveModulesByEvent(key) {
541
- return this._getActiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));
542
- }
543
- _getInactiveModulesByEvent(key) {
544
- return this._getInactiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));
545
- }
546
- _setPendingResetByModule(module) {
547
- return untracked(() => {
548
- const activationEvents = getEvents(module.activatesOn).map(eventKey).filter((key) => this._state.eventsFired.includes(key));
549
- const pendingReset = Array.fromIterable(new Set(activationEvents)).filter((event) => !this._state.pendingReset.includes(event));
550
- if (pendingReset.length > 0) {
551
- log2("pending reset", {
552
- events: pendingReset
553
- }, {
554
- F: __dxlog_file2,
555
- L: 348,
556
- S: this,
557
- C: (f, a) => f(...a)
558
- });
559
- this._state.pendingReset.push(...pendingReset);
560
- }
561
- });
562
- }
563
- /**
564
- * @internal
565
- */
566
- // TODO(wittjosiah): Improve error typing.
567
- _activate(event, params) {
568
- return Effect2.gen(this, function* () {
569
- const key = typeof event === "string" ? event : eventKey(event);
570
- log2("activating", {
571
- key,
572
- ...params
573
- }, {
574
- F: __dxlog_file2,
575
- L: 364,
576
- S: this,
577
- C: (f, a) => f(...a)
578
- });
579
- yield* Ref.update(this._activatingEvents, (activating) => Array.append(activating, key));
580
- const pendingIndex = this._state.pendingReset.findIndex((event2) => event2 === key);
581
- if (pendingIndex !== -1) {
582
- this._state.pendingReset.splice(pendingIndex, 1);
583
- }
584
- const activatingEvents = yield* this._activatingEvents;
585
- const activatingModules = yield* this._activatingModules;
586
- const modules = this._getInactiveModulesByEvent(key).filter((module) => {
587
- const allOf2 = isAllOf(module.activatesOn);
588
- if (!allOf2) {
589
- return true;
590
- }
591
- const events = module.activatesOn.events.filter((event2) => eventKey(event2) !== key);
592
- return events.every((event2) => this._state.eventsFired.includes(eventKey(event2)) || activatingEvents.includes(eventKey(event2))) && !activatingModules.includes(module.id);
593
- });
594
- yield* Ref.update(this._activatingModules, (activating) => Array.appendAll(activating, modules.map((module) => module.id)));
595
- if (modules.length === 0) {
596
- log2("no modules to activate", {
597
- key
598
- }, {
599
- F: __dxlog_file2,
600
- L: 395,
601
- S: this,
602
- C: (f, a) => f(...a)
603
- });
604
- if (!this._state.eventsFired.includes(key)) {
605
- this._state.eventsFired.push(key);
606
- }
607
- return false;
608
- }
609
- log2("activating modules", {
610
- key,
611
- modules: modules.map((module) => module.id)
612
- }, {
613
- F: __dxlog_file2,
614
- L: 402,
615
- S: this,
616
- C: (f, a) => f(...a)
617
- });
618
- this.activation.emit({
619
- event: key,
620
- state: "activating"
621
- });
622
- yield* Function.pipe(modules, Array.flatMap((module) => module.activatesBefore ?? []), HashSet.fromIterable, HashSet.toValues, Array.filter((event2) => !activatingEvents.includes(eventKey(event2))), Array.map((event2) => this._activate(event2, {
623
- before: key
624
- })), Effect2.allWith({
625
- concurrency: "unbounded"
626
- }));
627
- const getCapabilities = yield* Function.pipe(modules, Array.map((mod) => this._loadModule(mod)), Effect2.allWith({
628
- concurrency: "unbounded"
629
- }), Effect2.catchAll((error) => {
630
- this.activation.emit({
631
- event: key,
632
- state: "error",
633
- error
634
- });
635
- return Effect2.fail(error);
636
- }));
637
- yield* Function.pipe(
638
- modules,
639
- Array.zip(getCapabilities),
640
- Array.map(([module, capabilities]) => this._contributeCapabilities(module, capabilities)),
641
- Effect2.all
642
- );
643
- yield* Function.pipe(modules, Array.flatMap((module) => module.activatesAfter ?? []), HashSet.fromIterable, HashSet.toValues, Array.filter((event2) => !activatingEvents.includes(eventKey(event2))), Array.map((event2) => this._activate(event2, {
644
- after: key
645
- })), Effect2.allWith({
646
- concurrency: "unbounded"
647
- }));
648
- yield* Ref.update(this._activatingEvents, (activating) => Array.filter(activating, (event2) => event2 !== key));
649
- yield* Ref.update(this._activatingModules, (activating) => Array.filter(activating, (module) => !modules.map((module2) => module2.id).includes(module)));
650
- if (!this._state.eventsFired.includes(key)) {
651
- this._state.eventsFired.push(key);
652
- }
653
- this.activation.emit({
654
- event: key,
655
- state: "activated"
656
- });
657
- log2("activated", {
658
- key
659
- }, {
660
- F: __dxlog_file2,
661
- L: 458,
662
- S: this,
663
- C: (f, a) => f(...a)
664
- });
665
- return true;
666
- });
667
- }
668
- // Memoized with _moduleMemoMap
669
- _loadModule = (mod) => Effect2.tryPromise({
670
- try: async () => {
671
- const entry = this._moduleMemoMap.get(mod.id);
672
- if (entry) {
673
- return entry;
674
- }
675
- const promise2 = (async () => {
676
- const start = performance.now();
677
- let failed = false;
678
- try {
679
- log2("loading module", {
680
- module: mod.id
681
- }, {
682
- F: __dxlog_file2,
683
- L: 477,
684
- S: this,
685
- C: (f, a) => f(...a)
686
- });
687
- let activationResult = await mod.activate(this.context);
688
- if (typeof activationResult === "function") {
689
- activationResult = await activationResult();
690
- }
691
- return Array.isArray(activationResult) ? activationResult : [
692
- activationResult
693
- ];
694
- } catch (error) {
695
- failed = true;
696
- throw error;
697
- } finally {
698
- performance.measure("activate-module", {
699
- start,
700
- end: performance.now(),
701
- detail: {
702
- module: mod.id
703
- }
704
- });
705
- log2("loaded module", {
706
- module: mod.id,
707
- elapsed: performance.now() - start,
708
- failed
709
- }, {
710
- F: __dxlog_file2,
711
- L: 495,
712
- S: this,
713
- C: (f, a) => f(...a)
714
- });
715
- }
716
- })();
717
- this._moduleMemoMap.set(mod.id, promise2);
718
- return promise2;
719
- },
720
- catch: (error) => error
721
- }).pipe(Effect2.withSpan("PluginManager._loadModule"), together(Effect2.sleep(Duration.seconds(10)).pipe(Effect2.andThen(Effect2.sync(() => log2.warn(`module is taking a long time to activate`, {
722
- module: mod.id
723
- }, {
724
- F: __dxlog_file2,
725
- L: 506,
726
- S: this,
727
- C: (f, a) => f(...a)
728
- }))))));
729
- _contributeCapabilities(module, capabilities) {
730
- return Effect2.gen(this, function* () {
731
- capabilities.forEach((capability) => {
732
- this.context.contributeCapability({
733
- module: module.id,
734
- ...capability
735
- });
736
- });
737
- this._state.active.push(module.id);
738
- this._capabilities.set(module.id, capabilities);
739
- });
740
- }
741
- _deactivate(id) {
742
- return Effect2.gen(this, function* () {
743
- const plugin = this._getPlugin(id);
744
- if (!plugin) {
745
- return false;
746
- }
747
- const modules = plugin.modules;
748
- const results = yield* Effect2.all(modules.map((module) => this._deactivateModule(module)), {
749
- concurrency: "unbounded"
750
- });
751
- return results.every((result) => result);
752
- });
753
- }
754
- _deactivateModule(module) {
755
- return Effect2.gen(this, function* () {
756
- const id = module.id;
757
- log2("deactivating", {
758
- id
759
- }, {
760
- F: __dxlog_file2,
761
- L: 540,
762
- S: this,
763
- C: (f, a) => f(...a)
764
- });
765
- this._moduleMemoMap.delete(id);
766
- const capabilities = this._capabilities.get(id);
767
- if (capabilities) {
768
- for (const capability of capabilities) {
769
- this.context.removeCapability(capability.interface, capability.implementation);
770
- const program = capability.deactivate?.();
771
- yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (effect) => effect), Match.when(isPromise, (promise2) => Effect2.tryPromise({
772
- try: () => promise2,
773
- catch: (error) => error
774
- })), Match.orElse((program2) => Effect2.succeed(program2)));
775
- }
776
- this._capabilities.delete(id);
777
- }
778
- const activeIndex = this._state.active.findIndex((event) => event === id);
779
- if (activeIndex !== -1) {
780
- this._state.active.splice(activeIndex, 1);
781
- }
782
- log2("deactivated", {
783
- id
784
- }, {
785
- F: __dxlog_file2,
786
- L: 567,
787
- S: this,
788
- C: (f, a) => f(...a)
789
- });
790
- return true;
791
- });
792
- }
793
- _reset(event) {
794
- return Effect2.gen(this, function* () {
795
- const key = typeof event === "string" ? event : eventKey(event);
796
- log2("reset", {
797
- key
798
- }, {
799
- F: __dxlog_file2,
800
- L: 575,
801
- S: this,
802
- C: (f, a) => f(...a)
803
- });
804
- const modules = this._getActiveModulesByEvent(key);
805
- const results = yield* Effect2.all(modules.map((module) => this._deactivateModule(module)), {
806
- concurrency: "unbounded"
807
- });
808
- if (results.every((result) => result)) {
809
- return yield* this._activate(key);
810
- } else {
811
- return false;
812
- }
813
- });
814
- }
815
- };
816
- var together = (togetherEffect) => (effect) => Effect2.gen(function* () {
817
- const togetherFiber = yield* Effect2.fork(togetherEffect);
818
- const result = yield* effect;
819
- yield* Fiber.interrupt(togetherFiber);
820
- return result;
821
- });
822
-
823
- // src/core/plugin.ts
824
- var PluginModule = class {
825
- id;
826
- activatesOn;
827
- activatesBefore;
828
- activatesAfter;
829
- activate;
830
- constructor(options) {
831
- this.id = options.id;
832
- this.activatesOn = options.activatesOn;
833
- this.activatesBefore = options.activatesBefore;
834
- this.activatesAfter = options.activatesAfter;
835
- this.activate = options.activate;
836
- }
837
- };
838
- var defineModule = (options) => new PluginModule(options);
839
- var Plugin = class {
840
- meta;
841
- modules;
842
- constructor(meta2, modules) {
843
- this.meta = meta2;
844
- this.modules = modules;
845
- }
846
- };
847
- var definePlugin = (meta2, provider) => {
848
- const factory = (args) => {
849
- return new Plugin(meta2, provider(args));
850
- };
851
- return Object.assign(factory, {
852
- meta: meta2
853
- });
854
- };
855
-
856
- // src/common/capabilities.ts
857
- (function(Capabilities2) {
858
- Capabilities2.Null = defineCapability("dxos.org/app-framework/capability/null");
859
- Capabilities2.PluginManager = defineCapability("dxos.org/app-framework/capability/plugin-manager");
860
- Capabilities2.AtomRegistry = defineCapability("dxos.org/app-framework/capability/atom-registry");
861
- Capabilities2.ReactContext = defineCapability("dxos.org/app-framework/capability/react-context");
862
- Capabilities2.ReactRoot = defineCapability("dxos.org/app-framework/capability/react-root");
863
- Capabilities2.ReactSurface = defineCapability("dxos.org/app-framework/common/react-surface");
864
- Capabilities2.IntentResolver = defineCapability("dxos.org/app-framework/capability/intent-resolver");
865
- Capabilities2.IntentDispatcher = defineCapability("dxos.org/app-framework/capability/intent-dispatcher");
866
- Capabilities2.Layout = defineCapability("dxos.org/app-framework/capability/layout");
867
- Capabilities2.Translations = defineCapability("dxos.org/app-framework/capability/translations");
868
- Capabilities2.AppGraph = defineCapability("dxos.org/app-framework/capability/app-graph");
869
- Capabilities2.AppGraphBuilder = defineCapability("dxos.org/app-framework/capability/app-graph-builder");
870
- Capabilities2.AppGraphSerializer = defineCapability("dxos.org/app-framework/capability/app-graph-serializer");
871
- Capabilities2.SettingsStore = defineCapability("dxos.org/app-framework/capability/settings-store");
872
- Capabilities2.Settings = defineCapability("dxos.org/app-framework/capability/settings");
873
- Capabilities2.Metadata = defineCapability("dxos.org/app-framework/capability/metadata");
874
- Capabilities2.Toolkit = defineCapability("dxos.org/app-framework/capability/ai-toolkit");
875
- Capabilities2.BlueprintDefinition = defineCapability("dxos.org/app-framework/capability/blueprint-definition");
876
- Capabilities2.AiServiceLayer = defineCapability("dxos.org/app-framework/capability/ai-service-factory");
877
- Capabilities2.AiModelResolver = defineCapability("dxos.org/app-framework/capability/ai-model-resolver");
878
- Capabilities2.Functions = defineCapability("dxos.org/app-framework/capability/functions");
879
- Capabilities2.FileUploader = defineCapability("dxos.org/app-framework/capability/file-uploader");
880
- Capabilities2.AnchorSort = defineCapability("dxos.org/app-framework/capability/anchor-sort");
881
- })(Capabilities || (Capabilities = {}));
882
- var Capabilities;
883
-
884
- // src/common/collaboration.ts
885
- import * as Schema from "effect/Schema";
886
- import { ContentBlock } from "@dxos/types";
887
- (function(CollaborationActions2) {
888
- class AcceptProposal extends Schema.TaggedClass()("collaboration/accept-proposal", {
889
- input: Schema.Struct({
890
- subject: Schema.Any,
891
- anchor: Schema.String,
892
- proposal: ContentBlock.Proposal
893
- }),
894
- output: Schema.Void
895
- }) {
896
- }
897
- CollaborationActions2.AcceptProposal = AcceptProposal;
898
- })(CollaborationActions || (CollaborationActions = {}));
899
- var CollaborationActions;
900
-
901
- // src/common/events.ts
902
- (function(Events2) {
903
- Events2.Startup = defineEvent("dxos.org/app-framework/event/startup");
904
- Events2.SetupReactSurface = defineEvent("dxos.org/app-framework/event/setup-react-surface");
905
- Events2.SetupMetadata = defineEvent("dxos.org/app-framework/event/setup-metadata");
906
- Events2.SetupIntentResolver = defineEvent("dxos.org/app-framework/event/setup-intent-resolver");
907
- Events2.SetupSettings = defineEvent("dxos.org/app-framework/event/setup-settings");
908
- Events2.SetupAppGraph = defineEvent("dxos.org/app-framework/event/setup-graph");
909
- Events2.SetupTranslations = defineEvent("dxos.org/app-framework/event/setup-translations");
910
- Events2.SetupArtifactDefinition = defineEvent("dxos.org/app-framework/event/setup-artifact-definition");
911
- Events2.DispatcherReady = defineEvent("dxos.org/app-framework/event/dispatcher-ready");
912
- Events2.SettingsReady = defineEvent("dxos.org/app-framework/event/settings-ready");
913
- Events2.AppGraphReady = defineEvent("dxos.org/app-framework/event/graph-ready");
914
- Events2.createStateEvent = (specifier) => defineEvent("dxos.org/app-framework/event/state", specifier);
915
- Events2.LayoutReady = Events2.createStateEvent(Capabilities.Layout.identifier);
916
- })(Events || (Events = {}));
917
- var Events;
918
-
919
- // src/common/file.ts
920
- import * as Schema2 from "effect/Schema";
921
- var defaultFileTypes = {
922
- images: [
923
- "png",
924
- "jpg",
925
- "jpeg",
926
- "gif"
927
- ],
928
- media: [
929
- "mp3",
930
- "mp4",
931
- "mov",
932
- "avi"
933
- ],
934
- text: [
935
- "pdf",
936
- "txt",
937
- "md"
938
- ]
939
- };
940
- var FileInfoSchema = Schema2.Struct({
941
- name: Schema2.String,
942
- type: Schema2.String,
943
- url: Schema2.optional(Schema2.String),
944
- cid: Schema2.optional(Schema2.String)
945
- });
946
-
947
- // src/common/layout.ts
948
- import * as Schema5 from "effect/Schema";
949
-
950
- // src/plugin-intent/actions.ts
951
- import * as Schema4 from "effect/Schema";
952
-
953
- // src/plugin-intent/intent.ts
954
- import * as Schema3 from "effect/Schema";
955
- var createIntent = (schema, data = {}, params = {}) => {
956
- const _ = Schema3.validateSync(schema.fields.input)(data);
957
- const intent = {
958
- ...params,
959
- _schema: schema,
960
- id: schema._tag,
961
- data
962
- };
963
- return {
964
- first: intent,
965
- last: intent,
966
- all: [
967
- intent
968
- ]
969
- };
970
- };
971
- var chain = (schema, data = {}, params = {}) => (intent) => {
972
- const intents = "all" in intent ? intent.all : [
973
- intent
974
- ];
975
- const first = intents[0];
976
- const last = {
977
- ...params,
978
- _schema: schema,
979
- id: schema._tag,
980
- data
981
- };
982
- return {
983
- first,
984
- last,
985
- all: [
986
- ...intents,
987
- last
988
- ]
989
- };
990
- };
991
- var Label = Schema3.Union(Schema3.String, Schema3.mutable(Schema3.Tuple(Schema3.String, Schema3.mutable(Schema3.Struct({
992
- ns: Schema3.String,
993
- count: Schema3.optional(Schema3.Number),
994
- defaultValue: Schema3.optional(Schema3.String)
995
- })))));
996
-
997
- // src/plugin-intent/meta.ts
998
- var meta = {
999
- id: "dxos.org/plugin/intent",
1000
- name: "Intent"
1001
- };
1002
-
1003
- // src/plugin-intent/actions.ts
1004
- (function(IntentAction2) {
1005
- class Track extends Schema4.TaggedClass()(`${meta.id}/action/track`, {
1006
- input: Schema4.Struct({
1007
- intents: Schema4.Array(Schema4.String),
1008
- error: Schema4.optional(Schema4.String)
1009
- }),
1010
- output: Schema4.Void
1011
- }) {
1012
- }
1013
- IntentAction2.Track = Track;
1014
- class ShowUndo extends Schema4.TaggedClass()(`${meta.id}/action/show-undo`, {
1015
- input: Schema4.Struct({
1016
- message: Label
1017
- }),
1018
- output: Schema4.Void
1019
- }) {
1020
- }
1021
- IntentAction2.ShowUndo = ShowUndo;
1022
- })(IntentAction || (IntentAction = {}));
1023
- var IntentAction;
1024
-
1025
- // src/plugin-intent/errors.ts
1026
- var BaseError = class extends Error {
1027
- code;
1028
- context;
1029
- constructor(code, message, context) {
1030
- super(message ?? code, {
1031
- cause: context
1032
- }), this.code = code, this.context = context;
1033
- this.name = code;
1034
- Object.setPrototypeOf(this, new.target.prototype);
1035
- }
1036
- };
1037
- var NoResolversError = class extends BaseError {
1038
- constructor(action) {
1039
- super("NO_RESOLVERS", `No resolvers were found for the action: ${action}`, {
1040
- action
1041
- });
1042
- }
1043
- };
1044
- var CycleDetectedError = class extends BaseError {
1045
- constructor(context) {
1046
- super("CYCLE_DETECTED", "Intent execution limit exceeded. This is likely due to an infinite loop within intent resolvers.", context);
1047
- }
1048
- };
1049
-
1050
- // src/plugin-intent/IntentPlugin.ts
1051
- var IntentPlugin = definePlugin(meta, () => [
1052
- defineModule({
1053
- id: `${meta.id}/module/dispatcher`,
1054
- // TODO(wittjosiah): This will mean that startup needs to be reset when intents are added or removed.
1055
- // This is fine for now because it's how it worked prior to capabilities api anyways.
1056
- // In the future, the intent dispatcher should be able to be reset without resetting the entire app.
1057
- activatesOn: Events.Startup,
1058
- activatesAfter: [
1059
- Events.DispatcherReady
1060
- ],
1061
- activate: lazy(() => import("./intent-dispatcher-MGOJ3CHD.mjs"))
1062
- })
1063
- ]);
1064
-
1065
- // src/common/layout.ts
1066
- var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
1067
- (function(LayoutAction2) {
1068
- LayoutAction2.UPDATE_LAYOUT = `${LAYOUT_PLUGIN}/action/update-layout`;
1069
- class UpdateLayout extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1070
- input: Schema5.Struct({
1071
- part: Schema5.String.annotations({
1072
- description: "The part of the layout to mutate."
1073
- }),
1074
- subject: Schema5.optional(Schema5.Any.annotations({
1075
- description: "The subject of the layout update."
1076
- })),
1077
- options: Schema5.optional(Schema5.Record({
1078
- key: Schema5.String,
1079
- value: Schema5.Any
1080
- }).annotations({
1081
- description: "Additional options for the layout action."
1082
- }))
1083
- }),
1084
- output: Schema5.Void
1085
- }) {
1086
- }
1087
- LayoutAction2.UpdateLayout = UpdateLayout;
1088
- class SetLayoutMode extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1089
- input: Schema5.Struct({
1090
- part: Schema5.Literal("mode").annotations({
1091
- description: "Setting the layout mode."
1092
- }),
1093
- subject: Schema5.optional(Schema5.String.annotations({
1094
- description: "Item which is the subject of the new layout mode."
1095
- })),
1096
- options: Schema5.Union(Schema5.Struct({
1097
- mode: Schema5.String.annotations({
1098
- description: "The new layout mode."
1099
- })
1100
- }), Schema5.Struct({
1101
- revert: Schema5.Boolean.annotations({
1102
- description: "Revert to the previous layout mode."
1103
- })
1104
- }))
1105
- }),
1106
- output: Schema5.Void
1107
- }) {
1108
- }
1109
- LayoutAction2.SetLayoutMode = SetLayoutMode;
1110
- class UpdateSidebar extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1111
- input: Schema5.Struct({
1112
- part: Schema5.Literal("sidebar").annotations({
1113
- description: "Updating the sidebar."
1114
- }),
1115
- subject: Schema5.optional(Schema5.String.annotations({
1116
- description: "URI of the component to display in the sidebar."
1117
- })),
1118
- options: Schema5.optional(Schema5.Struct({
1119
- state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
1120
- description: "Whether the sidebar is closed, collapsed, or expanded."
1121
- })
1122
- }))
1123
- }),
1124
- output: Schema5.Void
1125
- }) {
1126
- }
1127
- LayoutAction2.UpdateSidebar = UpdateSidebar;
1128
- class UpdateComplementary extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1129
- input: Schema5.Struct({
1130
- part: Schema5.Literal("complementary").annotations({
1131
- description: "Updating the complementary sidebar."
1132
- }),
1133
- subject: Schema5.optional(Schema5.String.annotations({
1134
- description: "URI of the component to display in the complementary area."
1135
- })),
1136
- options: Schema5.optional(Schema5.Struct({
1137
- state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
1138
- description: "Whether the complementary sidebar is closed, collapsed, or expanded."
1139
- })
1140
- }))
1141
- }),
1142
- output: Schema5.Void
1143
- }) {
1144
- }
1145
- LayoutAction2.UpdateComplementary = UpdateComplementary;
1146
- class UpdateDialog extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1147
- input: Schema5.Struct({
1148
- part: Schema5.Literal("dialog").annotations({
1149
- description: "Updating the dialog."
1150
- }),
1151
- subject: Schema5.optional(Schema5.String.annotations({
1152
- description: "URI of the component to display in the dialog."
1153
- })),
1154
- options: Schema5.Struct({
1155
- state: Schema5.optional(Schema5.Boolean.annotations({
1156
- description: "Whether the dialog is open or closed."
1157
- })),
1158
- type: Schema5.optional(Schema5.Literal("default", "alert").annotations({
1159
- description: "The type of dialog."
1160
- })),
1161
- blockAlign: Schema5.optional(Schema5.Literal("start", "center", "end").annotations({
1162
- description: "The alignment of the dialog."
1163
- })),
1164
- overlayClasses: Schema5.optional(Schema5.String.annotations({
1165
- description: "Additional classes for the dialog overlay."
1166
- })),
1167
- overlayStyle: Schema5.optional(Schema5.Record({
1168
- key: Schema5.String,
1169
- value: Schema5.Any
1170
- }).annotations({
1171
- description: "Additional styles for the dialog overlay."
1172
- })),
1173
- props: Schema5.optional(Schema5.Record({
1174
- key: Schema5.String,
1175
- value: Schema5.Any
1176
- }).annotations({
1177
- description: "Additional props for the dialog."
1178
- }))
1179
- })
1180
- }),
1181
- output: Schema5.Void
1182
- }) {
1183
- }
1184
- LayoutAction2.UpdateDialog = UpdateDialog;
1185
- class UpdatePopover extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1186
- input: Schema5.Struct({
1187
- part: Schema5.Literal("popover").annotations({
1188
- description: "Updating the popover."
1189
- }),
1190
- subject: Schema5.optional(Schema5.Any.annotations({
1191
- description: "URI of the component to display in the popover or data to pass to the popover."
1192
- })),
1193
- options: Schema5.Struct({
1194
- side: Schema5.optional(Schema5.Literal("top", "right", "bottom", "left").annotations({
1195
- description: "The side of the anchor."
1196
- })),
1197
- state: Schema5.optional(Schema5.Boolean.annotations({
1198
- description: "Whether the popover is open or closed."
1199
- })),
1200
- props: Schema5.optional(Schema5.Record({
1201
- key: Schema5.String,
1202
- value: Schema5.Any
1203
- }).annotations({
1204
- description: "Additional props for the popover."
1205
- }))
1206
- }).pipe(Schema5.extend(Schema5.Union(Schema5.Struct({
1207
- variant: Schema5.Literal("virtual"),
1208
- anchor: Schema5.Any.annotations({
1209
- description: "The DOM element to anchor the popover to."
1210
- })
1211
- }), Schema5.Struct({
1212
- variant: Schema5.optional(Schema5.Literal("react")),
1213
- anchorId: Schema5.String.annotations({
1214
- description: "An id that can be used to determine whether to render the anchor subcomponent."
1215
- })
1216
- }))))
1217
- }),
1218
- output: Schema5.Void
1219
- }) {
1220
- }
1221
- LayoutAction2.UpdatePopover = UpdatePopover;
1222
- LayoutAction2.Toast = Schema5.Struct({
1223
- id: Schema5.String.annotations({
1224
- description: "The id of the toast."
1225
- }),
1226
- title: Schema5.optional(Label.annotations({
1227
- description: "The title of the toast."
1228
- })),
1229
- description: Schema5.optional(Label.annotations({
1230
- description: "The description of the toast."
1231
- })),
1232
- icon: Schema5.optional(Schema5.String.annotations({
1233
- description: "The icon of the toast."
1234
- })),
1235
- duration: Schema5.optional(Schema5.Number.annotations({
1236
- description: "The duration of the toast."
1237
- })),
1238
- closeLabel: Schema5.optional(Label.annotations({
1239
- description: "The label of the close button."
1240
- })),
1241
- actionLabel: Schema5.optional(Label.annotations({
1242
- description: "The label of the action button."
1243
- })),
1244
- actionAlt: Schema5.optional(Label.annotations({
1245
- description: "The alt text of the action button."
1246
- })),
1247
- onAction: Schema5.optional(Schema5.Any.annotations({
1248
- description: "The action to perform when the action button is clicked."
1249
- }))
1250
- });
1251
- class AddToast extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1252
- input: Schema5.Struct({
1253
- part: Schema5.Literal("toast").annotations({
1254
- description: "Adding a toast."
1255
- }),
1256
- subject: LayoutAction2.Toast.annotations({
1257
- description: "The toast to add."
1258
- })
1259
- }),
1260
- output: Schema5.Void
1261
- }) {
1262
- }
1263
- LayoutAction2.AddToast = AddToast;
1264
- class SwitchWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1265
- input: Schema5.Struct({
1266
- part: Schema5.Literal("workspace").annotations({
1267
- description: "Switching the workspace."
1268
- }),
1269
- subject: Schema5.String.annotations({
1270
- description: "The id of the workspace to switch to."
1271
- })
1272
- }),
1273
- output: Schema5.Void
1274
- }) {
1275
- }
1276
- LayoutAction2.SwitchWorkspace = SwitchWorkspace;
1277
- class RevertWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1278
- input: Schema5.Struct({
1279
- part: Schema5.Literal("workspace").annotations({
1280
- description: "Switching the workspace."
1281
- }),
1282
- options: Schema5.Struct({
1283
- revert: Schema5.Literal(true).annotations({
1284
- description: "Revert to the previous workspace."
1285
- })
1286
- })
1287
- }),
1288
- output: Schema5.Void
1289
- }) {
1290
- }
1291
- LayoutAction2.RevertWorkspace = RevertWorkspace;
1292
- class Open extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1293
- input: Schema5.Struct({
1294
- part: Schema5.Literal("main").annotations({
1295
- description: "Opening an item in the main content area."
1296
- }),
1297
- subject: Schema5.Array(Schema5.String.annotations({
1298
- description: "Ids of the items to open."
1299
- })),
1300
- options: Schema5.optional(Schema5.Struct({
1301
- state: Schema5.optional(Schema5.Literal(true).annotations({
1302
- description: "The items are being added."
1303
- })),
1304
- variant: Schema5.optional(Schema5.String.annotations({
1305
- description: "The variant of the item to open."
1306
- })),
1307
- key: Schema5.optional(Schema5.String.annotations({
1308
- description: "If provided, will replace item with a matching key (id prefix)."
1309
- })),
1310
- workspace: Schema5.optional(Schema5.String.annotations({
1311
- description: "The workspace to open the items in."
1312
- })),
1313
- scrollIntoView: Schema5.optional(Schema5.Boolean.annotations({
1314
- description: "Scroll the items into view."
1315
- })),
1316
- pivotId: Schema5.optional(Schema5.String.annotations({
1317
- description: "The id of the item to place new items next to."
1318
- })),
1319
- positioning: Schema5.optional(Schema5.Union(Schema5.Literal("start").annotations({
1320
- description: "The items are being added before the pivot item."
1321
- }), Schema5.Literal("end").annotations({
1322
- description: "The items are being added after the pivot item."
1323
- })))
1324
- }))
1325
- }),
1326
- output: Schema5.Void
1327
- }) {
1328
- }
1329
- LayoutAction2.Open = Open;
1330
- class Set2 extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1331
- input: Schema5.Struct({
1332
- part: Schema5.Literal("main").annotations({
1333
- description: "Setting items in the main content area."
1334
- }),
1335
- subject: Schema5.Array(Schema5.String.annotations({
1336
- description: "Ids of the items to set."
1337
- })),
1338
- options: Schema5.Struct({
1339
- override: Schema5.Literal(true).annotations({
1340
- description: "Override the current items in the main content area."
1341
- })
1342
- })
1343
- }),
1344
- output: Schema5.Void
1345
- }) {
1346
- }
1347
- LayoutAction2.Set = Set2;
1348
- class Close extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1349
- input: Schema5.Struct({
1350
- part: Schema5.Literal("main").annotations({
1351
- description: "Closing items in the main content area."
1352
- }),
1353
- subject: Schema5.Array(Schema5.String.annotations({
1354
- description: "Ids of the items to close."
1355
- })),
1356
- options: Schema5.Struct({
1357
- state: Schema5.Literal(false).annotations({
1358
- description: "The items are being removed."
1359
- })
1360
- })
1361
- }),
1362
- output: Schema5.Void
1363
- }) {
1364
- }
1365
- LayoutAction2.Close = Close;
1366
- class ScrollIntoView extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1367
- input: Schema5.Struct({
1368
- part: Schema5.Literal("current").annotations({
1369
- description: "Setting the current item"
1370
- }),
1371
- subject: Schema5.optional(Schema5.String.annotations({
1372
- description: "The id of the item to set as current."
1373
- })),
1374
- options: Schema5.optional(Schema5.Record({
1375
- key: Schema5.String,
1376
- value: Schema5.Any
1377
- }).annotations({
1378
- description: "Additional options for the scroll into view."
1379
- }))
1380
- }),
1381
- output: Schema5.Void
1382
- }) {
1383
- }
1384
- LayoutAction2.ScrollIntoView = ScrollIntoView;
1385
- class Expose extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
1386
- input: Schema5.Struct({
1387
- part: Schema5.Literal("navigation").annotations({
1388
- description: "Exposing an item in the navigation area."
1389
- }),
1390
- subject: Schema5.String.annotations({
1391
- description: "The id of the item to expose."
1392
- })
1393
- }),
1394
- output: Schema5.Void
1395
- }) {
1396
- }
1397
- LayoutAction2.Expose = Expose;
1398
- })(LayoutAction || (LayoutAction = {}));
1399
- var LayoutAction;
1400
-
1401
- // src/common/surface.ts
1402
- var createSurface = (definition) => definition;
1403
-
1404
- // src/common/translations.ts
1405
- import * as Schema6 from "effect/Schema";
1406
- var ResourceKey = Schema6.Union(Schema6.String, Schema6.Record({
1407
- key: Schema6.String,
1408
- value: Schema6.Any
1409
- }));
1410
- var ResourceLanguage = Schema6.Record({
1411
- key: Schema6.String,
1412
- value: ResourceKey
1413
- });
1414
- var Resource = Schema6.Record({
1415
- key: Schema6.String,
1416
- value: ResourceLanguage
1417
- });
1418
-
1419
- // src/plugin-intent/intent-dispatcher.ts
1420
- var __dxlog_file3 = "/__w/dxos/dxos/packages/sdk/app-framework/src/plugin-intent/intent-dispatcher.ts";
1421
- var EXECUTION_LIMIT = 100;
1422
- var HISTORY_LIMIT = 100;
1423
- var createResolver = (resolver) => resolver;
1424
- var isUndoable = (historyEntry) => historyEntry.length > 0 && historyEntry.every(({ undoable }) => !!undoable);
1425
- var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {}) => {
1426
- const historyRef = Effect3.runSync(Ref2.make([]));
1427
- const handleIntent = (intent) => Effect3.gen(function* () {
1428
- const candidates = getResolvers().filter((resolver) => resolver.intent._tag === intent.id).filter((resolver) => !resolver.filter || resolver.filter(intent.data)).toSorted(byPosition);
1429
- if (candidates.length === 0) {
1430
- return yield* Effect3.fail(new NoResolversError(intent.id));
1431
- }
1432
- const effect = candidates[0].resolve(intent.data, intent.undo ?? false);
1433
- const result = Effect3.isEffect(effect) ? yield* effect : yield* Effect3.promise(async () => effect);
1434
- return {
1435
- _intent: intent,
1436
- ...result
1437
- };
1438
- });
1439
- const dispatch = (intentChain, depth = 0) => {
1440
- log3("dispatch", {
1441
- intentChain: intentChain.all.map((i) => i.id),
1442
- depth
1443
- }, {
1444
- F: __dxlog_file3,
1445
- L: 212,
1446
- S: void 0,
1447
- C: (f, a) => f(...a)
1448
- });
1449
- return Effect3.gen(function* () {
1450
- if (depth > executionLimit) {
1451
- return yield* Effect3.fail(new CycleDetectedError());
1452
- }
1453
- const resultsRef = yield* Ref2.make([]);
1454
- for (const intent of intentChain.all) {
1455
- log3("processing", {
1456
- intent
1457
- }, {
1458
- F: __dxlog_file3,
1459
- L: 220,
1460
- S: this,
1461
- C: (f, a) => f(...a)
1462
- });
1463
- const { data: prev } = (yield* resultsRef.get)[0] ?? {};
1464
- const result2 = yield* handleIntent({
1465
- ...intent,
1466
- data: {
1467
- ...intent.data,
1468
- ...prev
1469
- }
1470
- });
1471
- log3("ok", {
1472
- intent: intent.id,
1473
- result: result2
1474
- }, {
1475
- F: __dxlog_file3,
1476
- L: 223,
1477
- S: this,
1478
- C: (f, a) => f(...a)
1479
- });
1480
- yield* Ref2.update(resultsRef, (results2) => [
1481
- result2,
1482
- ...results2
1483
- ]);
1484
- if (result2.intents) {
1485
- for (const intent2 of result2.intents) {
1486
- yield* dispatch(intent2, depth + 1);
1487
- }
1488
- }
1489
- if (result2.error) {
1490
- log3.error("failed", {
1491
- intent: intent.id,
1492
- error: result2.error
1493
- }, {
1494
- F: __dxlog_file3,
1495
- L: 240,
1496
- S: this,
1497
- C: (f, a) => f(...a)
1498
- });
1499
- return yield* Effect3.fail(result2.error);
1500
- }
1501
- }
1502
- const results = yield* resultsRef.get;
1503
- const result = results[0];
1504
- yield* Ref2.update(historyRef, (history) => {
1505
- const next = [
1506
- ...history,
1507
- results
1508
- ];
1509
- if (next.length > historyLimit) {
1510
- next.splice(0, next.length - historyLimit);
1511
- }
1512
- return next;
1513
- });
1514
- if (result.undoable && isUndoable(results)) {
1515
- yield* Function2.pipe(dispatch(createIntent(IntentAction.ShowUndo, {
1516
- message: result.undoable.message
1517
- })), Effect3.catchSome((err) => err instanceof NoResolversError ? Option.some(Effect3.succeed(void 0)) : Option.none()));
1518
- }
1519
- log3("done", {
1520
- intent: intentChain.all.map((i) => i.id),
1521
- result: result.data
1522
- }, {
1523
- F: __dxlog_file3,
1524
- L: 270,
1525
- S: this,
1526
- C: (f, a) => f(...a)
1527
- });
1528
- return result.data;
1529
- });
1530
- };
1531
- const dispatchPromise = (intentChain) => {
1532
- return Effect3.runPromise(dispatch(intentChain)).then((data) => ({
1533
- data
1534
- })).catch((error) => {
1535
- log3.catch(error, void 0, {
1536
- F: __dxlog_file3,
1537
- L: 279,
1538
- S: void 0,
1539
- C: (f, a) => f(...a)
1540
- });
1541
- return {
1542
- error
1543
- };
1544
- });
1545
- };
1546
- const undo = () => {
1547
- return Effect3.gen(function* () {
1548
- const history = yield* historyRef.get;
1549
- const last = history.findLastIndex(isUndoable);
1550
- const result = last !== -1 ? history[last] : void 0;
1551
- if (result) {
1552
- const all2 = result.map(({ _intent, undoable }) => {
1553
- const data = _intent.data;
1554
- const undoData = undoable?.data ?? {};
1555
- return {
1556
- ..._intent,
1557
- data: {
1558
- ...data,
1559
- ...undoData
1560
- },
1561
- undo: true
1562
- };
1563
- });
1564
- const intent = {
1565
- first: all2[0],
1566
- last: all2.at(-1),
1567
- all: all2
1568
- };
1569
- yield* Ref2.update(historyRef, (h) => h.filter((_, index) => index !== last));
1570
- return yield* dispatch(intent);
1571
- }
1572
- });
1573
- };
1574
- const undoPromise = () => {
1575
- return Effect3.runPromise(undo()).then((data) => ({
1576
- data
1577
- })).catch((error) => ({
1578
- error
1579
- }));
1580
- };
1581
- return {
1582
- dispatch,
1583
- dispatchPromise,
1584
- undo,
1585
- undoPromise
1586
- };
1587
- };
1588
- var defaultEffect = () => Effect3.fail(new Error("Intent runtime not ready"));
1589
- var defaultPromise = () => Effect3.runPromise(defaultEffect());
1590
- var intent_dispatcher_default = ((context) => {
1591
- const state = live2({
1592
- dispatch: defaultEffect,
1593
- dispatchPromise: defaultPromise,
1594
- undo: defaultEffect,
1595
- undoPromise: defaultPromise
1596
- });
1597
- const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher(() => context.getCapabilities(Capabilities.IntentResolver).flat());
1598
- const manager = context.getCapability(Capabilities.PluginManager);
1599
- state.dispatch = (intentChain, depth) => {
1600
- return Effect3.gen(function* () {
1601
- yield* manager._activate(Events.SetupIntentResolver);
1602
- return yield* dispatch(intentChain, depth);
1603
- });
1604
- };
1605
- state.dispatchPromise = async (intentChain) => {
1606
- await manager.activate(Events.SetupIntentResolver);
1607
- return await dispatchPromise(intentChain);
1608
- };
1609
- state.undo = undo;
1610
- state.undoPromise = undoPromise;
1611
- return contributes(Capabilities.IntentDispatcher, state);
1612
- });
1613
-
1614
- export {
1615
- defineCapability,
1616
- contributes,
1617
- lazy,
1618
- PluginContext,
1619
- defineEvent,
1620
- eventKey,
1621
- oneOf,
1622
- allOf,
1623
- isOneOf,
1624
- isAllOf,
1625
- getEvents,
1626
- PluginManager,
1627
- PluginModule,
1628
- defineModule,
1629
- Plugin,
1630
- definePlugin,
1631
- Capabilities,
1632
- CollaborationActions,
1633
- Events,
1634
- defaultFileTypes,
1635
- FileInfoSchema,
1636
- createIntent,
1637
- chain,
1638
- Label,
1639
- IntentAction,
1640
- BaseError,
1641
- NoResolversError,
1642
- CycleDetectedError,
1643
- createResolver,
1644
- createDispatcher,
1645
- intent_dispatcher_default,
1646
- IntentPlugin,
1647
- LayoutAction,
1648
- createSurface,
1649
- ResourceKey,
1650
- ResourceLanguage,
1651
- Resource
1652
- };
1653
- //# sourceMappingURL=chunk-XJZGUJ3H.mjs.map