@dxos/app-framework 0.9.0 → 0.9.1-staging.ee54ba693a

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 (224) hide show
  1. package/dist/lib/browser/{capability-BOPAKKWG.mjs → capability-S44TE2H7.mjs} +9 -9
  2. package/dist/lib/browser/{chunk-66IXTIVK.mjs → chunk-3NQLTQCP.mjs} +6 -7
  3. package/dist/lib/browser/chunk-3NQLTQCP.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-53HJHMS5.mjs +7 -0
  5. package/dist/lib/browser/chunk-53HJHMS5.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-Y66ELD4U.mjs → chunk-KRJ4KK2W.mjs} +36 -7
  7. package/dist/lib/browser/chunk-KRJ4KK2W.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-KZUDO43J.mjs → chunk-LUH4Y5F2.mjs} +31 -23
  9. package/dist/lib/browser/chunk-LUH4Y5F2.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-CO3XLNUX.mjs → chunk-NKVRSMFN.mjs} +18 -18
  11. package/dist/lib/browser/chunk-NKVRSMFN.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-DC3WRPBV.mjs → chunk-OO53M5UK.mjs} +45 -12
  13. package/dist/lib/browser/chunk-OO53M5UK.mjs.map +7 -0
  14. package/dist/lib/browser/{chunk-IW44C7UL.mjs → chunk-OPTS3ZSN.mjs} +1 -1
  15. package/dist/lib/browser/chunk-OPTS3ZSN.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-HFLKXMT7.mjs → chunk-U5MESPM5.mjs} +61 -45
  17. package/dist/lib/browser/chunk-U5MESPM5.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-XHS5KDNX.mjs → chunk-UGYCLOXE.mjs} +25 -25
  19. package/dist/lib/browser/chunk-UGYCLOXE.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-5GY3YOEL.mjs → chunk-VF37YTXJ.mjs} +5 -5
  21. package/dist/lib/browser/chunk-VF37YTXJ.mjs.map +7 -0
  22. package/dist/lib/browser/{chunk-FO3IYSLV.mjs → chunk-YUVQIOTB.mjs} +29 -37
  23. package/dist/lib/browser/chunk-YUVQIOTB.mjs.map +7 -0
  24. package/dist/lib/browser/cli/index.mjs +9 -9
  25. package/dist/lib/browser/cli/index.mjs.map +2 -2
  26. package/dist/lib/browser/common/activation-events.mjs +7 -7
  27. package/dist/lib/browser/common/capabilities.mjs +7 -7
  28. package/dist/lib/browser/config/index.mjs +8 -0
  29. package/dist/lib/browser/config/index.mjs.map +7 -0
  30. package/dist/lib/browser/core/activation-event.mjs +1 -1
  31. package/dist/lib/browser/core/capability.mjs +1 -1
  32. package/dist/lib/browser/core/plugin-manager.mjs +4 -4
  33. package/dist/lib/browser/core/plugin.mjs +12 -2
  34. package/dist/lib/browser/core/url-loader.mjs +3 -3
  35. package/dist/lib/browser/index.mjs +14 -10
  36. package/dist/lib/browser/index.mjs.map +1 -1
  37. package/dist/lib/browser/meta.json +1 -1
  38. package/dist/lib/browser/{process-manager-capability-GXNUO7AR.mjs → process-manager-capability-QK4BMKMN.mjs} +9 -9
  39. package/dist/lib/browser/testing/index.mjs +15 -15
  40. package/dist/lib/browser/testing/index.mjs.map +3 -3
  41. package/dist/lib/browser/testing/react.mjs +11 -11
  42. package/dist/lib/browser/testing/react.mjs.map +3 -3
  43. package/dist/lib/browser/ui/index.mjs +18 -10
  44. package/dist/lib/node-esm/{capability-KZWRTX7R.mjs → capability-3YRF77LV.mjs} +9 -9
  45. package/dist/lib/node-esm/chunk-2UPUZXGU.mjs +9 -0
  46. package/dist/lib/node-esm/chunk-2UPUZXGU.mjs.map +7 -0
  47. package/dist/lib/node-esm/{chunk-XIGPWXCQ.mjs → chunk-4SE7SX7N.mjs} +45 -12
  48. package/dist/lib/node-esm/chunk-4SE7SX7N.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-XOCUANHO.mjs → chunk-BMW6P6QA.mjs} +6 -7
  50. package/dist/lib/node-esm/chunk-BMW6P6QA.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-A5CHGAZE.mjs → chunk-DRT75WGD.mjs} +61 -45
  52. package/dist/lib/node-esm/chunk-DRT75WGD.mjs.map +7 -0
  53. package/dist/lib/node-esm/{chunk-XGBUKRCK.mjs → chunk-FKMVORZN.mjs} +31 -23
  54. package/dist/lib/node-esm/chunk-FKMVORZN.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-CTKEZHKF.mjs → chunk-GLH4LGHZ.mjs} +1 -1
  56. package/dist/lib/node-esm/chunk-GLH4LGHZ.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-SX5NVETP.mjs → chunk-IL7O7IRX.mjs} +25 -25
  58. package/dist/lib/node-esm/chunk-IL7O7IRX.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-FSVGKTF6.mjs → chunk-ND2HETHD.mjs} +36 -7
  60. package/dist/lib/node-esm/chunk-ND2HETHD.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-KFZEB6BV.mjs → chunk-TLKYZKPW.mjs} +5 -5
  62. package/dist/lib/node-esm/chunk-TLKYZKPW.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-WK7OIQKI.mjs → chunk-VCPGX7WN.mjs} +29 -37
  64. package/dist/lib/node-esm/chunk-VCPGX7WN.mjs.map +7 -0
  65. package/dist/lib/node-esm/{chunk-NULBHQYS.mjs → chunk-XSZMX53L.mjs} +18 -18
  66. package/dist/lib/node-esm/chunk-XSZMX53L.mjs.map +7 -0
  67. package/dist/lib/node-esm/cli/index.mjs +9 -9
  68. package/dist/lib/node-esm/cli/index.mjs.map +2 -2
  69. package/dist/lib/node-esm/common/activation-events.mjs +7 -7
  70. package/dist/lib/node-esm/common/capabilities.mjs +7 -7
  71. package/dist/lib/node-esm/config/index.mjs +9 -0
  72. package/dist/lib/node-esm/config/index.mjs.map +7 -0
  73. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  74. package/dist/lib/node-esm/core/capability.mjs +1 -1
  75. package/dist/lib/node-esm/core/plugin-manager.mjs +4 -4
  76. package/dist/lib/node-esm/core/plugin.mjs +12 -2
  77. package/dist/lib/node-esm/core/url-loader.mjs +3 -3
  78. package/dist/lib/node-esm/index.mjs +14 -10
  79. package/dist/lib/node-esm/index.mjs.map +1 -1
  80. package/dist/lib/node-esm/meta.json +1 -1
  81. package/dist/lib/node-esm/{process-manager-capability-TX5TA6YN.mjs → process-manager-capability-5S7WZ2JR.mjs} +9 -9
  82. package/dist/lib/node-esm/testing/index.mjs +15 -15
  83. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  84. package/dist/lib/node-esm/testing/react.mjs +11 -11
  85. package/dist/lib/node-esm/testing/react.mjs.map +3 -3
  86. package/dist/lib/node-esm/ui/index.mjs +18 -10
  87. package/dist/plugin/node-esm/index.mjs +414 -81
  88. package/dist/plugin/node-esm/index.mjs.map +4 -4
  89. package/dist/plugin/node-esm/meta.json +1 -1
  90. package/dist/types/src/cli/cli.d.ts +1 -1
  91. package/dist/types/src/common/activation-events.d.ts.map +1 -1
  92. package/dist/types/src/common/capabilities.d.ts +2 -2
  93. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  94. package/dist/types/src/config/index.d.ts +2 -0
  95. package/dist/types/src/config/index.d.ts.map +1 -0
  96. package/dist/types/src/core/activation-event.d.ts +9 -6
  97. package/dist/types/src/core/activation-event.d.ts.map +1 -1
  98. package/dist/types/src/core/capability.d.ts +9 -3
  99. package/dist/types/src/core/capability.d.ts.map +1 -1
  100. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +6 -11
  101. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -1
  102. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  103. package/dist/types/src/core/plugin-manifest.d.ts +25 -7
  104. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -1
  105. package/dist/types/src/core/plugin.d.ts +89 -91
  106. package/dist/types/src/core/plugin.d.ts.map +1 -1
  107. package/dist/types/src/core/registry.d.ts +17 -57
  108. package/dist/types/src/core/registry.d.ts.map +1 -1
  109. package/dist/types/src/core/url-loader.d.ts +2 -2
  110. package/dist/types/src/core/url-loader.d.ts.map +1 -1
  111. package/dist/types/src/index.d.ts +1 -0
  112. package/dist/types/src/index.d.ts.map +1 -1
  113. package/dist/types/src/plugin-process-manager/history/capability.d.ts +1 -3
  114. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -1
  115. package/dist/types/src/plugin-process-manager/meta.d.ts +32 -2
  116. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -1
  117. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +1 -4
  118. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -1
  119. package/dist/types/src/testing/harness.d.ts +1 -1
  120. package/dist/types/src/testing/harness.d.ts.map +1 -1
  121. package/dist/types/src/testing/react.d.ts +6 -5
  122. package/dist/types/src/testing/react.d.ts.map +1 -1
  123. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  124. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  125. package/dist/types/src/ui/components/App/App.stories.d.ts +2 -2
  126. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
  127. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +6 -0
  128. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -1
  129. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +6 -10
  130. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
  131. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
  132. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +1 -1
  133. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -1
  134. package/dist/types/src/ui/components/Surface/context.d.ts +6 -2
  135. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -1
  136. package/dist/types/src/ui/components/Surface/index.d.ts +11 -4
  137. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
  138. package/dist/types/src/ui/components/Surface/types.d.ts +52 -72
  139. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
  140. package/dist/types/src/ui/hooks/useApp.d.ts +1 -1
  141. package/dist/types/src/ui/hooks/useCapabilities.d.ts +17 -1
  142. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
  143. package/dist/types/src/vite-plugin/composer/index.d.ts +11 -4
  144. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -1
  145. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
  146. package/dist/types/src/vite-plugin/index.d.ts +1 -0
  147. package/dist/types/src/vite-plugin/index.d.ts.map +1 -1
  148. package/dist/types/src/vite-plugin/load.d.ts +16 -0
  149. package/dist/types/src/vite-plugin/load.d.ts.map +1 -0
  150. package/dist/types/src/vite-plugin/manifest.d.ts +16 -4
  151. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -1
  152. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
  153. package/dist/types/tsconfig.tsbuildinfo +1 -1
  154. package/docs/registry-spec.md +331 -0
  155. package/moon.yml +1 -0
  156. package/package.json +50 -39
  157. package/src/cli/cli.ts +2 -2
  158. package/src/common/activation-events.ts +3 -3
  159. package/src/common/capabilities.ts +18 -18
  160. package/src/config/index.ts +5 -0
  161. package/src/core/activation-event.ts +15 -8
  162. package/src/core/capability.ts +18 -6
  163. package/src/core/edge-registry-plugin-provider.ts +41 -42
  164. package/src/core/plugin-manager.test.ts +133 -137
  165. package/src/core/plugin-manager.ts +25 -19
  166. package/src/core/plugin-manifest.test.ts +5 -5
  167. package/src/core/plugin-manifest.ts +13 -10
  168. package/src/core/plugin.ts +58 -114
  169. package/src/core/registry.ts +20 -60
  170. package/src/core/url-loader.test.ts +2 -2
  171. package/src/core/url-loader.ts +23 -19
  172. package/src/index.ts +1 -0
  173. package/src/testing/harness.ts +5 -3
  174. package/src/testing/react.test.tsx +4 -2
  175. package/src/testing/react.tsx +10 -9
  176. package/src/testing/service.ts +2 -2
  177. package/src/testing/withPluginManager.stories.tsx +4 -2
  178. package/src/testing/withPluginManager.tsx +3 -1
  179. package/src/ui/components/App/App.stories.tsx +2 -2
  180. package/src/ui/components/PluginManager/PluginManagerProvider.ts +7 -0
  181. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +22 -22
  182. package/src/ui/components/Surface/SurfaceComponent.tsx +90 -79
  183. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +1 -1
  184. package/src/ui/components/Surface/context.ts +6 -4
  185. package/src/ui/components/Surface/index.ts +14 -3
  186. package/src/ui/components/Surface/types.test.ts +43 -51
  187. package/src/ui/components/Surface/types.ts +99 -64
  188. package/src/ui/hooks/useApp.test.tsx +1 -1
  189. package/src/ui/hooks/useApp.tsx +2 -2
  190. package/src/ui/hooks/useCapabilities.ts +49 -2
  191. package/src/vite-plugin/boot-loader/BootLoader.solid-stories.tsx +11 -11
  192. package/src/vite-plugin/boot-loader/loader.ts +3 -3
  193. package/src/vite-plugin/composer/index.ts +134 -61
  194. package/src/vite-plugin/import-map/index.ts +23 -7
  195. package/src/vite-plugin/index.ts +1 -0
  196. package/src/vite-plugin/load.ts +57 -0
  197. package/src/vite-plugin/manifest.test.ts +3 -3
  198. package/src/vite-plugin/manifest.ts +21 -10
  199. package/src/vite-plugin/packages.ts +0 -2
  200. package/tsconfig.json +5 -2
  201. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +0 -7
  202. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +0 -7
  203. package/dist/lib/browser/chunk-CO3XLNUX.mjs.map +0 -7
  204. package/dist/lib/browser/chunk-DC3WRPBV.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +0 -7
  206. package/dist/lib/browser/chunk-HFLKXMT7.mjs.map +0 -7
  207. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +0 -7
  208. package/dist/lib/browser/chunk-KZUDO43J.mjs.map +0 -7
  209. package/dist/lib/browser/chunk-XHS5KDNX.mjs.map +0 -7
  210. package/dist/lib/browser/chunk-Y66ELD4U.mjs.map +0 -7
  211. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +0 -7
  213. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs.map +0 -7
  214. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +0 -7
  215. package/dist/lib/node-esm/chunk-NULBHQYS.mjs.map +0 -7
  216. package/dist/lib/node-esm/chunk-SX5NVETP.mjs.map +0 -7
  217. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +0 -7
  218. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs.map +0 -7
  219. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs.map +0 -7
  220. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +0 -7
  221. /package/dist/lib/browser/{capability-BOPAKKWG.mjs.map → capability-S44TE2H7.mjs.map} +0 -0
  222. /package/dist/lib/browser/{process-manager-capability-GXNUO7AR.mjs.map → process-manager-capability-QK4BMKMN.mjs.map} +0 -0
  223. /package/dist/lib/node-esm/{capability-KZWRTX7R.mjs.map → capability-3YRF77LV.mjs.map} +0 -0
  224. /package/dist/lib/node-esm/{process-manager-capability-TX5TA6YN.mjs.map → process-manager-capability-5S7WZ2JR.mjs.map} +0 -0
