@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
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -18,4 +18,4 @@ pnpm i @dxos/app-framework
18
18
 
19
19
  Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
20
20
 
21
- License: [MIT](./LICENSE) Copyright 2022 © DXOS
21
+ License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2022 © DXOS
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  make,
3
3
  make2
4
- } from "./chunk-ZGJAZSNE.mjs";
5
- import "./chunk-23D4SJUE.mjs";
4
+ } from "./chunk-BRK6GYNB.mjs";
5
+ import "./chunk-KFDF7KR3.mjs";
6
6
  import {
7
7
  capabilities_exports
8
- } from "./chunk-WBHCSOBW.mjs";
9
- import "./chunk-45CHLTBV.mjs";
8
+ } from "./chunk-5AHASNDW.mjs";
9
+ import "./chunk-5GY3YOEL.mjs";
10
10
  import "./chunk-FO3IYSLV.mjs";
11
- import "./chunk-CZ4BIAHH.mjs";
12
- import "./chunk-NBXPP7JR.mjs";
11
+ import "./chunk-KLHQNYJ2.mjs";
12
+ import "./chunk-VJ5PFAWC.mjs";
13
13
  import "./chunk-66IXTIVK.mjs";
14
- import "./chunk-Z55LVAGN.mjs";
14
+ import "./chunk-SLX73WRZ.mjs";
15
15
  import {
16
16
  capability_exports
17
- } from "./chunk-3JWJXGLK.mjs";
17
+ } from "./chunk-IW44C7UL.mjs";
18
18
  import "./chunk-J5LGTIGS.mjs";
19
19
 
20
- // src/plugin-operation/history/capability.ts
20
+ // src/plugin-process-manager/history/capability.ts
21
21
  import * as Effect from "effect/Effect";
22
22
  var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
23
23
  const capabilities = yield* capability_exports.Service;
