@dxos/app-framework 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b

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 (382) hide show
  1. package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs +137 -0
  2. package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-ATRNTMSS.mjs +1399 -0
  4. package/dist/lib/browser/chunk-ATRNTMSS.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-LDJ3T4V3.mjs +32 -0
  6. package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-WS6SU6HI.mjs +285 -0
  8. package/dist/lib/browser/chunk-WS6SU6HI.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +119 -642
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/intent-dispatcher-E6J7E5Y5.mjs +11 -0
  12. package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs +38 -0
  13. package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs.map +7 -0
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/store-QU2IKFAI.mjs +19 -0
  16. package/dist/lib/browser/store-QU2IKFAI.mjs.map +7 -0
  17. package/dist/lib/browser/testing/index.mjs +74 -0
  18. package/dist/lib/browser/testing/index.mjs.map +7 -0
  19. package/dist/lib/browser/worker.mjs +77 -0
  20. package/dist/lib/node/app-graph-builder-JGBADFF7.cjs +146 -0
  21. package/dist/lib/node/app-graph-builder-JGBADFF7.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-FCMHRU3M.cjs → chunk-QLVQ6PND.cjs} +23 -35
  23. package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
  24. package/dist/lib/node/chunk-WKC6YMEQ.cjs +1433 -0
  25. package/dist/lib/node/chunk-WKC6YMEQ.cjs.map +7 -0
  26. package/dist/lib/node/chunk-WRWRZKZU.cjs +308 -0
  27. package/dist/lib/node/chunk-WRWRZKZU.cjs.map +7 -0
  28. package/dist/lib/node/index.cjs +125 -665
  29. package/dist/lib/node/index.cjs.map +4 -4
  30. package/dist/lib/node/{plugin-settings-W6UHMH5M.cjs → intent-dispatcher-CFBKDZQR.cjs} +10 -14
  31. package/dist/lib/node/intent-dispatcher-CFBKDZQR.cjs.map +7 -0
  32. package/dist/lib/node/intent-resolver-3TKCXP4S.cjs +45 -0
  33. package/dist/lib/node/intent-resolver-3TKCXP4S.cjs.map +7 -0
  34. package/dist/lib/node/meta.json +1 -1
  35. package/dist/lib/node/store-4QMUUU2A.cjs +34 -0
  36. package/dist/lib/node/store-4QMUUU2A.cjs.map +7 -0
  37. package/dist/lib/node/testing/index.cjs +98 -0
  38. package/dist/lib/node/testing/index.cjs.map +7 -0
  39. package/dist/lib/node/worker.cjs +99 -0
  40. package/dist/lib/node/worker.cjs.map +7 -0
  41. package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs +138 -0
  42. package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-44J2VZBB.mjs +1401 -0
  44. package/dist/lib/node-esm/chunk-44J2VZBB.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +34 -0
  46. package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-HTLXL32I.mjs +286 -0
  48. package/dist/lib/node-esm/chunk-HTLXL32I.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +119 -642
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/intent-dispatcher-LDQGDZ62.mjs +12 -0
  52. package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs +39 -0
  53. package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs.map +7 -0
  54. package/dist/lib/node-esm/meta.json +1 -1
  55. package/dist/lib/node-esm/store-VWDAYUQY.mjs +20 -0
  56. package/dist/lib/node-esm/store-VWDAYUQY.mjs.map +7 -0
  57. package/dist/lib/node-esm/testing/index.mjs +75 -0
  58. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  59. package/dist/lib/node-esm/worker.mjs +78 -0
  60. package/dist/types/src/App.d.ts +22 -13
  61. package/dist/types/src/App.d.ts.map +1 -1
  62. package/dist/types/src/common/capabilities.d.ts +293 -0
  63. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  64. package/dist/types/src/common/events.d.ts +48 -0
  65. package/dist/types/src/common/events.d.ts.map +1 -0
  66. package/dist/types/src/common/file.d.ts +14 -0
  67. package/dist/types/src/common/file.d.ts.map +1 -0
  68. package/dist/types/src/common/graph.d.ts +21 -0
  69. package/dist/types/src/common/graph.d.ts.map +1 -0
  70. package/dist/types/src/common/index.d.ts +8 -0
  71. package/dist/types/src/common/index.d.ts.map +1 -0
  72. package/dist/types/src/common/layout.d.ts +248 -0
  73. package/dist/types/src/common/layout.d.ts.map +1 -0
  74. package/dist/types/src/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
  75. package/dist/types/src/common/surface.d.ts.map +1 -0
  76. package/dist/types/src/common/translations.d.ts +11 -0
  77. package/dist/types/src/common/translations.d.ts.map +1 -0
  78. package/dist/types/src/core/capabilities.d.ts +94 -0
  79. package/dist/types/src/core/capabilities.d.ts.map +1 -0
  80. package/dist/types/src/core/capabilities.test.d.ts +2 -0
  81. package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
  82. package/dist/types/src/core/events.d.ts +58 -0
  83. package/dist/types/src/core/events.d.ts.map +1 -0
  84. package/dist/types/src/core/index.d.ts +5 -0
  85. package/dist/types/src/core/index.d.ts.map +1 -0
  86. package/dist/types/src/core/manager.d.ts +119 -0
  87. package/dist/types/src/core/manager.d.ts.map +1 -0
  88. package/dist/types/src/core/manager.test.d.ts +2 -0
  89. package/dist/types/src/core/manager.test.d.ts.map +1 -0
  90. package/dist/types/src/core/plugin.d.ts +97 -0
  91. package/dist/types/src/core/plugin.d.ts.map +1 -0
  92. package/dist/types/src/helpers.d.ts +10 -0
  93. package/dist/types/src/helpers.d.ts.map +1 -0
  94. package/dist/types/src/helpers.test.d.ts +2 -0
  95. package/dist/types/src/helpers.test.d.ts.map +1 -0
  96. package/dist/types/src/index.d.ts +5 -1
  97. package/dist/types/src/index.d.ts.map +1 -1
  98. package/dist/types/src/playground/debug/Debug.d.ts +6 -0
  99. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
  100. package/dist/types/src/playground/debug/index.d.ts +2 -0
  101. package/dist/types/src/playground/debug/index.d.ts.map +1 -0
  102. package/dist/types/src/playground/debug/plugin.d.ts +2 -0
  103. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
  104. package/dist/types/src/playground/generator/Main.d.ts +6 -0
  105. package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
  106. package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
  107. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
  108. package/dist/types/src/playground/generator/generator.d.ts +7 -0
  109. package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
  110. package/dist/types/src/playground/generator/index.d.ts +3 -0
  111. package/dist/types/src/playground/generator/index.d.ts.map +1 -0
  112. package/dist/types/src/playground/generator/plugin.d.ts +2 -0
  113. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
  114. package/dist/types/src/playground/layout/Layout.d.ts +8 -0
  115. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
  116. package/dist/types/src/playground/layout/index.d.ts +2 -0
  117. package/dist/types/src/playground/layout/index.d.ts.map +1 -0
  118. package/dist/types/src/playground/layout/plugin.d.ts +2 -0
  119. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
  120. package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
  121. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
  122. package/dist/types/src/playground/logger/index.d.ts +2 -0
  123. package/dist/types/src/playground/logger/index.d.ts.map +1 -0
  124. package/dist/types/src/playground/logger/plugin.d.ts +2 -0
  125. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
  126. package/dist/types/src/playground/logger/schema.d.ts +13 -0
  127. package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
  128. package/dist/types/src/playground/playground.stories.d.ts +10 -0
  129. package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
  130. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
  131. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
  132. package/dist/types/src/plugin-intent/actions.d.ts +23 -0
  133. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
  134. package/dist/types/src/plugin-intent/errors.d.ts +16 -0
  135. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
  136. package/dist/types/src/plugin-intent/index.d.ts +5 -0
  137. package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
  138. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +113 -0
  139. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
  140. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
  141. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +8 -28
  142. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
  143. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
  144. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
  145. package/dist/types/src/plugin-settings/actions.d.ts +27 -0
  146. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
  147. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
  148. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -0
  149. package/dist/types/src/plugin-settings/index.d.ts +3 -0
  150. package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
  151. package/dist/types/src/plugin-settings/intent-resolver.d.ts +4 -0
  152. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
  153. package/dist/types/src/plugin-settings/store.d.ts +5 -0
  154. package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
  155. package/dist/types/src/plugin-settings/translations.d.ts +11 -0
  156. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
  157. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
  158. package/dist/types/src/{plugins/plugin-intent → react}/IntentContext.d.ts +2 -2
  159. package/dist/types/src/react/IntentContext.d.ts.map +1 -0
  160. package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
  161. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
  162. package/dist/types/src/react/Surface.d.ts +12 -0
  163. package/dist/types/src/react/Surface.d.ts.map +1 -0
  164. package/dist/types/src/react/Surface.stories.d.ts +16 -0
  165. package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
  166. package/dist/types/src/react/common.d.ts +12 -0
  167. package/dist/types/src/react/common.d.ts.map +1 -0
  168. package/dist/types/src/react/index.d.ts +7 -0
  169. package/dist/types/src/react/index.d.ts.map +1 -0
  170. package/dist/types/src/react/useCapabilities.d.ts +13 -0
  171. package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
  172. package/dist/types/src/react/useIntentResolver.d.ts +3 -0
  173. package/dist/types/src/react/useIntentResolver.d.ts.map +1 -0
  174. package/dist/types/src/testing/index.d.ts +2 -0
  175. package/dist/types/src/testing/index.d.ts.map +1 -0
  176. package/dist/types/src/testing/withPluginManager.d.ts +10 -0
  177. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
  178. package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
  179. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
  180. package/dist/types/src/worker.d.ts +4 -0
  181. package/dist/types/src/worker.d.ts.map +1 -0
  182. package/dist/types/tsconfig.tsbuildinfo +1 -1
  183. package/package.json +37 -18
  184. package/project.json +4 -3
  185. package/src/App.tsx +139 -34
  186. package/src/common/capabilities.ts +91 -0
  187. package/src/common/events.ts +72 -0
  188. package/src/common/file.ts +22 -0
  189. package/src/common/graph.ts +30 -0
  190. package/src/{plugins/common → common}/index.ts +3 -2
  191. package/src/common/layout.ts +225 -0
  192. package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
  193. package/src/common/translations.ts +17 -0
  194. package/src/core/capabilities.test.ts +116 -0
  195. package/src/core/capabilities.ts +222 -0
  196. package/src/core/events.ts +58 -0
  197. package/src/core/index.ts +8 -0
  198. package/src/core/manager.test.ts +516 -0
  199. package/src/core/manager.ts +511 -0
  200. package/src/core/plugin.ts +131 -0
  201. package/src/helpers.test.ts +97 -0
  202. package/src/helpers.ts +45 -0
  203. package/src/index.ts +6 -3
  204. package/src/playground/debug/Debug.tsx +39 -0
  205. package/src/playground/debug/index.ts +5 -0
  206. package/src/playground/debug/plugin.ts +17 -0
  207. package/src/playground/generator/Main.tsx +71 -0
  208. package/src/playground/generator/Toolbar.tsx +46 -0
  209. package/src/playground/generator/generator.ts +48 -0
  210. package/src/playground/generator/index.ts +6 -0
  211. package/src/playground/generator/plugin.ts +23 -0
  212. package/src/playground/layout/Layout.tsx +33 -0
  213. package/src/playground/layout/index.ts +5 -0
  214. package/src/playground/layout/plugin.ts +17 -0
  215. package/src/playground/logger/Toolbar.tsx +29 -0
  216. package/src/playground/logger/index.ts +5 -0
  217. package/src/playground/logger/plugin.ts +36 -0
  218. package/src/playground/logger/schema.ts +12 -0
  219. package/src/playground/playground.stories.tsx +34 -0
  220. package/src/plugin-intent/IntentPlugin.tsx +20 -0
  221. package/src/plugin-intent/actions.ts +22 -0
  222. package/src/plugin-intent/errors.ts +39 -0
  223. package/src/plugin-intent/index.ts +8 -0
  224. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +83 -63
  225. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +114 -95
  226. package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +10 -26
  227. package/src/plugin-settings/SettingsPlugin.ts +35 -0
  228. package/src/plugin-settings/actions.ts +27 -0
  229. package/src/plugin-settings/app-graph-builder.ts +122 -0
  230. package/src/plugin-settings/index.ts +6 -0
  231. package/src/plugin-settings/intent-resolver.ts +28 -0
  232. package/src/plugin-settings/store.ts +20 -0
  233. package/src/plugin-settings/translations.ts +17 -0
  234. package/src/{plugins/plugin-intent → react}/IntentContext.tsx +13 -5
  235. package/src/react/PluginManagerProvider.ts +22 -0
  236. package/src/react/Surface.stories.tsx +96 -0
  237. package/src/react/Surface.tsx +75 -0
  238. package/src/react/common.ts +12 -0
  239. package/src/react/index.ts +10 -0
  240. package/src/react/useCapabilities.ts +39 -0
  241. package/src/react/useIntentResolver.ts +22 -0
  242. package/src/testing/index.ts +5 -0
  243. package/src/testing/withPluginManager.stories.tsx +47 -0
  244. package/src/testing/withPluginManager.tsx +75 -0
  245. package/src/worker.ts +11 -0
  246. package/tsconfig.json +16 -4
  247. package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
  248. package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
  249. package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
  250. package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
  251. package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
  252. package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
  254. package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
  255. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
  256. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
  257. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
  258. package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
  259. package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
  260. package/dist/lib/node/chunk-FCMHRU3M.cjs.map +0 -7
  261. package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
  262. package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
  263. package/dist/lib/node/chunk-VWHAALIN.cjs +0 -344
  264. package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
  265. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
  266. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
  267. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
  268. package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
  269. package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
  271. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
  273. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
  274. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
  275. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
  277. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
  278. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs +0 -33
  279. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
  280. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
  281. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
  282. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs.map +0 -7
  283. package/dist/types/src/plugins/common/file.d.ts +0 -22
  284. package/dist/types/src/plugins/common/file.d.ts.map +0 -1
  285. package/dist/types/src/plugins/common/graph.d.ts +0 -51
  286. package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
  287. package/dist/types/src/plugins/common/index.d.ts +0 -7
  288. package/dist/types/src/plugins/common/index.d.ts.map +0 -1
  289. package/dist/types/src/plugins/common/layout.d.ts +0 -176
  290. package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
  291. package/dist/types/src/plugins/common/metadata.d.ts +0 -16
  292. package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
  293. package/dist/types/src/plugins/common/navigation.d.ts +0 -243
  294. package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
  295. package/dist/types/src/plugins/common/translations.d.ts +0 -22
  296. package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
  297. package/dist/types/src/plugins/helpers.d.ts +0 -41
  298. package/dist/types/src/plugins/helpers.d.ts.map +0 -1
  299. package/dist/types/src/plugins/index.d.ts +0 -7
  300. package/dist/types/src/plugins/index.d.ts.map +0 -1
  301. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -16
  302. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
  303. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
  304. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
  305. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
  306. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
  307. package/dist/types/src/plugins/plugin-host/index.d.ts +0 -6
  308. package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
  309. package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
  310. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
  311. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
  312. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
  313. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
  314. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
  315. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
  316. package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -7
  317. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
  318. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts +0 -107
  319. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  320. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  321. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
  322. package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
  323. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
  324. package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
  325. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
  326. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
  327. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  328. package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
  329. package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
  330. package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
  331. package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
  332. package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -26
  333. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
  334. package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
  335. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -7
  336. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
  337. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +0 -1
  338. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
  339. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
  340. package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
  341. package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
  342. package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
  343. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
  344. package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
  345. package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
  346. package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -17
  347. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
  348. package/src/plugins/common/file.ts +0 -36
  349. package/src/plugins/common/graph.ts +0 -70
  350. package/src/plugins/common/layout.ts +0 -173
  351. package/src/plugins/common/metadata.ts +0 -29
  352. package/src/plugins/common/navigation.ts +0 -214
  353. package/src/plugins/common/translations.ts +0 -36
  354. package/src/plugins/helpers.ts +0 -92
  355. package/src/plugins/index.ts +0 -11
  356. package/src/plugins/plugin-host/HostPlugin.tsx +0 -88
  357. package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
  358. package/src/plugins/plugin-host/PluginContext.tsx +0 -79
  359. package/src/plugins/plugin-host/index.ts +0 -12
  360. package/src/plugins/plugin-host/plugin.test.ts +0 -158
  361. package/src/plugins/plugin-host/plugin.ts +0 -133
  362. package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
  363. package/src/plugins/plugin-intent/index.ts +0 -13
  364. package/src/plugins/plugin-intent/meta.ts +0 -11
  365. package/src/plugins/plugin-intent/provides.ts +0 -26
  366. package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
  367. package/src/plugins/plugin-settings/index.ts +0 -9
  368. package/src/plugins/plugin-settings/meta.ts +0 -9
  369. package/src/plugins/plugin-settings/provides.ts +0 -34
  370. package/src/plugins/plugin-surface/Surface.tsx +0 -62
  371. package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
  372. package/src/plugins/plugin-surface/helpers.ts +0 -22
  373. package/src/plugins/plugin-surface/index.ts +0 -14
  374. package/src/plugins/plugin-surface/meta.ts +0 -9
  375. package/src/plugins/plugin-surface/provides.ts +0 -27
  376. /package/dist/lib/browser/{plugin-intent-T7Y3MJ5C.mjs.map → intent-dispatcher-E6J7E5Y5.mjs.map} +0 -0
  377. /package/dist/lib/browser/{plugin-settings-5U2L2NRU.mjs.map → worker.mjs.map} +0 -0
  378. /package/dist/lib/{browser/plugin-surface-OKPF3EQI.mjs.map → node-esm/intent-dispatcher-LDQGDZ62.mjs.map} +0 -0
  379. /package/dist/lib/node-esm/{plugin-intent-W2HQC6LC.mjs.map → worker.mjs.map} +0 -0
  380. /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
  381. /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
  382. /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
