@dxos/app-framework 0.8.4-main.8360d9e660 → 0.8.4-main.8baae0fced
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.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/{capability-5OFLR7J4.mjs → capability-K5XIVCQU.mjs} +12 -11
- package/dist/lib/browser/capability-K5XIVCQU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WEBSGU5L.mjs → chunk-5AHASNDW.mjs} +20 -5
- package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-272IPLHQ.mjs → chunk-66IXTIVK.mjs} +3 -2
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JGWCBVKJ.mjs → chunk-BRK6GYNB.mjs} +14 -42
- package/dist/lib/browser/chunk-BRK6GYNB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TGX63LTL.mjs → chunk-FJ4765WW.mjs} +1 -1
- package/dist/lib/browser/{chunk-TGX63LTL.mjs.map → chunk-FJ4765WW.mjs.map} +2 -2
- package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YNFPIQGB.mjs → chunk-IW44C7UL.mjs} +9 -2
- package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TIEBZMTF.mjs → chunk-KFDF7KR3.mjs} +9 -11
- package/dist/lib/browser/{chunk-TIEBZMTF.mjs.map → chunk-KFDF7KR3.mjs.map} +3 -3
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs +422 -0
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs.map +7 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs +581 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GH3M2LIW.mjs → chunk-SLX73WRZ.mjs} +85 -15
- package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs +513 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs +1446 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +15 -30
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/common/activation-events.mjs +11 -14
- package/dist/lib/browser/common/capabilities.mjs +19 -8
- package/dist/lib/browser/core/activation-event.mjs +1 -1
- package/dist/lib/browser/core/capability.mjs +5 -1
- package/dist/lib/browser/core/plugin-manager.mjs +8 -4
- package/dist/lib/browser/core/plugin.mjs +12 -2
- package/dist/lib/browser/core/url-loader.mjs +24 -0
- package/dist/lib/browser/index.mjs +47 -49
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs +89 -0
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +164 -34
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/testing/react.mjs +78 -0
- package/dist/lib/browser/testing/react.mjs.map +7 -0
- package/dist/lib/browser/ui/index.mjs +24 -15
- package/dist/lib/node-esm/{capability-CRHZKL6T.mjs → capability-RLKFFLTB.mjs} +12 -11
- package/dist/lib/node-esm/capability-RLKFFLTB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs → chunk-37Z53PXZ.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs.map → chunk-37Z53PXZ.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-42UNAKYO.mjs +423 -0
- package/dist/lib/node-esm/chunk-42UNAKYO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LHCJGNXK.mjs → chunk-6S45OMUP.mjs} +85 -15
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3D66SZHP.mjs → chunk-BYHYYJZH.mjs} +14 -42
- package/dist/lib/node-esm/chunk-BYHYYJZH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SB5ODNPX.mjs → chunk-CTKEZHKF.mjs} +9 -2
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs +514 -0
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs +582 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SCDGIGGU.mjs → chunk-OUEMWPIW.mjs} +9 -11
- package/dist/lib/node-esm/{chunk-SCDGIGGU.mjs.map → chunk-OUEMWPIW.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-SQICGJBW.mjs → chunk-PW2VYGOS.mjs} +20 -5
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs +1447 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6REV5DE7.mjs → chunk-XOCUANHO.mjs} +3 -2
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +15 -30
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/common/activation-events.mjs +11 -14
- package/dist/lib/node-esm/common/capabilities.mjs +19 -8
- package/dist/lib/node-esm/core/activation-event.mjs +1 -1
- package/dist/lib/node-esm/core/capability.mjs +5 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
- package/dist/lib/node-esm/core/plugin.mjs +12 -2
- package/dist/lib/node-esm/core/url-loader.mjs +25 -0
- package/dist/lib/node-esm/index.mjs +47 -49
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs +90 -0
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +164 -34
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/testing/react.mjs +79 -0
- package/dist/lib/node-esm/testing/react.mjs.map +7 -0
- package/dist/lib/node-esm/ui/index.mjs +24 -15
- package/dist/plugin/node-esm/index.mjs +893 -0
- package/dist/plugin/node-esm/index.mjs.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/types/src/cli/cli.d.ts +1 -3
- package/dist/types/src/cli/cli.d.ts.map +1 -1
- package/dist/types/src/common/activation-events.d.ts +10 -13
- package/dist/types/src/common/activation-events.d.ts.map +1 -1
- package/dist/types/src/common/annotations.d.ts +1 -0
- package/dist/types/src/common/annotations.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +113 -12
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +8 -22
- package/dist/types/src/common/operations.d.ts.map +1 -1
- package/dist/types/src/core/activation-event.d.ts +4 -4
- package/dist/types/src/core/activation-event.d.ts.map +1 -1
- package/dist/types/src/core/capability-manager.d.ts +5 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -1
- package/dist/types/src/core/capability.d.ts +13 -2
- package/dist/types/src/core/capability.d.ts.map +1 -1
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +6 -0
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
- package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.d.ts +232 -7
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manifest.d.ts +101 -0
- package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +176 -6
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +107 -0
- package/dist/types/src/core/registry.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.d.ts +127 -0
- package/dist/types/src/core/url-loader.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.test.d.ts +2 -0
- package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +79 -0
- package/dist/types/src/testing/harness.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/react.d.ts +27 -0
- package/dist/types/src/testing/react.d.ts.map +1 -0
- package/dist/types/src/testing/react.test.d.ts +2 -0
- package/dist/types/src/testing/react.test.d.ts.map +1 -0
- package/dist/types/src/testing/service.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts +3 -2
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.stories.d.ts +2 -2
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +16 -4
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/index.d.ts +22 -6
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/types.d.ts +110 -9
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
- package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
- package/dist/types/src/ui/components/index.d.ts +1 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/index.d.ts +1 -1
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts +47 -11
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +24 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/index.d.ts +5 -0
- package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
- package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/packages.d.ts +13 -0
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +15 -0
- package/package.json +53 -54
- package/src/cli/cli.ts +2 -7
- package/src/common/activation-events.ts +10 -15
- package/src/common/annotations.ts +3 -0
- package/src/common/capabilities.ts +147 -16
- package/src/common/operations.ts +5 -8
- package/src/core/activation-event.ts +4 -1
- package/src/core/capability-manager.test.ts +1 -1
- package/src/core/capability-manager.ts +22 -1
- package/src/core/capability.ts +20 -2
- package/src/core/edge-registry-plugin-provider.ts +92 -0
- package/src/core/index.ts +6 -0
- package/src/core/plugin-asset-cache.ts +60 -0
- package/src/core/plugin-manager.test.ts +816 -10
- package/src/core/plugin-manager.ts +865 -46
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +185 -10
- package/src/core/registry.ts +163 -0
- package/src/core/url-loader.test.ts +221 -0
- package/src/core/url-loader.ts +388 -0
- package/src/index.ts +1 -2
- package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
- package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +1 -2
- package/src/plugin-process-manager/history/errors.ts +7 -0
- package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +37 -43
- package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +1 -2
- package/src/{plugin-operation → plugin-process-manager}/history/types.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +3 -4
- package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
- package/src/plugin-process-manager/meta.ts +14 -0
- package/src/plugin-process-manager/process-manager-capability.ts +178 -0
- package/src/{plugin-operation → plugin-process-manager}/testing.ts +26 -45
- package/src/testing/harness.ts +247 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/react.test.tsx +48 -0
- package/src/testing/react.tsx +113 -0
- package/src/testing/service.ts +2 -2
- package/src/testing/withPluginManager.stories.tsx +1 -2
- package/src/testing/withPluginManager.tsx +5 -4
- package/src/ui/components/App/App.stories.tsx +5 -11
- package/src/ui/components/App/App.tsx +29 -5
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
- package/src/{plugin-runtime → ui/components/Placeholder}/index.ts +1 -1
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +5 -4
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +16 -15
- package/src/ui/components/Surface/SurfaceComponent.tsx +111 -55
- package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
- package/src/ui/components/Surface/index.ts +35 -1
- package/src/ui/components/Surface/types.test.ts +126 -0
- package/src/ui/components/Surface/types.ts +164 -12
- package/src/ui/components/index.ts +1 -0
- package/src/ui/hooks/index.ts +1 -1
- package/src/ui/hooks/useApp.test.tsx +2 -2
- package/src/ui/hooks/useApp.tsx +216 -17
- package/src/ui/hooks/useLoading.tsx +14 -6
- package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
- package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
- package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
- package/src/vite-plugin/boot-loader/index.ts +5 -0
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/composer/index.ts +306 -0
- package/src/vite-plugin/import-map/index.ts +527 -0
- package/src/vite-plugin/index.ts +10 -0
- package/src/vite-plugin/manifest.test.ts +46 -0
- package/src/vite-plugin/manifest.ts +57 -0
- package/src/vite-plugin/packages.ts +187 -0
- package/tsconfig.json +25 -1
- package/tsconfig.node.json +1 -1
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/dist/lib/browser/capability-5OFLR7J4.mjs.map +0 -7
- package/dist/lib/browser/capability-ZHQDZRP5.mjs +0 -37
- package/dist/lib/browser/capability-ZHQDZRP5.mjs.map +0 -7
- package/dist/lib/browser/chunk-272IPLHQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-3VXJONTI.mjs +0 -933
- package/dist/lib/browser/chunk-3VXJONTI.mjs.map +0 -7
- package/dist/lib/browser/chunk-7AL6SKIV.mjs +0 -728
- package/dist/lib/browser/chunk-7AL6SKIV.mjs.map +0 -7
- package/dist/lib/browser/chunk-GH3M2LIW.mjs.map +0 -7
- package/dist/lib/browser/chunk-JGWCBVKJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-M5IC326L.mjs +0 -34
- package/dist/lib/browser/chunk-M5IC326L.mjs.map +0 -7
- package/dist/lib/browser/chunk-WEBSGU5L.mjs.map +0 -7
- package/dist/lib/browser/chunk-YAFEA4GV.mjs +0 -1
- package/dist/lib/browser/chunk-YNFPIQGB.mjs.map +0 -7
- package/dist/lib/browser/invoker-capability-YTTQ2OBB.mjs +0 -36
- package/dist/lib/browser/invoker-capability-YTTQ2OBB.mjs.map +0 -7
- package/dist/lib/node-esm/capability-CRHZKL6T.mjs.map +0 -7
- package/dist/lib/node-esm/capability-W5C5464H.mjs +0 -38
- package/dist/lib/node-esm/capability-W5C5464H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3D66SZHP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6REV5DE7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CMDON4NG.mjs +0 -934
- package/dist/lib/node-esm/chunk-CMDON4NG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I7FZT4A7.mjs +0 -729
- package/dist/lib/node-esm/chunk-I7FZT4A7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LHCJGNXK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NHXBSAQR.mjs +0 -35
- package/dist/lib/node-esm/chunk-NHXBSAQR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SB5ODNPX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SQICGJBW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +0 -2
- package/dist/lib/node-esm/invoker-capability-BU26474T.mjs +0 -37
- package/dist/lib/node-esm/invoker-capability-BU26474T.mjs.map +0 -7
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/errors.d.ts +0 -5
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/index.d.ts +0 -3
- package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/testing.d.ts +0 -109
- package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
- package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/index.d.ts +0 -2
- package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
- package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts +0 -19
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +0 -1
- package/src/plugin-operation/OperationPlugin.ts +0 -25
- package/src/plugin-operation/history/errors.ts +0 -11
- package/src/plugin-operation/invoker-capability.ts +0 -40
- package/src/plugin-operation/meta.ts +0 -11
- package/src/plugin-runtime/RuntimePlugin.ts +0 -20
- package/src/plugin-runtime/capability.ts +0 -53
- package/src/plugin-runtime/meta.ts +0 -11
- package/src/ui/hooks/useOperationResolver.ts +0 -40
- /package/dist/lib/browser/{chunk-YAFEA4GV.mjs.map → core/url-loader.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-Z4TJPSMP.mjs.map → core/url-loader.mjs.map} +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/capability.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
package/moon.yml
CHANGED
|
@@ -20,3 +20,18 @@ tasks:
|
|
|
20
20
|
- '--entryPoint=src/common/activation-events.ts'
|
|
21
21
|
- '--entryPoint=src/ui/index.ts'
|
|
22
22
|
- '--entryPoint=src/testing/index.ts'
|
|
23
|
+
- '--entryPoint=src/testing/react.tsx'
|
|
24
|
+
- '--entryPoint=src/core/url-loader.ts'
|
|
25
|
+
deps:
|
|
26
|
+
- compile-plugin
|
|
27
|
+
compile-plugin:
|
|
28
|
+
command: dx-compile
|
|
29
|
+
args:
|
|
30
|
+
- '--entryPoint=src/vite-plugin/index.ts'
|
|
31
|
+
- '--outputPath=dist/plugin'
|
|
32
|
+
- '--platform=node'
|
|
33
|
+
deps:
|
|
34
|
+
- ^:compile
|
|
35
|
+
- dx-compile:compile
|
|
36
|
+
outputs:
|
|
37
|
+
- dist/plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.8baae0fced",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"type": "module",
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"node": "./dist/lib/node-esm/plugin-manager/index.mjs",
|
|
56
56
|
"types": "./dist/types/src/plugin-manager/index.d.ts"
|
|
57
57
|
},
|
|
58
|
+
"./UrlLoader": {
|
|
59
|
+
"source": "./src/core/url-loader.ts",
|
|
60
|
+
"browser": "./dist/lib/browser/url-loader/index.mjs",
|
|
61
|
+
"node": "./dist/lib/node-esm/url-loader/index.mjs",
|
|
62
|
+
"types": "./dist/types/src/url-loader/index.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./vite-plugin": {
|
|
65
|
+
"import": "./dist/plugin/node-esm/index.mjs",
|
|
66
|
+
"types": "./dist/types/src/vite-plugin/index.d.ts"
|
|
67
|
+
},
|
|
58
68
|
"./cli": {
|
|
59
69
|
"source": "./src/cli/index.ts",
|
|
60
70
|
"browser": "./dist/lib/browser/cli/index.mjs",
|
|
@@ -67,6 +77,12 @@
|
|
|
67
77
|
"node": "./dist/lib/node-esm/testing/index.mjs",
|
|
68
78
|
"types": "./dist/types/src/testing/index.d.ts"
|
|
69
79
|
},
|
|
80
|
+
"./testing-react": {
|
|
81
|
+
"source": "./src/testing/react.tsx",
|
|
82
|
+
"browser": "./dist/lib/browser/testing/react.mjs",
|
|
83
|
+
"node": "./dist/lib/node-esm/testing/react.mjs",
|
|
84
|
+
"types": "./dist/types/src/testing/react.d.ts"
|
|
85
|
+
},
|
|
70
86
|
"./ui": {
|
|
71
87
|
"source": "./src/ui/index.ts",
|
|
72
88
|
"browser": "./dist/lib/browser/ui/index.mjs",
|
|
@@ -75,72 +91,55 @@
|
|
|
75
91
|
}
|
|
76
92
|
},
|
|
77
93
|
"types": "dist/types/src/index.d.ts",
|
|
78
|
-
"typesVersions": {
|
|
79
|
-
"*": {
|
|
80
|
-
"ActivationEvent": [
|
|
81
|
-
"dist/types/src/activation-event/index.d.ts"
|
|
82
|
-
],
|
|
83
|
-
"ActivationEvents": [
|
|
84
|
-
"dist/types/src/common/activation-events.d.ts"
|
|
85
|
-
],
|
|
86
|
-
"Capabilities": [
|
|
87
|
-
"dist/types/src/common/capabilities.d.ts"
|
|
88
|
-
],
|
|
89
|
-
"Capability": [
|
|
90
|
-
"dist/types/src/capability/index.d.ts"
|
|
91
|
-
],
|
|
92
|
-
"Plugin": [
|
|
93
|
-
"dist/types/src/plugin/index.d.ts"
|
|
94
|
-
],
|
|
95
|
-
"PluginManager": [
|
|
96
|
-
"dist/types/src/plugin-manager/index.d.ts"
|
|
97
|
-
],
|
|
98
|
-
"cli": [
|
|
99
|
-
"dist/types/src/cli/index.d.ts"
|
|
100
|
-
],
|
|
101
|
-
"testing": [
|
|
102
|
-
"dist/types/src/testing/index.d.ts"
|
|
103
|
-
],
|
|
104
|
-
"ui": [
|
|
105
|
-
"dist/types/src/ui/index.d.ts"
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
94
|
"dependencies": {
|
|
95
|
+
"@effect-atom/atom": "^0.5.1",
|
|
110
96
|
"@effect/cli": "0.73.2",
|
|
111
|
-
"@
|
|
112
|
-
"
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/
|
|
116
|
-
"@dxos/
|
|
117
|
-
"@dxos/
|
|
118
|
-
"@dxos/
|
|
119
|
-
"@dxos/
|
|
120
|
-
"@dxos/
|
|
121
|
-
"@dxos/
|
|
122
|
-
"@dxos/
|
|
97
|
+
"@effect/platform": "0.94.4",
|
|
98
|
+
"cjs-module-lexer": "^2.2.0",
|
|
99
|
+
"@dxos/async": "0.8.4-main.8baae0fced",
|
|
100
|
+
"@dxos/context": "0.8.4-main.8baae0fced",
|
|
101
|
+
"@dxos/debug": "0.8.4-main.8baae0fced",
|
|
102
|
+
"@dxos/compute": "0.8.4-main.8baae0fced",
|
|
103
|
+
"@dxos/echo": "0.8.4-main.8baae0fced",
|
|
104
|
+
"@dxos/edge-client": "0.8.4-main.8baae0fced",
|
|
105
|
+
"@dxos/effect": "0.8.4-main.8baae0fced",
|
|
106
|
+
"@dxos/compute-runtime": "0.8.4-main.8baae0fced",
|
|
107
|
+
"@dxos/errors": "0.8.4-main.8baae0fced",
|
|
108
|
+
"@dxos/log": "0.8.4-main.8baae0fced",
|
|
109
|
+
"@dxos/invariant": "0.8.4-main.8baae0fced",
|
|
110
|
+
"@dxos/functions": "0.8.4-main.8baae0fced",
|
|
111
|
+
"@dxos/operation": "0.8.4-main.8baae0fced",
|
|
112
|
+
"@dxos/protocols": "0.8.4-main.8baae0fced",
|
|
113
|
+
"@dxos/react-error-boundary": "0.8.4-main.8baae0fced",
|
|
114
|
+
"@dxos/react-hooks": "0.8.4-main.8baae0fced",
|
|
115
|
+
"@dxos/react-ui": "0.8.4-main.8baae0fced",
|
|
116
|
+
"@dxos/ui-theme": "0.8.4-main.8baae0fced",
|
|
117
|
+
"@dxos/util": "0.8.4-main.8baae0fced",
|
|
118
|
+
"@dxos/web-context": "0.8.4-main.8baae0fced",
|
|
119
|
+
"@dxos/web-context-react": "0.8.4-main.8baae0fced"
|
|
123
120
|
},
|
|
124
121
|
"devDependencies": {
|
|
125
122
|
"@effect-atom/atom-react": "^0.5.0",
|
|
126
123
|
"@effect/platform": "0.94.4",
|
|
127
|
-
"@effect/vitest": "0.
|
|
124
|
+
"@effect/vitest": "0.29.0",
|
|
125
|
+
"@testing-library/react": "^16.3.0",
|
|
128
126
|
"@types/react": "~19.2.7",
|
|
129
|
-
"effect": "3.
|
|
127
|
+
"effect": "3.20.0",
|
|
130
128
|
"react": "~19.2.3",
|
|
131
129
|
"react-dom": "~19.2.3",
|
|
132
130
|
"typedoc": "0.28.1",
|
|
133
|
-
"
|
|
134
|
-
"@dxos/
|
|
135
|
-
"@dxos/
|
|
136
|
-
"@dxos/
|
|
137
|
-
"@dxos/
|
|
138
|
-
"@dxos/
|
|
131
|
+
"vite": "^8.0.13",
|
|
132
|
+
"@dxos/random": "0.8.4-main.8baae0fced",
|
|
133
|
+
"@dxos/brand": "0.8.4-main.8baae0fced",
|
|
134
|
+
"@dxos/echo-db": "0.8.4-main.8baae0fced",
|
|
135
|
+
"@dxos/storybook-utils": "0.8.4-main.8baae0fced",
|
|
136
|
+
"@dxos/test-utils": "0.8.4-main.8baae0fced"
|
|
139
137
|
},
|
|
140
138
|
"peerDependencies": {
|
|
141
139
|
"@effect-atom/atom-react": "^0.5.0",
|
|
142
140
|
"@effect/platform": "0.94.4",
|
|
143
|
-
"
|
|
141
|
+
"@testing-library/react": "^16.3.0",
|
|
142
|
+
"effect": "3.20.0",
|
|
144
143
|
"react": "~19.2.3",
|
|
145
144
|
"react-dom": "~19.2.3"
|
|
146
145
|
},
|
package/src/cli/cli.ts
CHANGED
|
@@ -17,7 +17,7 @@ const defaultPluginLoader =
|
|
|
17
17
|
Effect.sync(() => {
|
|
18
18
|
const plugin = plugins.find((plugin) => plugin.meta.id === id);
|
|
19
19
|
invariant(plugin, `Plugin not found: ${id}`);
|
|
20
|
-
return plugin;
|
|
20
|
+
return { plugin };
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
type SubCommands = [Command.Command<any, any, any, any>, ...Array<Command.Command<any, any, any, any>>];
|
|
@@ -28,7 +28,6 @@ export type CreateCliAppOptions = {
|
|
|
28
28
|
pluginManager?: PluginManager.PluginManager;
|
|
29
29
|
pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];
|
|
30
30
|
plugins?: Plugin.Plugin[];
|
|
31
|
-
core?: string[];
|
|
32
31
|
enabled?: string[];
|
|
33
32
|
safeMode?: boolean;
|
|
34
33
|
};
|
|
@@ -44,8 +43,7 @@ export type CreateCliAppOptions = {
|
|
|
44
43
|
*
|
|
45
44
|
* @param options.pluginManager Optional existing PluginManager instance.
|
|
46
45
|
* @param options.pluginLoader Function to load plugins by ID.
|
|
47
|
-
* @param options.plugins All plugins available to the application.
|
|
48
|
-
* @param options.core Core plugins which will always be enabled.
|
|
46
|
+
* @param options.plugins All plugins available to the application. Plugins whose `meta.tags` includes `'system'` are treated as core.
|
|
49
47
|
* @param options.enabled Enabled plugins.
|
|
50
48
|
* @param options.safeMode Whether to enable safe mode, which disables optional plugins.
|
|
51
49
|
*/
|
|
@@ -55,12 +53,10 @@ export const createCliApp = Effect.fn(function* ({
|
|
|
55
53
|
pluginManager: pluginManagerProp,
|
|
56
54
|
pluginLoader: pluginLoaderProp,
|
|
57
55
|
plugins: pluginsProp = [],
|
|
58
|
-
core: coreProp,
|
|
59
56
|
enabled: enabledProp = [],
|
|
60
57
|
safeMode = false,
|
|
61
58
|
}: CreateCliAppOptions) {
|
|
62
59
|
const plugins = pluginsProp;
|
|
63
|
-
const core = coreProp ?? plugins.map(({ meta }) => meta.id);
|
|
64
60
|
const pluginLoader = pluginLoaderProp ?? defaultPluginLoader(plugins);
|
|
65
61
|
const enabled = safeMode ? [] : enabledProp;
|
|
66
62
|
const manager =
|
|
@@ -68,7 +64,6 @@ export const createCliApp = Effect.fn(function* ({
|
|
|
68
64
|
PluginManager.make({
|
|
69
65
|
pluginLoader,
|
|
70
66
|
plugins,
|
|
71
|
-
core,
|
|
72
67
|
enabled,
|
|
73
68
|
});
|
|
74
69
|
|
|
@@ -19,26 +19,21 @@ export const Startup = ActivationEvent$.make('org.dxos.app-framework.event.start
|
|
|
19
19
|
export const SetupReactSurface = ActivationEvent$.make('org.dxos.app-framework.event.setup-react-surface');
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Fired before the
|
|
22
|
+
* Fired before the process manager is created.
|
|
23
|
+
* Plugins should contribute their {@link Capabilities.LayerSpec} entries and
|
|
24
|
+
* {@link Capabilities.OperationHandler} sets before this event fires so the
|
|
25
|
+
* process manager's {@link ServiceResolver} and {@link OperationInvoker} pick
|
|
26
|
+
* them up at construction time.
|
|
23
27
|
*/
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Fired before the managed runtime is created.
|
|
28
|
-
* Plugins should contribute their Layer capabilities before this event.
|
|
29
|
-
*/
|
|
30
|
-
export const SetupLayer = ActivationEvent$.make('org.dxos.app-framework.event.setup-layer');
|
|
28
|
+
export const SetupProcessManager = ActivationEvent$.make('org.dxos.app-framework.event.setup-process-manager');
|
|
31
29
|
|
|
32
30
|
//
|
|
33
31
|
// Triggered Events
|
|
34
32
|
//
|
|
35
33
|
|
|
36
34
|
/**
|
|
37
|
-
* Fired after the
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Fired after the managed runtime is ready.
|
|
35
|
+
* Fired after the process manager runtime is ready and its derived capabilities
|
|
36
|
+
* (`ProcessManagerRuntime`, `ServiceResolver`, `ProcessMonitor`, `OperationInvoker`)
|
|
37
|
+
* have been contributed.
|
|
43
38
|
*/
|
|
44
|
-
export const
|
|
39
|
+
export const ProcessManagerReady = ActivationEvent$.make('org.dxos.app-framework.event.process-manager-ready');
|
|
@@ -2,21 +2,33 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import type * as Command$ from '@effect/cli/Command';
|
|
6
5
|
import { type Atom, type Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Command$ from '@effect/cli/Command';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
|
+
import type * as Exit$ from 'effect/Exit';
|
|
9
|
+
import type * as Fiber$ from 'effect/Fiber';
|
|
8
10
|
import type * as Layer$ from 'effect/Layer';
|
|
9
11
|
import type * as ManagedRuntime$ from 'effect/ManagedRuntime';
|
|
12
|
+
import type * as Runtime$ from 'effect/Runtime';
|
|
10
13
|
import type { FC, PropsWithChildren } from 'react';
|
|
11
14
|
|
|
12
|
-
import type {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
import type {
|
|
16
|
+
LayerSpec as LayerSpec$,
|
|
17
|
+
Operation as Operation$,
|
|
18
|
+
OperationHandlerSet,
|
|
19
|
+
Process as Process$,
|
|
20
|
+
ServiceResolver as ServiceResolver$,
|
|
21
|
+
Trace as Trace$,
|
|
22
|
+
} from '@dxos/compute';
|
|
23
|
+
import type { ProcessManager as ProcessManager$ } from '@dxos/compute-runtime';
|
|
24
|
+
import { OperationInvoker as OperationInvoker$ } from '@dxos/operation';
|
|
25
|
+
|
|
26
|
+
import { Capability as Capability$, Plugin as Plugin$, type PluginManager as PluginManager$ } from '../core';
|
|
15
27
|
import type {
|
|
16
28
|
HistoryTracker as HistoryTracker$,
|
|
17
29
|
UndoMapping as UndoMapping$,
|
|
18
30
|
UndoRegistry as UndoRegistry$,
|
|
19
|
-
} from '../plugin-
|
|
31
|
+
} from '../plugin-process-manager';
|
|
20
32
|
import type { Surface } from '../ui';
|
|
21
33
|
|
|
22
34
|
/**
|
|
@@ -77,6 +89,127 @@ export const Command = Capability$.make<AnyCommand>('org.dxos.app-framework.capa
|
|
|
77
89
|
*/
|
|
78
90
|
export const Layer = Capability$.make<Layer$.Layer<any, any, any>>('org.dxos.app-framework.capability.layer');
|
|
79
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Layer specification contributed by plugins.
|
|
94
|
+
*
|
|
95
|
+
* Plugins contribute {@link LayerSpec.LayerSpec} entries that are collected by the
|
|
96
|
+
* process-manager module and composed into a {@link LayerStack} which backs the
|
|
97
|
+
* {@link ProcessManagerRuntime}'s service resolver.
|
|
98
|
+
*
|
|
99
|
+
* @category Capability
|
|
100
|
+
*/
|
|
101
|
+
export const LayerSpec = Capability$.make<LayerSpec$.LayerSpec>('org.dxos.app-framework.capability.layer-spec');
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Context passed to {@link TraceSinkFactory} implementations when the
|
|
105
|
+
* process-manager capability materialises contributed sinks.
|
|
106
|
+
*/
|
|
107
|
+
export interface TraceSinkFactoryContext {
|
|
108
|
+
/**
|
|
109
|
+
* Service resolver backing the shared {@link ProcessManagerRuntime}. Use it
|
|
110
|
+
* to resolve per-space (or per-process) services like `FeedTraceSink` when
|
|
111
|
+
* building a routing sink.
|
|
112
|
+
*/
|
|
113
|
+
readonly resolver: ServiceResolver$.ServiceResolver;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Factory that builds a {@link Trace$.Sink} when the process-manager
|
|
118
|
+
* capability is ready. Plugins that only need a static sink can ignore the
|
|
119
|
+
* context (e.g. `() => myConsoleSink`); plugins that need per-space routing
|
|
120
|
+
* can use {@link TraceSinkFactoryContext.resolver} to look up services.
|
|
121
|
+
*/
|
|
122
|
+
export type TraceSinkFactory = (ctx: TraceSinkFactoryContext) => Trace$.Sink;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Trace sink contribution.
|
|
126
|
+
*
|
|
127
|
+
* Plugins contribute {@link TraceSinkFactory} functions; the process-manager
|
|
128
|
+
* capability invokes each factory with the runtime's
|
|
129
|
+
* {@link ServiceResolver$.ServiceResolver}, collects the resulting
|
|
130
|
+
* {@link Trace$.Sink}s, merges them via {@link Trace$.mergeSinks}, and
|
|
131
|
+
* installs the merged sink as {@link Trace$.TraceSink} in the runtime layer
|
|
132
|
+
* so every process writes to every contributed sink.
|
|
133
|
+
*
|
|
134
|
+
* @category Capability
|
|
135
|
+
*/
|
|
136
|
+
export const TraceSink = Capability$.make<TraceSinkFactory>('org.dxos.app-framework.capability.trace-sink');
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Service resolver backing the shared {@link ProcessManagerRuntime}.
|
|
140
|
+
*
|
|
141
|
+
* Contributed by the process-manager capability module. Consumers can combine
|
|
142
|
+
* it with {@link ServiceResolver$.provide} to build space-scoped layers without
|
|
143
|
+
* having to go through the process-manager runtime:
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* const resolver = yield* Capability.get(Capabilities.ServiceResolver);
|
|
148
|
+
* yield* effect.pipe(
|
|
149
|
+
* Effect.provide(
|
|
150
|
+
* ServiceResolver.provide({ space }, Database.Service, QueueService).pipe(
|
|
151
|
+
* Layer.provide(Layer.succeed(ServiceResolver.ServiceResolver, resolver)),
|
|
152
|
+
* ),
|
|
153
|
+
* ),
|
|
154
|
+
* );
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @category Capability
|
|
158
|
+
*/
|
|
159
|
+
export const ServiceResolver = Capability$.make<ServiceResolver$.ServiceResolver>(
|
|
160
|
+
'org.dxos.app-framework.capability.service-resolver',
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Process monitor backing the shared {@link ProcessManagerRuntime}. Exposes the
|
|
165
|
+
* live process tree (including inactive/terminated entries) via
|
|
166
|
+
* {@link Process$.Monitor#processTreeAtom}.
|
|
167
|
+
*
|
|
168
|
+
* @category Capability
|
|
169
|
+
*/
|
|
170
|
+
export const ProcessMonitor = Capability$.make<Process$.Monitor>('org.dxos.app-framework.capability.process-monitor');
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Services that are always available when running effects through a {@link ProcessManagerRuntime}.
|
|
174
|
+
*/
|
|
175
|
+
export type ProcessManagerRuntimeServices =
|
|
176
|
+
| Capability$.Service
|
|
177
|
+
| Plugin$.Service
|
|
178
|
+
| ProcessManager$.ProcessManagerService
|
|
179
|
+
| Operation$.Service
|
|
180
|
+
| ProcessManager$.ProcessOperationInvoker.Service
|
|
181
|
+
| ServiceResolver$.ServiceResolver;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Runtime that runs effects requiring a fixed set of capability-manager and
|
|
185
|
+
* process-manager services.
|
|
186
|
+
*
|
|
187
|
+
* The shape mirrors {@link ManagedRuntime$.ManagedRuntime} but deliberately does
|
|
188
|
+
* not expose `dispose` – lifecycle is driven by the host plugin manager.
|
|
189
|
+
*/
|
|
190
|
+
export interface ProcessManagerRuntime {
|
|
191
|
+
runPromise<A, E>(
|
|
192
|
+
effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,
|
|
193
|
+
options?: { readonly signal?: AbortSignal },
|
|
194
|
+
): Promise<A>;
|
|
195
|
+
runPromiseExit<A, E>(
|
|
196
|
+
effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,
|
|
197
|
+
options?: { readonly signal?: AbortSignal },
|
|
198
|
+
): Promise<Exit$.Exit<A, E>>;
|
|
199
|
+
runFork<A, E>(
|
|
200
|
+
effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>,
|
|
201
|
+
options?: Runtime$.RunForkOptions,
|
|
202
|
+
): Fiber$.RuntimeFiber<A, E>;
|
|
203
|
+
runSync<A, E>(effect: Effect.Effect<A, E, ProcessManagerRuntimeServices>): A;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @category Capability
|
|
208
|
+
*/
|
|
209
|
+
export const ProcessManagerRuntime = Capability$.make<ProcessManagerRuntime>(
|
|
210
|
+
'org.dxos.app-framework.capability.process-manager-runtime',
|
|
211
|
+
);
|
|
212
|
+
|
|
80
213
|
export type ManagedRuntime = ManagedRuntime$.ManagedRuntime<any, any>;
|
|
81
214
|
|
|
82
215
|
/**
|
|
@@ -88,14 +221,8 @@ export const ManagedRuntime = Capability$.make<ManagedRuntime>('org.dxos.app-fra
|
|
|
88
221
|
// Operation System Capabilities
|
|
89
222
|
//
|
|
90
223
|
|
|
91
|
-
export
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Handler registration for operations - contributed by plugins.
|
|
95
|
-
* @category Capability
|
|
96
|
-
*/
|
|
97
|
-
export const OperationResolver = Capability$.make<OperationResolver[]>(
|
|
98
|
-
'org.dxos.app-framework.capability.operation-resolver',
|
|
224
|
+
export const OperationHandler = Capability$.make<OperationHandlerSet.OperationHandlerSet>(
|
|
225
|
+
'org.dxos.app-framework.capability.operation-handler',
|
|
99
226
|
);
|
|
100
227
|
|
|
101
228
|
export type UndoMapping = UndoMapping$.UndoMapping;
|
|
@@ -106,10 +233,14 @@ export type UndoMapping = UndoMapping$.UndoMapping;
|
|
|
106
233
|
*/
|
|
107
234
|
export const UndoMapping = Capability$.make<UndoMapping[]>('org.dxos.app-framework.capability.undo-mapping');
|
|
108
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Operation invoker backed by the process manager. Spawns a process per
|
|
238
|
+
* operation invocation; see {@link ProcessManager$.ProcessOperationInvoker}.
|
|
239
|
+
*/
|
|
109
240
|
export type OperationInvoker = OperationInvoker$.OperationInvoker;
|
|
110
241
|
|
|
111
242
|
/**
|
|
112
|
-
* Operation invoker - provided by
|
|
243
|
+
* Operation invoker - provided by the process-manager capability.
|
|
113
244
|
* @category Capability
|
|
114
245
|
*/
|
|
115
246
|
export const OperationInvoker = Capability$.make<OperationInvoker>(
|
|
@@ -119,7 +250,7 @@ export const OperationInvoker = Capability$.make<OperationInvoker>(
|
|
|
119
250
|
export type UndoRegistry = UndoRegistry$.UndoRegistry;
|
|
120
251
|
|
|
121
252
|
/**
|
|
122
|
-
* Undo registry - provided by
|
|
253
|
+
* Undo registry - provided by ProcessManagerPlugin.
|
|
123
254
|
* @category Capability
|
|
124
255
|
*/
|
|
125
256
|
export const UndoRegistry = Capability$.make<UndoRegistry>('org.dxos.app-framework.capability.undo-registry');
|
|
@@ -127,7 +258,7 @@ export const UndoRegistry = Capability$.make<UndoRegistry>('org.dxos.app-framewo
|
|
|
127
258
|
export type HistoryTracker = HistoryTracker$.HistoryTracker;
|
|
128
259
|
|
|
129
260
|
/**
|
|
130
|
-
* History tracker - provided by
|
|
261
|
+
* History tracker - provided by ProcessManagerPlugin.
|
|
131
262
|
* @category Capability
|
|
132
263
|
*/
|
|
133
264
|
export const HistoryTracker = Capability$.make<HistoryTracker>('org.dxos.app-framework.capability.history-tracker');
|
package/src/common/operations.ts
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Operation } from '@dxos/
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
8
|
|
|
9
9
|
import { Capability } from '../core';
|
|
10
|
-
|
|
11
10
|
import { Label } from './translations';
|
|
12
11
|
|
|
13
12
|
const UNDO_NAMESPACE = 'org.dxos.app-framework.undo';
|
|
@@ -28,11 +27,9 @@ export namespace UndoOperation {
|
|
|
28
27
|
},
|
|
29
28
|
executionMode: 'sync',
|
|
30
29
|
services: [Capability.Service],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
output: Schema.Void,
|
|
36
|
-
},
|
|
30
|
+
input: Schema.Struct({
|
|
31
|
+
message: Schema.optional(Label.annotations({ description: 'The message to display in the undo toast.' })),
|
|
32
|
+
}),
|
|
33
|
+
output: Schema.Void,
|
|
37
34
|
});
|
|
38
35
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { compositeKey } from '@dxos/util';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* A unique string identifier representing an event.
|
|
7
9
|
* This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.
|
|
@@ -31,7 +33,8 @@ export const make = (id: string, specifier?: string) => {
|
|
|
31
33
|
/**
|
|
32
34
|
* Helper to create an activation event key.
|
|
33
35
|
*/
|
|
34
|
-
export const eventKey = (event: ActivationEvent) =>
|
|
36
|
+
export const eventKey = (event: ActivationEvent) =>
|
|
37
|
+
event.specifier ? compositeKey(event.id, event.specifier) : event.id;
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
40
|
* Helper to create an activation event that triggers when any of the given events are activated.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { describe, expect, it, onTestFinished } from '@effect/vitest';
|
|
6
5
|
import { Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import { describe, expect, it, onTestFinished } from '@effect/vitest';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
|
|
9
9
|
import * as Capability from './capability';
|
|
@@ -59,6 +59,12 @@ export interface CapabilityManager {
|
|
|
59
59
|
* @returns The capability.
|
|
60
60
|
*/
|
|
61
61
|
waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get capabilities grouped by the module that contributed them.
|
|
65
|
+
* @returns An atom containing a record from module ID to capability implementations.
|
|
66
|
+
*/
|
|
67
|
+
atomByModule<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<Record<string, T[]>>;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
/**
|
|
@@ -75,7 +81,18 @@ class CapabilityManagerImpl implements CapabilityManager {
|
|
|
75
81
|
return Atom.make((get) => {
|
|
76
82
|
const current = get(this._capabilityEntries(id));
|
|
77
83
|
return current.map((c) => c.implementation);
|
|
78
|
-
});
|
|
84
|
+
}).pipe(Atom.keepAlive);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
readonly _capabilitiesByModule = Atom.family<string, Atom.Atom<Record<string, unknown[]>>>((id: string) => {
|
|
88
|
+
return Atom.make((get) => {
|
|
89
|
+
const entries = get(this._capabilityEntries(id));
|
|
90
|
+
const result: Record<string, unknown[]> = {};
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
(result[entry.moduleId] ??= []).push(entry.implementation);
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}).pipe(Atom.keepAlive);
|
|
79
96
|
});
|
|
80
97
|
|
|
81
98
|
readonly _capability = Atom.family<string, Atom.Atom<unknown>>((id: string) => {
|
|
@@ -163,6 +180,10 @@ class CapabilityManagerImpl implements CapabilityManager {
|
|
|
163
180
|
return result;
|
|
164
181
|
});
|
|
165
182
|
}
|
|
183
|
+
|
|
184
|
+
atomByModule<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<Record<string, T[]>> {
|
|
185
|
+
return this._capabilitiesByModule(interfaceDef.identifier) as Atom.Atom<Record<string, T[]>>;
|
|
186
|
+
}
|
|
166
187
|
}
|
|
167
188
|
|
|
168
189
|
/**
|
package/src/core/capability.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { type Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Context from 'effect/Context';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
8
9
|
|
|
9
10
|
import type * as CapabilityManager from './capability-manager';
|
|
10
11
|
import type * as Plugin from './plugin';
|
|
@@ -62,6 +63,22 @@ export const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Erro
|
|
|
62
63
|
export const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>
|
|
63
64
|
Effect.map(Service, (manager) => manager.atom(interfaceDef));
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Get capabilities grouped by the module that contributed them.
|
|
68
|
+
* @param interfaceDef The interface definition of the capability.
|
|
69
|
+
* @returns An Atom containing a record from module ID to capability implementations.
|
|
70
|
+
*/
|
|
71
|
+
export const atomByModule = <T>(
|
|
72
|
+
interfaceDef: InterfaceDef<T>,
|
|
73
|
+
): Effect.Effect<Atom.Atom<Record<string, T[]>>, never, Service> =>
|
|
74
|
+
Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Constructs a layer that will request its interface implementation from the capability manager.
|
|
78
|
+
*/
|
|
79
|
+
export const asLayer = <T, I>(interfaceDef: InterfaceDef<T>, tag: Context.Tag<I, T>): Layer.Layer<I, never, Service> =>
|
|
80
|
+
Layer.effect(tag, get(interfaceDef).pipe(Effect.orDie));
|
|
81
|
+
|
|
65
82
|
const InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');
|
|
66
83
|
|
|
67
84
|
/**
|
|
@@ -120,6 +137,7 @@ export type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]]
|
|
|
120
137
|
/**
|
|
121
138
|
* Helper to define the implementation of a capability.
|
|
122
139
|
*/
|
|
140
|
+
// TODO(dmaretskyi): Make the return type non-generic so capabilities are non-discernable.
|
|
123
141
|
export const contributes = <I extends InterfaceDef<any>>(
|
|
124
142
|
interfaceDef: I,
|
|
125
143
|
implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],
|
|
@@ -164,7 +182,7 @@ export const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(
|
|
|
164
182
|
): LazyCapability<T, R> => {
|
|
165
183
|
const lazyFn: LazyCapability<T, R> = (props: T) =>
|
|
166
184
|
Effect.gen(function* () {
|
|
167
|
-
const { default: getCapability } = yield* Effect.
|
|
185
|
+
const { default: getCapability } = yield* Effect.promise(() => c());
|
|
168
186
|
const result = yield* getCapability(props);
|
|
169
187
|
const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];
|
|
170
188
|
return normalized as NormalizeReturn<R>;
|
|
@@ -221,7 +239,7 @@ export const getModuleTag = (capability: unknown): string | undefined => {
|
|
|
221
239
|
* export default Capability.makeModule(
|
|
222
240
|
* Effect.fnUntraced(function* (props: { observability: boolean }) {
|
|
223
241
|
* const invoker = yield* Capability.get(Capabilities.OperationInvoker);
|
|
224
|
-
* return contributes(Capabilities.
|
|
242
|
+
* return contributes(Capabilities.OperationHandler, ...);
|
|
225
243
|
* })
|
|
226
244
|
* );
|
|
227
245
|
* ```
|