@dxos/app-framework 0.8.4-main.cb12b3f963 → 0.8.4-main.d05539e30a

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 (249) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/browser/{capability-5RRH3WIB.mjs → capability-K5XIVCQU.mjs} +10 -10
  4. package/dist/lib/browser/{capability-5RRH3WIB.mjs.map → capability-K5XIVCQU.mjs.map} +1 -1
  5. package/dist/lib/browser/{chunk-WBHCSOBW.mjs → chunk-5AHASNDW.mjs} +17 -2
  6. package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
  8. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-ZGJAZSNE.mjs → chunk-BRK6GYNB.mjs} +7 -7
  10. package/dist/lib/browser/{chunk-ZGJAZSNE.mjs.map → chunk-BRK6GYNB.mjs.map} +1 -1
  11. package/dist/lib/browser/{chunk-3JWJXGLK.mjs → chunk-IW44C7UL.mjs} +5 -1
  12. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-23D4SJUE.mjs → chunk-KFDF7KR3.mjs} +2 -2
  14. package/dist/lib/browser/{chunk-CZ4BIAHH.mjs → chunk-KLHQNYJ2.mjs} +2 -2
  15. package/dist/lib/browser/{chunk-MX5DKEJH.mjs → chunk-QLML5QFJ.mjs} +4 -7
  16. package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-Z55LVAGN.mjs → chunk-SLX73WRZ.mjs} +7 -2
  18. package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-PC4NOADA.mjs → chunk-UVTGHZQF.mjs} +60 -18
  20. package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
  21. package/dist/lib/browser/{chunk-NBXPP7JR.mjs → chunk-VJ5PFAWC.mjs} +312 -40
  22. package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
  23. package/dist/lib/browser/cli/index.mjs +9 -11
  24. package/dist/lib/browser/cli/index.mjs.map +3 -3
  25. package/dist/lib/browser/common/activation-events.mjs +9 -13
  26. package/dist/lib/browser/common/capabilities.mjs +15 -5
  27. package/dist/lib/browser/core/capability.mjs +3 -1
  28. package/dist/lib/browser/core/plugin-manager.mjs +3 -3
  29. package/dist/lib/browser/core/plugin.mjs +4 -2
  30. package/dist/lib/browser/core/url-loader.mjs +3 -3
  31. package/dist/lib/browser/index.mjs +26 -43
  32. package/dist/lib/browser/index.mjs.map +4 -4
  33. package/dist/lib/browser/meta.json +1 -1
  34. package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs +89 -0
  35. package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
  36. package/dist/lib/browser/testing/index.mjs +26 -18
  37. package/dist/lib/browser/testing/index.mjs.map +3 -3
  38. package/dist/lib/browser/testing/react.mjs +8 -8
  39. package/dist/lib/browser/ui/index.mjs +16 -10
  40. package/dist/lib/node-esm/{capability-JOIQ2MQE.mjs → capability-RLKFFLTB.mjs} +10 -10
  41. package/dist/lib/node-esm/{capability-JOIQ2MQE.mjs.map → capability-RLKFFLTB.mjs.map} +1 -1
  42. package/dist/lib/node-esm/{chunk-M3HKPRPO.mjs → chunk-42UNAKYO.mjs} +2 -2
  43. package/dist/lib/node-esm/{chunk-HTBJU5FX.mjs → chunk-6S45OMUP.mjs} +7 -2
  44. package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
  45. package/dist/lib/node-esm/{chunk-D347W3KO.mjs → chunk-BYHYYJZH.mjs} +7 -7
  46. package/dist/lib/node-esm/{chunk-D347W3KO.mjs.map → chunk-BYHYYJZH.mjs.map} +1 -1
  47. package/dist/lib/node-esm/{chunk-SDJ4B2LU.mjs → chunk-CTKEZHKF.mjs} +5 -1
  48. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-42J2ZUQQ.mjs → chunk-JNT72ZCN.mjs} +60 -18
  50. package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  52. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  53. package/dist/lib/node-esm/{chunk-WKTLE7MG.mjs → chunk-LJNUFNDO.mjs} +4 -7
  54. package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-SBS2YMPT.mjs → chunk-OUEMWPIW.mjs} +2 -2
  56. package/dist/lib/node-esm/{chunk-WFSRZKBP.mjs → chunk-PW2VYGOS.mjs} +17 -2
  57. package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
  58. package/dist/lib/node-esm/{chunk-MUVUQC3G.mjs → chunk-SFYCO3PT.mjs} +312 -40
  59. package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
  60. package/dist/lib/node-esm/cli/index.mjs +9 -11
  61. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  62. package/dist/lib/node-esm/common/activation-events.mjs +9 -13
  63. package/dist/lib/node-esm/common/capabilities.mjs +15 -5
  64. package/dist/lib/node-esm/core/capability.mjs +3 -1
  65. package/dist/lib/node-esm/core/plugin-manager.mjs +3 -3
  66. package/dist/lib/node-esm/core/plugin.mjs +4 -2
  67. package/dist/lib/node-esm/core/url-loader.mjs +3 -3
  68. package/dist/lib/node-esm/index.mjs +26 -43
  69. package/dist/lib/node-esm/index.mjs.map +4 -4
  70. package/dist/lib/node-esm/meta.json +1 -1
  71. package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs +90 -0
  72. package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
  73. package/dist/lib/node-esm/testing/index.mjs +26 -18
  74. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  75. package/dist/lib/node-esm/testing/react.mjs +8 -8
  76. package/dist/lib/node-esm/ui/index.mjs +16 -10
  77. package/dist/plugin/node-esm/index.mjs +26 -8
  78. package/dist/plugin/node-esm/index.mjs.map +4 -4
  79. package/dist/plugin/node-esm/meta.json +1 -1
  80. package/dist/types/src/cli/cli.d.ts +1 -3
  81. package/dist/types/src/cli/cli.d.ts.map +1 -1
  82. package/dist/types/src/common/activation-events.d.ts +10 -13
  83. package/dist/types/src/common/activation-events.d.ts.map +1 -1
  84. package/dist/types/src/common/capabilities.d.ts +111 -6
  85. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  86. package/dist/types/src/core/capability.d.ts +5 -0
  87. package/dist/types/src/core/capability.d.ts.map +1 -1
  88. package/dist/types/src/core/plugin-manager.d.ts +62 -4
  89. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  90. package/dist/types/src/core/plugin.d.ts +69 -0
  91. package/dist/types/src/core/plugin.d.ts.map +1 -1
  92. package/dist/types/src/core/registry.d.ts +6 -0
  93. package/dist/types/src/core/registry.d.ts.map +1 -1
  94. package/dist/types/src/index.d.ts +1 -2
  95. package/dist/types/src/index.d.ts.map +1 -1
  96. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  97. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  98. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  99. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  100. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  101. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  102. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  103. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  104. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  105. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  106. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  107. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  108. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  109. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  110. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  111. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  112. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  113. package/dist/types/src/testing/harness.d.ts +16 -4
  114. package/dist/types/src/testing/harness.d.ts.map +1 -1
  115. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  116. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
  117. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
  118. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
  119. package/dist/types/src/ui/hooks/index.d.ts +1 -0
  120. package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
  121. package/dist/types/src/ui/hooks/useApp.d.ts +5 -8
  122. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
  123. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +24 -0
  124. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  125. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -1
  126. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +1 -51
  127. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -1
  128. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  129. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  130. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
  131. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
  132. package/dist/types/tsconfig.tsbuildinfo +1 -1
  133. package/package.json +31 -27
  134. package/src/cli/cli.ts +1 -6
  135. package/src/common/activation-events.ts +10 -15
  136. package/src/common/capabilities.ts +142 -6
  137. package/src/core/capability.ts +7 -0
  138. package/src/core/plugin-manager.test.ts +237 -9
  139. package/src/core/plugin-manager.ts +365 -13
  140. package/src/core/plugin.ts +50 -0
  141. package/src/core/registry.ts +6 -0
  142. package/src/index.ts +1 -2
  143. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  144. package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
  145. package/src/plugin-process-manager/meta.ts +14 -0
  146. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  147. package/src/testing/harness.ts +25 -7
  148. package/src/testing/service.ts +1 -1
  149. package/src/testing/withPluginManager.tsx +5 -2
  150. package/src/ui/components/App/App.stories.tsx +2 -8
  151. package/src/ui/components/Placeholder/Placeholder.tsx +2 -2
  152. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +1 -2
  153. package/src/ui/components/Surface/SurfaceComponent.tsx +2 -2
  154. package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
  155. package/src/ui/components/Surface/types.test.ts +2 -2
  156. package/src/ui/hooks/index.ts +1 -0
  157. package/src/ui/hooks/useApp.test.tsx +1 -1
  158. package/src/ui/hooks/useApp.tsx +5 -11
  159. package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
  160. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +8 -1
  161. package/src/vite-plugin/boot-loader/boot-loader.css +48 -22
  162. package/src/vite-plugin/boot-loader/boot-loader.js +67 -16
  163. package/src/vite-plugin/boot-loader/index.ts +1 -108
  164. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  165. package/src/vite-plugin/import-map/index.ts +3 -0
  166. package/src/vite-plugin/index.ts +2 -2
  167. package/src/vite-plugin/packages.ts +0 -1
  168. package/tsconfig.json +6 -0
  169. package/dist/lib/browser/capability-LUKGKUQH.mjs +0 -38
  170. package/dist/lib/browser/capability-LUKGKUQH.mjs.map +0 -7
  171. package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +0 -7
  172. package/dist/lib/browser/chunk-45CHLTBV.mjs +0 -34
  173. package/dist/lib/browser/chunk-45CHLTBV.mjs.map +0 -7
  174. package/dist/lib/browser/chunk-MX5DKEJH.mjs.map +0 -7
  175. package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +0 -7
  176. package/dist/lib/browser/chunk-PC4NOADA.mjs.map +0 -7
  177. package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +0 -7
  178. package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +0 -7
  179. package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs +0 -44
  180. package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +0 -7
  181. package/dist/lib/node-esm/capability-FCGZVIEG.mjs +0 -39
  182. package/dist/lib/node-esm/capability-FCGZVIEG.mjs.map +0 -7
  183. package/dist/lib/node-esm/chunk-42J2ZUQQ.mjs.map +0 -7
  184. package/dist/lib/node-esm/chunk-6XW6LET6.mjs +0 -35
  185. package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +0 -7
  186. package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +0 -7
  187. package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +0 -7
  188. package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +0 -7
  189. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +0 -7
  190. package/dist/lib/node-esm/chunk-WKTLE7MG.mjs.map +0 -7
  191. package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs +0 -45
  192. package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +0 -7
  193. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
  194. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
  195. package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
  196. package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
  197. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
  198. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
  199. package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
  200. package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
  201. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
  202. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
  203. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
  204. package/dist/types/src/plugin-operation/index.d.ts +0 -3
  205. package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
  206. package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
  207. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
  208. package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
  209. package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
  210. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
  211. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
  212. package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
  213. package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
  214. package/dist/types/src/plugin-runtime/index.d.ts +0 -2
  215. package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
  216. package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
  217. package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
  218. package/src/plugin-operation/OperationPlugin.ts +0 -24
  219. package/src/plugin-operation/invoker-capability.ts +0 -55
  220. package/src/plugin-operation/meta.ts +0 -11
  221. package/src/plugin-runtime/RuntimePlugin.ts +0 -19
  222. package/src/plugin-runtime/capability.ts +0 -53
  223. package/src/plugin-runtime/index.ts +0 -5
  224. package/src/plugin-runtime/meta.ts +0 -11
  225. /package/dist/lib/browser/{chunk-23D4SJUE.mjs.map → chunk-KFDF7KR3.mjs.map} +0 -0
  226. /package/dist/lib/browser/{chunk-CZ4BIAHH.mjs.map → chunk-KLHQNYJ2.mjs.map} +0 -0
  227. /package/dist/lib/node-esm/{chunk-M3HKPRPO.mjs.map → chunk-42UNAKYO.mjs.map} +0 -0
  228. /package/dist/lib/node-esm/{chunk-SBS2YMPT.mjs.map → chunk-OUEMWPIW.mjs.map} +0 -0
  229. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/capability.d.ts +0 -0
  230. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/errors.d.ts +0 -0
  231. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.d.ts +0 -0
  232. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
  233. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
  234. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +0 -0
  235. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +0 -0
  236. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +0 -0
  237. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
  238. /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
  239. /package/dist/types/src/{plugin-operation → plugin-process-manager}/testing.d.ts +0 -0
  240. /package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +0 -0
  241. /package/src/{plugin-operation → plugin-process-manager}/history/errors.ts +0 -0
  242. /package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +0 -0
  243. /package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +0 -0
  244. /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
  245. /package/src/{plugin-operation → plugin-process-manager}/history/types.ts +0 -0
  246. /package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +0 -0
  247. /package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +0 -0
  248. /package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +0 -0
  249. /package/src/{plugin-operation → plugin-process-manager}/testing.ts +0 -0