@@ -1,30 +1,30 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  useApp
4
- } from "../chunk-FSVGKTF6.mjs";
5
- import "../chunk-A5CHGAZE.mjs";
4
+ } from "../chunk-ND2HETHD.mjs";
5
+ import "../chunk-DRT75WGD.mjs";
6
6
  import "../chunk-37Z53PXZ.mjs";
7
7
  import "../chunk-FPW45EZH.mjs";
8
8
  import {
9
9
  capabilities_exports
10
- } from "../chunk-NULBHQYS.mjs";
10
+ } from "../chunk-XSZMX53L.mjs";
11
11
  import {
12
12
  activation_events_exports
13
- } from "../chunk-KFZEB6BV.mjs";
14
- import "../chunk-WK7OIQKI.mjs";
15
- import "../chunk-XGBUKRCK.mjs";
13
+ } from "../chunk-TLKYZKPW.mjs";
14
+ import "../chunk-VCPGX7WN.mjs";
15
+ import "../chunk-FKMVORZN.mjs";
16
16
  import {
17
17
  plugin_manager_exports
18
- } from "../chunk-SX5NVETP.mjs";
18
+ } from "../chunk-IL7O7IRX.mjs";
19
19
  import {
20
20
  activation_event_exports
21
- } from "../chunk-XOCUANHO.mjs";
21
+ } from "../chunk-BMW6P6QA.mjs";
22
22
  import {
23
23
  plugin_exports
24
- } from "../chunk-XIGPWXCQ.mjs";
24
+ } from "../chunk-4SE7SX7N.mjs";
25
25
  import {
26
26
  capability_exports
27
- } from "../chunk-CTKEZHKF.mjs";
27
+ } from "../chunk-GLH4LGHZ.mjs";
28
28
  import "../chunk-HSLMI22Q.mjs";
29
29
 
30
30
  // src/testing/harness.ts
@@ -37,9 +37,9 @@ import { invariant } from "@dxos/invariant";
37
37
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/testing/harness.ts";
38
38
  var DEFAULT_TIMEOUT_MS = 5e3;