@@ -2,12 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { createContext, useContext, type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';
5
+ import { type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';
6
6
 
7
- import { raise } from '@dxos/debug';
8
- import { type GuardedType, type MakeOptional } from '@dxos/util';
7
+ import { type GuardedType, type MakeOptional, type Position } from '@dxos/util';
9
8
 
10
- import { type ErrorBoundary } from './ErrorBoundary';
9
+ import { type ErrorBoundary } from '../react';
11
10
 
12
11
  /**
13
12
  * SurfaceProps are the props that are passed to the Surface component.
@@ -68,45 +67,15 @@ export type SurfaceComponent<T extends Record<string, any> = Record<string, unkn
68
67
  forwardedRef: ForwardedRef<HTMLElement>,
69
68
  ) => JSX.Element | null;
70
69
 
71
- /**
72
- * Determines the priority of the surface when multiple components are resolved.
73
- *
74
- * - `static` - The component is rendered in the order it was resolved.
75
- * - `hoist` - The component is rendered before `static` components.
76
- * - `fallback` - The component is rendered after `static` components.
77
- */
78
- export type SurfaceDisposition = 'static' | 'hoist' | 'fallback';
79
-
80
70
  /**
81
71
  * Definition of when a SurfaceComponent should be rendered.
82
72
  */
83
- export type SurfaceDefinition<T extends Record<string, any> = any> = {
73
+ export type SurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
84
74
  id: string;
85
75
  role: string | string[];
86
- disposition?: SurfaceDisposition;
76
+ position?: Position;
87
77
  filter?: (data: Record<string, unknown>) => data is T;
88
78
  component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
89
- };
79
+ }>;
90
80
 
91
81
  export const createSurface = <T extends Record<string, any> = any>(definition: SurfaceDefinition<T>) => definition;
92
-
93
- /**
94
- * Surface debug info.
95
- * NOTE: Short-term measure to track perf issues.
96
- */
97
- export type DebugInfo = {
98
- id: string;
99
- created: number;
100
- renderCount: number;
101
- } & Pick<SurfaceProps, 'role'>;
102
-
103
- export type SurfaceContextValue = {
104
- surfaces: Record<string, SurfaceDefinition>;
105
- debugInfo?: Map<string, DebugInfo>;
106
- };
107
-
108
- const SurfaceContext = createContext<SurfaceContextValue | undefined>(undefined);
109
-
110
- export const useSurfaceRoot = () => useContext(SurfaceContext) ?? raise(new Error('Missing SurfaceContext'));
111
-
112
- export const SurfaceProvider = SurfaceContext.Provider;
@@ -0,0 +1,17 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Schema as S } from '@effect/schema';
6
+
7
+ export const ResourceKey = S.Union(S.String, S.Record({ key: S.String, value: S.Any }));
8
+ export type ResourceKey = S.Schema.Type<typeof ResourceKey>;
9
+
10
+ export const ResourceLanguage = S.Record({ key: S.String, value: ResourceKey });
11
+ export type ResourceLanguage = S.Schema.Type<typeof ResourceLanguage>;
12
+
13
+ /**
14
+ * A resource is a collection of translations for a language.
15
+ */
16
+ export const Resource = S.Record({ key: S.String, value: ResourceLanguage });
17
+ export type Resource = S.Schema.Type<typeof Resource>;
@@ -0,0 +1,116 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { describe, expect, it } from 'vitest';
6
+
7
+ import { updateCounter } from '@dxos/echo-schema/testing';
8
+ import { registerSignalsRuntime } from '@dxos/echo-signals';
9
+
10
+ import { defineCapability, PluginsContext } from './capabilities';
11
+
12
+ registerSignalsRuntime();
13
+
14
+ const defaultOptions = {
15
+ activate: () => Promise.resolve(false),
16
+ reset: () => Promise.resolve(false),
17
+ };
18
+
19
+ describe('PluginsContext', () => {
20
+ it('should return empty array if no capabilities are contributed', () => {
21
+ const context = new PluginsContext(defaultOptions);
22
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
23
+ expect(context.requestCapabilities(interfaceDef)).toEqual([]);
24
+ });
25
+
26
+ it('should be able to contribute and request capabilities', () => {
27
+ const context = new PluginsContext(defaultOptions);
28
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
29
+ const implementation = { example: 'identifier' };
30
+ context.contributeCapability({ interface: interfaceDef, implementation, module: 'test' });
31
+ expect(context.requestCapabilities(interfaceDef)).toEqual([implementation]);
32
+ });
33
+
34
+ it('should be able to remove capabilities', () => {
35
+ const context = new PluginsContext(defaultOptions);
36
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
37
+ const implementation = { example: 'identifier' };
38
+ context.contributeCapability({ interface: interfaceDef, implementation, module: 'test' });
39
+ expect(context.requestCapabilities(interfaceDef)).toEqual([implementation]);
40
+ context.removeCapability(interfaceDef, implementation);
41
+ expect(context.requestCapabilities(interfaceDef)).toEqual([]);
42
+ });
43
+
44
+ it('should be able to contribute and request multiple implementations', () => {
45
+ const context = new PluginsContext(defaultOptions);
46
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
47
+ const implementation1 = { example: 'first' };
48
+ const implementation2 = { example: 'second' };
49
+ context.contributeCapability({ interface: interfaceDef, implementation: implementation1, module: 'test' });
50
+ context.contributeCapability({ interface: interfaceDef, implementation: implementation2, module: 'test' });
51
+ expect(context.requestCapabilities(interfaceDef)).toEqual([implementation1, implementation2]);
52
+ });
53
+
54
+ it('should be able to request multiple capabilities', () => {
55
+ const context = new PluginsContext(defaultOptions);
56
+ const interfaceDef1 = defineCapability<{ one: number }>('@dxos/app-framework/test/one');
57
+ const interfaceDef2 = defineCapability<{ two: number }>('@dxos/app-framework/test/two');
58
+ const implementation1 = { one: 1 };
59
+ const implementation2 = { two: 2 };
60
+ context.contributeCapability({ interface: interfaceDef1, implementation: implementation1, module: 'test' });
61
+ context.contributeCapability({ interface: interfaceDef2, implementation: implementation2, module: 'test' });
62
+ expect(context.requestCapabilities(interfaceDef1)).toEqual([implementation1]);
63
+ expect(context.requestCapabilities(interfaceDef2)).toEqual([implementation2]);
64
+ });
65
+
66
+ it('should be reactive', () => {
67
+ const context = new PluginsContext(defaultOptions);
68
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
69
+
70
+ using updates = updateCounter(() => {
71
+ context.requestCapabilities(interfaceDef);
72
+ });
73
+
74
+ expect(updates.count).toEqual(0);
75
+
76
+ const implementation = { example: 'identifier' };
77
+ context.contributeCapability({ interface: interfaceDef, implementation, module: 'test' });
78
+ expect(updates.count).toEqual(1);
79
+
80
+ context.removeCapability(interfaceDef, implementation);
81
+ expect(updates.count).toEqual(2);
82
+ });
83
+
84
+ it('should not be reactive to changes within the implementation', () => {
85
+ const context = new PluginsContext(defaultOptions);
86
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
87
+
88
+ using updates = updateCounter(() => {
89
+ context.requestCapabilities(interfaceDef);
90
+ });
91
+
92
+ expect(updates.count).toEqual(0);
93
+
94
+ const implementation = { example: 'identifier' };
95
+ context.contributeCapability({ interface: interfaceDef, implementation, module: 'test' });
96
+ expect(updates.count).toEqual(1);
97
+
98
+ implementation.example = 'updated';
99
+ expect(updates.count).toEqual(1);
100
+
101
+ const capabilities = context.requestCapabilities(interfaceDef);
102
+ expect(capabilities).toEqual([implementation]);
103
+ expect(capabilities[0].example).toEqual('updated');
104
+ expect(updates.count).toEqual(1);
105
+ });
106
+
107
+ it('should be able to wait for a capability', async () => {
108
+ const context = new PluginsContext(defaultOptions);
109
+ const interfaceDef = defineCapability<{ example: string }>('@dxos/app-framework/test/example');
110
+ const implementation = { example: 'identifier' };
111
+ const promise = context.waitForCapability(interfaceDef);
112
+ context.contributeCapability({ interface: interfaceDef, implementation, module: 'test' });
113
+ const capability = await promise;
114
+ expect(capability).toEqual(implementation);
115
+ });
116
+ });
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Interface definition for a capability.
3
+ */
4
+ //
5
+ // Copyright 2025 DXOS.org
6
+ //
7
+
8
+ import { effect, untracked } from '@preact/signals-core';
9
+ import { type Effect } from 'effect';
10
+
11
+ import { Trigger } from '@dxos/async';
12
+ import { invariant } from '@dxos/invariant';
13
+ import { create } from '@dxos/live-object';
14
+ import { log } from '@dxos/log';
15
+ import { type MaybePromise } from '@dxos/util';
16
+
17
+ import { type ActivationEvent } from './events';
18
+
19
+ const InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');
20
+
21
+ /**
22
+ * The interface definition of a capability.
23
+ */
24
+ export type InterfaceDef<T> = {
25
+ [InterfaceDefTypeId]: T;
26
+ identifier: string;
27
+ };
28
+
29
+ /**
30
+ * Helper to define the interface of a capability.
31
+ */
32
+ export const defineCapability = <T>(identifier: string) => {
33
+ return { identifier } as InterfaceDef<T>;
34
+ };
35
+
36
+ /**
37
+ * Functionality contributed to the application by a plugin module.
38
+ */
39
+ export type Capability<T> = {
40
+ /**
41
+ * The interface definition of the capability.
42
+ */
43
+ interface: InterfaceDef<T>;
44
+
45
+ /**
46
+ * The implementation of the capability.
47
+ */
48
+ implementation: T;
49
+
50
+ /**
51
+ * Called when the capability is deactivated.
52
+ */
53
+ deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
54
+ };
55
+
56
+ export type AnyCapability = Capability<any>;
57
+
58
+ type PluginsContextOptions = {
59
+ activate: (event: ActivationEvent) => MaybePromise<boolean>;
60
+ reset: (event: ActivationEvent) => MaybePromise<boolean>;
61
+ };
62
+
63
+ // NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.
64
+ class CapabilityImpl<T> {
65
+ constructor(
66
+ readonly moduleId: string,
67
+ readonly implementation: T,
68
+ ) {}
69
+ }
70
+
71
+ /**
72
+ * Helper to define the implementation of a capability.
73
+ */
74
+ export const contributes = <T>(
75
+ interfaceDef: Capability<T>['interface'],
76
+ implementation: Capability<T>['implementation'],
77
+ deactivate?: Capability<T>['deactivate'],
78
+ ): Capability<T> => {
79
+ return { interface: interfaceDef, implementation, deactivate } satisfies Capability<T>;
80
+ };
81
+
82
+ type LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;
83
+ type LoadCapabilities<T> = () => Promise<{ default: (props: T) => MaybePromise<AnyCapability[]> }>;
84
+ // TODO(wittjosiah): Not having the array be `any` causes type errors when using the lazy capability.
85
+ type LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;
86
+
87
+ /**
88
+ * Helper to define a lazily loaded implementation of a capability.
89
+ */
90
+ export const lazy =
91
+ <T, U>(c: LoadCapability<T, U> | LoadCapabilities<T>): LazyCapability<T, U> =>
92
+ async (props?: T) => {
93
+ const { default: getCapability } = await c();
94
+ return async () => getCapability(props as T);
95
+ };
96
+
97
+ /**
98
+ * Context which is passed to plugins, allowing them to interact with each other.
99
+ */
100
+ export class PluginsContext {
101
+ private readonly _definedCapabilities = new Map<string, CapabilityImpl<unknown>[]>();
102
+
103
+ /**
104
+ * Activates plugins based on the activation event.
105
+ * @param event The activation event.
106
+ * @returns Whether the activation was successful.
107
+ */
108
+ readonly activate: PluginsContextOptions['activate'];
109
+
110
+ /**
111
+ * Re-activates the modules that were activated by the event.
112
+ * @param event The activation event.
113
+ * @returns Whether the reset was successful.
114
+ */
115
+ readonly reset: PluginsContextOptions['reset'];
116
+
117
+ constructor({ activate, reset }: PluginsContextOptions) {
118
+ this.activate = activate;
119
+ this.reset = reset;
120
+ }
121
+
122
+ /**
123
+ * @internal
124
+ */
125
+ contributeCapability<T>({
126
+ module: moduleId,
127
+ interface: interfaceDef,
128
+ implementation,
129
+ }: {
130
+ module: string;
131
+ interface: InterfaceDef<T>;
132
+ implementation: T;
133
+ }) {
134
+ let current = this._definedCapabilities.get(interfaceDef.identifier);
135
+ if (!current) {
136
+ const object = create<{ value: CapabilityImpl<unknown>[] }>({ value: [] });
137
+ current = untracked(() => object.value);
138
+ this._definedCapabilities.set(interfaceDef.identifier, current);
139
+ }
140
+
141
+ current.push(new CapabilityImpl(moduleId, implementation));
142
+ log('capability contributed', {
143
+ id: interfaceDef.identifier,
144
+ moduleId,
145
+ count: untracked(() => current.length),
146
+ });
147
+ }
148
+
149
+ /**
150
+ * @internal
151
+ */
152
+ removeCapability<T>(interfaceDef: InterfaceDef<T>, implementation: T) {
153
+ const current = this._definedCapabilities.get(interfaceDef.identifier);
154
+ if (!current) {
155
+ return;
156
+ }
157
+
158
+ const index = current.findIndex((i) => i.implementation === implementation);
159
+ if (index !== -1) {
160
+ current.splice(index, 1);
161
+ log('capability removed', { id: interfaceDef.identifier, count: untracked(() => current.length) });
162
+ } else {
163
+ log.warn('capability not removed', { id: interfaceDef.identifier });
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Requests capabilities from the plugin context.
169
+ * @returns An array of capabilities.
170
+ * @reactive
171
+ */
172
+ requestCapabilities<T, U extends T = T>(
173
+ interfaceDef: InterfaceDef<T>,
174
+ filter?: (capability: T, moduleId: string) => capability is U,
175
+ ): U[] {
176
+ let current = this._definedCapabilities.get(interfaceDef.identifier);
177
+ if (!current) {
178
+ const object = create<{ value: CapabilityImpl<unknown>[] }>({ value: [] });
179
+ current = untracked(() => object.value);
180
+ this._definedCapabilities.set(interfaceDef.identifier, current);
181
+ }
182
+
183
+ // NOTE: This the type-checking for capabilities is done at the time of contribution.
184
+ const capabilities = filter ? current.filter((c) => filter(c.implementation as T, c.moduleId)) : current;
185
+ return capabilities.map((c) => c.implementation) as U[];
186
+ }
187
+
188
+ /**
189
+ * Requests a single capability from the plugin context.
190
+ * @returns The capability.
191
+ * @throws If no capability is found.
192
+ * @reactive
193
+ */
194
+ requestCapability<T, U extends T = T>(
195
+ interfaceDef: InterfaceDef<T>,
196
+ filter?: (capability: T, moduleId: string) => capability is U,
197
+ ): U {
198
+ const capability = this.requestCapabilities(interfaceDef, filter)[0];
199
+ invariant(capability, `No capability found for ${interfaceDef.identifier}`);
200
+ return capability;
201
+ }
202
+
203
+ /**
204
+ * Waits for a capability to be contributed.
205
+ * @returns The capability.
206
+ */
207
+ async waitForCapability<T, U extends T = T>(
208
+ interfaceDef: InterfaceDef<T>,
209
+ filter?: (capability: T) => capability is U,
210
+ ): Promise<U> {
211
+ const trigger = new Trigger<U>();
212
+ const unsubscribe = effect(() => {
213
+ const capabilities = this.requestCapabilities(interfaceDef, filter);
214
+ if (capabilities[0]) {
215
+ trigger.wake(capabilities[0]);
216
+ }
217
+ });
218
+ const capability = await trigger.wait();
219
+ unsubscribe();
220
+ return capability;
221
+ }
222
+ }
@@ -0,0 +1,58 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ /**
6
+ * An event which activates a plugin module.
7
+ */
8
+ export type ActivationEvent = {
9
+ id: string;
10
+ specifier?: string;
11
+ };
12
+
13
+ /**
14
+ * An activation event that can be a single event, or a combination of events.
15
+ */
16
+ export type ActivationEvents =
17
+ | ActivationEvent
18
+ | { type: 'one-of'; events: ActivationEvent[] }
19
+ | { type: 'all-of'; events: ActivationEvent[] };
20
+
21
+ /**
22
+ * Helper to define an activation event.
23
+ */
24
+ export const defineEvent = (id: string, specifier?: string) => {
25
+ return { id, specifier } as ActivationEvent;
26
+ };
27
+
28
+ /**
29
+ * Helper to create an activation event key.
30
+ */
31
+ export const eventKey = (event: ActivationEvent) => (event.specifier ? `${event.id}:${event.specifier}` : event.id);
32
+
33
+ /**
34
+ * Helper to create an activation event that triggers when any of the given events are activated.
35
+ */
36
+ export const oneOf = (...events: ActivationEvent[]) => ({ type: 'one-of' as const, events });
37
+
38
+ /**
39
+ * Helper to create an activation event that triggers when all of the given events are activated.
40
+ */
41
+ export const allOf = (...events: ActivationEvent[]) => ({ type: 'all-of' as const, events });
42
+
43
+ /**
44
+ * Helper to check if an activation event is a one-of event.
45
+ */
46
+ export const isOneOf = (events: ActivationEvents): events is { type: 'one-of'; events: ActivationEvent[] } =>
47
+ 'type' in events && events.type === 'one-of';
48
+
49
+ /**
50
+ * Helper to check if an activation event is an all-of event.
51
+ */
52
+ export const isAllOf = (events: ActivationEvents): events is { type: 'all-of'; events: ActivationEvent[] } =>
53
+ 'type' in events && events.type === 'all-of';
54
+
55
+ /**
56
+ * Helper to get the events from an activation event.
57
+ */
58
+ export const getEvents = (events: ActivationEvents) => ('type' in events ? events.events : [events]);
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './capabilities';
6
+ export * from './events';
7
+ export * from './manager';
8
+ export * from './plugin';