@@ -32,4 +32,4 @@ var capability_default = capability_exports.makeModule(Effect.fnUntraced(functio
32
32
  export {
33
33
  capability_default as default
34
34
  };
35
- //# sourceMappingURL=capability-5RRH3WIB.mjs.map
35
+ //# sourceMappingURL=capability-K5XIVCQU.mjs.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/plugin-operation/history/capability.ts"],
3
+ "sources": ["../../../src/plugin-process-manager/history/capability.ts"],
4
4
  "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationInvoker } from '@dxos/operation';\n\nimport { Capabilities } from '../../common';\nimport { Capability } from '../../core';\nimport * as HistoryTracker from './history-tracker';\nimport * as UndoRegistry from './undo-registry';\n\n//\n// Capability Module - contributes both UndoRegistry and HistoryTracker.\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the context for synchronous access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // Create UndoRegistry.\n const undoRegistry = UndoRegistry.make(() => capabilities.getAll(Capabilities.UndoMapping).flat());\n\n // Create HistoryTracker (depends on UndoRegistry and OperationInvoker).\n const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n // Cast to internal type - the factory always returns OperationInvokerInternal.\n const historyTracker = HistoryTracker.make(invoker as OperationInvoker.OperationInvokerInternal, undoRegistry);\n\n return [\n Capability.contributes(Capabilities.UndoRegistry, undoRegistry),\n Capability.contributes(Capabilities.HistoryTracker, historyTracker),\n ];\n }),\n);\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAaxB,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,mBAAWI;AAGvC,QAAMC,eAA4BC,KAAK,MAAMH,aAAaI,OAAOC,qBAAaC,WAAW,EAAEC,KAAI,CAAA;AAG/F,QAAMC,UAAU,OAAOX,mBAAWY,IAAIJ,qBAAaK,gBAAgB;AAEnE,QAAMC,iBAAgCR,MAAKK,SAAsDN,YAAAA;AAEjG,SAAO;IACLL,mBAAWe,YAAYP,qBAAaQ,cAAcX,YAAAA;IAClDL,mBAAWe,YAAYP,qBAAaS,gBAAgBH,cAAAA;;AAExD,CAAA,CAAA;",
6
6
  "names": ["Effect", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "undoRegistry", "make", "getAll", "Capabilities", "UndoMapping", "flat", "invoker", "get", "OperationInvoker", "historyTracker", "contributes", "UndoRegistry", "HistoryTracker"]
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  capability_exports
3
- } from "./chunk-3JWJXGLK.mjs";
3
+ } from "./chunk-IW44C7UL.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
@@ -12,14 +12,19 @@ __export(capabilities_exports, {
12
12
  Command: () => Command,
13
13
  HistoryTracker: () => HistoryTracker,
14
14
  Layer: () => Layer,
15
+ LayerSpec: () => LayerSpec,
15
16
  ManagedRuntime: () => ManagedRuntime,
16
17
  Null: () => Null,
17
18
  OperationHandler: () => OperationHandler,
18
19
  OperationInvoker: () => OperationInvoker,
19
20
  PluginManager: () => PluginManager,
21
+ ProcessManagerRuntime: () => ProcessManagerRuntime,
22
+ ProcessMonitor: () => ProcessMonitor,
20
23
  ReactContext: () => ReactContext,
21
24
  ReactRoot: () => ReactRoot,
22
25
  ReactSurface: () => ReactSurface,
26
+ ServiceResolver: () => ServiceResolver,
27
+ TraceSink: () => TraceSink,
23
28
  UndoMapping: () => UndoMapping,
24
29
  UndoRegistry: () => UndoRegistry,
25
30
  getAtomValue: () => getAtomValue,
@@ -35,6 +40,11 @@ var ReactRoot = capability_exports.make("org.dxos.app-framework.capability.react
35
40
  var ReactSurface = capability_exports.make("org.dxos.app-framework.common.react-surface");
36
41
  var Command = capability_exports.make("org.dxos.app-framework.capability.command");
37
42
  var Layer = capability_exports.make("org.dxos.app-framework.capability.layer");
43
+ var LayerSpec = capability_exports.make("org.dxos.app-framework.capability.layer-spec");
44
+ var TraceSink = capability_exports.make("org.dxos.app-framework.capability.trace-sink");
45
+ var ServiceResolver = capability_exports.make("org.dxos.app-framework.capability.service-resolver");
46
+ var ProcessMonitor = capability_exports.make("org.dxos.app-framework.capability.process-monitor");
47
+ var ProcessManagerRuntime = capability_exports.make("org.dxos.app-framework.capability.process-manager-runtime");
38
48
  var ManagedRuntime = capability_exports.make("org.dxos.app-framework.capability.managed-runtime");
39
49
  var OperationHandler = capability_exports.make("org.dxos.app-framework.capability.operation-handler");
40
50
  var UndoMapping = capability_exports.make("org.dxos.app-framework.capability.undo-mapping");
@@ -66,6 +76,11 @@ export {
66
76
  ReactSurface,
67
77
  Command,
68
78
  Layer,
79
+ LayerSpec,
80
+ TraceSink,
81
+ ServiceResolver,
82
+ ProcessMonitor,
83
+ ProcessManagerRuntime,
69
84
  ManagedRuntime,
70
85
  OperationHandler,
71
86
  UndoMapping,
@@ -77,4 +92,4 @@ export {
77
92
  subscribeAtom,
78
93
  capabilities_exports
79
94
  };
80
- //# sourceMappingURL=chunk-WBHCSOBW.mjs.map
95
+ //# sourceMappingURL=chunk-5AHASNDW.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/common/capabilities.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, type Registry } from '@effect-atom/atom-react';\nimport type * as Command$ from '@effect/cli/Command';\nimport * as Effect from 'effect/Effect';\nimport type * as Exit$ from 'effect/Exit';\nimport type * as Fiber$ from 'effect/Fiber';\nimport type * as Layer$ from 'effect/Layer';\nimport type * as ManagedRuntime$ from 'effect/ManagedRuntime';\nimport type * as Runtime$ from 'effect/Runtime';\nimport type { FC, PropsWithChildren } from 'react';\n\nimport type {\n LayerSpec as LayerSpec$,\n Operation as Operation$,\n OperationHandlerSet,\n Process as Process$,\n ServiceResolver as ServiceResolver$,\n Trace as Trace$,\n} from '@dxos/compute';\nimport type { ProcessManager as ProcessManager$ } from '@dxos/compute-runtime';\nimport { OperationInvoker as OperationInvoker$ } from '@dxos/operation';\n\nimport { Capability as Capability$, Plugin as Plugin$, type PluginManager as PluginManager$ } from '../core';\nimport type {\n HistoryTracker as HistoryTracker$,\n UndoMapping as UndoMapping$,\n UndoRegistry as UndoRegistry$,\n} from '../plugin-process-manager';\nimport type { Surface } from '../ui';\n\n/**\n * Null capability.\n * @category Capability\n */\nexport const Null = Capability$.make<null>('org.dxos.app-framework.capability.null');\n\n/**\n * @category Capability\n */\nexport const PluginManager = Capability$.make<PluginManager$.PluginManager>(\n 'org.dxos.app-framework.capability.plugin-manager',\n);\n\n/**\n * @category Capability\n */\nexport const AtomRegistry = Capability$.make<Registry.Registry>('org.dxos.app-framework.capability.atom-registry');\n\nexport type ReactContext = Readonly<{\n id: string;\n dependsOn?: string[];\n context: FC<PropsWithChildren>;\n}>;\n\n/**\n * @category Capability\n */\nexport const ReactContext = Capability$.make<ReactContext>('org.dxos.app-framework.capability.react-context');\n\nexport type ReactRoot = Readonly<{ id: string; root: FC<PropsWithChildren> }>;\n\n/**\n * @category Capability\n */\nexport const ReactRoot = Capability$.make<ReactRoot>('org.dxos.app-framework.capability.react-root');\n\n/**\n * Surface definitions that can be either React components or Web Components.\n */\nexport type ReactSurface = Surface.Definition | readonly Surface.Definition[];\n\n/**\n * @category Capability\n */\nexport const ReactSurface = Capability$.make<ReactSurface>('org.dxos.app-framework.common.react-surface');\n\nexport type AnyCommand = Command$.Command<any, any, any, any>;\n\n/**\n * @category Capability\n */\nexport const Command = Capability$.make<AnyCommand>('org.dxos.app-framework.capability.command');\n\n/**\n * @category Capability\n */\nexport const Layer = Capability$.make<Layer$.Layer<any, any, any>>('org.dxos.app-framework.capability.layer');\n\n/**\n * Layer specification contributed by plugins.\n *\n * Plugins contribute {@link LayerSpec.LayerSpec} entries that are collected by the\n * process-manager module and composed into a {@link LayerStack} which backs the\n * {@link ProcessManagerRuntime}'s service resolver.\n *\n * @category Capability\n */\nexport const LayerSpec = Capability$.make<LayerSpec$.LayerSpec>('org.dxos.app-framework.capability.layer-spec');\n\n/**\n * Context passed to {@link TraceSinkFactory} implementations when the\n * process-manager capability materialises contributed sinks.\n */\nexport interface TraceSinkFactoryContext {\n /**\n * Service resolver backing the shared {@link ProcessManagerRuntime}. Use it\n * to resolve per-space (or per-process) services like `FeedTraceSink` when\n * building a routing sink.\n */\n readonly resolver: ServiceResolver$.ServiceResolver;\n}\n\n/**\n * Factory that builds a {@link Trace$.Sink} when the process-manager\n * capability is ready. Plugins that only need a static sink can ignore the\n * context (e.g. `() => myConsoleSink`); plugins that need per-space routing\n * can use {@link TraceSinkFactoryContext.resolver} to look up services.\n */\nexport type TraceSinkFactory = (ctx: TraceSinkFactoryContext) => Trace$.Sink;\n\n/**\n * Trace sink contribution.\n *\n * Plugins contribute {@link TraceSinkFactory} functions; the process-manager\n * capability invokes each factory with the runtime's\n * {@link ServiceResolver$.ServiceResolver}, collects the resulting\n * {@link Trace$.Sink}s, merges them via {@link Trace$.mergeSinks}, and\n * installs the merged sink as {@link Trace$.TraceSink} in the runtime layer\n * so every process writes to every contributed sink.\n *\n * @category Capability\n */\nexport const TraceSink = Capability$.make<TraceSinkFactory>('org.dxos.app-framework.capability.trace-sink');\n\n/**\n * Service resolver backing the shared {@link ProcessManagerRuntime}.\n *\n * Contributed by the process-manager capability module. Consumers can combine\n * it with {@link ServiceResolver$.provide} to build space-scoped layers without\n * having to go through the process-manager runtime:\n *\n * @example\n * ```ts\n * const resolver = yield* Capability.get(Capabilities.ServiceResolver);\n * yield* effect.pipe(\n * Effect.provide(\n * ServiceResolver.provide({ space }, Database.Service, QueueService).pipe(\n * Layer.provide(Layer.succeed(ServiceResolver.ServiceResolver, resolver)),\n * ),\n * ),\n * );\n * ```\n *\n * @category Capability\n */\nexport const ServiceResolver = Capability$.make<ServiceResolver$.ServiceResolver>(\n 'org.dxos.app-framework.capability.service-resolver',\n);\n\n/**\n * Process monitor backing the shared {@link ProcessManagerRuntime}. Exposes the\n * live process tree (including inactive/terminated entries) via\n * {@link Process$.Monitor#processTreeAtom}.\n *\n * @category Capability\n */\nexport const ProcessMonitor = Capability$.make<Process$.Monitor>('org.dxos.app-framework.capability.process-monitor');\n\n/**\n * Services that are always available when running effects through a {@link ProcessManagerRuntime}.\n */\nexport type ProcessManagerRuntimeServices =\n | Capability$.Service\n | Plugin$.Service\n | ProcessManager$.ProcessManagerService\n | Operation$.Service\n | ProcessManager$.ProcessOperationInvoker.Service\n | ServiceResolver$.ServiceResolver;\n\n/**\n * Runtime that runs effects requiring a fixed set of capability-manager and\n * process-manager services.\n *\n * The shape mirrors {@link ManagedRuntime$.ManagedRuntime} but deliberately does\n * not expose `dispose` – lifecycle is driven by the host plugin manager.\n */\nexport interface ProcessManagerRuntime {\n runPromise<A, E>(\n effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,\n options?: { readonly signal?: AbortSignal },\n ): Promise<A>;\n runPromiseExit<A, E>(\n effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,\n options?: { readonly signal?: AbortSignal },\n ): Promise<Exit$.Exit<A, E>>;\n runFork<A, E>(\n effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,\n options?: Runtime$.RunForkOptions,\n ): Fiber$.RuntimeFiber<A, E>;\n runSync<A, E>(effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>): A;\n}\n\n/**\n * @category Capability\n */\nexport const ProcessManagerRuntime = Capability$.make<ProcessManagerRuntime>(\n 'org.dxos.app-framework.capability.process-manager-runtime',\n);\n\nexport type ManagedRuntime = ManagedRuntime$.ManagedRuntime<any, any>;\n\n/**\n * @category Capability\n */\nexport const ManagedRuntime = Capability$.make<ManagedRuntime>('org.dxos.app-framework.capability.managed-runtime');\n\n//\n// Operation System Capabilities\n//\n\nexport const OperationHandler = Capability$.make<OperationHandlerSet.OperationHandlerSet>(\n 'org.dxos.app-framework.capability.operation-handler',\n);\n\nexport type UndoMapping = UndoMapping$.UndoMapping;\n\n/**\n * Undo mapping registration - contributed by plugins.\n * @category Capability\n */\nexport const UndoMapping = Capability$.make<UndoMapping[]>('org.dxos.app-framework.capability.undo-mapping');\n\n/**\n * Operation invoker backed by the process manager. Spawns a process per\n * operation invocation; see {@link ProcessManager$.ProcessOperationInvoker}.\n */\nexport type OperationInvoker = OperationInvoker$.OperationInvoker;\n\n/**\n * Operation invoker - provided by the process-manager capability.\n * @category Capability\n */\nexport const OperationInvoker = Capability$.make<OperationInvoker>(\n 'org.dxos.app-framework.capability.operation-invoker',\n);\n\nexport type UndoRegistry = UndoRegistry$.UndoRegistry;\n\n/**\n * Undo registry - provided by ProcessManagerPlugin.\n * @category Capability\n */\nexport const UndoRegistry = Capability$.make<UndoRegistry>('org.dxos.app-framework.capability.undo-registry');\n\nexport type HistoryTracker = HistoryTracker$.HistoryTracker;\n\n/**\n * History tracker - provided by ProcessManagerPlugin.\n * @category Capability\n */\nexport const HistoryTracker = Capability$.make<HistoryTracker>('org.dxos.app-framework.capability.history-tracker');\n\n//\n// Atom Capability Helpers\n//\n\n/**\n * Get the current value of an atom capability.\n * @example const settings = yield* Capabilities.getAtomValue(ThreadCapabilities.Settings);\n */\nexport const getAtomValue = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Atom<T>>,\n): Effect.Effect<T, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n return registry.get(atom);\n });\n\n/**\n * Update an atom capability value (requires writable atom).\n * @example yield* Capabilities.updateAtomValue(ThreadCapabilities.Settings, (s) => ({ ...s, foo: true }));\n */\nexport const updateAtomValue = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Writable<T>>,\n fn: (current: T) => T,\n): Effect.Effect<void, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n registry.set(atom, fn(registry.get(atom)));\n });\n\n/**\n * Subscribe to an atom capability.\n * @example const unsubscribe = yield* Capabilities.subscribeAtom(ThreadCapabilities.Settings, (value) => ...);\n */\nexport const subscribeAtom = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Atom<T>>,\n callback: (value: T) => void,\n): Effect.Effect<() => void, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n return registry.subscribe(atom, () => callback(registry.get(atom)));\n });\n"],
5
+ "mappings": ";;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,YAAY;AA+BjB,IAAMC,OAAOC,mBAAYC,KAAW,wCAAA;AAKpC,IAAMC,gBAAgBF,mBAAYC,KACvC,kDAAA;AAMK,IAAME,eAAeH,mBAAYC,KAAwB,iDAAA;AAWzD,IAAMG,eAAeJ,mBAAYC,KAAmB,iDAAA;AAOpD,IAAMI,YAAYL,mBAAYC,KAAgB,8CAAA;AAU9C,IAAMK,eAAeN,mBAAYC,KAAmB,6CAAA;AAOpD,IAAMM,UAAUP,mBAAYC,KAAiB,2CAAA;AAK7C,IAAMO,QAAQR,mBAAYC,KAAkC,yCAAA;AAW5D,IAAMQ,YAAYT,mBAAYC,KAA2B,8CAAA;AAmCzD,IAAMS,YAAYV,mBAAYC,KAAuB,8CAAA;AAuBrD,IAAMU,kBAAkBX,mBAAYC,KACzC,oDAAA;AAUK,IAAMW,iBAAiBZ,mBAAYC,KAAuB,mDAAA;AAuC1D,IAAMY,wBAAwBb,mBAAYC,KAC/C,2DAAA;AAQK,IAAMa,iBAAiBd,mBAAYC,KAAqB,mDAAA;AAMxD,IAAMc,mBAAmBf,mBAAYC,KAC1C,qDAAA;AASK,IAAMe,cAAchB,mBAAYC,KAAoB,gDAAA;AAYpD,IAAMgB,mBAAmBjB,mBAAYC,KAC1C,qDAAA;AASK,IAAMiB,eAAelB,mBAAYC,KAAmB,iDAAA;AAQpD,IAAMkB,iBAAiBnB,mBAAYC,KAAqB,mDAAA;AAUxD,IAAMmB,eAAe,CAC1BC,mBAEOC,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOvB,mBAAYwB,IAAIrB,YAAAA;AACxC,QAAMsB,OAAO,OAAOzB,mBAAYwB,IAAIH,cAAAA;AACpC,SAAOE,SAASC,IAAIC,IAAAA;AACtB,CAAA;AAMK,IAAMC,kBAAkB,CAC7BL,gBACAM,OAEOL,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOvB,mBAAYwB,IAAIrB,YAAAA;AACxC,QAAMsB,OAAO,OAAOzB,mBAAYwB,IAAIH,cAAAA;AACpCE,WAASK,IAAIH,MAAME,GAAGJ,SAASC,IAAIC,IAAAA,CAAAA,CAAAA;AACrC,CAAA;AAMK,IAAMI,gBAAgB,CAC3BR,gBACAS,aAEOR,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOvB,mBAAYwB,IAAIrB,YAAAA;AACxC,QAAMsB,OAAO,OAAOzB,mBAAYwB,IAAIH,cAAAA;AACpC,SAAOE,SAASQ,UAAUN,MAAM,MAAMK,SAASP,SAASC,IAAIC,IAAAA,CAAAA,CAAAA;AAC9D,CAAA;",
6
+ "names": ["Effect", "Null", "Capability$", "make", "PluginManager", "AtomRegistry", "ReactContext", "ReactRoot", "ReactSurface", "Command", "Layer", "LayerSpec", "TraceSink", "ServiceResolver", "ProcessMonitor", "ProcessManagerRuntime", "ManagedRuntime", "OperationHandler", "UndoMapping", "OperationInvoker", "UndoRegistry", "HistoryTracker", "getAtomValue", "atomCapability", "gen", "registry", "get", "atom", "updateAtomValue", "fn", "set", "subscribeAtom", "callback", "subscribe"]
7
+ }
@@ -0,0 +1,28 @@
1
+ import {
2
+ activation_event_exports
3
+ } from "./chunk-66IXTIVK.mjs";
4
+ import {
5
+ __export
6
+ } from "./chunk-J5LGTIGS.mjs";
7
+
8
+ // src/common/activation-events.ts
9
+ var activation_events_exports = {};
10
+ __export(activation_events_exports, {
11
+ ProcessManagerReady: () => ProcessManagerReady,
12
+ SetupProcessManager: () => SetupProcessManager,
13
+ SetupReactSurface: () => SetupReactSurface,
14
+ Startup: () => Startup
15
+ });
16
+ var Startup = activation_event_exports.make("org.dxos.app-framework.event.startup");
17
+ var SetupReactSurface = activation_event_exports.make("org.dxos.app-framework.event.setup-react-surface");
18
+ var SetupProcessManager = activation_event_exports.make("org.dxos.app-framework.event.setup-process-manager");
19
+ var ProcessManagerReady = activation_event_exports.make("org.dxos.app-framework.event.process-manager-ready");
20
+
21
+ export {
22
+ Startup,
23
+ SetupReactSurface,
24
+ SetupProcessManager,
25
+ ProcessManagerReady,
26
+ activation_events_exports
27
+ };
28
+ //# sourceMappingURL=chunk-5GY3YOEL.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,16 +1,16 @@
1
1
  import {
2
2
  UndoOperation
3
- } from "./chunk-23D4SJUE.mjs";
3
+ } from "./chunk-KFDF7KR3.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
7
7
 
8
- // src/plugin-operation/history/errors.ts
8
+ // src/plugin-process-manager/history/errors.ts
9
9
  import { BaseError } from "@dxos/errors";
10
10
  var EmptyHistoryError = class extends BaseError.extend("EmptyHistoryError", "Cannot undo: history is empty.") {
11
11
  };
12
12
 
13
- // src/plugin-operation/history/undo-mapping.ts
13
+ // src/plugin-process-manager/history/undo-mapping.ts
14
14
  var undo_mapping_exports = {};
15
15
  __export(undo_mapping_exports, {
16
16
  make: () => make,
@@ -27,7 +27,7 @@ var resolveMessage = (message, input, output) => {
27
27
  return message;
28
28
  };
29
29
 
30
- // src/plugin-operation/history/undo-registry.ts
30
+ // src/plugin-process-manager/history/undo-registry.ts
31
31
  var undo_registry_exports = {};
32
32
  __export(undo_registry_exports, {
33
33
  make: () => make2
@@ -50,7 +50,7 @@ var make2 = (getMappings) => {
50
50
  };
51
51
  };
52
52
 
53
- // src/plugin-operation/history/history-tracker.ts
53
+ // src/plugin-process-manager/history/history-tracker.ts
54
54
  var history_tracker_exports = {};
55
55
  __export(history_tracker_exports, {
56
56
  make: () => make3
@@ -59,7 +59,7 @@ import * as Effect from "effect/Effect";
59
59
  import * as Stream from "effect/Stream";
60
60
  import { runAndForwardErrors } from "@dxos/effect";
61
61
  import { log } from "@dxos/log";
62
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/plugin-operation/history/history-tracker.ts";
62
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/plugin-process-manager/history/history-tracker.ts";
63
63
  var HISTORY_LIMIT = 100;
64
64
  var make3 = (invoker, undoRegistry) => {
65
65
  const history = [];
@@ -139,4 +139,4 @@ export {
139
139
  make3 as make2,
140
140
  history_tracker_exports
141
141
  };
142
- //# sourceMappingURL=chunk-ZGJAZSNE.mjs.map
142
+ //# sourceMappingURL=chunk-BRK6GYNB.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;QAEJ,mBAAc,CAAA,UAAA;UACZ,UAAA,aAAA,OAAA,MAAmC,SAAA;QACnC,CAAA,SAAA;AAGF;IACA;UACE,eAAA,QAAA,cAAA,MAAA,OAAA,MAAA,MAAA;QACAC,iBAAI,QAAA;AAA0D,UAAA,0BAAA;QAC9D,KAAA,MAAA,UAAA,KAAA;MACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;AAEA;;UAEEC,QAAOC;MACPC,WAAQD,MAAMC;MACdC,OAAAA,MAASC;MACTC,QAAAA,MAAAA;MACAC,SAAAA,QAAiBA;MACnB;MAEAC,WAAaC,MAAAA;IACbT;YAA6BU,KAAKR,KAAMS;QAAoBC,uBAAuBC;MAAO,KAAA,MAAA,UAAA,KAAA;MAE1F,eAAA,QAAA;IACA,GAAA,EAAA,YAAYA,YAAShB,GAAAA,cAAe,GAAA,IAAA,GAAA,OAAA,CAAA;AAEpC,QAAA,QAAA,SAAA,eAAA;AAEA,cAAA,OAAA,GAAA,QAAA,SAAA,aAAA;IACA;UAGIiB,kBAASC,eAAAA,QAAAA,SAAAA,MAAAA,OAAAA,MAAAA,MAAAA;AACX,IAAA,eAAA,QAAA,OAAA,cAAA,UAAA;MAEJ,SAAA;IAEA,CAAA,CAAA;EACAC;EAOE,eAAkB,kBAAA,QAAA,WAAA,EAAA,KAAA,kBAAA,CAAA,UAAA,YAAA,MAAA,iBAAA,KAAA,CAAA,CAAA,CAAA,CAAA;eAChB,MAAMP;WACDA,WAAO,aAAA;YACV,QAAO,QAAOO,IAAOC;AACvB,UAAA,CAAA,OAAA;AAEI,eAAA,OAAqB,YAAA,IAAA,kBAAA,CAAA;;UAAiCC,qBAAkBd;QAAiB,KAAA,MAAA,UAAA,KAAA;QAE7F,YAAA,MAAA,QAAA,KAAA;MACA,GAAA,EAAA,YAAOe,YAAQC,GAAYX,cAAa,GAAEA,IAAAA,GAAAA,KAAMH,CAAAA;aAExBI,QAAWC,YAAUU,MAAQ,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"]
@@ -7,6 +7,7 @@ var capability_exports = {};
7
7
  __export(capability_exports, {
8
8
  ModuleTag: () => ModuleTag,
9
9
  Service: () => Service,
10
+ asLayer: () => asLayer,
10
11
  atom: () => atom,
11
12
  atomByModule: () => atomByModule,
12
13
  contributes: () => contributes,
@@ -20,6 +21,7 @@ __export(capability_exports, {
20
21
  });
21
22
  import * as Context from "effect/Context";
22
23
  import * as Effect from "effect/Effect";
24
+ import * as Layer from "effect/Layer";
23
25
  var Service = class extends Context.Tag("@dxos/app-framework/CapabilityManager")() {
24
26
  };
25
27
  var get = (interfaceDef) => Effect.flatMap(Service, (manager) => Effect.try({
@@ -30,6 +32,7 @@ var getAll = (interfaceDef) => Effect.map(Service, (manager) => manager.getAll(i
30
32
  var waitFor = (interfaceDef) => Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));
31
33
  var atom = (interfaceDef) => Effect.map(Service, (manager) => manager.atom(interfaceDef));
32
34
  var atomByModule = (interfaceDef) => Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));
35
+ var asLayer = (interfaceDef, tag) => Layer.effect(tag, get(interfaceDef).pipe(Effect.orDie));
33
36
  var ModuleTag = /* @__PURE__ */ Symbol.for("@dxos/app-framework/ModuleTag");
34
37
  var make = (identifier) => {
35
38
  return {
@@ -68,6 +71,7 @@ export {
68
71
  waitFor,
69
72
  atom,
70
73
  atomByModule,
74
+ asLayer,
71
75
  ModuleTag,
72
76
  make,
73
77
  contributes,
@@ -76,4 +80,4 @@ export {
76
80
  makeModule,
77
81
  capability_exports
78
82
  };
79
- //# sourceMappingURL=chunk-3JWJXGLK.mjs.map
83
+ //# sourceMappingURL=chunk-IW44C7UL.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
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  capability_exports
3
- } from "./chunk-3JWJXGLK.mjs";
3
+ } from "./chunk-IW44C7UL.mjs";
4
4
 
5
5
  // src/common/translations.ts
6
6
  import * as Schema from "effect/Schema";
@@ -39,4 +39,4 @@ export {
39
39
  Label,
40
40
  UndoOperation
41
41
  };
42
- //# sourceMappingURL=chunk-23D4SJUE.mjs.map
42
+ //# sourceMappingURL=chunk-KFDF7KR3.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isPlugin
3
- } from "./chunk-Z55LVAGN.mjs";
3
+ } from "./chunk-SLX73WRZ.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
@@ -419,4 +419,4 @@ export {
419
419
  uninstall,
420
420
  url_loader_exports
421
421
  };
422
- //# sourceMappingURL=chunk-CZ4BIAHH.mjs.map
422
+ //# sourceMappingURL=chunk-KLHQNYJ2.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  capabilities_exports
3
- } from "./chunk-WBHCSOBW.mjs";
3
+ } from "./chunk-5AHASNDW.mjs";
4
4
 
5
5
  // src/helpers.ts
6
6
  var topologicalSort = (nodes) => {
@@ -94,7 +94,6 @@ var SurfaceInfo = /* @__PURE__ */ forwardRef(({ children }, forwardedRef) => {
94
94
  const padding = 0;
95
95
  return /* @__PURE__ */ React.createElement(React.Fragment, null, childWithRef, rect && /* @__PURE__ */ createPortal(
96
96
  /* @__PURE__ */ React.createElement("div", {
97
- role: "none",
98
97
  className: "z-[100] fixed flex flex-col-reverse scrollbar-none overflow-auto pointer-events-none",
99
98
  style: {
100
99
  top: rect.top + padding,
@@ -364,7 +363,6 @@ var SurfaceContextProvider = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
364
363
  ],
365
364
  FallbackComponent: fallback
366
365
  }, /* @__PURE__ */ React3.createElement("div", {
367
- role: "none",
368
366
  className: "contents",
369
367
  "data-id": id,
370
368
  "data-role": role
@@ -396,7 +394,6 @@ var SurfaceContextProvider = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
396
394
  ],
397
395
  FallbackComponent: fallback
398
396
  }, /* @__PURE__ */ React3.createElement("div", {
399
- role: "none",
400
397
  className: "contents",
401
398
  "data-id": id,
402
399
  "data-role": role
@@ -420,7 +417,7 @@ var SurfaceComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id: _
420
417
  if (DEBUG) {
421
418
  log.warn("Surface has neither `role` nor `type` prop", {
422
419
  id: _id
423
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 196, S: void 0 });
420
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 194, S: void 0 });
424
421
  }
425
422
  return null;
426
423
  }
@@ -433,7 +430,7 @@ var SurfaceComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id: _
433
430
  log.warn("no candidates for surface", {
434
431
  role: effectiveRole,
435
432
  data
436
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 209, S: void 0 });
433
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 207, S: void 0 });
437
434
  return null;
438
435
  }
439
436
  return /* @__PURE__ */ React3.createElement(Suspense, {
@@ -581,4 +578,4 @@ export {
581
578
  SurfaceComponent,
582
579
  Surface
583
580
  };
584
- //# sourceMappingURL=chunk-MX5DKEJH.mjs.map
581
+ //# sourceMappingURL=chunk-QLML5QFJ.mjs.map