39
39
  var createTestApp = async (opts) => {
40
- const { plugins, enabled = plugins.filter(({ meta }) => !meta.tags?.includes("system")).map((plugin) => plugin.meta.id), setupEvents = [], autoStart = true, registerFrameworkCapabilities = true } = opts;
40
+ const { plugins, enabled = plugins.filter(({ meta }) => !meta.profile.tags?.includes("system")).map((plugin) => plugin.meta.profile.key), setupEvents = [], autoStart = true, registerFrameworkCapabilities = true } = opts;
41
41
  const pluginLoader = (id) => Effect.sync(() => {
42
- const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
42
+ const plugin = plugins.find((plugin2) => plugin2.meta.profile.key === id);
43
43
  invariant(plugin, `Plugin not found: ${id}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 26, S: void 0, A: ["plugin", "`Plugin not found: ${id}`"] });
44
44
  return {
45
45
  plugin
@@ -234,7 +234,7 @@ import { invariant as invariant2 } from "@dxos/invariant";
234
234
  var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-framework/src/testing/service.ts";
235
235
  var fromPlugins = (plugins) => Layer.effect(plugin_exports.Service, Effect3.gen(function* () {
236
236
  const pluginLoader = (id) => Effect3.sync(() => {
237
- const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
237
+ const plugin = plugins.find((plugin2) => plugin2.meta.profile.key === id);
238
238
  invariant2(plugin, `Plugin not found: ${id}`, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 16, S: this, A: ["plugin", "`Plugin not found: ${id}`"] });
239
239
  return {
240
240
  plugin
@@ -243,7 +243,7 @@ var fromPlugins = (plugins) => Layer.effect(plugin_exports.Service, Effect3.gen(
243
243
  const manager = plugin_manager_exports.make({
244
244
  pluginLoader,
245
245
  plugins,
246
- enabled: plugins.map((plugin) => plugin.meta.id)
246
+ enabled: plugins.map((plugin) => plugin.meta.profile.key)
247
247
  });
248
248
  manager.capabilities.contribute({
249
249
  interface: capabilities_exports.PluginManager,
@@ -268,7 +268,7 @@ import { DXN } from "@dxos/keys";
268
268
  import { useAsyncEffect } from "@dxos/react-hooks";
269
269
  import { getProviderValue } from "@dxos/util";
270
270
  var setupPluginManager = ({ capabilities, plugins = [], ...options } = {}) => {
271
- const enabled = plugins.filter(({ meta }) => !meta.tags?.includes("system")).map(({ meta }) => meta.id);
271
+ const enabled = plugins.filter(({ meta }) => !meta.profile.tags?.includes("system")).map(({ meta }) => meta.profile.key);
272
272
  const pluginManager = plugin_manager_exports.make({
273
273
  pluginLoader: () => raise(new Error("Not implemented")),
274
274
  plugins: [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/harness.ts", "../../../../src/testing/operationCapture.ts", "../../../../src/testing/service.ts", "../../../../src/testing/withPluginManager.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Registry } from '@effect-atom/atom-react';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as PubSub from 'effect/PubSub';\nimport * as Queue from 'effect/Queue';\n\nimport { type Operation } from '@dxos/compute';\nimport { EffectEx } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { ActivationEvent, type Capability, type CapabilityManager, type Plugin, PluginManager } from '../core';\n\nexport type TestAppOptions = {\n /**\n * Plugins to register. Plugins whose `meta.tags` includes `'system'` are treated as core\n * (force-enabled). For test convenience, plugins without a `'system'` tag are enabled by\n * default unless `enabled` is provided.\n */\n plugins: Plugin.Plugin[];\n /** Plugin ids that are enabled by default in addition to core. Defaults to all non-system plugin ids. */\n enabled?: string[];\n /** Additional activation events fired alongside SetupReactSurface. */\n setupEvents?: ActivationEvent.ActivationEvent[];\n /**\n * Whether to automatically fire SetupReactSurface + Startup during setup.\n * Defaults to true.\n */\n autoStart?: boolean;\n /**\n * Whether to register the PluginManager + AtomRegistry framework capabilities.\n * Defaults to true.\n */\n registerFrameworkCapabilities?: boolean;\n};\n\n/**\n * A running plugin manager plus helpers for driving it in tests.\n */\nexport interface TestHarness {\n readonly manager: PluginManager.PluginManager;\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n /** Activate the given event. Equivalent to `manager.activate(event)`. */\n fire(event: ActivationEvent.ActivationEvent | string): Promise<boolean>;\n /** Re-activate all modules that were activated by the given event. */\n reset(event: ActivationEvent.ActivationEvent | string): Promise<boolean>;\n\n /** Returns the first contributed capability for the given interface. Throws if none are present. */\n get<T>(iface: Capability.InterfaceDef<T>): T;\n /** Returns all contributed capabilities for the given interface. */\n getAll<T>(iface: Capability.InterfaceDef<T>): T[];\n /** Waits until at least one capability is contributed for the given interface. */\n waitForCapability<T>(iface: Capability.InterfaceDef<T>, opts?: { timeout?: number }): Promise<T>;\n /** Waits until the given activation event has completed. */\n waitForEvent(event: ActivationEvent.ActivationEvent | string, opts?: { timeout?: number }): Promise<void>;\n\n /** Invokes an operation through the `Capabilities.OperationInvoker` capability. */\n invoke<I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I] : [input: I]): Promise<O>;\n\n /**\n * Waits for `Capabilities.ProcessManagerRuntime` and runs the given effect on it.\n * Convenience around `waitForCapability(ProcessManagerRuntime).runPromise(effect)`.\n */\n runPromise<A, E>(\n effect: Effect.Effect<A, E, Capabilities.ProcessManagerRuntimeServices>,\n options?: { readonly timeout?: number; readonly signal?: AbortSignal },\n ): Promise<A>;\n\n enable(id: string): Promise<boolean>;\n disable(id: string): Promise<boolean>;\n\n /** Shuts down the underlying plugin manager. */\n dispose(): Promise<void>;\n\n /** Async-disposable support so tests can use `await using harness = ...`. */\n [Symbol.asyncDispose](): Promise<void>;\n}\n\nconst DEFAULT_TIMEOUT_MS = 5_000;\n\n/**\n * Creates a TestHarness with the same bootstrap sequence that `useApp` performs,\n * minus the React provider tree.\n *\n * For Node-only tests, this is enough to fire activation events, read\n * capabilities, and invoke operations.\n *\n * For React tests, pass the returned harness to `render` or `renderSurface`\n * from `@dxos/app-framework/testing-react`.\n */\nexport const createTestApp = async (opts: TestAppOptions): Promise<TestHarness> => {\n const {\n plugins,\n enabled = plugins.filter(({ meta }) => !meta.tags?.includes('system')).map((plugin) => plugin.meta.id),\n setupEvents = [],\n autoStart = true,\n registerFrameworkCapabilities = true,\n } = opts;\n\n const pluginLoader = (id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return { plugin };\n });\n\n const manager = PluginManager.make({ pluginLoader, plugins, enabled });\n\n if (registerFrameworkCapabilities) {\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'org.dxos.app-framework.plugin-manager',\n });\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'org.dxos.app-framework.atom-registry',\n });\n }\n\n if (autoStart) {\n try {\n await EffectEx.runAndForwardErrors(\n Effect.all([\n ...setupEvents.map((event) => manager.activate(event)),\n manager.activate(ActivationEvents.SetupReactSurface),\n manager.activate(ActivationEvents.Startup),\n ]),\n );\n } catch (err) {\n await EffectEx.runAndForwardErrors(manager.shutdown()).catch(() => undefined);\n throw err;\n }\n }\n\n return new TestHarnessImpl(manager);\n};\n\nclass TestHarnessImpl implements TestHarness {\n constructor(readonly manager: PluginManager.PluginManager) {}\n\n get capabilities(): CapabilityManager.CapabilityManager {\n return this.manager.capabilities;\n }\n\n get registry(): Registry.Registry {\n return this.manager.registry;\n }\n\n fire(event: ActivationEvent.ActivationEvent | string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.activate(event));\n }\n\n reset(event: ActivationEvent.ActivationEvent | string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.reset(event));\n }\n\n get<T>(iface: Capability.InterfaceDef<T>): T {\n return this.manager.capabilities.get(iface);\n }\n\n getAll<T>(iface: Capability.InterfaceDef<T>): T[] {\n return this.manager.capabilities.getAll(iface);\n }\n\n waitForCapability<T>(iface: Capability.InterfaceDef<T>, opts?: { timeout?: number }): Promise<T> {\n const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;\n return EffectEx.runAndForwardErrors(\n this.manager.capabilities.waitFor(iface).pipe(\n Effect.timeoutFail({\n duration: Duration.millis(timeout),\n onTimeout: () => timeoutError(iface.identifier),\n }),\n ),\n );\n }\n\n waitForEvent(event: ActivationEvent.ActivationEvent | string, opts?: { timeout?: number }): Promise<void> {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;\n\n const program = Effect.gen(this, function* () {\n const queue = yield* PubSub.subscribe(this.manager.activation);\n // Re-check after subscribing to avoid a race where the event fires\n // between the caller invoking this and the subscription being installed.\n if (this.manager.getEventsFired().includes(key)) {\n return;\n }\n while (true) {\n const message = yield* Queue.take(queue);\n if (message.event === key && message.state === 'activated') {\n return;\n }\n }\n }).pipe(\n Effect.scoped,\n Effect.timeoutFail({\n duration: Duration.millis(timeout),\n onTimeout: () => timeoutError(key),\n }),\n );\n\n return EffectEx.runAndForwardErrors(program);\n }\n\n async invoke<I, O>(op: Operation.Definition<I, O>, ...args: [input?: I]): Promise<O> {\n const invoker = await this.waitForCapability(Capabilities.OperationInvoker);\n const result = await invoker.invokePromise(op as any, ...(args as [any]));\n if (result.error) {\n throw result.error;\n }\n return result.data as O;\n }\n\n async runPromise<A, E>(\n effect: Effect.Effect<A, E, Capabilities.ProcessManagerRuntimeServices>,\n options?: { readonly timeout?: number; readonly signal?: AbortSignal },\n ): Promise<A> {\n const runtime = await this.waitForCapability(Capabilities.ProcessManagerRuntime, { timeout: options?.timeout });\n return runtime.runPromise(effect, options?.signal ? { signal: options.signal } : undefined);\n }\n\n enable(id: string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.enable(id));\n }\n\n disable(id: string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.disable(id));\n }\n\n async dispose(): Promise<void> {\n await EffectEx.runAndForwardErrors(this.manager.shutdown());\n }\n\n [Symbol.asyncDispose](): Promise<void> {\n return this.dispose();\n }\n}\n\nconst timeoutError = (id: string) => new Error(`Timed out waiting for ${id}`);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { type Operation } from '@dxos/compute';\n\nimport { Capabilities } from '../common';\nimport { Capability } from '../core';\n\nexport type CapturedCall<I = unknown> = {\n /** The DXN key string of the invoked operation. */\n operationKey: string;\n /** The input passed to the operation. */\n input: I;\n};\n\ntype CapabilityManagerLike = {\n get: (cap: Capability.InterfaceDef<Capabilities.OperationInvoker>) => Capabilities.OperationInvoker;\n getAll: (cap: Capability.InterfaceDef<Capabilities.OperationInvoker>) => Capabilities.OperationInvoker[];\n};\n\nexport type OperationCapture = {\n /**\n * Wraps the real OperationInvoker from the given manager. Pass to\n * `withPluginManager({ capabilities: (m) => capture.wrap(m) })`.\n */\n wrap(manager: CapabilityManagerLike): Capability.Any[];\n /** Returns all recorded calls (mocked or real) for the given operation. */\n getCalls<I, O>(op: Operation.Definition<I, O>): CapturedCall<I>[];\n /** Clears all recorded calls (useful between play function steps). */\n reset(): void;\n};\n\n/**\n * Creates a capture that wraps the real `Capabilities.OperationInvoker`:\n *\n * - **Mocked operations** (declared in `mockedOperations`) are intercepted: the call is recorded\n * and returns `{ data: undefined }` without executing. Use this for side-effecting operations\n * you don't want to run in tests, such as `LayoutOperation.Open` (navigation).\n *\n * - **All other operations** are forwarded to the real invoker and still execute normally. The\n * call is still recorded so you can assert it was triggered even though it ran for real.\n *\n * Pass a `spyFn` wrapper (e.g. `fn` from `storybook/test`) to get Storybook Actions panel\n * integration and vi-style matchers on the recording.\n *\n * @example\n * ```ts\n * import { fn } from 'storybook/test';\n *\n * const capture = makeOperationCapture(\n * // These ops are mocked: captured but not executed.\n * [AssistantOperation.RunPromptInNewChat, LayoutOperation.Open],\n * fn,\n * );\n *\n * // Wire into withPluginManager:\n * capabilities: (manager) => capture.wrap(manager)\n *\n * // Assert in a play function:\n * const calls = capture.getCalls(AssistantOperation.RunPromptInNewChat);\n * expect(calls).toHaveLength(1);\n * expect(calls[0].input.prompt).toBe('Draft a new document');\n * ```\n *\n * @idiom org.dxos.app-framework.testing.operationCapture\n * applies: Storybook play-function tests for components that call plugin operations\n * instead-of: Loading every plugin whose operations the component triggers\n * uses: {@link makeOperationCapture}, {@link withPluginManager}\n */\nexport const makeOperationCapture = (\n mockedOperations: readonly Operation.Definition.Any[],\n spyFn?: (impl: (...args: any[]) => any) => any,\n): OperationCapture => {\n const calls: CapturedCall[] = [];\n\n const mockedKeys = new Set(mockedOperations.map((op) => String(op.meta.key)));\n\n const record = (op: Operation.Definition<any, any>, input?: unknown) => {\n calls.push({ operationKey: String(op.meta.key), input: input ?? {} });\n };\n\n const recordFn = spyFn ? spyFn(record) : record;\n\n return {\n wrap(manager) {\n // Use getAll to find the real invoker that was registered before our wrapper. manager.get\n // returns the last contribution (ours, once added), but getAll returns them all in order.\n // On first invocation (when activation is complete) we find the non-wrapper contribution.\n let real: Capabilities.OperationInvoker | undefined;\n const delegate = () => {\n if (!real) {\n const all = manager.getAll(Capabilities.OperationInvoker);\n real = all.find((inv) => inv !== wrapped);\n }\n return real;\n };\n\n const wrapped: Capabilities.OperationInvoker = {\n get invocations() {\n return delegate()!.invocations;\n },\n get pendingFollowups() {\n return delegate()!.pendingFollowups;\n },\n get awaitFollowups() {\n return delegate()!.awaitFollowups;\n },\n invoke: (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return Effect.succeed(undefined as any);\n }\n return (delegate()!.invoke as any)(op, input, ...rest);\n },\n invokePromise: async (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return { data: undefined };\n }\n return (delegate()!.invokePromise as any)(op, input, ...rest);\n },\n schedule: (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return Effect.succeed(undefined);\n }\n return (delegate()!.schedule as any)(op, input, ...rest);\n },\n };\n\n return [Capability.contributes(Capabilities.OperationInvoker, wrapped)];\n },\n getCalls<I, O>(op: Operation.Definition<I, O>): CapturedCall<I>[] {\n const key = String(op.meta.key);\n return calls.filter((c) => c.operationKey === key) as CapturedCall<I>[];\n },\n reset() {\n calls.length = 0;\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Plugin, PluginManager } from '../core';\n\n/**\n * Creates a Plugin.Service layer from a list of plugins.\n * This is primarily used for testing.\n */\nexport const fromPlugins = (plugins: Plugin.Plugin[]) =>\n Layer.effect(\n Plugin.Service,\n Effect.gen(function* () {\n // TODO(wittjosiah): Try to dedupe logic between here, createCliApp and useApp.\n\n const pluginLoader = (id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return { plugin };\n });\n\n const manager = PluginManager.make({\n pluginLoader,\n plugins,\n enabled: plugins.map((plugin) => plugin.meta.id),\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'org.dxos.app-framework.plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'org.dxos.app-framework.atom-registry',\n });\n\n yield* manager.activate(ActivationEvents.Startup);\n\n return manager;\n }),\n );\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport * as Effect from 'effect/Effect';\nimport React, { useEffect, useState } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { EffectEx } from '@dxos/effect';\nimport { DXN } from '@dxos/keys';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { type MaybeProvider, getProviderValue } from '@dxos/util';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { type ActivationEvent, Capability, type CapabilityManager, Plugin, PluginManager } from '../core';\nimport { type UseAppOptions, useApp } from '../ui';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n ...options\n}: UseAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n // Auto-enable every non-system plugin so stories don't have to spell out\n // enablement. System-tagged plugins are force-enabled by the manager.\n const enabled = plugins.filter(({ meta }) => !meta.tags?.includes('system')).map(({ meta }) => meta.id);\n const pluginManager = PluginManager.make({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin, ...plugins],\n enabled,\n ...options,\n });\n\n if (capabilities) {\n getProviderValue(capabilities, pluginManager.capabilities).forEach((capability) => {\n pluginManager.capabilities.contribute({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\ntype ManagedPluginManagerState = {\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n pluginManager: PluginManager.PluginManager;\n setupEvents?: ActivationEvent.ActivationEvent[];\n storyId: string;\n};\n\nexport type WithPluginManagerOptions = UseAppOptions & {\n /** @deprecated */\n capabilities?: MaybeProvider<Capability.Any[], CapabilityManager.CapabilityManager>;\n /** @deprecated */\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n};\n\nexport type WithPluginManagerInitializer<Args = void> =\n | WithPluginManagerOptions\n | ((context: StoryContext<Args>) => WithPluginManagerOptions);\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = <Args,>(init: WithPluginManagerInitializer<Args> = {}): Decorator => {\n return (Story, context) => {\n const storyId = context.id;\n const options = typeof init === 'function' ? init(context as any) : init;\n const [managerState, setManagerState] = useState<ManagedPluginManagerState>();\n\n // Storybook replaces the full context object often, so key manager ownership by story id.\n useEffect(() => {\n const pluginManager = setupPluginManager(options);\n const capability = Capability.contributes(Capabilities.ReactRoot, {\n id: storyId,\n root: () => <Story />,\n });\n\n pluginManager.capabilities.contribute({\n ...capability,\n module: 'org.dxos.app-framework.with-plugin-manager',\n });\n\n setManagerState({\n pluginManager,\n setupEvents: options.setupEvents,\n fireEvents: options.fireEvents,\n storyId,\n });\n\n return () => {\n pluginManager.capabilities.remove(capability.interface, capability.implementation);\n void EffectEx.runAndForwardErrors(pluginManager.shutdown());\n };\n }, [storyId, init]);\n\n // Avoid mounting useApp with a stale manager from the previous story.\n if (!managerState || managerState.storyId !== storyId) {\n return <></>;\n }\n\n return <WithPluginManagerApp {...managerState} />;\n };\n};\n\nconst WithPluginManagerApp = ({ fireEvents, pluginManager, setupEvents, storyId }: ManagedPluginManagerState) => {\n // Fire deprecated events only after the effect-owned manager for this story exists.\n useAsyncEffect(async () => {\n await Promise.all(fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n }, [fireEvents, pluginManager, storyId]);\n\n const App = useApp({ pluginManager, setupEvents });\n return <App />;\n};\n\nconst storyMeta = Plugin.makeMeta({\n key: DXN.make('org.dxos.appFramework.story'),\n name: 'Story',\n tags: ['system'],\n});\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst StoryPlugin = Plugin.define(storyMeta).pipe(\n Plugin.addModule({\n id: 'Story',\n activatesOn: ActivationEvents.Startup,\n activate: () => Effect.succeed([]),\n }),\n Plugin.make,\n)();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,YAAYA,cAAc;AAC1B,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AAGvB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAwE1B,IAAA,eAAMC;;AAqBEC,IAAAA,gBACJC,OAAOC,SAAK;UACV,SAAMC,UAASC,QAAY,OAAED,CAAAA,EAAAA,KAAWA,MAAOE,CAAAA,KAAO,MAAKC,SAAAA,QAAAA,CAAAA,EAAAA,IAAAA,CAAAA,WAAAA,OAAAA,KAAAA,EAAAA,GAAAA,cAAAA,CAAAA,GAAAA,YAAAA,MAAAA,gCAAAA,KAAAA,IAAAA;uBACjDH,CAAAA,OAAS,YAAA,MAAA;AACnB,UAAA,SAAO,QAAA,KAAA,CAAAA,YAAAA,QAAA,KAAA,OAAA,EAAA;cAAEA,QAAAA,qBAAAA,EAAAA,IAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,QAAAA,GAAAA,CAAAA,UAAAA,2BAAAA,EAAAA,CAAAA;AAAO,WAAA;MAClB;IAEII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UT_MS", "pluginLoader", "Effect", "sync", "plugin", "plugins", "meta", "id", "manager", "enabled", "registerFrameworkCapabilities", "PluginManager", "implementation", "module", "capabilities", "registry", "autoStart", "EffectEx", "activate", "SetupReactSurface", "ActivationEvents", "Startup", "err", "TestHarnessImpl", "fire", "reset", "iface", "getAll", "waitForCapability", "runAndForwardErrors", "duration", "Duration", "timeout", "onTimeout", "identifier", "waitForEvent", "opts", "program", "queue", "subscribe", "message", "timeoutError", "key", "invoke", "args", "result", "invoker", "error", "data", "runPromise", "effect", "options", "runtime", "undefined", "enable", "disable", "dispose", "Symbol", "asyncDispose", "Effect", "makeOperationCapture", "mockedOperations", "spyFn", "calls", "mockedKeys", "Set", "map", "op", "String", "meta", "key", "record", "input", "push", "operationKey", "recordFn", "wrap", "manager", "real", "delegate", "all", "getAll", "Capabilities", "OperationInvoker", "find", "inv", "wrapped", "invocations", "pendingFollowups", "awaitFollowups", "invoke", "rest", "has", "succeed", "undefined", "invokePromise", "data", "schedule", "Capability", "contributes", "getCalls", "filter", "c", "reset", "length", "Effect", "Layer", "invariant", "__dxlog_file", "pluginLoader", "id", "plugin", "manager", "plugins", "enabled", "capabilities", "contribute", "implementation", "module", "registry", "Effect", "React", "useEffect", "useState", "raise", "EffectEx", "DXN", "useAsyncEffect", "getProviderValue", "setupPluginManager", "capabilities", "plugins", "options", "enabled", "filter", "meta", "tags", "includes", "map", "id", "pluginManager", "PluginManager", "make", "pluginLoader", "raise", "Error", "StoryPlugin", "getProviderValue", "forEach", "capability", "contribute", "interface", "implementation", "module", "withPluginManager", "init", "Story", "context", "storyId", "managerState", "setManagerState", "useState", "useEffect", "Capability", "contributes", "Capabilities", "ReactRoot", "root", "setupEvents", "fireEvents", "remove", "EffectEx", "runAndForwardErrors", "shutdown", "WithPluginManagerApp", "useAsyncEffect", "Promise", "all", "event", "activate", "App", "useApp", "storyMeta", "Plugin", "makeMeta", "key", "DXN", "name", "define", "pipe", "addModule", "activatesOn", "ActivationEvents", "Startup", "succeed"]
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Registry } from '@effect-atom/atom-react';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as PubSub from 'effect/PubSub';\nimport * as Queue from 'effect/Queue';\n\nimport { type Operation } from '@dxos/compute';\nimport { EffectEx } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { ActivationEvent, type Capability, type CapabilityManager, type Plugin, PluginManager } from '../core';\n\nexport type TestAppOptions = {\n /**\n * Plugins to register. Plugins whose `meta.profile.tags` includes `'system'` are treated as core\n * (force-enabled). For test convenience, plugins without a `'system'` tag are enabled by\n * default unless `enabled` is provided.\n */\n plugins: Plugin.Plugin[];\n /** Plugin ids that are enabled by default in addition to core. Defaults to all non-system plugin ids. */\n enabled?: string[];\n /** Additional activation events fired alongside SetupReactSurface. */\n setupEvents?: ActivationEvent.ActivationEvent[];\n /**\n * Whether to automatically fire SetupReactSurface + Startup during setup.\n * Defaults to true.\n */\n autoStart?: boolean;\n /**\n * Whether to register the PluginManager + AtomRegistry framework capabilities.\n * Defaults to true.\n */\n registerFrameworkCapabilities?: boolean;\n};\n\n/**\n * A running plugin manager plus helpers for driving it in tests.\n */\nexport interface TestHarness {\n readonly manager: PluginManager.PluginManager;\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n /** Activate the given event. Equivalent to `manager.activate(event)`. */\n fire(event: ActivationEvent.ActivationEvent | string): Promise<boolean>;\n /** Re-activate all modules that were activated by the given event. */\n reset(event: ActivationEvent.ActivationEvent | string): Promise<boolean>;\n\n /** Returns the first contributed capability for the given interface. Throws if none are present. */\n get<T>(iface: Capability.InterfaceDef<T>): T;\n /** Returns all contributed capabilities for the given interface. */\n getAll<T>(iface: Capability.InterfaceDef<T>): T[];\n /** Waits until at least one capability is contributed for the given interface. */\n waitForCapability<T>(iface: Capability.InterfaceDef<T>, opts?: { timeout?: number }): Promise<T>;\n /** Waits until the given activation event has completed. */\n waitForEvent(event: ActivationEvent.ActivationEvent | string, opts?: { timeout?: number }): Promise<void>;\n\n /** Invokes an operation through the `Capabilities.OperationInvoker` capability. */\n invoke<I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I] : [input: I]): Promise<O>;\n\n /**\n * Waits for `Capabilities.ProcessManagerRuntime` and runs the given effect on it.\n * Convenience around `waitForCapability(ProcessManagerRuntime).runPromise(effect)`.\n */\n runPromise<A, E>(\n effect: Effect.Effect<A, E, Capabilities.ProcessManagerRuntimeServices>,\n options?: { readonly timeout?: number; readonly signal?: AbortSignal },\n ): Promise<A>;\n\n enable(id: string): Promise<boolean>;\n disable(id: string): Promise<boolean>;\n\n /** Shuts down the underlying plugin manager. */\n dispose(): Promise<void>;\n\n /** Async-disposable support so tests can use `await using harness = ...`. */\n [Symbol.asyncDispose](): Promise<void>;\n}\n\nconst DEFAULT_TIMEOUT_MS = 5_000;\n\n/**\n * Creates a TestHarness with the same bootstrap sequence that `useApp` performs,\n * minus the React provider tree.\n *\n * For Node-only tests, this is enough to fire activation events, read\n * capabilities, and invoke operations.\n *\n * For React tests, pass the returned harness to `render` or `renderSurface`\n * from `@dxos/app-framework/testing-react`.\n */\nexport const createTestApp = async (opts: TestAppOptions): Promise<TestHarness> => {\n const {\n plugins,\n enabled = plugins\n .filter(({ meta }) => !meta.profile.tags?.includes('system'))\n .map((plugin) => plugin.meta.profile.key),\n setupEvents = [],\n autoStart = true,\n registerFrameworkCapabilities = true,\n } = opts;\n\n const pluginLoader = (id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.profile.key === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return { plugin };\n });\n\n const manager = PluginManager.make({ pluginLoader, plugins, enabled });\n\n if (registerFrameworkCapabilities) {\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'org.dxos.app-framework.plugin-manager',\n });\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'org.dxos.app-framework.atom-registry',\n });\n }\n\n if (autoStart) {\n try {\n await EffectEx.runAndForwardErrors(\n Effect.all([\n ...setupEvents.map((event) => manager.activate(event)),\n manager.activate(ActivationEvents.SetupReactSurface),\n manager.activate(ActivationEvents.Startup),\n ]),\n );\n } catch (err) {\n await EffectEx.runAndForwardErrors(manager.shutdown()).catch(() => undefined);\n throw err;\n }\n }\n\n return new TestHarnessImpl(manager);\n};\n\nclass TestHarnessImpl implements TestHarness {\n constructor(readonly manager: PluginManager.PluginManager) {}\n\n get capabilities(): CapabilityManager.CapabilityManager {\n return this.manager.capabilities;\n }\n\n get registry(): Registry.Registry {\n return this.manager.registry;\n }\n\n fire(event: ActivationEvent.ActivationEvent | string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.activate(event));\n }\n\n reset(event: ActivationEvent.ActivationEvent | string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.reset(event));\n }\n\n get<T>(iface: Capability.InterfaceDef<T>): T {\n return this.manager.capabilities.get(iface);\n }\n\n getAll<T>(iface: Capability.InterfaceDef<T>): T[] {\n return this.manager.capabilities.getAll(iface);\n }\n\n waitForCapability<T>(iface: Capability.InterfaceDef<T>, opts?: { timeout?: number }): Promise<T> {\n const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;\n return EffectEx.runAndForwardErrors(\n this.manager.capabilities.waitFor(iface).pipe(\n Effect.timeoutFail({\n duration: Duration.millis(timeout),\n onTimeout: () => timeoutError(iface.identifier),\n }),\n ),\n );\n }\n\n waitForEvent(event: ActivationEvent.ActivationEvent | string, opts?: { timeout?: number }): Promise<void> {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n const timeout = opts?.timeout ?? DEFAULT_TIMEOUT_MS;\n\n const program = Effect.gen(this, function* () {\n const queue = yield* PubSub.subscribe(this.manager.activation);\n // Re-check after subscribing to avoid a race where the event fires\n // between the caller invoking this and the subscription being installed.\n if (this.manager.getEventsFired().includes(key)) {\n return;\n }\n while (true) {\n const message = yield* Queue.take(queue);\n if (message.event === key && message.state === 'activated') {\n return;\n }\n }\n }).pipe(\n Effect.scoped,\n Effect.timeoutFail({\n duration: Duration.millis(timeout),\n onTimeout: () => timeoutError(key),\n }),\n );\n\n return EffectEx.runAndForwardErrors(program);\n }\n\n async invoke<I, O>(op: Operation.Definition<I, O>, ...args: [input?: I]): Promise<O> {\n const invoker = await this.waitForCapability(Capabilities.OperationInvoker);\n const result = await invoker.invokePromise(op as any, ...(args as [any]));\n if (result.error) {\n throw result.error;\n }\n return result.data as O;\n }\n\n async runPromise<A, E>(\n effect: Effect.Effect<A, E, Capabilities.ProcessManagerRuntimeServices>,\n options?: { readonly timeout?: number; readonly signal?: AbortSignal },\n ): Promise<A> {\n const runtime = await this.waitForCapability(Capabilities.ProcessManagerRuntime, { timeout: options?.timeout });\n return runtime.runPromise(effect, options?.signal ? { signal: options.signal } : undefined);\n }\n\n enable(id: string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.enable(id));\n }\n\n disable(id: string): Promise<boolean> {\n return EffectEx.runAndForwardErrors(this.manager.disable(id));\n }\n\n async dispose(): Promise<void> {\n await EffectEx.runAndForwardErrors(this.manager.shutdown());\n }\n\n [Symbol.asyncDispose](): Promise<void> {\n return this.dispose();\n }\n}\n\nconst timeoutError = (id: string) => new Error(`Timed out waiting for ${id}`);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { type Operation } from '@dxos/compute';\n\nimport { Capabilities } from '../common';\nimport { Capability } from '../core';\n\nexport type CapturedCall<I = unknown> = {\n /** The DXN key string of the invoked operation. */\n operationKey: string;\n /** The input passed to the operation. */\n input: I;\n};\n\ntype CapabilityManagerLike = {\n get: (cap: Capability.InterfaceDef<Capabilities.OperationInvoker>) => Capabilities.OperationInvoker;\n getAll: (cap: Capability.InterfaceDef<Capabilities.OperationInvoker>) => Capabilities.OperationInvoker[];\n};\n\nexport type OperationCapture = {\n /**\n * Wraps the real OperationInvoker from the given manager. Pass to\n * `withPluginManager({ capabilities: (m) => capture.wrap(m) })`.\n */\n wrap(manager: CapabilityManagerLike): Capability.Any[];\n /** Returns all recorded calls (mocked or real) for the given operation. */\n getCalls<I, O>(op: Operation.Definition<I, O>): CapturedCall<I>[];\n /** Clears all recorded calls (useful between play function steps). */\n reset(): void;\n};\n\n/**\n * Creates a capture that wraps the real `Capabilities.OperationInvoker`:\n *\n * - **Mocked operations** (declared in `mockedOperations`) are intercepted: the call is recorded\n * and returns `{ data: undefined }` without executing. Use this for side-effecting operations\n * you don't want to run in tests, such as `LayoutOperation.Open` (navigation).\n *\n * - **All other operations** are forwarded to the real invoker and still execute normally. The\n * call is still recorded so you can assert it was triggered even though it ran for real.\n *\n * Pass a `spyFn` wrapper (e.g. `fn` from `storybook/test`) to get Storybook Actions panel\n * integration and vi-style matchers on the recording.\n *\n * @example\n * ```ts\n * import { fn } from 'storybook/test';\n *\n * const capture = makeOperationCapture(\n * // These ops are mocked: captured but not executed.\n * [AssistantOperation.RunPromptInNewChat, LayoutOperation.Open],\n * fn,\n * );\n *\n * // Wire into withPluginManager:\n * capabilities: (manager) => capture.wrap(manager)\n *\n * // Assert in a play function:\n * const calls = capture.getCalls(AssistantOperation.RunPromptInNewChat);\n * expect(calls).toHaveLength(1);\n * expect(calls[0].input.prompt).toBe('Draft a new document');\n * ```\n *\n * @idiom org.dxos.app-framework.testing.operationCapture\n * applies: Storybook play-function tests for components that call plugin operations\n * instead-of: Loading every plugin whose operations the component triggers\n * uses: {@link makeOperationCapture}, {@link withPluginManager}\n */\nexport const makeOperationCapture = (\n mockedOperations: readonly Operation.Definition.Any[],\n spyFn?: (impl: (...args: any[]) => any) => any,\n): OperationCapture => {\n const calls: CapturedCall[] = [];\n\n const mockedKeys = new Set(mockedOperations.map((op) => String(op.meta.key)));\n\n const record = (op: Operation.Definition<any, any>, input?: unknown) => {\n calls.push({ operationKey: String(op.meta.key), input: input ?? {} });\n };\n\n const recordFn = spyFn ? spyFn(record) : record;\n\n return {\n wrap(manager) {\n // Use getAll to find the real invoker that was registered before our wrapper. manager.get\n // returns the last contribution (ours, once added), but getAll returns them all in order.\n // On first invocation (when activation is complete) we find the non-wrapper contribution.\n let real: Capabilities.OperationInvoker | undefined;\n const delegate = () => {\n if (!real) {\n const all = manager.getAll(Capabilities.OperationInvoker);\n real = all.find((inv) => inv !== wrapped);\n }\n return real;\n };\n\n const wrapped: Capabilities.OperationInvoker = {\n get invocations() {\n return delegate()!.invocations;\n },\n get pendingFollowups() {\n return delegate()!.pendingFollowups;\n },\n get awaitFollowups() {\n return delegate()!.awaitFollowups;\n },\n invoke: (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return Effect.succeed(undefined as any);\n }\n return (delegate()!.invoke as any)(op, input, ...rest);\n },\n invokePromise: async (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return { data: undefined };\n }\n return (delegate()!.invokePromise as any)(op, input, ...rest);\n },\n schedule: (op: Operation.Definition<any, any>, input?: unknown, ...rest: any[]) => {\n recordFn(op, input);\n if (mockedKeys.has(String(op.meta.key))) {\n return Effect.succeed(undefined);\n }\n return (delegate()!.schedule as any)(op, input, ...rest);\n },\n };\n\n return [Capability.contributes(Capabilities.OperationInvoker, wrapped)];\n },\n getCalls<I, O>(op: Operation.Definition<I, O>): CapturedCall<I>[] {\n const key = String(op.meta.key);\n return calls.filter((c) => c.operationKey === key) as CapturedCall<I>[];\n },\n reset() {\n calls.length = 0;\n },\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Plugin, PluginManager } from '../core';\n\n/**\n * Creates a Plugin.Service layer from a list of plugins.\n * This is primarily used for testing.\n */\nexport const fromPlugins = (plugins: Plugin.Plugin[]) =>\n Layer.effect(\n Plugin.Service,\n Effect.gen(function* () {\n // TODO(wittjosiah): Try to dedupe logic between here, createCliApp and useApp.\n\n const pluginLoader = (id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.profile.key === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return { plugin };\n });\n\n const manager = PluginManager.make({\n pluginLoader,\n plugins,\n enabled: plugins.map((plugin) => plugin.meta.profile.key),\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'org.dxos.app-framework.plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'org.dxos.app-framework.atom-registry',\n });\n\n yield* manager.activate(ActivationEvents.Startup);\n\n return manager;\n }),\n );\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport * as Effect from 'effect/Effect';\nimport React, { useEffect, useState } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { EffectEx } from '@dxos/effect';\nimport { DXN } from '@dxos/keys';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { type MaybeProvider, getProviderValue } from '@dxos/util';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { type ActivationEvent, Capability, type CapabilityManager, Plugin, PluginManager } from '../core';\nimport { type UseAppOptions, useApp } from '../ui';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n ...options\n}: UseAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n // Auto-enable every non-system plugin so stories don't have to spell out\n // enablement. System-tagged plugins are force-enabled by the manager.\n const enabled = plugins\n .filter(({ meta }) => !meta.profile.tags?.includes('system'))\n .map(({ meta }) => meta.profile.key);\n const pluginManager = PluginManager.make({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin, ...plugins],\n enabled,\n ...options,\n });\n\n if (capabilities) {\n getProviderValue(capabilities, pluginManager.capabilities).forEach((capability) => {\n pluginManager.capabilities.contribute({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\ntype ManagedPluginManagerState = {\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n pluginManager: PluginManager.PluginManager;\n setupEvents?: ActivationEvent.ActivationEvent[];\n storyId: string;\n};\n\nexport type WithPluginManagerOptions = UseAppOptions & {\n /** @deprecated */\n capabilities?: MaybeProvider<Capability.Any[], CapabilityManager.CapabilityManager>;\n /** @deprecated */\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n};\n\nexport type WithPluginManagerInitializer<Args = void> =\n | WithPluginManagerOptions\n | ((context: StoryContext<Args>) => WithPluginManagerOptions);\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = <Args,>(init: WithPluginManagerInitializer<Args> = {}): Decorator => {\n return (Story, context) => {\n const storyId = context.id;\n const options = typeof init === 'function' ? init(context as any) : init;\n const [managerState, setManagerState] = useState<ManagedPluginManagerState>();\n\n // Storybook replaces the full context object often, so key manager ownership by story id.\n useEffect(() => {\n const pluginManager = setupPluginManager(options);\n const capability = Capability.contributes(Capabilities.ReactRoot, {\n id: storyId,\n root: () => <Story />,\n });\n\n pluginManager.capabilities.contribute({\n ...capability,\n module: 'org.dxos.app-framework.with-plugin-manager',\n });\n\n setManagerState({\n pluginManager,\n setupEvents: options.setupEvents,\n fireEvents: options.fireEvents,\n storyId,\n });\n\n return () => {\n pluginManager.capabilities.remove(capability.interface, capability.implementation);\n void EffectEx.runAndForwardErrors(pluginManager.shutdown());\n };\n }, [storyId, init]);\n\n // Avoid mounting useApp with a stale manager from the previous story.\n if (!managerState || managerState.storyId !== storyId) {\n return <></>;\n }\n\n return <WithPluginManagerApp {...managerState} />;\n };\n};\n\nconst WithPluginManagerApp = ({ fireEvents, pluginManager, setupEvents, storyId }: ManagedPluginManagerState) => {\n // Fire deprecated events only after the effect-owned manager for this story exists.\n useAsyncEffect(async () => {\n await Promise.all(fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n }, [fireEvents, pluginManager, storyId]);\n\n const App = useApp({ pluginManager, setupEvents });\n return <App />;\n};\n\nconst storyMeta = Plugin.makeMeta({\n key: DXN.make('org.dxos.appFramework.story'),\n name: 'Story',\n tags: ['system'],\n});\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst StoryPlugin = Plugin.define(storyMeta).pipe(\n Plugin.addModule({\n id: 'Story',\n activatesOn: ActivationEvents.Startup,\n activate: () => Effect.succeed([]),\n }),\n Plugin.make,\n)();\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,YAAYA,cAAc;AAC1B,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AAGvB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAwE1B,IAAA,eAAMC;;AAuBEC,IAAAA,gBACJC,OAAOC,SAAK;UACV,SAAMC,UAASC,QAAY,OAAED,CAAAA,EAAAA,KAAWA,MAAOE,CAAAA,KAAKC,QAAQC,MAAQC,SAAAA,QAAAA,CAAAA,EAAAA,IAAAA,CAAAA,WAAAA,OAAAA,KAAAA,QAAAA,GAAAA,GAAAA,cAAAA,CAAAA,GAAAA,YAAAA,MAAAA,gCAAAA,KAAAA,IAAAA;uBAC1DL,CAAAA,OAAS,YAAA,MAAA;AACnB,UAAA,SAAO,QAAA,KAAA,CAAAA,YAAAA,QAAA,KAAA,QAAA,QAAA,EAAA;cAAEA,QAAAA,qBAAAA,EAAAA,IAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,QAAAA,GAAAA,CAAAA,UAAAA,2BAA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IAAI,EAAA;",
6
+ "names": ["Duration", "Effect", "PubSub", "Queue", "EffectEx", "invariant", "DEFAULT_TIMEOUT_MS", "pluginLoader", "Effect", "sync", "plugin", "plugins", "meta", "profile", "key", "id", "manager", "enabled", "registerFrameworkCapabilities", "PluginManager", "implementation", "module", "capabilities", "registry", "autoStart", "EffectEx", "activate", "SetupReactSurface", "ActivationEvents", "Startup", "err", "TestHarnessImpl", "fire", "reset", "iface", "getAll", "waitForCapability", "runAndForwardErrors", "duration", "Duration", "timeout", "onTimeout", "identifier", "waitForEvent", "opts", "program", "queue", "subscribe", "message", "timeoutError", "invoke", "args", "result", "invoker", "error", "data", "runPromise", "effect", "options", "runtime", "undefined", "enable", "disable", "dispose", "Symbol", "asyncDispose", "Effect", "makeOperationCapture", "mockedOperations", "spyFn", "calls", "mockedKeys", "Set", "map", "op", "String", "meta", "key", "record", "input", "push", "operationKey", "recordFn", "wrap", "manager", "real", "delegate", "all", "getAll", "Capabilities", "OperationInvoker", "find", "inv", "wrapped", "invocations", "pendingFollowups", "awaitFollowups", "invoke", "rest", "has", "succeed", "undefined", "invokePromise", "data", "schedule", "Capability", "contributes", "getCalls", "filter", "c", "reset", "length", "Effect", "Layer", "invariant", "__dxlog_file", "pluginLoader", "id", "plugin", "manager", "plugins", "enabled", "capabilities", "contribute", "implementation", "module", "registry", "Effect", "React", "useEffect", "useState", "raise", "EffectEx", "DXN", "useAsyncEffect", "getProviderValue", "setupPluginManager", "capabilities", "plugins", "options", "enabled", "filter", "meta", "profile", "tags", "includes", "map", "key", "pluginManager", "PluginManager", "make", "pluginLoader", "raise", "Error", "StoryPlugin", "getProviderValue", "forEach", "capability", "contribute", "interface", "implementation", "module", "withPluginManager", "init", "Story", "context", "storyId", "id", "managerState", "setManagerState", "useState", "useEffect", "Capability", "contributes", "Capabilities", "ReactRoot", "root", "setupEvents", "fireEvents", "remove", "EffectEx", "runAndForwardErrors", "shutdown", "WithPluginManagerApp", "useAsyncEffect", "Promise", "all", "event", "activate", "App", "useApp", "storyMeta", "Plugin", "makeMeta", "DXN", "name", "define", "pipe", "addModule", "activatesOn", "ActivationEvents", "Startup", "succeed"]
7
7
  }
@@ -3,21 +3,21 @@ import {
3
3
  PluginManagerProvider,
4
4
  SurfaceComponent,
5
5
  topologicalSort
6
- } from "../chunk-A5CHGAZE.mjs";
6
+ } from "../chunk-DRT75WGD.mjs";
7
7
  import {
8
8
  PluginManagerContext
9
9
  } from "../chunk-37Z53PXZ.mjs";
10
10
  import "../chunk-FPW45EZH.mjs";
11
11
  import {
12
12
  capabilities_exports
13
- } from "../chunk-NULBHQYS.mjs";
14
- import "../chunk-KFZEB6BV.mjs";
15
- import "../chunk-WK7OIQKI.mjs";
16
- import "../chunk-XGBUKRCK.mjs";
17
- import "../chunk-SX5NVETP.mjs";
18
- import "../chunk-XOCUANHO.mjs";
19
- import "../chunk-XIGPWXCQ.mjs";
20
- import "../chunk-CTKEZHKF.mjs";
13
+ } from "../chunk-XSZMX53L.mjs";
14
+ import "../chunk-TLKYZKPW.mjs";
15
+ import "../chunk-VCPGX7WN.mjs";
16
+ import "../chunk-FKMVORZN.mjs";
17
+ import "../chunk-IL7O7IRX.mjs";
18
+ import "../chunk-BMW6P6QA.mjs";
19
+ import "../chunk-4SE7SX7N.mjs";
20
+ import "../chunk-GLH4LGHZ.mjs";
21
21
  import "../chunk-HSLMI22Q.mjs";
