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