@@ -1,17 +1,17 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  UndoOperation
4
- } from "./chunk-SBS2YMPT.mjs";
4
+ } from "./chunk-OUEMWPIW.mjs";
5
5
  import {
6
6
  __export
7
7
  } from "./chunk-HSLMI22Q.mjs";
8
8
 
9
- // src/plugin-operation/history/errors.ts
9
+ // src/plugin-process-manager/history/errors.ts
10
10
  import { BaseError } from "@dxos/errors";
11
11
  var EmptyHistoryError = class extends BaseError.extend("EmptyHistoryError", "Cannot undo: history is empty.") {
12
12
  };
13
13
 
14
- // src/plugin-operation/history/undo-mapping.ts
14
+ // src/plugin-process-manager/history/undo-mapping.ts
15
15
  var undo_mapping_exports = {};
16
16
  __export(undo_mapping_exports, {
17
17
  make: () => make,
@@ -28,7 +28,7 @@ var resolveMessage = (message, input, output) => {
28
28
  return message;
29
29
  };
30
30
 
31
- // src/plugin-operation/history/undo-registry.ts
31
+ // src/plugin-process-manager/history/undo-registry.ts
32
32
  var undo_registry_exports = {};
33
33
  __export(undo_registry_exports, {
34
34
  make: () => make2
@@ -51,7 +51,7 @@ var make2 = (getMappings) => {
51
51
  };
52
52
  };
53
53
 
54
- // src/plugin-operation/history/history-tracker.ts
54
+ // src/plugin-process-manager/history/history-tracker.ts
55
55
  var history_tracker_exports = {};
56
56
  __export(history_tracker_exports, {
57
57
  make: () => make3
@@ -60,7 +60,7 @@ import * as Effect from "effect/Effect";
60
60
  import * as Stream from "effect/Stream";
61
61
  import { runAndForwardErrors } from "@dxos/effect";
62
62
  import { log } from "@dxos/log";
63
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/plugin-operation/history/history-tracker.ts";
63
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/plugin-process-manager/history/history-tracker.ts";
64
64
  var HISTORY_LIMIT = 100;
65
65
  var make3 = (invoker, undoRegistry) => {
66
66
  const history = [];
@@ -140,4 +140,4 @@ export {
140
140
  make3 as make2,
141
141
  history_tracker_exports
142
142
  };
143
- //# sourceMappingURL=chunk-D347W3KO.mjs.map
143
+ //# sourceMappingURL=chunk-BYHYYJZH.mjs.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/plugin-operation/history/errors.ts", "../../../src/plugin-operation/history/undo-mapping.ts", "../../../src/plugin-operation/history/undo-registry.ts", "../../../src/plugin-operation/history/history-tracker.ts"],
3
+ "sources": ["../../../src/plugin-process-manager/history/errors.ts", "../../../src/plugin-process-manager/history/undo-mapping.ts", "../../../src/plugin-process-manager/history/undo-registry.ts", "../../../src/plugin-process-manager/history/history-tracker.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { BaseError } from '@dxos/errors';\n\nexport class EmptyHistoryError extends BaseError.extend('EmptyHistoryError', 'Cannot undo: history is empty.') {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Operation } from '@dxos/compute';\n\n/**\n * Label type for translatable text (canonical definition in @dxos/app-toolkit).\n */\ntype Label = string | [string, { ns: string; count?: number; defaultValue?: string }];\n\n/**\n * Extract the input type from an OperationDefinition.\n */\nexport type InputOf<T> = T extends Operation.Definition<infer I, any> ? I : never;\n\n/**\n * Extract the output type from an OperationDefinition.\n */\nexport type OutputOf<T> = T extends Operation.Definition<any, infer O> ? O : never;\n\n/**\n * Message provider for undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\nexport type MessageProvider<Op extends Operation.Definition<any, any>> =\n | Label\n | ((input: InputOf<Op>, output: OutputOf<Op>) => Label);\n\n/**\n * Undo mapping that links a forward operation to its inverse.\n * Type parameters ensure deriveContext has correctly typed arguments.\n *\n * @template Op - The forward operation definition type.\n * @template Inv - The inverse operation definition type.\n */\nexport interface UndoMapping<\n Op extends Operation.Definition<any, any> = Operation.Definition<any, any>,\n Inv extends Operation.Definition<any, any> = Operation.Definition<any, any>,\n> {\n /** The forward operation. */\n readonly operation: Op;\n\n /** The inverse operation to invoke for undo. */\n readonly inverse: Inv;\n\n /**\n * Derives the input for the inverse operation from the forward operation's input and output.\n * @param input - The input that was passed to the forward operation.\n * @param output - The output that was returned by the forward operation.\n * @returns The input to pass to the inverse operation, or undefined to indicate the operation is not undoable.\n */\n readonly deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;\n\n /**\n * Optional message to show in the undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\n readonly message?: MessageProvider<Op>;\n}\n\n/**\n * Props for creating an UndoMapping.\n */\nexport interface UndoMappingProps<\n Op extends Operation.Definition<any, any>,\n Inv extends Operation.Definition<any, any>,\n> {\n /** The forward operation. */\n operation: Op;\n\n /** The inverse operation to invoke for undo. */\n inverse: Inv;\n\n /**\n * Derives the input for the inverse operation from the forward operation's input and output.\n * Return undefined to indicate the operation is not undoable.\n */\n deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;\n\n /**\n * Optional message to show in the undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\n message?: MessageProvider<Op>;\n}\n\n/**\n * Creates a type-safe undo mapping.\n *\n * @example\n * ```ts\n * // Static message\n * const mapping = UndoMapping.make({\n * operation: DeleteThread,\n * inverse: RestoreThread,\n * deriveContext: (input, output) => ({\n * thread: output.thread,\n * anchor: output.anchor,\n * }),\n * message: ['thread deleted label', { ns: '@dxos/plugin-thread' }],\n * });\n *\n * // Dynamic message based on input/output\n * const mapping = UndoMapping.make({\n * operation: RemoveObjects,\n * inverse: RestoreObjects,\n * deriveContext: (_input, output) => output,\n * message: (input, _output) =>\n * input.objects.length === 1\n * ? ['object deleted label', { ns: getTypename(input.objects[0]) }]\n * : ['objects deleted label', { ns: '@dxos/plugin-space' }],\n * });\n * ```\n */\nexport const make = <Op extends Operation.Definition<any, any>, Inv extends Operation.Definition<any, any>>(\n props: UndoMappingProps<Op, Inv>,\n): UndoMapping<Op, Inv> => props;\n\n/**\n * Resolves a message provider to a Label.\n */\nexport const resolveMessage = <Op extends Operation.Definition<any, any>>(\n message: MessageProvider<Op> | undefined,\n input: InputOf<Op>,\n output: OutputOf<Op>,\n): Label | undefined => {\n if (message === undefined) {\n return undefined;\n }\n if (typeof message === 'function') {\n return message(input, output);\n }\n return message;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Operation } from '@dxos/compute';\n\nimport type * as UndoMapping from './undo-mapping';\n\n//\n// Public Interface\n//\n\n/**\n * Lookup result from UndoRegistry.\n */\nexport type UndoMappingResult = {\n inverse: Operation.Definition<any, any>;\n /** Returns undefined to indicate the operation is not undoable. */\n deriveContext: (input: any, output: any) => any | undefined;\n /** Message provider - may be a static Label or a function. */\n message?: UndoMapping.MessageProvider<Operation.Definition<any, any>>;\n};\n\n/**\n * UndoRegistry interface - looks up inverse operations.\n */\nexport interface UndoRegistry {\n lookup: (operation: Operation.Definition<any, any>) => UndoMappingResult | undefined;\n}\n\n//\n// Factory\n//\n\n/**\n * Creates an UndoRegistry that looks up inverse operations.\n */\nexport const make = (getMappings: () => UndoMapping.UndoMapping[]): UndoRegistry => {\n const lookup = (operation: Operation.Definition<any, any>): UndoMappingResult | undefined => {\n const mappings = getMappings();\n const mapping = mappings.find((m) => m.operation.meta.key === operation.meta.key);\n if (!mapping) {\n return undefined;\n }\n\n return {\n inverse: mapping.inverse,\n deriveContext: mapping.deriveContext,\n message: mapping.message,\n };\n };\n\n return { lookup };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Stream from 'effect/Stream';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { log } from '@dxos/log';\nimport { OperationInvoker } from '@dxos/operation';\n\nimport { UndoOperation } from '../../common';\nimport { EmptyHistoryError } from './errors';\nimport type { HistoryEntry } from './types';\nimport { resolveMessage } from './undo-mapping';\nimport type { UndoRegistry } from './undo-registry';\n\nconst HISTORY_LIMIT = 100;\n\n//\n// Public Interface\n//\n\n/**\n * HistoryTracker interface - tracks operation history and provides undo.\n */\nexport interface HistoryTracker {\n undo: () => Effect.Effect<void, Error>;\n undoPromise: () => Promise<{ error?: Error }>;\n canUndo: () => boolean;\n}\n\n//\n// Factory\n//\n\n/**\n * Creates a HistoryTracker that subscribes to invocation events and provides undo.\n */\nexport const make = (\n invoker: OperationInvoker.OperationInvokerInternal,\n undoRegistry: UndoRegistry,\n): HistoryTracker => {\n const history: HistoryEntry[] = [];\n\n // Subscribe to invocation stream.\n const handleInvocation = (event: OperationInvoker.InvocationEvent) => {\n const mapping = undoRegistry.lookup(event.operation);\n if (!mapping) {\n // Operation is not undoable, skip.\n return;\n }\n\n const inverseInput = mapping.deriveContext(event.input, event.output);\n if (inverseInput === undefined) {\n // Operation is conditionally not undoable (deriveContext returned undefined).\n log('operation not undoable', { key: event.operation.meta.key });\n return;\n }\n\n const entry: HistoryEntry = {\n operation: event.operation,\n input: event.input,\n output: event.output,\n inverse: mapping.inverse,\n inverseInput,\n timestamp: event.timestamp,\n };\n\n history.push(entry);\n log('history entry added', { key: event.operation.meta.key, historyLength: history.length });\n\n // Trim history if it exceeds limit.\n if (history.length > HISTORY_LIMIT) {\n history.splice(0, history.length - HISTORY_LIMIT);\n }\n\n // Show undo toast (resolve message if it's a function).\n const resolvedMessage = resolveMessage(mapping.message, event.input, event.output);\n Effect.runFork(\n invoker.invoke(UndoOperation.ShowUndo, {\n message: resolvedMessage,\n }),\n );\n };\n\n // Fork a fiber to consume the invocation stream.\n Effect.runFork(\n Stream.fromPubSub(invoker.invocations).pipe(\n Stream.runForEach((event) => Effect.sync(() => handleInvocation(event))),\n ),\n );\n\n const undo = (): Effect.Effect<void, Error> => {\n return Effect.gen(function* () {\n const entry = history.pop();\n if (!entry) {\n return yield* Effect.fail(new EmptyHistoryError());\n }\n\n log('undoing operation', { key: entry.operation.meta.key, inverseKey: entry.inverse.meta.key });\n\n // Use _invokeCore to skip event emission (avoid undo-of-undo loops).\n yield* invoker._invokeCore(entry.inverse, entry.inverseInput);\n\n log('undo completed', { key: entry.operation.meta.key });\n });\n };\n\n const undoPromise = async (): Promise<{ error?: Error }> => {\n return runAndForwardErrors(undo())\n .then(() => ({}))\n .catch((error) => {\n log.catch(error);\n return { error };\n });\n };\n\n const canUndo = (): boolean => {\n return history.length > 0;\n };\n\n return {\n undo,\n undoPromise,\n canUndo,\n };\n};\n"],
5
5
  "mappings": ";;;;;;;;;AAIA,SAASA,iBAAiB;AAEnB,IAAMC,oBAAN,cAAgCD,UAAUE,OAAO,qBAAqB,gCAAA,EAAA;AAAmC;;;ACNhH;;;;;AAmHO,IAAMC,OAAO,CAClBC,UACyBA;AAKpB,IAAMC,iBAAiB,CAC5BC,SACAC,OACAC,WAAAA;AAEA,MAAIF,YAAYG,QAAW;AACzB,WAAOA;EACT;AACA,MAAI,OAAOH,YAAY,YAAY;AACjC,WAAOA,QAAQC,OAAOC,MAAAA;EACxB;AACA,SAAOF;AACT;;;ACtIA;;cAAAI;;AAqCO,IAAMA,QAAO,CAACC,gBAAAA;AACnB,QAAMC,SAAS,CAACC,cAAAA;AACd,UAAMC,WAAWH,YAAAA;AACjB,UAAMI,UAAUD,SAASE,KAAK,CAACC,MAAMA,EAAEJ,UAAUK,KAAKC,QAAQN,UAAUK,KAAKC,GAAG;AAChF,QAAI,CAACJ,SAAS;AACZ,aAAOK;IACT;AAEA,WAAO;MACLC,SAASN,QAAQM;MACjBC,eAAeP,QAAQO;MACvBC,SAASR,QAAQQ;IACnB;EACF;AAEA,SAAO;IAAEX;EAAO;AAClB;;;ACrDA;;cAAAY;;AAIA,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,2BAA2B;AACpC,SAASC,WAAW;AASpB,IAAA,eAAMC;AAgBN,IAAA,gBAAU;AAYR,IAAAC,QAAA,CAAA,SAAA,iBAAkC;AAClC,QAAMC,UAAAA,CAAAA;QA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,SAAA,MAAA,YAAA;AAAC,UAAA,kBAAA;QACxD,KAAA,MAAA,UAAA,KAAA;MACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;IAEA,CAAA;;sBAIgBC,YAAAA;WACV,oBAAO,KAAA,CAAA,EAAA,KAAA,OAAA,CAAA,EAAA,EAAA,MAAA,CAAA,UAAA;UAAEA,MAAAA,OAAAA,QAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,OAAAA,CAAAA;AAAM,aAAA;QACjB;MACJ;IAEA,CAAA;;AAEA,QAAA,UAAA,MAAA;AAEA,WAAO,QAAA,SAAA;;SAELC;IACAC;IACF;IACA;;;",
6
6
  "names": ["BaseError", "EmptyHistoryError", "extend", "make", "props", "resolveMessage", "message", "input", "output", "undefined", "make", "getMappings", "lookup", "operation", "mappings", "mapping", "find", "m", "meta", "key", "undefined", "inverse", "deriveContext", "message", "make", "Effect", "Stream", "runAndForwardErrors", "log", "HISTORY_LIMIT", "make", "handleInvocation", "log", "input", "event", "output", "inverse", "mapping", "inverseInput", "timestamp", "history", "entry", "key", "operation", "historyLength", "length", "message", "resolvedMessage", "Effect", "fail", "inverseKey", "invoker", "_invokeCore", "meta", "error", "undoPromise", "canUndo"]
@@ -8,6 +8,7 @@ var capability_exports = {};
8
8
  __export(capability_exports, {
9
9
  ModuleTag: () => ModuleTag,
10
10
  Service: () => Service,
11
+ asLayer: () => asLayer,
11
12
  atom: () => atom,
12
13
  atomByModule: () => atomByModule,
13
14
  contributes: () => contributes,
@@ -21,6 +22,7 @@ __export(capability_exports, {
21
22
  });
22
23
  import * as Context from "effect/Context";
23
24
  import * as Effect from "effect/Effect";
25
+ import * as Layer from "effect/Layer";
24
26
  var Service = class extends Context.Tag("@dxos/app-framework/CapabilityManager")() {
25
27
  };
26
28
  var get = (interfaceDef) => Effect.flatMap(Service, (manager) => Effect.try({
@@ -31,6 +33,7 @@ var getAll = (interfaceDef) => Effect.map(Service, (manager) => manager.getAll(i
31
33
  var waitFor = (interfaceDef) => Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));
32
34
  var atom = (interfaceDef) => Effect.map(Service, (manager) => manager.atom(interfaceDef));
33
35
  var atomByModule = (interfaceDef) => Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));
36
+ var asLayer = (interfaceDef, tag) => Layer.effect(tag, get(interfaceDef).pipe(Effect.orDie));
34
37
  var ModuleTag = /* @__PURE__ */ Symbol.for("@dxos/app-framework/ModuleTag");
35
38
  var make = (identifier) => {
36
39
  return {
@@ -69,6 +72,7 @@ export {
69
72
  waitFor,
70
73
  atom,
71
74
  atomByModule,
75
+ asLayer,
72
76
  ModuleTag,
73
77
  make,
74
78
  contributes,
@@ -77,4 +81,4 @@ export {
77
81
  makeModule,
78
82
  capability_exports
79
83
  };
80
- //# sourceMappingURL=chunk-SDJ4B2LU.mjs.map
84
+ //# sourceMappingURL=chunk-CTKEZHKF.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/core/capability.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport type * as CapabilityManager from './capability-manager';\nimport type * as Plugin from './plugin';\n\n//\n// Capability Service Layer\n//\n\n/**\n * Effect Context.Tag for accessing CapabilityManager via the Effect layer system.\n * This allows capability modules to access the capability manager without having it passed as an argument.\n */\nexport class Service extends Context.Tag('@dxos/app-framework/CapabilityManager')<\n Service,\n CapabilityManager.CapabilityManager\n>() {}\n\n/**\n * Get a single capability from the capability manager.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation.\n * @throws If no capability is found.\n */\n// TODO(wittjosiah): Add custom tagged errors (Data.TaggedError) for app-framework to enable\n// type-safe error handling with Effect. Consider CapabilityNotFoundError, ModuleActivationError, etc.\nexport const get = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) =>\n Effect.try({\n try: () => manager.get(interfaceDef),\n catch: (error) => (error instanceof Error ? error : new Error(String(error))),\n }),\n );\n\n/**\n * Get all capabilities from the capability manager for a given interface.\n * @param interfaceDef The interface definition of the capability.\n * @returns An array of capability implementations.\n */\nexport const getAll = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T[], never, Service> =>\n Effect.map(Service, (manager) => manager.getAll(interfaceDef));\n\n/**\n * Wait for a capability to be available.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation once available.\n */\nexport const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));\n\n/**\n * Get the Atom reference to capabilities for reactive access.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing the array of capability implementations.\n */\nexport const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>\n Effect.map(Service, (manager) => manager.atom(interfaceDef));\n\n/**\n * Get capabilities grouped by the module that contributed them.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing a record from module ID to capability implementations.\n */\nexport const atomByModule = <T>(\n interfaceDef: InterfaceDef<T>,\n): Effect.Effect<Atom.Atom<Record<string, T[]>>, never, Service> =>\n Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));\n\n/**\n * Constructs a layer that will request its interface implementation from the capability manager.\n */\nexport const asLayer = <T, I>(interfaceDef: InterfaceDef<T>, tag: Context.Tag<I, T>): Layer.Layer<I, never, Service> =>\n Layer.effect(tag, get(interfaceDef).pipe(Effect.orDie));\n\nconst InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');\n\n/**\n * Symbol used to tag lazy capability functions with their module ID.\n */\nexport const ModuleTag: unique symbol = Symbol.for('@dxos/app-framework/ModuleTag');\n\n/**\n * The interface definition of a capability.\n */\nexport type InterfaceDef<T> = {\n [InterfaceDefTypeId]: T;\n identifier: string;\n};\n\nexport namespace InterfaceDef {\n export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;\n}\n\n/**\n * Helper to define the interface of a capability.\n */\nexport const make = <T>(identifier: string) => {\n return { identifier } as InterfaceDef<T>;\n};\n\n/**\n * A unique string identifier with a Typescript type associated with it.\n * When a capability is contributed to the application an implementation of the interface is provided.\n */\nexport type Capability<T> = {\n /**\n * The interface definition of the capability.\n */\n readonly interface: InterfaceDef<T>;\n\n /**\n * The implementation of the capability.\n */\n readonly implementation: T;\n\n /**\n * Called when the capability is deactivated.\n */\n readonly deactivate?: () => Effect.Effect<void, Error>;\n};\n\nexport type Any = Capability<any>;\n\n/**\n * Union type representing all valid return types for a capability module.\n * Supports single capabilities, arrays, and tuples of different capability types.\n */\nexport type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]] | readonly [Any, ...Any[]];\n\n/**\n * Helper to define the implementation of a capability.\n */\n// TODO(dmaretskyi): Make the return type non-generic so capabilities are non-discernable.\nexport const contributes = <I extends InterfaceDef<any>>(\n interfaceDef: I,\n implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],\n deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],\n): Capability<I> => {\n return {\n interface: interfaceDef,\n implementation,\n deactivate,\n } satisfies Capability<I>;\n};\n\ntype LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\ntype LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\n\ntype NormalizeReturn<R> = R extends readonly (infer A)[]\n ? A[]\n : R extends (infer A)[]\n ? A[]\n : R extends Any\n ? [R]\n : Any[];\n\nexport type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (\n props: Props,\n) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;\n\n/**\n * Helper to define a lazily loaded implementation of a capability.\n * Supports single capabilities, arrays, and tuples of different capability types.\n * @param name The export name (e.g., 'AppGraphBuilder') - used to auto-compute module IDs.\n * @param loader The lazy loader function.\n * @returns A lazy capability function with ModuleTag symbol attached.\n */\nexport const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(\n name: string,\n c: LoadCapability<T, R> | LoadCapabilities<T, R>,\n): LazyCapability<T, R> => {\n const lazyFn: LazyCapability<T, R> = (props: T) =>\n Effect.gen(function* () {\n const { default: getCapability } = yield* Effect.promise(() => c());\n const result = yield* getCapability(props);\n const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];\n return normalized as NormalizeReturn<R>;\n });\n\n return Object.assign(lazyFn, { [ModuleTag]: name });\n};\n\n/**\n * Gets the module tag (export name) from a lazy capability function.\n * @param capability The lazy capability function.\n * @returns The module tag if present, undefined otherwise.\n */\n// TODO(wittjosiah): Stricter type for capability.\nexport const getModuleTag = (capability: unknown): string | undefined => {\n return capability && typeof capability === 'function' && ModuleTag in capability\n ? String(capability[ModuleTag])\n : undefined;\n};\n\n/**\n * Helper to define a capability module with explicit typing.\n * Wraps the default export function to provide better type inference and make the pattern explicit.\n *\n * This helper provides explicit typing for the module activation function,\n * making it clear that the function should:\n * - Access CapabilityManager via the Effect layer system (Capability.get, Capability.getAll, etc.)\n * - Return a capability, array of capabilities, or tuple of different capability types (sync or async)\n *\n * Supports returning multiple capabilities of different types as a tuple, which will be normalized\n * to an array at runtime for compatibility with the plugin system.\n *\n * @example\n * ```ts\n * // Module without options - single capability\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * const client = yield* Capability.get(ClientCapabilities.Client);\n * return contributes(Capabilities.SettingsStore, store);\n * })\n * );\n *\n * // Module with multiple capabilities\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * return [\n * contributes(Capabilities.SettingsStore, store),\n * contributes(Capabilities.Translations, translations),\n * ];\n * })\n * );\n *\n * // Module with required options (context accessed via layer)\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* (props: { observability: boolean }) {\n * const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n * return contributes(Capabilities.OperationHandler, ...);\n * })\n * );\n * ```\n */\nexport const makeModule = <\n TProps = void,\n TReturn extends ModuleReturn = ModuleReturn,\n E extends Error = Error,\n R extends Service | Plugin.Service | never = Service,\n>(\n fn: (props: TProps) => Effect.Effect<TReturn, E, R>,\n): ((props: TProps) => Effect.Effect<TReturn, E, R>) => fn;\n"],
5
+ "mappings": ";;;;;;AAAA;;;;;;;;;;;;;;;;AAKA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AAahB,IAAMC,UAAN,cAA8BC,YAAI,uCAAA,EAAA,EAAA;AAGpC;AAUE,IAAMC,MAAM,CAAIC,iBACdC,eAAQJ,SAAS,CAACK,YAChBC,WAAI;EACTA,KAAK,MAAMD,QAAQH,IAAIC,YAAAA;EACvBI,OAAO,CAACC,UAAWA,iBAAiBC,QAAQD,QAAQ,IAAIC,MAAMC,OAAOF,KAAAA,CAAAA;AACvE,CAAA,CAAA;AAQG,IAAMG,SAAS,CAAIR,iBACjBS,WAAIZ,SAAS,CAACK,YAAYA,QAAQM,OAAOR,YAAAA,CAAAA;AAO3C,IAAMU,UAAU,CAAIV,iBAClBC,eAAQJ,SAAS,CAACK,YAAYA,QAAQQ,QAAQV,YAAAA,CAAAA;AAOhD,IAAMW,OAAO,CAAIX,iBACfS,WAAIZ,SAAS,CAACK,YAAYA,QAAQS,KAAKX,YAAAA,CAAAA;AAOzC,IAAMY,eAAe,CAC1BZ,iBAEOS,WAAIZ,SAAS,CAACK,YAAYA,QAAQU,aAAaZ,YAAAA,CAAAA;AAKjD,IAAMa,UAAU,CAAOb,cAA+Bc,QACrDC,aAAOD,KAAKf,IAAIC,YAAAA,EAAcgB,KAAYC,YAAK,CAAA;AAOhD,IAAMC,YAA2BC,uBAAOC,IAAI,+BAAA;AAiB5C,IAAMC,OAAO,CAAIC,eAAAA;AACtB,SAAO;IAAEA;EAAW;AACtB;AAmCO,IAAMC,cAAc,CACzBC,cACAC,gBACAC,eAAAA;AAEA,SAAO;IACLC,WAAWH;IACXC;IACAC;EACF;AACF;AA4BO,IAAME,OAAO,CAClBC,MACAC,MAAAA;AAEA,QAAMC,SAA+B,CAACC,UAC7BC,WAAI,aAAA;AACT,UAAM,EAAEC,SAASC,cAAa,IAAK,OAAcC,eAAQ,MAAMN,EAAAA,CAAAA;AAC/D,UAAMO,SAAS,OAAOF,cAAcH,KAAAA;AACpC,UAAMM,aAAaD,UAAU,OAAO,CAAA,IAAKE,MAAMC,QAAQH,MAAAA,IAAUE,MAAME,KAAKJ,MAAAA,IAAU;MAACA;;AACvF,WAAOC;EACT,CAAA;AAEF,SAAOI,OAAOC,OAAOZ,QAAQ;IAAE,CAACb,SAAAA,GAAYW;EAAK,CAAA;AACnD;AAQO,IAAMe,eAAe,CAACC,eAAAA;AAC3B,SAAOA,cAAc,OAAOA,eAAe,cAAc3B,aAAa2B,aAClEC,OAAOD,WAAW3B,SAAAA,CAAU,IAC5B6B;AACN;AA2CO,IAAMC,aAAa,CAMxBC,OACsDA;",
6
+ "names": ["Context", "Effect", "Layer", "Service", "Tag", "get", "interfaceDef", "flatMap", "manager", "try", "catch", "error", "Error", "String", "getAll", "map", "waitFor", "atom", "atomByModule", "asLayer", "tag", "effect", "pipe", "orDie", "ModuleTag", "Symbol", "for", "make", "identifier", "contributes", "interfaceDef", "implementation", "deactivate", "interface", "lazy", "name", "c", "lazyFn", "props", "gen", "default", "getCapability", "promise", "result", "normalized", "Array", "isArray", "from", "Object", "assign", "getModuleTag", "capability", "String", "undefined", "makeModule", "fn"]
7
+ }
@@ -3,19 +3,19 @@ import {
3
3
  PluginManagerProvider,
4
4
  topologicalSort,
5
5
  usePluginManager
6
- } from "./chunk-WKTLE7MG.mjs";
6
+ } from "./chunk-LJNUFNDO.mjs";
7
7
  import {
8
8
  PluginManagerContext
9
9
  } from "./chunk-37Z53PXZ.mjs";
10
10
  import {
11
11
  capabilities_exports
12
- } from "./chunk-WFSRZKBP.mjs";
12
+ } from "./chunk-PW2VYGOS.mjs";
13
13
  import {
14
14
  activation_events_exports
15
- } from "./chunk-6XW6LET6.mjs";
15
+ } from "./chunk-KFZEB6BV.mjs";
16
16
  import {
17
17
  plugin_manager_exports
18
- } from "./chunk-MUVUQC3G.mjs";
18
+ } from "./chunk-SFYCO3PT.mjs";
19
19
 
20
20
  // src/ui/components/App/App.tsx
21
21
  import React2, { useEffect as useEffect3 } from "react";
@@ -35,14 +35,13 @@ import { useAsyncEffect, useDefaultValue } from "@dxos/react-hooks";
35
35
  import { ContextProtocolProvider } from "@dxos/web-context-react";
36
36
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/ui/hooks/useApp.tsx";
37
37
  var ENABLED_KEY = "org.dxos.app-framework.enabled";
38
- var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, pluginRegistryProvider, plugins: pluginsProp, core: coreProp, defaults: defaultsProp, setupEvents: setupEventsProp, placeholder, fallback = ErrorFallback, cacheEnabled = false, safeMode = false, debounce = 0, timeout = 3e4 }) => {
38
+ var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, pluginRegistryProvider, plugins: pluginsProp, defaults: defaultsProp, setupEvents: setupEventsProp, placeholder, fallback = ErrorFallback, cacheEnabled = false, safeMode = false, debounce = 0, timeout = 3e4 }) => {
39
39
  const plugins = useDefaultValue(pluginsProp, () => []);
40
- const core = useDefaultValue(coreProp, () => plugins.map(({ meta }) => meta.id));
41
40
  const defaults = useDefaultValue(defaultsProp, () => []);
42
41
  const setupEvents = useDefaultValue(setupEventsProp, () => []);
43
42
  const pluginLoader = useMemo(() => pluginLoaderProp ?? ((id) => Effect.sync(() => {
44
43
  const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
45
- invariant(plugin, `Plugin not found: ${id}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 52, S: void 0, A: ["plugin", "`Plugin not found: ${id}`"] });
44
+ invariant(plugin, `Plugin not found: ${id}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 49, S: void 0, A: ["plugin", "`Plugin not found: ${id}`"] });
46
45
  return {
47
46
  plugin
48
47
  };
@@ -71,20 +70,18 @@ var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, p
71
70
  const mgr = pluginManager ?? plugin_manager_exports.make({
72
71
  pluginLoader,
73
72
  plugins,
74
- core,
75
73
  enabled,
76
74
  onRemove: onPluginRemove,
77
75
  pluginRegistryProvider
78
76
  });
79
77
  log("useApp: useMemo created/reused manager", {
80
78
  provided: !!pluginManager
81
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 87, S: void 0 });
79
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 83, S: void 0 });
82
80
  return mgr;
83
81
  }, [
84
82
  pluginManager,
85
83
  pluginLoader,
86
84
  plugins,
87
- core,
88
85
  enabled,
89
86
  onPluginRemove,
90
87
  pluginRegistryProvider
@@ -106,7 +103,7 @@ var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, p
106
103
  manager
107
104
  ]);
108
105
  useAsyncEffect(async () => {
109
- log("useApp: effect mount", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 117, S: void 0 });
106
+ log("useApp: effect mount", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 112, S: void 0 });
110
107
  manager.capabilities.contribute({
111
108
  interface: capabilities_exports.PluginManager,
112
109
  implementation: manager,
@@ -179,13 +176,13 @@ var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, p
179
176
  eventsFired: manager.getEventsFired(),
180
177
  activeModules: manager.getActive(),
181
178
  pendingReset: manager.getPendingReset()
182
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 224, S: void 0 });
179
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 219, S: void 0 });
183
180
  void runAndForwardErrors(Fiber.interrupt(fiber));
184
181
  setError(new Error(`Startup timed out after ${timeout}ms`));
185
182
  }
186
183
  }, timeout);