22
22
 
23
23
  // src/testing/react.tsx
@@ -37,9 +37,9 @@ var render = (harness, ui, options) => {
37
37
  });
38
38
  };
39
39
  var renderSurface = (harness, props, options) => {
40
- const { role, data, limit, fallback, placeholder } = props;
40
+ const { type, data, limit, fallback, placeholder } = props;
41
41
  return render(harness, /* @__PURE__ */ React.createElement(SurfaceComponent, {
42
- role,
42
+ type,
43
43
  data,
44
44
  limit,
45
45
  fallback,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/react.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport { render as rtlRender, type RenderOptions, type RenderResult } from '@testing-library/react';\nimport React, { type FC, Fragment, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport { Capabilities } from '../common';\nimport { PluginManagerContext } from '../context';\nimport { topologicalSort } from '../helpers';\nimport { PluginManagerProvider } from '../ui/components/PluginManager/PluginManagerProvider';\nimport { SurfaceComponent } from '../ui/components/Surface/SurfaceComponent';\nimport { type TestHarness } from './harness';\n\nexport type HarnessRenderOptions = Omit<RenderOptions, 'wrapper'> & {\n /** Additional providers to wrap around the harness tree (applied innermost first). */\n reactContexts?: FC<PropsWithChildren>[];\n};\n\n/**\n * Renders `ui` wrapped in the same provider tree as `useApp` plus every contributed\n * `Capabilities.ReactContext`.\n */\nexport const render = (harness: TestHarness, ui: ReactNode, options?: HarnessRenderOptions): RenderResult => {\n const { reactContexts = [], ...rest } = options ?? {};\n const Wrapper = ({ children }: PropsWithChildren) => (\n <HarnessProviders harness={harness} extra={reactContexts}>\n {children}\n </HarnessProviders>\n );\n return rtlRender(<>{ui}</>, { ...rest, wrapper: Wrapper });\n};\n\nexport type RenderSurfaceProps = {\n role: string;\n data?: unknown;\n limit?: number;\n fallback?: FC<{ error: Error; data?: any }>;\n placeholder?: ReactNode;\n};\n\n/**\n * Renders a `Surface` with the given role/data inside the harness provider tree.\n */\nexport const renderSurface = (\n harness: TestHarness,\n props: RenderSurfaceProps,\n options?: HarnessRenderOptions,\n): RenderResult => {\n const { role, data, limit, fallback, placeholder } = props;\n return render(\n harness,\n <SurfaceComponent role={role} data={data as any} limit={limit} fallback={fallback} placeholder={placeholder} />,\n options,\n );\n};\n\ntype HarnessProvidersProps = PropsWithChildren<{\n harness: TestHarness;\n extra: FC<PropsWithChildren>[];\n}>;\n\nconst HarnessProviders = ({ harness, extra, children }: HarnessProvidersProps) => {\n const contributed = harness.getAll(Capabilities.ReactContext);\n const ContributedContext = composeContexts(contributed);\n const ExtraContext = composeExtra(extra);\n return (\n <PluginManagerProvider value={harness.manager}>\n <ContextProtocolProvider value={harness.manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={harness.registry}>\n <ContributedContext>\n <ExtraContext>{children}</ExtraContext>\n </ContributedContext>\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }: PropsWithChildren) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\n// Composes in innermost-first order: the first context in the array wraps\n// `children` directly; subsequent contexts wrap the accumulator.\nconst composeExtra = (contexts: FC<PropsWithChildren>[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return contexts.reduce<FC<PropsWithChildren>>(\n (Acc, Next) =>\n ({ children }: PropsWithChildren) => (\n <Next>\n <Acc>{children}</Acc>\n </Next>\n ),\n Passthrough,\n );\n};\n\nconst Passthrough: FC<PropsWithChildren> = ({ children }) => <Fragment>{children}</Fragment>;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,uBAAuB;AAChC,SAASC,UAAUC,iBAAwD;AAC3E,OAAOC,SAAkBC,gBAAwD;AAEjF,SAASC,+BAA+B;AAkBjC,IAAMC,SAAS,CAACC,SAAsBC,IAAeC,YAAAA;AAC1D,QAAM,EAAEC,gBAAgB,CAAA,GAAI,GAAGC,KAAAA,IAASF,WAAW,CAAC;AACpD,QAAMG,UAAU,CAAC,EAAEC,SAAQ,MACzB,sBAAA,cAACC,kBAAAA;IAAiBP;IAAkBQ,OAAOL;KACxCG,QAAAA;AAGL,SAAOG,UAAU,sBAAA,cAAA,MAAA,UAAA,MAAGR,EAAAA,GAAQ;IAAE,GAAGG;IAAMM,SAASL;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QAAAA,CAAAA,GAGZgC,WAAAA;AAEJ;AAEA,IAAMA,cAAqC,CAAC,EAAEhC,SAAQ,MAAO,sBAAA,cAACsC,UAAAA,MAAUtC,QAAAA;",
6
- "names": ["RegistryContext", "render", "rtlRender", "React", "Fragment", "ContextProtocolProvider", "render", "harness", "ui", "options", "reactContexts", "rest", "Wrapper", "children", "HarnessProviders", "extra", "rtlRender", "wrapper", "renderSurface", "props", "role", "data", "limit", "fallback", "placeholder", "SurfaceComponent", "contributed", "getAll", "Capabilities", "ReactContext", "ContributedContext", "composeContexts", "ExtraContext", "composeExtra", "PluginManagerProvider", "value", "manager", "ContextProtocolProvider", "context", "PluginManagerContext", "RegistryContext", "Provider", "registry", "contexts", "length", "Passthrough", "topologicalSort", "map", "reduce", "Acc", "Next", "Fragment"]
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport { type RenderOptions, type RenderResult, render as rtlRender } from '@testing-library/react';\nimport React, { type FC, Fragment, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport { Capabilities } from '../common';\nimport { PluginManagerContext } from '../context';\nimport { topologicalSort } from '../helpers';\nimport { PluginManagerProvider } from '../ui/components/PluginManager/PluginManagerProvider';\nimport { SurfaceComponent } from '../ui/components/Surface/SurfaceComponent';\nimport { type RoleToken } from '../ui/components/Surface/types';\nimport { type TestHarness } from './harness';\n\nexport type HarnessRenderOptions = Omit<RenderOptions, 'wrapper'> & {\n /** Additional providers to wrap around the harness tree (applied innermost first). */\n reactContexts?: FC<PropsWithChildren>[];\n};\n\n/**\n * Renders `ui` wrapped in the same provider tree as `useApp` plus every contributed\n * `Capabilities.ReactContext`.\n */\nexport const render = (harness: TestHarness, ui: ReactNode, options?: HarnessRenderOptions): RenderResult => {\n const { reactContexts = [], ...rest } = options ?? {};\n const Wrapper = ({ children }: PropsWithChildren) => (\n <HarnessProviders harness={harness} extra={reactContexts}>\n {children}\n </HarnessProviders>\n );\n return rtlRender(<>{ui}</>, { ...rest, wrapper: Wrapper });\n};\n\nexport type RenderSurfaceProps<TToken extends RoleToken<any>> = {\n type: TToken;\n data?: TToken extends RoleToken<infer D> ? D : never;\n limit?: number;\n fallback?: FC<{ error: Error; data?: any }>;\n placeholder?: ReactNode;\n};\n\n/**\n * Renders a `Surface` with the given role token/data inside the harness provider tree.\n */\nexport const renderSurface = <TToken extends RoleToken<any>>(\n harness: TestHarness,\n props: RenderSurfaceProps<TToken>,\n options?: HarnessRenderOptions,\n): RenderResult => {\n const { type, data, limit, fallback, placeholder } = props;\n return render(\n harness,\n <SurfaceComponent type={type} data={data as any} limit={limit} fallback={fallback} placeholder={placeholder} />,\n options,\n );\n};\n\ntype HarnessProvidersProps = PropsWithChildren<{\n harness: TestHarness;\n extra: FC<PropsWithChildren>[];\n}>;\n\nconst HarnessProviders = ({ harness, extra, children }: HarnessProvidersProps) => {\n const contributed = harness.getAll(Capabilities.ReactContext);\n const ContributedContext = composeContexts(contributed);\n const ExtraContext = composeExtra(extra);\n return (\n <PluginManagerProvider value={harness.manager}>\n <ContextProtocolProvider value={harness.manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={harness.registry}>\n <ContributedContext>\n <ExtraContext>{children}</ExtraContext>\n </ContributedContext>\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }: PropsWithChildren) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\n// Composes in innermost-first order: the first context in the array wraps\n// `children` directly; subsequent contexts wrap the accumulator.\nconst composeExtra = (contexts: FC<PropsWithChildren>[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return contexts.reduce<FC<PropsWithChildren>>(\n (Acc, Next) =>\n ({ children }: PropsWithChildren) => (\n <Next>\n <Acc>{children}</Acc>\n </Next>\n ),\n Passthrough,\n );\n};\n\nconst Passthrough: FC<PropsWithChildren> = ({ children }) => <Fragment>{children}</Fragment>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,uBAAuB;AAChC,SAAgDC,UAAUC,iBAAiB;AAC3E,OAAOC,SAAkBC,gBAAwD;AAEjF,SAASC,+BAA+B;AAmBjC,IAAMC,SAAS,CAACC,SAAsBC,IAAeC,YAAAA;AAC1D,QAAM,EAAEC,gBAAgB,CAAA,GAAI,GAAGC,KAAAA,IAASF,WAAW,CAAC;AACpD,QAAMG,UAAU,CAAC,EAAEC,SAAQ,MACzB,sBAAA,cAACC,kBAAAA;IAAiBP;IAAkBQ,OAAOL;KACxCG,QAAAA;AAGL,SAAOG,UAAU,sBAAA,cAAA,MAAA,UAAA,MAAGR,EAAAA,GAAQ;IAAE,GAAGG;IAAMM,SAASL;EAAQ,CAAA;AAC1D;AAaO,IAAMM,gBAAgB,CAC3BX,SACAY,OACAV,YAAAA;AAEA,QAAM,EAAEW,MAAMC,MAAMC,OAAOC,UAAUC,YAAW,IAAKL;AACrD,SAAOb,OACLC,SACA,sBAAA,cAACkB,kBAAAA;IAAiBL;IAAYC;IAAmBC;IAAcC;IAAoBC;MACnFf,OAAAA;AAEJ;AAOA,IAAMK,mBAAmB,CAAC,EAAEP,SAASQ,OAAOF,SAAQ,MAAyB;AAC3E,QAAMa,cAAcnB,QAAQoB,OAAOC,qBAAaC,YAAY;AAC5D,QAAMC,qBAAqBC,gBAAgBL,WAAAA;AAC3C,QAAMM,eAAeC,aAAalB,KAAAA;AAClC,SACE,sBAAA,cAACmB,uBAAAA;IAAsBC,OAAO5B,QAAQ6B;KACpC,sBAAA,cAACC,yBAAAA;IAAwBF,OAAO5B,QAAQ6B;IAASE,SAASC;KACxD,sBAAA,cAACC,gBAAgBC,UAAQ;IAACN,OAAO5B,QAAQmC;KACvC,sBAAA,cAACZ,oBAAAA,MACC,sBAAA,cAACE,cAAAA,MAAcnB,QAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAM3B;AAEA,IAAMkB,kBAAkB,CAACY,aAAAA;AACvB,MAAIA,SAASC,WAAW,GAAG;AACzB,WAAOC;EACT;AACA,SAAOC,gBAAgBH,QAAAA,EACpBI,IAAI,CAAC,EAAET,QAAO,MAAOA,OAAAA,EACrBU,OAAO,CAACC,KAAKC,SAAS,CAAC,EAAErC,SAAQ,MAChC,sBAAA,cAACoC,KAAAA,MACC,sBAAA,cAACC,MAAAA,MAAMrC,QAAAA,CAAAA,CAAAA;AAGf;AAIA,IAAMoB,eAAe,CAACU,aAAAA;AACpB,MAAIA,SAASC,WAAW,GAAG;AACzB,WAAOC;EACT;AACA,SAAOF,SAASK,OACd,CAACC,KAAKC,SACJ,CAAC,EAAErC,SAAQ,MACT,sBAAA,cAACqC,MAAAA,MACC,sBAAA,cAACD,KAAAA,MAAKpC,QAAAA,CAAAA,GAGZgC,WAAAA;AAEJ;AAEA,IAAMA,cAAqC,CAAC,EAAEhC,SAAQ,MAAO,sBAAA,cAACsC,UAAAA,MAAUtC,QAAAA;",
6
+ "names": ["RegistryContext", "render", "rtlRender", "React", "Fragment", "ContextProtocolProvider", "render", "harness", "ui", "options", "reactContexts", "rest", "Wrapper", "children", "HarnessProviders", "extra", "rtlRender", "wrapper", "renderSurface", "props", "type", "data", "limit", "fallback", "placeholder", "SurfaceComponent", "contributed", "getAll", "Capabilities", "ReactContext", "ContributedContext", "composeContexts", "ExtraContext", "composeExtra", "PluginManagerProvider", "value", "manager", "ContextProtocolProvider", "context", "PluginManagerContext", "RegistryContext", "Provider", "registry", "contexts", "length", "Passthrough", "topologicalSort", "map", "reduce", "Acc", "Next", "Fragment"]
7
7
  }
@@ -9,27 +9,31 @@ import {
9
9
  useCapability,
10
10
  useLoading,
11
11
  useOperationInvoker,
12
+ useOptionalAtomCapabilityState,
13
+ useOptionalCapabilities,
14
+ useOptionalCapability,
12
15
  useProcessManagerRuntime,
13
16
  useSettingsState,
14
17
  useSpaceCallback,
15
18
  useSpaceService
16
- } from "../chunk-FSVGKTF6.mjs";
19
+ } from "../chunk-ND2HETHD.mjs";
17
20
  import {
18
21
  PluginManagerProvider,
19
22
  Surface,
23
+ useOptionalPluginManager,
20
24
  usePluginManager,
21
25
  useSurface
22
- } from "../chunk-A5CHGAZE.mjs";
26
+ } from "../chunk-DRT75WGD.mjs";
23
27
  import "../chunk-37Z53PXZ.mjs";
24
28
  import "../chunk-FPW45EZH.mjs";
25
- import "../chunk-NULBHQYS.mjs";
26
- import "../chunk-KFZEB6BV.mjs";
27
- import "../chunk-WK7OIQKI.mjs";
28
- import "../chunk-XGBUKRCK.mjs";
29
- import "../chunk-SX5NVETP.mjs";
30
- import "../chunk-XOCUANHO.mjs";
31
- import "../chunk-XIGPWXCQ.mjs";
32
- import "../chunk-CTKEZHKF.mjs";
29
+ import "../chunk-XSZMX53L.mjs";
30
+ import "../chunk-TLKYZKPW.mjs";
31
+ import "../chunk-VCPGX7WN.mjs";
32
+ import "../chunk-FKMVORZN.mjs";
33
+ import "../chunk-IL7O7IRX.mjs";
34
+ import "../chunk-BMW6P6QA.mjs";
35
+ import "../chunk-4SE7SX7N.mjs";
36
+ import "../chunk-GLH4LGHZ.mjs";
33
37
  import "../chunk-HSLMI22Q.mjs";
34
38
  export {
35
39
  App,
@@ -43,6 +47,10 @@ export {
43
47
  useCapability,
44
48
  useLoading,
45
49
  useOperationInvoker,
50
+ useOptionalAtomCapabilityState,
51
+ useOptionalCapabilities,
52
+ useOptionalCapability,
53
+ useOptionalPluginManager,
46
54
  usePluginManager,
47
55
  useProcessManagerRuntime,
48
56
  useSettingsState,