@dxos/app-framework 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/.storybook/main.mts +1 -1
- package/.storybook/preview.mts +2 -2
- package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs +149 -0
- package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs.map +7 -0
- package/dist/lib/browser/capability-7PCNSWBT.mjs +33 -0
- package/dist/lib/browser/capability-7PCNSWBT.mjs.map +7 -0
- package/dist/lib/browser/capability-KP3PFEXD.mjs +31 -0
- package/dist/lib/browser/capability-KP3PFEXD.mjs.map +7 -0
- package/dist/lib/browser/chunk-6Y7PZV72.mjs +77 -0
- package/dist/lib/browser/chunk-6Y7PZV72.mjs.map +7 -0
- package/dist/lib/browser/chunk-7IQHKD4U.mjs +170 -0
- package/dist/lib/browser/chunk-7IQHKD4U.mjs.map +7 -0
- package/dist/lib/browser/chunk-BLQJSGL3.mjs +732 -0
- package/dist/lib/browser/chunk-BLQJSGL3.mjs.map +7 -0
- package/dist/lib/browser/chunk-FHQTHCX7.mjs +8 -0
- package/dist/lib/browser/chunk-FHQTHCX7.mjs.map +7 -0
- package/dist/lib/browser/chunk-FMZN33N4.mjs +807 -0
- package/dist/lib/browser/chunk-FMZN33N4.mjs.map +7 -0
- package/dist/lib/browser/chunk-H4WPA7U7.mjs +77 -0
- package/dist/lib/browser/chunk-H4WPA7U7.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-PKQT6C53.mjs +47 -0
- package/dist/lib/browser/chunk-PKQT6C53.mjs.map +7 -0
- package/dist/lib/browser/chunk-TCLLRCS3.mjs +145 -0
- package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +7 -0
- package/dist/lib/browser/chunk-XYNO72GQ.mjs +746 -0
- package/dist/lib/browser/chunk-XYNO72GQ.mjs.map +7 -0
- package/dist/lib/browser/common/index.mjs +38 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/capability.mjs +28 -0
- package/dist/lib/browser/core/plugin-manager.mjs +15 -0
- package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/browser/core/plugin.mjs +27 -0
- package/dist/lib/browser/core/plugin.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +162 -128
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs +32 -0
- package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs +64 -0
- package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs.map +7 -0
- package/dist/lib/browser/react/index.mjs +46 -0
- package/dist/lib/browser/react/index.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +68 -22
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs +150 -0
- package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs.map +7 -0
- package/dist/lib/node-esm/capability-CFLQ2QQU.mjs +34 -0
- package/dist/lib/node-esm/capability-CFLQ2QQU.mjs.map +7 -0
- package/dist/lib/node-esm/capability-RCUNM2M7.mjs +32 -0
- package/dist/lib/node-esm/capability-RCUNM2M7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-663A54LQ.mjs +171 -0
- package/dist/lib/node-esm/chunk-663A54LQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6WXBT3EC.mjs +747 -0
- package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs +48 -0
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GQEBIGKD.mjs +733 -0
- package/dist/lib/node-esm/chunk-GQEBIGKD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GT6OKM5I.mjs +146 -0
- package/dist/lib/node-esm/chunk-GT6OKM5I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-STMXUEPO.mjs +78 -0
- package/dist/lib/node-esm/chunk-STMXUEPO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UEWJDI2L.mjs +10 -0
- package/dist/lib/node-esm/chunk-UEWJDI2L.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XR6NMKEP.mjs +78 -0
- package/dist/lib/node-esm/chunk-XR6NMKEP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XYQTBFPA.mjs +808 -0
- package/dist/lib/node-esm/chunk-XYQTBFPA.mjs.map +7 -0
- package/dist/lib/node-esm/common/index.mjs +39 -0
- package/dist/lib/node-esm/common/index.mjs.map +7 -0
- package/dist/lib/node-esm/core/activation-event.mjs +21 -0
- package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
- package/dist/lib/node-esm/core/capability.mjs +29 -0
- package/dist/lib/node-esm/core/capability.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs +16 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin.mjs +28 -0
- package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +162 -128
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs +33 -0
- package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs +65 -0
- package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs.map +7 -0
- package/dist/lib/node-esm/react/index.mjs +47 -0
- package/dist/lib/node-esm/react/index.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +68 -22
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/cli.d.ts +39 -0
- package/dist/types/src/cli.d.ts.map +1 -0
- package/dist/types/src/common/activation-event.d.ts +66 -0
- package/dist/types/src/common/activation-event.d.ts.map +1 -0
- package/dist/types/src/common/capability.d.ts +265 -0
- package/dist/types/src/common/capability.d.ts.map +1 -0
- package/dist/types/src/common/collaboration.d.ts +23 -17
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/graph.d.ts +2 -2
- package/dist/types/src/common/graph.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +4 -3
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +380 -0
- package/dist/types/src/common/operations.d.ts.map +1 -0
- package/dist/types/src/common/plugin.d.ts +201 -0
- package/dist/types/src/common/plugin.d.ts.map +1 -0
- package/dist/types/src/common/surface.d.ts +48 -13
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +9 -0
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/context.d.ts +5 -0
- package/dist/types/src/context.d.ts.map +1 -0
- package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +6 -6
- package/dist/types/src/core/activation-event.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.d.ts +43 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.test.d.ts +2 -0
- package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/capability.d.ts +150 -0
- package/dist/types/src/core/capability.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -4
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +66 -0
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +92 -34
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +4 -2
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts +2 -1
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +4 -2
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +4 -2
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +17 -5
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts +2 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts +4 -2
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts +2 -1
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +4 -2
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts +2 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +14 -0
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts +5 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
- package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +93 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/index.d.ts +3 -0
- package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/meta.d.ts +3 -0
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/testing.d.ts +109 -0
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/index.d.ts +2 -0
- package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +36 -0
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +4 -2
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/meta.d.ts +2 -2
- package/dist/types/src/plugin-settings/meta.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/operation-resolver.d.ts +6 -0
- package/dist/types/src/plugin-settings/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/react/App.d.ts +8 -0
- package/dist/types/src/react/App.d.ts.map +1 -0
- package/dist/types/src/react/App.stories.d.ts.map +1 -0
- package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
- package/dist/types/src/react/PluginManagerContext.stories.d.ts +13 -0
- package/dist/types/src/react/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts +2 -2
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +8 -6
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +3 -6
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/SurfaceInfo.d.ts +11 -0
- package/dist/types/src/react/SurfaceInfo.d.ts.map +1 -0
- package/dist/types/src/react/common.d.ts +13 -12
- package/dist/types/src/react/common.d.ts.map +1 -1
- package/dist/types/src/react/index.d.ts +3 -1
- package/dist/types/src/react/index.d.ts.map +1 -1
- package/dist/types/src/react/types.d.ts +12 -0
- package/dist/types/src/react/types.d.ts.map +1 -0
- package/dist/types/src/{components → react}/useApp.d.ts +7 -6
- package/dist/types/src/react/useApp.d.ts.map +1 -0
- package/dist/types/src/react/useCapabilities.d.ts +16 -3
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/{components → react}/useLoading.d.ts +1 -2
- package/dist/types/src/react/useLoading.d.ts.map +1 -0
- package/dist/types/src/react/useOperationResolver.d.ts +19 -0
- package/dist/types/src/react/useOperationResolver.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/service.d.ts +8 -0
- package/dist/types/src/testing/service.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +4 -4
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +6 -2
- package/package.json +101 -45
- package/src/cli.ts +107 -0
- package/src/common/activation-event.ts +99 -0
- package/src/common/capability.ts +343 -0
- package/src/common/collaboration.ts +23 -10
- package/src/common/graph.ts +2 -2
- package/src/common/index.ts +4 -3
- package/src/common/operations.ts +412 -0
- package/src/common/plugin.ts +364 -0
- package/src/common/surface.ts +56 -19
- package/src/common/translations.ts +20 -0
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +5 -5
- package/src/core/capability-manager.test.ts +151 -0
- package/src/core/capability-manager.ts +171 -0
- package/src/core/capability.ts +236 -0
- package/src/core/index.ts +5 -4
- package/src/core/plugin-manager.test.ts +845 -0
- package/src/core/plugin-manager.ts +696 -0
- package/src/core/plugin.ts +221 -39
- package/src/index.ts +5 -4
- package/src/playground/debug/Debug.tsx +26 -16
- package/src/playground/debug/plugin.ts +8 -8
- package/src/playground/generator/Main.tsx +20 -11
- package/src/playground/generator/Toolbar.tsx +26 -16
- package/src/playground/generator/generator.ts +27 -27
- package/src/playground/generator/plugin.ts +11 -12
- package/src/playground/layout/Layout.tsx +11 -7
- package/src/playground/layout/plugin.ts +8 -8
- package/src/playground/logger/Toolbar.tsx +19 -16
- package/src/playground/logger/plugin.ts +24 -23
- package/src/playground/logger/schema.ts +10 -0
- package/src/playground/playground.stories.tsx +14 -6
- package/src/plugin-operation/OperationPlugin.ts +25 -0
- package/src/plugin-operation/history/capability.ts +37 -0
- package/src/plugin-operation/history/errors.ts +11 -0
- package/src/plugin-operation/history/history-tracker.test.ts +380 -0
- package/src/plugin-operation/history/history-tracker.ts +129 -0
- package/src/plugin-operation/history/index.ts +9 -0
- package/src/plugin-operation/history/types.ts +17 -0
- package/src/plugin-operation/history/undo-mapping.ts +132 -0
- package/src/plugin-operation/history/undo-registry.test.ts +73 -0
- package/src/plugin-operation/history/undo-registry.ts +54 -0
- package/src/plugin-operation/index.ts +6 -0
- package/src/plugin-operation/invoker-capability.ts +40 -0
- package/src/plugin-operation/meta.ts +11 -0
- package/src/plugin-operation/testing.ts +174 -0
- package/src/plugin-runtime/RuntimePlugin.ts +20 -0
- package/src/plugin-runtime/capability.ts +53 -0
- package/src/{components → plugin-runtime}/index.ts +1 -1
- package/src/plugin-runtime/meta.ts +11 -0
- package/src/plugin-settings/SettingsPlugin.ts +11 -26
- package/src/plugin-settings/actions.ts +39 -0
- package/src/plugin-settings/app-graph-builder.ts +122 -142
- package/src/plugin-settings/meta.ts +2 -2
- package/src/plugin-settings/operation-resolver.ts +55 -0
- package/src/plugin-settings/translations.ts +1 -1
- package/src/react/App.stories.tsx +63 -0
- package/src/{components → react}/App.tsx +11 -10
- package/src/{components → react}/DefaultFallback.tsx +1 -1
- package/src/react/PluginManagerContext.stories.tsx +184 -0
- package/src/react/PluginManagerProvider.ts +2 -2
- package/src/react/Surface.stories.tsx +91 -51
- package/src/react/Surface.tsx +226 -45
- package/src/react/SurfaceInfo.tsx +107 -0
- package/src/react/common.ts +29 -5
- package/src/react/index.ts +5 -1
- package/src/react/types.ts +27 -0
- package/src/react/useApp.tsx +209 -0
- package/src/react/useCapabilities.ts +37 -5
- package/src/{components → react}/useLoading.tsx +4 -6
- package/src/react/useOperationResolver.ts +40 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/service.ts +52 -0
- package/src/testing/withPluginManager.stories.tsx +5 -5
- package/src/testing/withPluginManager.tsx +21 -23
- package/tsconfig.json +25 -7
- package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
- package/dist/lib/browser/app-graph-builder-PSA3RESL.mjs +0 -138
- package/dist/lib/browser/app-graph-builder-PSA3RESL.mjs.map +0 -7
- package/dist/lib/browser/chunk-2VZ4RF4A.mjs +0 -1608
- package/dist/lib/browser/chunk-2VZ4RF4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-CPVYIS24.mjs +0 -451
- package/dist/lib/browser/chunk-CPVYIS24.mjs.map +0 -7
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-BND6IF4U.mjs +0 -11
- package/dist/lib/browser/intent-resolver-27FJAJDE.mjs +0 -39
- package/dist/lib/browser/intent-resolver-27FJAJDE.mjs.map +0 -7
- package/dist/lib/browser/store-F545UOIR.mjs +0 -30
- package/dist/lib/browser/store-F545UOIR.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -77
- package/dist/lib/node-esm/app-graph-builder-VJGZ6KH7.mjs +0 -139
- package/dist/lib/node-esm/app-graph-builder-VJGZ6KH7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3RRWO5TD.mjs +0 -1610
- package/dist/lib/node-esm/chunk-3RRWO5TD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MN37WUJ2.mjs +0 -452
- package/dist/lib/node-esm/chunk-MN37WUJ2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-254AZ6EE.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-NPMOPNFL.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-NPMOPNFL.mjs.map +0 -7
- package/dist/lib/node-esm/store-CINC4R4L.mjs +0 -31
- package/dist/lib/node-esm/store-CINC4R4L.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -78
- package/dist/types/src/common/capabilities.d.ts +0 -201
- package/dist/types/src/common/capabilities.d.ts.map +0 -1
- package/dist/types/src/common/events.d.ts +0 -52
- package/dist/types/src/common/events.d.ts.map +0 -1
- package/dist/types/src/common/layout.d.ts +0 -279
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/components/App.d.ts +0 -10
- package/dist/types/src/components/App.d.ts.map +0 -1
- package/dist/types/src/components/App.stories.d.ts.map +0 -1
- package/dist/types/src/components/DefaultFallback.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/components/useApp.d.ts.map +0 -1
- package/dist/types/src/components/useLoading.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -117
- package/dist/types/src/core/capabilities.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.test.d.ts +0 -2
- package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
- package/dist/types/src/core/events.d.ts.map +0 -1
- package/dist/types/src/core/manager.d.ts +0 -126
- package/dist/types/src/core/manager.d.ts.map +0 -1
- package/dist/types/src/core/manager.test.d.ts +0 -2
- package/dist/types/src/core/manager.test.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/actions.d.ts +0 -36
- package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/errors.d.ts +0 -16
- package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/index.d.ts +0 -6
- package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent.d.ts +0 -63
- package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/meta.d.ts +0 -3
- package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/store.d.ts +0 -5
- package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
- package/dist/types/src/react/IntentContext.d.ts +0 -8
- package/dist/types/src/react/IntentContext.d.ts.map +0 -1
- package/dist/types/src/react/useIntentResolver.d.ts +0 -3
- package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/common/capabilities.ts +0 -217
- package/src/common/events.ts +0 -79
- package/src/common/layout.ts +0 -277
- package/src/components/App.stories.tsx +0 -33
- package/src/components/useApp.tsx +0 -164
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -263
- package/src/core/manager.test.ts +0 -516
- package/src/core/manager.ts +0 -604
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -31
- package/src/plugin-intent/errors.ts +0 -40
- package/src/plugin-intent/index.ts +0 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
- package/src/plugin-intent/intent-dispatcher.ts +0 -337
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-intent/meta.ts +0 -10
- package/src/plugin-settings/intent-resolver.ts +0 -35
- package/src/plugin-settings/store.ts +0 -33
- package/src/react/IntentContext.tsx +0 -35
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
- /package/dist/lib/browser/{intent-dispatcher-BND6IF4U.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → common/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-254AZ6EE.mjs.map → browser/core/activation-event.mjs.map} +0 -0
- /package/dist/lib/{node-esm/worker.mjs.map → browser/core/capability.mjs.map} +0 -0
- /package/dist/types/src/{components → react}/App.stories.d.ts +0 -0
- /package/dist/types/src/{components → react}/DefaultFallback.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactNode, RefCallback } from 'react';
|
|
2
|
+
import type { MakeOptional, Position } from '@dxos/util';
|
|
3
|
+
import type { ErrorBoundary } from '../react';
|
|
4
4
|
/**
|
|
5
5
|
* SurfaceProps are the props that are passed to the Surface component.
|
|
6
6
|
*/
|
|
@@ -15,10 +15,19 @@ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>
|
|
|
15
15
|
* The placeholder component will be rendered while the surface component is loading.
|
|
16
16
|
*/
|
|
17
17
|
placeholder?: ReactNode;
|
|
18
|
-
} & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> &
|
|
18
|
+
} & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> &
|
|
19
|
+
/**
|
|
20
|
+
* Additional props to pass to the component.
|
|
21
|
+
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
22
|
+
* Exclude known prop names to prevent overriding well-defined props.
|
|
23
|
+
*/
|
|
24
|
+
{
|
|
19
25
|
[K in keyof Record<string, any>]: K extends keyof CoreSurfaceProps<T> | 'fallback' | 'placeholder' ? never : any;
|
|
20
26
|
};
|
|
21
|
-
|
|
27
|
+
/**
|
|
28
|
+
* NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.
|
|
29
|
+
*/
|
|
30
|
+
export type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
22
31
|
/**
|
|
23
32
|
* ID for debugging.
|
|
24
33
|
*/
|
|
@@ -29,6 +38,7 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
|
29
38
|
role: string;
|
|
30
39
|
/**
|
|
31
40
|
* The data to be rendered by the surface.
|
|
41
|
+
* NOTE: This must be a stable value.
|
|
32
42
|
*/
|
|
33
43
|
data: T;
|
|
34
44
|
/**
|
|
@@ -36,24 +46,49 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
|
36
46
|
*/
|
|
37
47
|
limit?: number | undefined;
|
|
38
48
|
}>;
|
|
39
|
-
type SurfaceComponentProps<T extends Record<string, any> = Record<string,
|
|
49
|
+
export type SurfaceComponentProps<T extends Record<string, any> = Record<string, any>> = CoreSurfaceProps<T> & {
|
|
50
|
+
ref?: RefCallback<HTMLElement>;
|
|
51
|
+
} & Record<string, any>;
|
|
40
52
|
/**
|
|
41
53
|
* React component used to render a surface once is has matched.
|
|
42
54
|
*/
|
|
43
|
-
export type SurfaceComponent<T extends Record<string, any> = Record<string,
|
|
55
|
+
export type SurfaceComponent<T extends Record<string, any> = Record<string, any>> = (props: SurfaceComponentProps<T>) => ReactNode;
|
|
44
56
|
/**
|
|
45
|
-
* Definition of when a SurfaceComponent should be rendered.
|
|
57
|
+
* Definition of when a React SurfaceComponent should be rendered.
|
|
46
58
|
*/
|
|
47
|
-
export type
|
|
59
|
+
export type ReactSurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
60
|
+
kind: 'react';
|
|
48
61
|
id: string;
|
|
49
62
|
role: string | string[];
|
|
50
63
|
position?: Position;
|
|
64
|
+
component: SurfaceComponent<T>;
|
|
51
65
|
filter?: (data: Record<string, unknown>) => data is T;
|
|
52
|
-
component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
|
|
53
66
|
}>;
|
|
54
67
|
/**
|
|
55
|
-
*
|
|
68
|
+
* Definition of when a Web Component surface should be rendered.
|
|
69
|
+
*/
|
|
70
|
+
export type WebComponentSurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
71
|
+
kind: 'web-component';
|
|
72
|
+
id: string;
|
|
73
|
+
role: string | string[];
|
|
74
|
+
position?: Position;
|
|
75
|
+
/**
|
|
76
|
+
* The tag name of the Web Component to render.
|
|
77
|
+
* The Web Component will receive the same props as React surfaces via properties/attributes.
|
|
78
|
+
*/
|
|
79
|
+
tagName: string;
|
|
80
|
+
filter?: (data: Record<string, unknown>) => data is T;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Definition of when a surface (React or Web Component) should be rendered.
|
|
84
|
+
*/
|
|
85
|
+
export type SurfaceDefinition<T extends Record<string, any> = any> = ReactSurfaceDefinition<T> | WebComponentSurfaceDefinition<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a React surface definition.
|
|
88
|
+
*/
|
|
89
|
+
export declare const createSurface: <T extends Record<string, any> = any>(definition: Omit<ReactSurfaceDefinition<T>, "kind">) => ReactSurfaceDefinition<T>;
|
|
90
|
+
/**
|
|
91
|
+
* Creates a Web Component surface definition.
|
|
56
92
|
*/
|
|
57
|
-
export declare const
|
|
58
|
-
export {};
|
|
93
|
+
export declare const createWebSurface: <T extends Record<string, any> = any>(definition: Omit<WebComponentSurfaceDefinition<T>, "kind">) => WebComponentSurfaceDefinition<T>;
|
|
59
94
|
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAA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,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAC7D,sBAAsB,CAAC,CAAC,CAAC,GACzB,6BAA6B,CAAC,CAAC,CAAC,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAC/D,YAAY,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAClD,sBAAsB,CAAC,CAAC,CAAuC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAClE,YAAY,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KACzD,6BAA6B,CAAC,CAAC,CAA+C,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* A Label represents translatable text - either a simple string or a tuple of [key, options].
|
|
4
|
+
*/
|
|
5
|
+
export declare const Label: Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Tuple2<typeof Schema.String, Schema.mutable<Schema.Struct<{
|
|
6
|
+
ns: typeof Schema.String;
|
|
7
|
+
count: Schema.optional<typeof Schema.Number>;
|
|
8
|
+
defaultValue: Schema.optional<typeof Schema.String>;
|
|
9
|
+
}>>>>]>;
|
|
10
|
+
export type Label = Schema.Schema.Type<typeof Label>;
|
|
2
11
|
export declare const ResourceKey: Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>;
|
|
3
12
|
export type ResourceKey = Schema.Schema.Type<typeof ResourceKey>;
|
|
4
13
|
export declare const ResourceLanguage: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,WAAW,+FAAwF,CAAC;AACjH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qIAA4D,CAAC;AAC1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,QAAQ,2KAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,KAAK;;;;OAcjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD,eAAO,MAAM,WAAW,+FAAwF,CAAC;AACjH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qIAA4D,CAAC;AAC1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,QAAQ,2KAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,eAAO,MAAM,oBAAoB;;CAAsF,CAAC"}
|
|
@@ -11,7 +11,7 @@ export type ActivationEvent = {
|
|
|
11
11
|
/**
|
|
12
12
|
* An activation event that can be a single event, or a combination of events.
|
|
13
13
|
*/
|
|
14
|
-
export type
|
|
14
|
+
export type Events = ActivationEvent | {
|
|
15
15
|
type: 'one-of';
|
|
16
16
|
events: ActivationEvent[];
|
|
17
17
|
} | {
|
|
@@ -21,7 +21,7 @@ export type ActivationEvents = ActivationEvent | {
|
|
|
21
21
|
/**
|
|
22
22
|
* Helper to define an activation event.
|
|
23
23
|
*/
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const make: (id: string, specifier?: string) => ActivationEvent;
|
|
25
25
|
/**
|
|
26
26
|
* Helper to create an activation event key.
|
|
27
27
|
*/
|
|
@@ -43,19 +43,19 @@ export declare const allOf: (...events: ActivationEvent[]) => {
|
|
|
43
43
|
/**
|
|
44
44
|
* Helper to check if an activation event is a one-of event.
|
|
45
45
|
*/
|
|
46
|
-
export declare const isOneOf: (events:
|
|
46
|
+
export declare const isOneOf: (events: Events) => events is {
|
|
47
47
|
type: "one-of";
|
|
48
48
|
events: ActivationEvent[];
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* Helper to check if an activation event is an all-of event.
|
|
52
52
|
*/
|
|
53
|
-
export declare const isAllOf: (events:
|
|
53
|
+
export declare const isAllOf: (events: Events) => events is {
|
|
54
54
|
type: "all-of";
|
|
55
55
|
events: ActivationEvent[];
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
58
|
* Helper to get the events from an activation event.
|
|
59
59
|
*/
|
|
60
|
-
export declare const getEvents: (events:
|
|
61
|
-
//# sourceMappingURL=
|
|
60
|
+
export declare const getEvents: (events: Events) => ActivationEvent[];
|
|
61
|
+
//# sourceMappingURL=activation-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation-event.d.ts","sourceRoot":"","sources":["../../../../src/core/activation-event.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,eAAe,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,IAAI,MAAM,EAAE,YAAY,MAAM,KACrB,eAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,eAAe,WAAoE,CAAC;AAEpH;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAChD,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAChD,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,sBAAkD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import type * as Capability from './capability';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for the Capability Manager.
|
|
6
|
+
* Provides methods for contributing, removing, and accessing capabilities.
|
|
7
|
+
*/
|
|
8
|
+
export interface CapabilityManager {
|
|
9
|
+
contribute<T>(args: {
|
|
10
|
+
module: string;
|
|
11
|
+
interface: Capability.InterfaceDef<T>;
|
|
12
|
+
implementation: T;
|
|
13
|
+
}): void;
|
|
14
|
+
remove<T>(interfaceDef: Capability.InterfaceDef<T>, implementation: T): void;
|
|
15
|
+
/**
|
|
16
|
+
* Get the Atom reference to the available capabilities for a given interface.
|
|
17
|
+
* Primarily useful for deriving other Atom values based on the capabilities or
|
|
18
|
+
* for subscribing to changes in the capabilities.
|
|
19
|
+
* @returns An atom reference to the available capabilities.
|
|
20
|
+
*/
|
|
21
|
+
atom<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<T[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Get capabilities from the capability manager.
|
|
24
|
+
* @returns An array of capabilities.
|
|
25
|
+
*/
|
|
26
|
+
getAll<T>(interfaceDef: Capability.InterfaceDef<T>): T[];
|
|
27
|
+
/**
|
|
28
|
+
* Requests a single capability from the capability manager.
|
|
29
|
+
* @returns The capability.
|
|
30
|
+
* @throws If no capability is found.
|
|
31
|
+
*/
|
|
32
|
+
get<T>(interfaceDef: Capability.InterfaceDef<T>): T;
|
|
33
|
+
/**
|
|
34
|
+
* Waits for a capability to be available.
|
|
35
|
+
* @returns The capability.
|
|
36
|
+
*/
|
|
37
|
+
waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new Capability Manager instance.
|
|
41
|
+
*/
|
|
42
|
+
export declare const make: (options: CapabilityManagerOptions) => CapabilityManager;
|
|
43
|
+
//# sourceMappingURL=capability-manager.d.ts.map
|
|
@@ -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|
|
|
1
|
+
{"version":3,"file":"capability-manager.test.d.ts","sourceRoot":"","sources":["../../../../src/core/capability-manager.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import type * as CapabilityManager from './capability-manager';
|
|
5
|
+
import type * as Plugin from './plugin';
|
|
6
|
+
declare const Service_base: Context.TagClass<Service, "@dxos/app-framework/CapabilityManager", CapabilityManager.CapabilityManager>;
|
|
7
|
+
/**
|
|
8
|
+
* Effect Context.Tag for accessing CapabilityManager via the Effect layer system.
|
|
9
|
+
* This allows capability modules to access the capability manager without having it passed as an argument.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Service extends Service_base {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get a single capability from the capability manager.
|
|
15
|
+
* @param interfaceDef The interface definition of the capability.
|
|
16
|
+
* @returns The capability implementation.
|
|
17
|
+
* @throws If no capability is found.
|
|
18
|
+
*/
|
|
19
|
+
export declare const get: <T>(interfaceDef: InterfaceDef<T>) => Effect.Effect<T, Error, Service>;
|
|
20
|
+
/**
|
|
21
|
+
* Get all capabilities from the capability manager for a given interface.
|
|
22
|
+
* @param interfaceDef The interface definition of the capability.
|
|
23
|
+
* @returns An array of capability implementations.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getAll: <T>(interfaceDef: InterfaceDef<T>) => Effect.Effect<T[], never, Service>;
|
|
26
|
+
/**
|
|
27
|
+
* Wait for a capability to be available.
|
|
28
|
+
* @param interfaceDef The interface definition of the capability.
|
|
29
|
+
* @returns The capability implementation once available.
|
|
30
|
+
*/
|
|
31
|
+
export declare const waitFor: <T>(interfaceDef: InterfaceDef<T>) => Effect.Effect<T, Error, Service>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the Atom reference to capabilities for reactive access.
|
|
34
|
+
* @param interfaceDef The interface definition of the capability.
|
|
35
|
+
* @returns An Atom containing the array of capability implementations.
|
|
36
|
+
*/
|
|
37
|
+
export declare const atom: <T>(interfaceDef: InterfaceDef<T>) => Effect.Effect<Atom.Atom<T[]>, never, Service>;
|
|
38
|
+
declare const InterfaceDefTypeId: unique symbol;
|
|
39
|
+
/**
|
|
40
|
+
* Symbol used to tag lazy capability functions with their module ID.
|
|
41
|
+
*/
|
|
42
|
+
export declare const ModuleTag: unique symbol;
|
|
43
|
+
/**
|
|
44
|
+
* The interface definition of a capability.
|
|
45
|
+
*/
|
|
46
|
+
export type InterfaceDef<T> = {
|
|
47
|
+
[InterfaceDefTypeId]: T;
|
|
48
|
+
identifier: string;
|
|
49
|
+
};
|
|
50
|
+
export declare namespace InterfaceDef {
|
|
51
|
+
type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Helper to define the interface of a capability.
|
|
55
|
+
*/
|
|
56
|
+
export declare const make: <T>(identifier: string) => InterfaceDef<T>;
|
|
57
|
+
/**
|
|
58
|
+
* A unique string identifier with a Typescript type associated with it.
|
|
59
|
+
* When a capability is contributed to the application an implementation of the interface is provided.
|
|
60
|
+
*/
|
|
61
|
+
export type Capability<T> = {
|
|
62
|
+
/**
|
|
63
|
+
* The interface definition of the capability.
|
|
64
|
+
*/
|
|
65
|
+
readonly interface: InterfaceDef<T>;
|
|
66
|
+
/**
|
|
67
|
+
* The implementation of the capability.
|
|
68
|
+
*/
|
|
69
|
+
readonly implementation: T;
|
|
70
|
+
/**
|
|
71
|
+
* Called when the capability is deactivated.
|
|
72
|
+
*/
|
|
73
|
+
readonly deactivate?: () => Effect.Effect<void, Error>;
|
|
74
|
+
};
|
|
75
|
+
export type Any = Capability<any>;
|
|
76
|
+
/**
|
|
77
|
+
* Union type representing all valid return types for a capability module.
|
|
78
|
+
* Supports single capabilities, arrays, and tuples of different capability types.
|
|
79
|
+
*/
|
|
80
|
+
export type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]] | readonly [Any, ...Any[]];
|
|
81
|
+
/**
|
|
82
|
+
* Helper to define the implementation of a capability.
|
|
83
|
+
*/
|
|
84
|
+
export declare const contributes: <I extends InterfaceDef<any>>(interfaceDef: I, implementation: Capability<InterfaceDef.Implementation<I>>["implementation"], deactivate?: Capability<InterfaceDef.Implementation<I>>["deactivate"]) => Capability<I>;
|
|
85
|
+
type LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{
|
|
86
|
+
default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
|
|
87
|
+
}>;
|
|
88
|
+
type LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{
|
|
89
|
+
default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
|
|
90
|
+
}>;
|
|
91
|
+
type NormalizeReturn<R> = R extends readonly (infer A)[] ? A[] : R extends (infer A)[] ? A[] : R extends Any ? [R] : Any[];
|
|
92
|
+
export type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (props?: Props) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;
|
|
93
|
+
/**
|
|
94
|
+
* Helper to define a lazily loaded implementation of a capability.
|
|
95
|
+
* Supports single capabilities, arrays, and tuples of different capability types.
|
|
96
|
+
* @param name The export name (e.g., 'AppGraphBuilder') - used to auto-compute module IDs.
|
|
97
|
+
* @param loader The lazy loader function.
|
|
98
|
+
* @returns A lazy capability function with ModuleTag symbol attached.
|
|
99
|
+
*/
|
|
100
|
+
export declare const lazy: <T = void, R extends ModuleReturn = ModuleReturn>(name: string, c: LoadCapability<T, R> | LoadCapabilities<T, R>) => LazyCapability<T, R>;
|
|
101
|
+
/**
|
|
102
|
+
* Gets the module tag (export name) from a lazy capability function.
|
|
103
|
+
* @param capability The lazy capability function.
|
|
104
|
+
* @returns The module tag if present, undefined otherwise.
|
|
105
|
+
*/
|
|
106
|
+
export declare const getModuleTag: (capability: unknown) => string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Helper to define a capability module with explicit typing.
|
|
109
|
+
* Wraps the default export function to provide better type inference and make the pattern explicit.
|
|
110
|
+
*
|
|
111
|
+
* This helper provides explicit typing for the module activation function,
|
|
112
|
+
* making it clear that the function should:
|
|
113
|
+
* - Access CapabilityManager via the Effect layer system (Capability.get, Capability.getAll, etc.)
|
|
114
|
+
* - Return a capability, array of capabilities, or tuple of different capability types (sync or async)
|
|
115
|
+
*
|
|
116
|
+
* Supports returning multiple capabilities of different types as a tuple, which will be normalized
|
|
117
|
+
* to an array at runtime for compatibility with the plugin system.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* // Module without options - single capability
|
|
122
|
+
* export default Capability.makeModule(
|
|
123
|
+
* Effect.fnUntraced(function* () {
|
|
124
|
+
* const client = yield* Capability.get(ClientCapabilities.Client);
|
|
125
|
+
* return contributes(Capabilities.SettingsStore, store);
|
|
126
|
+
* })
|
|
127
|
+
* );
|
|
128
|
+
*
|
|
129
|
+
* // Module with multiple capabilities
|
|
130
|
+
* export default Capability.makeModule(
|
|
131
|
+
* Effect.fnUntraced(function* () {
|
|
132
|
+
* return [
|
|
133
|
+
* contributes(Capabilities.SettingsStore, store),
|
|
134
|
+
* contributes(Capabilities.Translations, translations),
|
|
135
|
+
* ];
|
|
136
|
+
* })
|
|
137
|
+
* );
|
|
138
|
+
*
|
|
139
|
+
* // Module with additional options (context accessed via layer)
|
|
140
|
+
* export default Capability.makeModule(
|
|
141
|
+
* Effect.fnUntraced(function* ({ observability }: { observability?: boolean }) {
|
|
142
|
+
* const invoker = yield* Capability.get(Common.Capability.OperationInvoker);
|
|
143
|
+
* return contributes(Capabilities.IntentResolver, ...);
|
|
144
|
+
* })
|
|
145
|
+
* );
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export declare const makeModule: <TProps = void, TReturn extends ModuleReturn = ModuleReturn, E extends Error = Error, R extends Service | Plugin.Service | never = Service>(fn: (props?: TProps) => Effect.Effect<TReturn, E, R>) => ((props?: TProps) => Effect.Effect<TReturn, E, R>);
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../../src/core/capability.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;;AAMxC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAG1B;CAAG;AAEN;;;;;GAKG;AAGH,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAMnF,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAC3B,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CACrB,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,cAAc,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,I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AE,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,GAAG,IAAI,EAAE,CAAC,SAAS,YAAY,GAAG,YAAY,EAClE,MAAM,MAAM,EACZ,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,KAC/C,cAAc,CAAC,CAAC,EAAE,CAAC,CAUrB,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,YAAY,GAAI,YAAY,OAAO,KAAG,MAAM,GAAG,SAI3D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,GAAG,IAAI,EACb,OAAO,SAAS,YAAY,GAAG,YAAY,EAC3C,CAAC,SAAS,KAAK,GAAG,KAAK,EACvB,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,OAAO,EAEpD,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,KACnD,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAO,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './manager';
|
|
4
|
-
export * from './plugin';
|
|
1
|
+
export * as ActivationEvent from './activation-event';
|
|
2
|
+
export * as Capability from './capability';
|
|
3
|
+
export * as CapabilityManager from './capability-manager';
|
|
4
|
+
export * as Plugin from './plugin';
|
|
5
|
+
export * as PluginManager from './plugin-manager';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as PubSub from 'effect/PubSub';
|
|
4
|
+
import * as ActivationEvent from './activation-event';
|
|
5
|
+
import * as CapabilityManager from './capability-manager';
|
|
6
|
+
import * as Plugin from './plugin';
|
|
7
|
+
/**
|
|
8
|
+
* Identifier denoting a Manager.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ManagerTypeId: unique symbol;
|
|
11
|
+
export type ManagerTypeId = typeof ManagerTypeId;
|
|
12
|
+
export type ManagerOptions = {
|
|
13
|
+
pluginLoader: (id: string) => Effect.Effect<Plugin.Plugin, Error>;
|
|
14
|
+
plugins?: Plugin.Plugin[];
|
|
15
|
+
core?: string[];
|
|
16
|
+
enabled?: string[];
|
|
17
|
+
registry?: Registry.Registry;
|
|
18
|
+
};
|
|
19
|
+
type ActivationMessage = {
|
|
20
|
+
event: string;
|
|
21
|
+
state: 'activating' | 'activated' | 'error';
|
|
22
|
+
error?: Error;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Interface for the Plugin Manager.
|
|
26
|
+
*/
|
|
27
|
+
export interface PluginManager {
|
|
28
|
+
readonly [ManagerTypeId]: ManagerTypeId;
|
|
29
|
+
readonly activation: PubSub.PubSub<ActivationMessage>;
|
|
30
|
+
readonly capabilities: CapabilityManager.CapabilityManager;
|
|
31
|
+
readonly registry: Registry.Registry;
|
|
32
|
+
readonly plugins: Atom.Atom<readonly Plugin.Plugin[]>;
|
|
33
|
+
readonly core: Atom.Atom<readonly string[]>;
|
|
34
|
+
readonly enabled: Atom.Atom<readonly string[]>;
|
|
35
|
+
readonly modules: Atom.Atom<readonly Plugin.PluginModule[]>;
|
|
36
|
+
readonly active: Atom.Atom<readonly string[]>;
|
|
37
|
+
readonly eventsFired: Atom.Atom<readonly string[]>;
|
|
38
|
+
readonly pendingReset: Atom.Atom<readonly string[]>;
|
|
39
|
+
getPlugins(): readonly Plugin.Plugin[];
|
|
40
|
+
getCore(): readonly string[];
|
|
41
|
+
getEnabled(): readonly string[];
|
|
42
|
+
getModules(): readonly Plugin.PluginModule[];
|
|
43
|
+
getActive(): readonly string[];
|
|
44
|
+
getEventsFired(): readonly string[];
|
|
45
|
+
getPendingReset(): readonly string[];
|
|
46
|
+
add(id: string): Effect.Effect<boolean, Error>;
|
|
47
|
+
enable(id: string): Effect.Effect<boolean, Error>;
|
|
48
|
+
remove(id: string): boolean;
|
|
49
|
+
disable(id: string): Effect.Effect<boolean, Error>;
|
|
50
|
+
activate(event: ActivationEvent.ActivationEvent | string, params?: {
|
|
51
|
+
before?: string;
|
|
52
|
+
after?: string;
|
|
53
|
+
}): Effect.Effect<boolean, Error>;
|
|
54
|
+
deactivate(id: string): Effect.Effect<boolean, Error>;
|
|
55
|
+
reset(event: ActivationEvent.ActivationEvent | string): Effect.Effect<boolean, Error>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Type guard to check if a value is a PluginManager.
|
|
59
|
+
*/
|
|
60
|
+
export declare const isManager: (value: unknown) => value is PluginManager;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new Plugin Manager instance.
|
|
63
|
+
*/
|
|
64
|
+
export declare const make: (options: ManagerOptions) => PluginManager;
|
|
65
|
+
export {};
|
|
66
|
+
//#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