187
184
  return () => {
188
- log("useApp: effect cleanup", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 234, S: void 0 });
185
+ log("useApp: effect cleanup", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 229, S: void 0 });
189
186
  clearTimeout(timeoutId);
190
187
  void runAndForwardErrors(Fiber.interrupt(fiber));
191
188
  if (!isExternalManager) {
@@ -333,13 +330,57 @@ var useLoading = (ready, debounce = 0) => {
333
330
  return stage;
334
331
  };
335
332
 
333
+ // src/ui/hooks/useProcessManagerRuntime.ts
334
+ import * as Effect2 from "effect/Effect";
335
+ import { use, useCallback as useCallback3, useMemo as useMemo2 } from "react";
336
+ import { ServiceResolver } from "@dxos/compute";
337
+ import { unwrapExit } from "@dxos/effect";
338
+ var useProcessManagerRuntime = () => useCapability(capabilities_exports.ProcessManagerRuntime);
339
+ var useSpaceCallback = (spaceId, tags, fn, deps) => {
340
+ const runtime = useProcessManagerRuntime();
341
+ return useCallback3(() => {
342
+ if (spaceId === void 0) {
343
+ throw new TypeError("Space not provided to useSpaceCallback");
344
+ }
345
+ const layer = ServiceResolver.provide({
346
+ space: spaceId
347
+ }, ...tags);
348
+ return runtime.runPromise(fn().pipe(Effect2.provide(layer)));
349
+ }, [
350
+ runtime,
351
+ spaceId,
352
+ ...deps ?? []
353
+ ]);
354
+ };
355
+ var useSpaceService = (tag, spaceId) => {
356
+ const runtime = useProcessManagerRuntime();
357
+ const promise = useMemo2(() => {
358
+ if (spaceId === void 0) {
359
+ return void 0;
360
+ }
361
+ const layer = ServiceResolver.provide({
362
+ space: spaceId
363
+ }, tag);
364
+ const effect = Effect2.flatMap(tag, (service) => Effect2.succeed(service)).pipe(Effect2.provide(layer));
365
+ return runtime.runPromiseExit(effect);
366
+ }, [
367
+ runtime,
368
+ spaceId,
369
+ tag
370
+ ]);
371
+ if (!promise) {
372
+ return void 0;
373
+ }
374
+ return unwrapExit(use(promise));
375
+ };
376
+
336
377
  // src/ui/hooks/useSettingsState.ts
337
378
  import { RegistryContext as RegistryContext2, useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
338
- import { useCallback as useCallback3, useContext } from "react";
379
+ import { useCallback as useCallback4, useContext } from "react";
339
380
  var useSettingsState = (atom) => {
340
381
  const registry = useContext(RegistryContext2);
341
382
  const settings = useAtomValue2(atom);
342
- const updateSettings = useCallback3((fn) => {
383
+ const updateSettings = useCallback4((fn) => {
343
384
  registry.set(atom, fn(registry.get(atom)));
344
385
  }, [
345
386
  registry,
@@ -444,10 +485,8 @@ var Placeholder = ({ stage = 1, progress, logo }) => {
444
485
  return /* @__PURE__ */ React3.createElement(ThemeProvider, {
445
486
  tx: defaultTx
446
487
  }, /* @__PURE__ */ React3.createElement("div", {
447
- role: "none",
448
488
  className: "relative dx-container h-dvh flex flex-col"
449
489
  }, /* @__PURE__ */ React3.createElement("div", {
450
- role: "none",
451
490
  className: "flex flex-col grow justify-center items-center"
452
491
  }, typeof logo === "function" ? logo({
453
492
  className: logoClassName
@@ -465,8 +504,11 @@ export {
465
504
  useOperationInvoker,
466
505
  LoadingState,
467
506
  useLoading,
507
+ useProcessManagerRuntime,
508
+ useSpaceCallback,
509
+ useSpaceService,
468
510
  useSettingsState,
469
511
  App,
470
512
  Placeholder
471
513
  };
472
- //# sourceMappingURL=chunk-42J2ZUQQ.mjs.map
514
+ //# sourceMappingURL=chunk-JNT72ZCN.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ui/components/App/App.tsx", "../../../src/ui/hooks/useApp.tsx", "../../../src/ui/hooks/useCapabilities.ts", "../../../src/ui/hooks/useLoading.tsx", "../../../src/ui/hooks/useProcessManagerRuntime.ts", "../../../src/ui/hooks/useSettingsState.ts", "../../../src/ui/components/Placeholder/Placeholder.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useEffect } from 'react';\n\nimport { Capabilities } from '../../../common';\nimport { topologicalSort } from '../../../helpers';\nimport { LoadingState, type StartupProgress, type UseAppOptions, useCapabilities, useLoading } from '../../hooks';\n\nexport type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {\n ready: boolean;\n error: unknown;\n progress?: StartupProgress;\n};\n\nconst FIRST_INTERACTIVE_MARK = 'app-framework:first-interactive';\n\nexport const App = ({ placeholder: Placeholder, ready, error, debounce, progress }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n const stage = useLoading(ready, debounce);\n const placeholderDismissed = stage >= LoadingState.Done;\n\n // Emit a once-per-app `app-framework:first-interactive` mark the first time\n // the placeholder is dismissed and the real app shell renders. Closes the\n // gap between `Startup` activated and the first interactive paint.\n //\n // Also dismisses the native-DOM boot loader from\n // `@dxos/app-framework/vite-plugin` here — the framework owns the\n // handoff-complete signal, so dismissing in `App` covers both hosts that\n // wire in a `Placeholder` (which may have its own dismiss path) and hosts\n // that don't (the loader would otherwise sit forever as a `z-index: 10`\n // overlay covering the rendered shell).\n useEffect(() => {\n if (!placeholderDismissed) {\n return;\n }\n if (performance.getEntriesByName(FIRST_INTERACTIVE_MARK).length === 0) {\n performance.mark(FIRST_INTERACTIVE_MARK);\n }\n (window as { __bootLoader?: { dismiss?: () => void } }).__bootLoader?.dismiss?.();\n }, [placeholderDismissed]);\n\n if (error) {\n // This triggers the error boundary to provide UI feedback for the startup error.\n throw error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead.\n if (!placeholderDismissed) {\n if (!Placeholder) {\n return null;\n }\n\n return <Placeholder stage={stage} progress={progress} />;\n }\n\n const ComposedContext = composeContexts(reactContexts);\n return (\n <ComposedContext>\n {reactRoots.map(({ id, root: Component }) => (\n <Component key={id} />\n ))}\n </ComposedContext>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as PubSub from 'effect/PubSub';\nimport * as Queue from 'effect/Queue';\nimport React, { type FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { ErrorBoundary, ErrorFallback, type FallbackProps } from '@dxos/react-error-boundary';\nimport { useAsyncEffect, useDefaultValue } from '@dxos/react-hooks';\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport { ActivationEvents, Capabilities } from '../../common';\nimport { PluginManagerContext } from '../../context';\nimport { type ActivationEvent, type Plugin, PluginManager } from '../../core';\nimport { App, PluginManagerProvider } from '../components';\n\nconst ENABLED_KEY = 'org.dxos.app-framework.enabled';\n\nexport type StartupProgress = {\n /** Number of modules that have been activated. */\n activated: number;\n /** Total number of modules registered. */\n total: number;\n /** Fractional progress (0-1). */\n progress: number;\n /**\n * Raw activation event key (e.g. `org.dxos.app-framework.event.startup`).\n * Set on event-level transitions, *and* on module-level transitions where\n * it carries the parent activation event that first triggered the\n * module's load (plumbed through `_loadCapabilitiesForModules` →\n * `_loadModule`). Consumers can use this either as the primary id (when\n * {@link module} is absent) or as an extra \"context\" field alongside\n * {@link module}.\n */\n event?: string;\n /**\n * Raw module id (e.g. `org.dxos.plugin.observability.module.ReactSurface`)\n * when the in-flight activation is module-level. When present,\n * {@link event} may also be set, identifying the parent activation that\n * triggered this module's load.\n */\n module?: string;\n /**\n * Pre-humanized label for the currently surfaced transition (module\n * label if {@link module} is set, otherwise the event label), supplied\n * for consumers that want a sensible default. Hosts that prefer to\n * render their own label can read the raw {@link event}/{@link module}\n * fields and ignore this — the framework leaves the policy choice\n * (which transitions to surface, how to format them, whether to drop\n * sub-modules entirely) to the host's `Placeholder`.\n */\n humanizedName?: string;\n};\n\nexport type PlaceholderProps = {\n stage?: number;\n progress?: StartupProgress;\n};\n\nexport type UseAppOptions = {\n pluginManager?: PluginManager.PluginManager;\n pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];\n onPluginRemove?: PluginManager.ManagerOptions['onRemove'];\n pluginRegistryProvider?: PluginManager.ManagerOptions['pluginRegistryProvider'];\n plugins?: Plugin.Plugin[];\n defaults?: string[];\n /**\n * Additional activation events to fire before startup.\n * These are fired alongside SetupReactSurface before the Startup event.\n */\n setupEvents?: ActivationEvent.ActivationEvent[];\n cacheEnabled?: boolean;\n safeMode?: boolean;\n debounce?: number;\n timeout?: number;\n fallback?: FC<FallbackProps>;\n placeholder?: FC<PlaceholderProps>;\n};\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const plugins = [LayoutPlugin(), MyPlugin()];\n * const defaults = [MyPluginId];\n * const fallback = () => <div>Initializing Plugins...</div>;\n * const App = useApp({ plugins, defaults, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.pluginLoader A function which loads new plugins.\n * @param params.plugins All plugins available to the application. Plugins whose `meta.tags` includes `'system'` are treated as core (force-enabled, not user-toggleable).\n * @param params.defaults Default plugins are enabled by default but can be disabled by the user.\n * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.\n * @param params.safeMode Whether to enable safe mode, which disables optional plugins.\n * @param params.fallback Fallback component to render if an error occurs during startup.\n * @param params.placeholder Placeholder component to render during startup.\n */\nexport const useApp = ({\n pluginManager,\n pluginLoader: pluginLoaderProp,\n onPluginRemove,\n pluginRegistryProvider,\n plugins: pluginsProp,\n defaults: defaultsProp,\n setupEvents: setupEventsProp,\n placeholder,\n fallback = ErrorFallback,\n cacheEnabled = false,\n safeMode = false,\n debounce = 0,\n timeout = 30_000,\n}: UseAppOptions) => {\n const plugins = useDefaultValue(pluginsProp, () => []);\n const defaults = useDefaultValue(defaultsProp, () => []);\n const setupEvents = useDefaultValue(setupEventsProp, () => []);\n\n const pluginLoader = useMemo(\n () =>\n pluginLoaderProp ??\n ((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 [pluginLoaderProp, plugins],\n );\n\n const readyRef = useRef(false);\n const [ready, setReady] = useState(false);\n const errorRef = useRef<unknown>(null);\n const [error, setError] = useState<unknown>(null);\n const [startupProgress, setStartupProgress] = useState<StartupProgress>({\n activated: 0,\n total: 0,\n progress: 0,\n });\n // TODO(wittjosiah): Migrate to Atom.kvs for isomorphic storage.\n const cached: string[] = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]'), []);\n const enabled = useMemo(\n () => (safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults),\n [safeMode, cacheEnabled, cached, defaults],\n );\n const isExternalManager = !!pluginManager;\n const manager = useMemo(() => {\n const mgr =\n pluginManager ??\n PluginManager.make({\n pluginLoader,\n plugins,\n enabled,\n onRemove: onPluginRemove,\n pluginRegistryProvider,\n });\n log('useApp: useMemo created/reused manager', { provided: !!pluginManager });\n return mgr;\n }, [pluginManager, pluginLoader, plugins, enabled, onPluginRemove, pluginRegistryProvider]);\n\n useEffect(() => {\n if (!cacheEnabled) {\n return;\n }\n return manager.registry.subscribe(manager.enabled, (value) => {\n localStorage.setItem(ENABLED_KEY, JSON.stringify(value));\n });\n }, [cacheEnabled, manager]);\n\n useEffect(() => {\n setupDevtools(manager);\n }, [manager]);\n\n useAsyncEffect(async () => {\n log('useApp: effect mount');\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 const fiber = Effect.gen(function* () {\n const queue = yield* PubSub.subscribe(manager.activation);\n const listener = yield* Effect.forkDaemon(\n Queue.take(queue).pipe(\n Effect.tap(({ event, state, module, error: error$ }) =>\n Effect.sync(() => {\n // Event-level Startup activated (no `module` field) fires once,\n // after every module triggered by Startup has finished. Module\n // activations now also carry their parent event id (so the trace\n // can attribute a module to its triggering event), which means\n // each module activated under Startup publishes\n // `{ event: 'startup', state: 'activated', module: <id> }`. Without\n // the `!module` guard the listener would mark the app ready on\n // the *first* such module rather than waiting for the event-level\n // completion — leaving downstream capabilities (operation-invoker,\n // app-graph, …) un-registered when the placeholder dismisses.\n if (event === ActivationEvents.Startup.id && state === 'activated' && !module) {\n clearTimeout(timeoutId);\n setReady(true);\n readyRef.current = true;\n // Trigger startup profiler dump if available.\n (globalThis as any).composer?.profiler?.dump();\n // Notify any host observability layer that startup completed.\n // A `CustomEvent` keeps this generic — app-framework doesn't\n // import a provider, and consumers can capture the startup\n // summary without us picking one.\n if (typeof window !== 'undefined') {\n window.dispatchEvent(new CustomEvent('app-framework:startup-activated'));\n }\n return;\n }\n // `activating` is the start-of-load signal. Surface the raw\n // `module` (or `event`) plus a pre-humanized label so the\n // host placeholder can decide what to render — show\n // everything, suppress noisy sub-modules, group by plugin,\n // or apply its own formatting. We intentionally do NOT touch\n // these fields on `activated`: pairing the two would cause\n // back-to-back identical updates to the host's effect, which\n // the boot loader treats as a re-trigger because\n // `progress.progress` moved. Leaving the label alone on\n // completion keeps it accurate (\"now activating X\") until\n // the next module starts.\n if (module && state === 'activating' && !readyRef.current) {\n setStartupProgress((current) => ({\n ...current,\n // `event` here is the activation event that first\n // triggered this module load (plumbed through\n // `_loadCapabilitiesForModules` → `_loadModule`).\n // Falsy/empty falls back to undefined so consumers can\n // tell \"no parent context\" from \"parent context: <X>\".\n event: event || undefined,\n module,\n humanizedName: humanizeModuleId(module),\n }));\n }\n // Update the activation count when a module commits. The\n // ring's fraction comes from this; `event`/`module`/\n // `humanizedName` were set by the matching `activating`\n // message above and are left alone so the count can advance\n // without re-firing the host's status callback.\n if (module && state === 'activated' && !readyRef.current) {\n const active = manager.getActive();\n const total = manager.getModules().length;\n setStartupProgress((current) => ({\n ...current,\n activated: active.length,\n total,\n progress: total > 0 ? active.length / total : 0,\n }));\n }\n // Event-level `activating` (no `module`) — fired at the start\n // of `_activateModulesForEvent` and recursively for each\n // before/after event. Surfaces a label during the gap before\n // the first module-level message lands; subsequent module\n // updates immediately overwrite this with a more specific\n // label.\n if (event && !module && state === 'activating' && !readyRef.current) {\n setStartupProgress((current) => ({\n ...current,\n event,\n module: undefined,\n humanizedName: humanizeEventKey(event),\n }));\n }\n if (error$ && !readyRef.current) {\n setError(error$);\n errorRef.current = error$;\n }\n }),\n ),\n Effect.forever,\n ),\n );\n\n yield* Effect.all([\n ...setupEvents.map((event) => manager.activate(event)),\n manager.activate(ActivationEvents.SetupReactSurface),\n manager.activate(ActivationEvents.Startup),\n ]);\n\n return yield* Fiber.join(listener);\n }).pipe(Effect.scoped, Effect.runFork);\n\n // Set up a timeout for startup.\n const timeoutId = setTimeout(() => {\n if (!readyRef.current && !errorRef.current) {\n log.warn('startup timeout diagnostic', {\n eventsFired: manager.getEventsFired(),\n activeModules: manager.getActive(),\n pendingReset: manager.getPendingReset(),\n });\n void runAndForwardErrors(Fiber.interrupt(fiber));\n setError(new Error(`Startup timed out after ${timeout}ms`));\n }\n }, timeout);\n\n return () => {\n log('useApp: effect cleanup');\n clearTimeout(timeoutId);\n void runAndForwardErrors(Fiber.interrupt(fiber));\n if (!isExternalManager) {\n void runAndForwardErrors(manager.shutdown());\n }\n };\n }, [manager]);\n\n const progressRef = useRef(startupProgress);\n progressRef.current = startupProgress;\n\n return useCallback(\n () => (\n <ErrorBoundary name='app' FallbackComponent={fallback}>\n <PluginManagerProvider value={manager}>\n <ContextProtocolProvider value={manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={manager.registry}>\n <App\n placeholder={placeholder}\n ready={ready}\n error={error}\n debounce={debounce}\n progress={progressRef.current}\n />\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n </ErrorBoundary>\n ),\n [fallback, manager, placeholder, ready, error],\n );\n};\n\nconst setupDevtools = (manager: PluginManager.PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\n};\n\n/**\n * Extracts a human-readable label from a module ID.\n *\n * Module IDs follow `org.dxos.plugin.<plugin-slug>.module.<module-name>`,\n * where `<plugin-slug>` is kebab-case and `<module-name>` is either an\n * explicit string (often kebab-case, e.g. `'observability'`, `'namespace'`)\n * or a capability tag in PascalCase from `Capability.getModuleTag(...)`\n * (e.g. `'ReactSurface'`, `'AppGraphBuilder'`). The output is\n * `\"Title Case Plugin: kebab-module\"` so the visible status names both the\n * plugin and the aspect being activated, helping disambiguate the multiple\n * modules a plugin contributes.\n *\n * Examples:\n * - \"org.dxos.plugin.markdown.module.ReactSurface\" → \"Markdown: react-surface\"\n * - \"org.dxos.plugin.observability.module.AppGraphBuilder\" → \"Observability: app-graph-builder\"\n * - \"org.dxos.plugin.observability.module.observability\" → \"Observability\"\n * (the module name matches the plugin slug — collapsed to avoid\n * \"Observability: observability\" noise.)\n */\nconst humanizeModuleId = (moduleId: string): string => {\n const match = moduleId.match(/\\.plugin\\.([^.]+)\\.module\\.(.+)$/);\n if (!match) {\n // Fallback: use the last segment.\n const parts = moduleId.split('.');\n return parts[parts.length - 1];\n }\n const [, pluginSlug, moduleName] = match;\n const pluginLabel = pluginSlug\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n // Normalise the module name to kebab-case so PascalCase capability tags\n // (\"ReactSurface\") read consistently with explicit kebab IDs\n // (\"operation-handler\"). The two-step substitution handles consecutive\n // uppercase runs (`URLLoader` → `url-loader`) without splitting them\n // mid-acronym.\n const moduleLabel = moduleName\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n // Capability modules whose name matches the plugin slug (e.g. the\n // observability plugin's `observability` capability module) would render\n // as \"Observability: observability\" — drop the redundant suffix.\n if (moduleLabel === pluginSlug) {\n return pluginLabel;\n }\n return `${pluginLabel}: ${moduleLabel}`;\n};\n\n/**\n * Extracts a human-readable label from an activation event key.\n * E.g., \"org.dxos.app-framework.event.setup-react-surface\" → \"Setup React Surface\".\n */\nconst humanizeEventKey = (eventKey: string): string => {\n // Strip a leading specifier (composite key form: \"<id>:<specifier>\").\n const id = eventKey.split(':')[0];\n // Match the trailing segment after `.event.`.\n const match = id.match(/\\.event\\.(.+)$/);\n const slug = match ? match[1] : (id.split('.').pop() ?? id);\n return slug\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback } from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { Capabilities } from '../../common';\nimport { type Capability } from '../../core';\nimport { usePluginManager } from '../components';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const manager = usePluginManager();\n return useAtomValue(manager.capabilities.atom(interfaceDef));\n};\n\n/**\n * Hook to request a capability from the plugin context.\n * @returns The capability.\n * @throws If no capability is found.\n */\nexport const useCapability = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const capabilities = useCapabilities(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\n};\n\n/**\n * Hook to get the current value of an atom capability.\n * Automatically subscribes to changes.\n * @example const settings = useAtomCapability(ThreadCapabilities.Settings);\n */\nexport const useAtomCapability = <T>(atomCapability: Capability.InterfaceDef<Atom.Atom<T>>): T => {\n const atom = useCapability(atomCapability);\n return useAtomValue(atom);\n};\n\n/**\n * Hook to get value and updater for an atom capability.\n * Returns [currentValue, updateFn] similar to useState.\n * @example const [settings, updateSettings] = useAtomCapabilityState(ThreadCapabilities.Settings);\n */\nexport const useAtomCapabilityState = <T>(\n atomCapability: Capability.InterfaceDef<Atom.Writable<T>>,\n): [T, (fn: (current: T) => T) => void] => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const atom = useCapability(atomCapability);\n const value = useAtomValue(atom);\n const update = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n return [value, update];\n};\n\n/**\n * Hook to get the operation invoker capability.\n */\nexport const useOperationInvoker = (): Capabilities.OperationInvoker => useCapability(Capabilities.OperationInvoker);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useRef, useState } from 'react';\n\nexport enum LoadingState {\n Loading = 0,\n FadeIn = 1,\n FadeOut = 2,\n Done = 3,\n}\n\n/**\n * To avoid \"flashing\" the placeholder, we wait a period of time before starting the loading animation.\n * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.\n *\n * States:\n * 0: Loading - Wait for a period of time before starting the loading animation.\n * 1: Fade-in - Display a loading animation.\n * 2: Fade-out - Fade out the loading animation.\n * 3: Done - Remove the placeholder.\n */\nexport const useLoading = (ready: boolean, debounce = 0) => {\n const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);\n // Mirror `ready` into a ref so the interval's `setStage` callback can read\n // the latest value without depending on the effect re-running. The pure\n // closure-capture pattern (with `ready` in deps) sticks the FSM at\n // `FadeIn` whenever HMR doesn't propagate the dep change end-to-end —\n // a ref sidesteps that entirely and fires the read on every tick.\n const readyRef = useRef(ready);\n readyRef.current = ready;\n\n useEffect(() => {\n if (!debounce) {\n return;\n }\n\n const i = setInterval(() => {\n setStage((stage) => {\n const isReady = readyRef.current;\n switch (stage) {\n case LoadingState.Loading: {\n if (!isReady) {\n return LoadingState.FadeIn;\n }\n clearInterval(i);\n return LoadingState.Done;\n }\n\n case LoadingState.FadeIn: {\n if (isReady) {\n return LoadingState.FadeOut;\n }\n break;\n }\n\n case LoadingState.FadeOut: {\n clearInterval(i);\n return LoadingState.Done;\n }\n }\n\n return stage;\n });\n }, debounce);\n\n return () => clearInterval(i);\n }, [debounce]);\n\n if (!debounce) {\n return ready ? LoadingState.Done : LoadingState.Loading;\n }\n\n return stage;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport { type DependencyList, use, useCallback, useMemo } from 'react';\n\nimport { ServiceResolver } from '@dxos/compute';\nimport { unwrapExit } from '@dxos/effect';\nimport type { SpaceId } from '@dxos/keys';\n\nimport { Capabilities } from '../../common';\nimport { useCapability } from './useCapabilities';\n\n/**\n * Resolve the shared {@link Capabilities.ProcessManagerRuntime} from the plugin context.\n */\nexport const useProcessManagerRuntime = (): Capabilities.ProcessManagerRuntime =>\n useCapability(Capabilities.ProcessManagerRuntime);\n\n/**\n * Build a callback that runs an effect on the {@link Capabilities.ProcessManagerRuntime}\n * with space-scoped services resolved via {@link ServiceResolver.provide}.\n *\n * The `tags` tuple must list every service the effect requires (beyond the\n * fixed {@link Capabilities.ProcessManagerRuntimeServices}); these services are\n * resolved for the given `spaceId` through the runtime's service resolver.\n */\nexport const useSpaceCallback = <const Tags extends readonly Context.Tag<any, any>[], T>(\n spaceId: SpaceId | undefined,\n tags: Tags,\n fn: () => Effect.Effect<T, any, Context.Tag.Identifier<Tags[number]> | Capabilities.ProcessManagerRuntimeServices>,\n deps?: DependencyList,\n): (() => Promise<T>) => {\n const runtime = useProcessManagerRuntime();\n return useCallback(() => {\n if (spaceId === undefined) {\n throw new TypeError('Space not provided to useSpaceCallback');\n }\n const layer = ServiceResolver.provide({ space: spaceId }, ...tags);\n return runtime.runPromise(fn().pipe(Effect.provide(layer)) as Effect.Effect<T, any, any>);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [runtime, spaceId, ...(deps ?? [])]);\n};\n\n/**\n * Suspensefully resolve a single space-scoped service via the\n * {@link Capabilities.ProcessManagerRuntime}'s service resolver.\n */\nexport const useSpaceService = <T extends Context.Tag<any, any>>(\n tag: T,\n spaceId: SpaceId | undefined,\n): Context.Tag.Service<T> | undefined => {\n const runtime = useProcessManagerRuntime();\n const promise = useMemo(() => {\n if (spaceId === undefined) {\n return undefined;\n }\n const layer = ServiceResolver.provide({ space: spaceId }, tag);\n const effect = Effect.flatMap(tag, (service) => Effect.succeed(service)).pipe(Effect.provide(layer));\n return runtime.runPromiseExit(effect as Effect.Effect<Context.Tag.Service<T>, any, any>);\n }, [runtime, spaceId, tag]);\n if (!promise) {\n return undefined;\n }\n return unwrapExit(use(promise));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useContext } from 'react';\n\n/**\n * Hook to read and update a settings atom.\n * Returns the current value and an update function.\n */\nexport const useSettingsState = <T>(\n atom: Atom.Writable<T>,\n): { settings: T; updateSettings: (fn: (current: T) => T) => void } => {\n const registry = useContext(RegistryContext);\n const settings = useAtomValue(atom);\n\n const updateSettings = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n\n return { settings, updateSettings };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type ReactNode, useEffect, useLayoutEffect, useRef } from 'react';\n\nimport { ThemeProvider } from '@dxos/react-ui';\nimport { defaultTx, mx } from '@dxos/ui-theme';\n\nimport { type PlaceholderProps as PlaceholderSlotProps } from '../../hooks';\n\ndeclare global {\n interface Window {\n /**\n * Driver injected by `@dxos/app-framework/vite-plugin`'s `bootLoaderPlugin`.\n * Declared here so the {@link Placeholder} can dismiss the native-DOM\n * loader once the React placeholder commits without each host having to\n * re-declare the type.\n */\n __bootLoader?: {\n status: (payload: {\n event?: string;\n module?: string;\n humanized: string;\n /**\n * Optional `(index/total)` tick. When present, the loader replaces the\n * current line in place (\"Loading plugins (12/80)\") instead of\n * appending a new entry — keeps the visible log compact during long\n * counted phases like plugin chunk-loading or module activation.\n */\n range?: { index: number; total: number };\n }) => void;\n progress: (fraction?: number) => void;\n dismiss: () => void;\n };\n }\n}\n\nexport type PlaceholderComponentProps = PlaceholderSlotProps & {\n /**\n * Brand mark rendered while the React tree settles. Pass either a static\n * `ReactNode` (the framework wraps it in a sizing/animation div) or a\n * render function that receives the precomputed `className` so the host\n * can apply it directly to its logo (e.g. an SVG that accepts `className`\n * — `composer-app` passes `(p) => <Composer {...p} />` from `@dxos/brand`).\n */\n logo?: ReactNode | ((props: { className: string }) => ReactNode);\n};\n\n/**\n * React placeholder. The native-DOM boot loader is the visible UI through\n * stages 0 (Loading) and 1 (FadeIn): we render `null` until `stage >= 2`\n * (FadeOut) and instead feed activation progress + status into the still-\n * alive boot loader. At stage 2 the loader dismisses and the React mark\n * appears for the cross-fade to the real shell:\n *\n * - composer-app fills `0 → 50%` from `getPlugins`'s per-chunk counter.\n * - this component fills `50 → 100%` from `useApp`'s\n * `startupProgress.progress` (`activated / total` modules) and pushes\n * the per-module status text to the loader's status line.\n * - at `stage >= 2` the boot loader is dismissed and the React mark\n * starts its `FadeOut → Done` shrink-and-fade.\n *\n * Stage progression (driven by `useApp`):\n * - `0` — Loading: native-DOM boot loader visible. Placeholder renders nothing.\n * - `1` — FadeIn: same — boot loader still owns the screen.\n * - `2` — FadeOut: boot loader dismissed, React mark visible at full opacity then shrinks.\n */\nexport const Placeholder = ({ stage = 1, progress, logo }: PlaceholderComponentProps) => {\n // Used in tests to exercise the error boundary & reset dialog.\n if (location.search === '?throw') {\n throw new Error('Test error');\n }\n\n // Phase B: feed activation progress + status to the still-visible boot\n // loader. Maps `[0, 1]` activation → `[0.5, 1]` of the ring; forwards\n // the raw activation source (`event` / `module`) plus the pre-humanised\n // label to `__bootLoader.status` so the loader gets to decide how to\n // render and trace each transition (current default policy: \"Activating\n // <humanizedName>\"; trace mode and timings track the structured fields).\n // No-op once the loader has been dismissed (its `status()` early-returns\n // when the boot DOM is gone). Skipping `stage >= 2` lets the dismissal\n // run uncontended.\n useEffect(() => {\n if (stage >= 2) {\n return;\n }\n const fraction = progress?.progress ?? 0;\n window.__bootLoader?.progress(0.5 + fraction * 0.5);\n if (progress?.humanizedName) {\n window.__bootLoader?.status({\n event: progress.event,\n module: progress.module,\n humanized: `Activating ${progress.humanizedName}`,\n });\n }\n }, [stage, progress?.progress, progress?.event, progress?.module, progress?.humanizedName]);\n\n // Hand off from the native-DOM boot loader once the placeholder starts\n // fading out — keeping the loader visible through `stage 0` and `stage 1`\n // means the ring stays the visible source of truth for activation\n // progress. `useLayoutEffect` runs before the next paint so the loader\n // DOM is removed in the same frame the cross-fade begins.\n useLayoutEffect(() => {\n if (stage >= 2) {\n window.__bootLoader?.dismiss();\n }\n }, [stage]);\n\n // Backstop for the fast-load path where `useLoading` can skip straight\n // from stage 0 to `Done` (ready=true at the first debounce tick) — the\n // stage-driven effect above never sees `stage >= 2`, so dismiss on\n // unmount instead. The `stageRef` guard is what keeps StrictMode's\n // synthetic mount → cleanup → remount cycle from prematurely dismissing\n // the loader: the synthetic cleanup runs while `stageRef.current === 0`,\n // skips the dismiss, and the real unmount (later, at stage `Done`)\n // performs it.\n const stageRef = useRef(stage);\n stageRef.current = stage;\n useEffect(() => {\n return () => {\n if (stageRef.current >= 3 /* Done */) {\n window.__bootLoader?.dismiss();\n }\n };\n }, []);\n\n // Defer rendering anything until the FadeOut stage. The boot loader owns\n // the screen during stages 0 and 1, so any DOM we render here would just\n // sit invisibly behind it — and rendering null avoids paint cost during\n // the longest part of the loading sequence (plugin activation).\n if (stage < 2) {\n return null;\n }\n\n const logoClassName = mx(\n 'h-[300px] w-[300px] scale-600 transition-all duration-500 ease-in-out filter grayscale opacity-0',\n stage >= 1 && 'scale-100 grayscale-0 opacity-70',\n stage >= 2 && 'scale-50 opacity-0',\n );\n\n return (\n <ThemeProvider tx={defaultTx}>\n <div className='relative dx-container h-dvh flex flex-col'>\n <div className='flex flex-col grow justify-center items-center'>\n {typeof logo === 'function' ? (\n logo({ className: logoClassName })\n ) : logo ? (\n <div className={logoClassName}>{logo}</div>\n ) : null}\n </div>\n </div>\n </ThemeProvider>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,OAAOA,UAAiCC,aAAAA,kBAAiB;;;ACAzD,SAASC,uBAAuB;AAChC,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,OAAOC,SAAkBC,aAAaC,WAAWC,SAASC,QAAQC,gBAAgB;AAElF,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,eAAeC,qBAAyC;AACjE,SAASC,gBAAgBC,uBAAuB;AAChD,SAASC,+BAA+B;AAOxC,IAAA,eAAMC;;AAsGEC,IAAAA,SAAWC,CAAAA,EAAAA,eAAgBC,cAAsB,kBAAA,gBAAA,wBAAA,SAAA,aAAA,UAAA,cAAA,aAAA,iBAAA,aAAA,WAAA,eAAA,eAAA,OAAA,WAAA,OAAA,WAAA,GAAA,UAAA,IAAA,MAAA;AACvD,QAAMC,UAAAA,gBAAcF,aAAgBG,MAAAA,CAAAA,CAAAA;AAEpC,QAAMC,WAAAA,gBAEFC,cAAAA,MAAAA,CAAAA,CACC;sBAESC,gBAAiBC,iBAAiBD,MAAOE,CAAAA,CAAAA;uBAC/CC,QAAUH,MAAS,qBAAoBI,CAAI,OAAA,YAAA,MAAA;AAC3C,UAAA,SAAO,QAAA,KAAA,CAAAJ,YAAAA,QAAA,KAAA,O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A;AACR,WAAO,MAAA;AACL,UAAIsB,SAASC,WAAW,GAAc;AACpCT,eAAOC,cAAcM,QAAAA;MACvB;IACF;EACF,GAAG,CAAA,CAAE;AAML,MAAId,QAAQ,GAAG;AACb,WAAO;EACT;AAEA,QAAMiB,gBAAgBnB,GACpB,oGACAE,SAAS,KAAK,oCACdA,SAAS,KAAK,oBAAA;AAGhB,SACE,gBAAAR,OAAA,cAACI,eAAAA;IAAcsB,IAAIrB;KACjB,gBAAAL,OAAA,cAAC2B,OAAAA;IAAIC,WAAU;KACb,gBAAA5B,OAAA,cAAC2B,OAAAA;IAAIC,WAAU;KACZ,OAAOlB,SAAS,aACfA,KAAK;IAAEkB,WAAWH;EAAc,CAAA,IAC9Bf,OACF,gBAAAV,OAAA,cAAC2B,OAAAA;IAAIC,WAAWH;KAAgBf,IAAAA,IAC9B,IAAA,CAAA,CAAA;AAKd;",
6
+ "names": ["React", "useEffect", "RegistryContext", "Effect", "Fiber", "PubSub", "Queue", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "runAndForwardErrors", "invariant", "log", "ErrorBoundary", "ErrorFallback", "useAsyncEffect", "useDefaultValue", "ContextProtocolProvider", "ENABLED_KEY", "defaults", "useDefaultValue", "defaultsProp", "setupEvents", "setupEventsProp", "pluginLoader", "pluginLoaderProp", "plugin", "find", "meta", "invariant", "id", "plugins", "errorRef", "useRef", "error", "setError", "useState", "startupProgress", "setStartupProgress", "activated", "total", "progress", "safeMode", "cacheEnabled", "cached", "pluginManager", "enabled", "onRemove", "pluginRegistryProvider", "mgr", "onPluginRemove", "useEffect", "manager", "useAsyncEffect", "capabilities", "contribute", "interface", "Capabilities", "PluginManager", "implementation", "module", "registry", "fiber", "forkDaemon", "setReady", "readyRef", "current", "globalThis", "humanizedName", "humanizeModuleId", "length", "active", "event", "error$", "Effect", "forever", "activate", "ActivationEvents", "Startup", "join", "listener", "pipe", "timeoutId", "eventsFired", "getEventsFired", "activeModules", "pendingReset", "getPendingReset", "runAndForwardErrors", "Fiber", "Error", "timeout", "clearTimeout", "interrupt", "isExternalManager", "shutdown", "progressRef", "name", "FallbackComponent", "fallback", "value", "ContextProtocolProvider", "PluginManagerContext", "App", "placeholder", "ready", "debounce", "composer", "match", "parts", "pluginSlug", "moduleName", "pluginLabel", "split", "map", "word", "useAtomValue", "useCallback", "invariant", "__dxlog_file", "useAtomValue", "capabilities", "interfaceDef", "invariant", "atom", "useCapability", "atomCapability", "value", "update", "fn", "registry", "set", "useCallback", "useEffect", "useRef", "useState", "LoadingState", "useLoading", "ready", "debounce", "stage", "setStage", "readyRef", "current", "i", "setInterval", "isReady", "clearInterval", "Effect", "use", "useCallback", "useMemo", "ServiceResolver", "unwrapExit", "useProcessManagerRuntime", "useCapability", "Capabilities", "ProcessManagerRuntime", "useSpaceCallback", "spaceId", "tags", "fn", "deps", "runtime", "useCallback", "undefined", "TypeError", "layer", "ServiceResolver", "provide", "space", "runPromise", "pipe", "useSpaceService", "tag", "promise", "useMemo", "effect", "flatMap", "service", "succeed", "runPromiseExit", "unwrapExit", "use", "RegistryContext", "useAtomValue", "useCallback", "useContext", "useSettingsState", "atom", "registry", "settings", "updateSettings", "fn", "set", "get", "FIRST_INTERACTIVE_MARK", "App", "placeholder", "Placeholder", "ready", "error", "debounce", "progress", "reactContexts", "useCapabilities", "Capabilities", "ReactContext", "reactRoots", "ReactRoot", "stage", "useLoading", "placeholderDismissed", "LoadingState", "Done", "useEffect", "performance", "getEntriesByName", "length", "mark", "window", "__bootLoader", "dismiss", "React", "ComposedContext", "composeContexts", "map", "id", "root", "Component", "key", "contexts", "children", "topologicalSort", "context", "reduce", "Acc", "Next", "React", "useEffect", "useLayoutEffect", "useRef", "ThemeProvider", "defaultTx", "mx", "Placeholder", "stage", "progress", "logo", "location", "search", "Error", "fraction", "window", "__bootLoader", "humanizedName", "status", "event", "module", "humanized", "dismiss", "stageRef", "current", "logoClassName", "tx", "div", "className"]
7
+ }
@@ -0,0 +1,29 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ activation_event_exports
4
+ } from "./chunk-XOCUANHO.mjs";
5
+ import {
6
+ __export
7
+ } from "./chunk-HSLMI22Q.mjs";
8
+
9
+ // src/common/activation-events.ts
10
+ var activation_events_exports = {};
11
+ __export(activation_events_exports, {
12
+ ProcessManagerReady: () => ProcessManagerReady,
13
+ SetupProcessManager: () => SetupProcessManager,
14
+ SetupReactSurface: () => SetupReactSurface,
15
+ Startup: () => Startup
16
+ });
17
+ var Startup = activation_event_exports.make("org.dxos.app-framework.event.startup");
18
+ var SetupReactSurface = activation_event_exports.make("org.dxos.app-framework.event.setup-react-surface");
19
+ var SetupProcessManager = activation_event_exports.make("org.dxos.app-framework.event.setup-process-manager");
20
+ var ProcessManagerReady = activation_event_exports.make("org.dxos.app-framework.event.process-manager-ready");
21
+
22
+ export {
23
+ Startup,
24
+ SetupReactSurface,
25
+ SetupProcessManager,
26
+ ProcessManagerReady,
27
+ activation_events_exports
28
+ };
29
+ //# sourceMappingURL=chunk-KFZEB6BV.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/common/activation-events.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent as ActivationEvent$ } from '../core';\n\n/**\n * Fired when the app is started.\n */\nexport const Startup = ActivationEvent$.make('org.dxos.app-framework.event.startup');\n\n//\n// Dependent Events\n//\n\n/**\n * Fired to load any newly available surfaces.\n */\nexport const SetupReactSurface = ActivationEvent$.make('org.dxos.app-framework.event.setup-react-surface');\n\n/**\n * Fired before the process manager is created.\n * Plugins should contribute their {@link Capabilities.LayerSpec} entries and\n * {@link Capabilities.OperationHandler} sets before this event fires so the\n * process manager's {@link ServiceResolver} and {@link OperationInvoker} pick\n * them up at construction time.\n */\nexport const SetupProcessManager = ActivationEvent$.make('org.dxos.app-framework.event.setup-process-manager');\n\n//\n// Triggered Events\n//\n\n/**\n * Fired after the process manager runtime is ready and its derived capabilities\n * (`ProcessManagerRuntime`, `ServiceResolver`, `ProcessMonitor`, `OperationInvoker`)\n * have been contributed.\n */\nexport const ProcessManagerReady = ActivationEvent$.make('org.dxos.app-framework.event.process-manager-ready');\n"],
5
+ "mappings": ";;;;;;;;;AAAA;;;;;;;AASO,IAAMA,UAAUC,yBAAiBC,KAAK,sCAAA;AAStC,IAAMC,oBAAoBF,yBAAiBC,KAAK,kDAAA;AAShD,IAAME,sBAAsBH,yBAAiBC,KAAK,oDAAA;AAWlD,IAAMG,sBAAsBJ,yBAAiBC,KAAK,oDAAA;",
6
+ "names": ["Startup", "ActivationEvent$", "make", "SetupReactSurface", "SetupProcessManager", "ProcessManagerReady"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  capabilities_exports
4
- } from "./chunk-WFSRZKBP.mjs";
4
+ } from "./chunk-PW2VYGOS.mjs";
5
5
 
6
6
  // src/helpers.ts
7
7
  var topologicalSort = (nodes) => {
@@ -95,7 +95,6 @@ var SurfaceInfo = /* @__PURE__ */ forwardRef(({ children }, forwardedRef) => {
95
95
  const padding = 0;
96
96
  return /* @__PURE__ */ React.createElement(React.Fragment, null, childWithRef, rect && /* @__PURE__ */ createPortal(
97
97
  /* @__PURE__ */ React.createElement("div", {
98
- role: "none",
99
98
  className: "z-[100] fixed flex flex-col-reverse scrollbar-none overflow-auto pointer-events-none",
100
99
  style: {
101
100
  top: rect.top + padding,
@@ -365,7 +364,6 @@ var SurfaceContextProvider = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
365
364
  ],
366
365
  FallbackComponent: fallback
367
366
  }, /* @__PURE__ */ React3.createElement("div", {
368
- role: "none",
369
367
  className: "contents",
370
368
  "data-id": id,
371
369
  "data-role": role
@@ -397,7 +395,6 @@ var SurfaceContextProvider = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
397
395
  ],
398
396
  FallbackComponent: fallback
399
397
  }, /* @__PURE__ */ React3.createElement("div", {
400
- role: "none",
401
398
  className: "contents",
402
399
  "data-id": id,
403
400
  "data-role": role
@@ -421,7 +418,7 @@ var SurfaceComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id: _
421
418
  if (DEBUG) {
422
419
  log.warn("Surface has neither `role` nor `type` prop", {
423
420
  id: _id
424
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 196, S: void 0 });
421
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 194, S: void 0 });
425
422
  }
426
423
  return null;
427
424
  }
@@ -434,7 +431,7 @@ var SurfaceComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id: _
434
431
  log.warn("no candidates for surface", {
435
432
  role: effectiveRole,
436
433
  data
437
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 209, S: void 0 });
434
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 207, S: void 0 });
438
435
  return null;
439
436
  }
440
437
  return /* @__PURE__ */ React3.createElement(Suspense, {
@@ -582,4 +579,4 @@ export {
582
579
  SurfaceComponent,
583
580
  Surface
584
581
  };
585
- //# sourceMappingURL=chunk-WKTLE7MG.mjs.map
582
+ //# sourceMappingURL=chunk-LJNUFNDO.mjs.map