@dxos/app-framework 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b
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/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs +137 -0
- package/dist/lib/browser/app-graph-builder-F7VZ6LRN.mjs.map +7 -0
- package/dist/lib/browser/chunk-ATRNTMSS.mjs +1399 -0
- package/dist/lib/browser/chunk-ATRNTMSS.mjs.map +7 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs +32 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +7 -0
- package/dist/lib/browser/chunk-WS6SU6HI.mjs +285 -0
- package/dist/lib/browser/chunk-WS6SU6HI.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +119 -642
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-dispatcher-E6J7E5Y5.mjs +11 -0
- package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs +38 -0
- package/dist/lib/browser/intent-resolver-XLE4L3LS.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/store-QU2IKFAI.mjs +19 -0
- package/dist/lib/browser/store-QU2IKFAI.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +74 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/worker.mjs +77 -0
- package/dist/lib/node/app-graph-builder-JGBADFF7.cjs +146 -0
- package/dist/lib/node/app-graph-builder-JGBADFF7.cjs.map +7 -0
- package/dist/lib/node/{chunk-FCMHRU3M.cjs → chunk-QLVQ6PND.cjs} +23 -35
- package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
- package/dist/lib/node/chunk-WKC6YMEQ.cjs +1433 -0
- package/dist/lib/node/chunk-WKC6YMEQ.cjs.map +7 -0
- package/dist/lib/node/chunk-WRWRZKZU.cjs +308 -0
- package/dist/lib/node/chunk-WRWRZKZU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +125 -665
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{plugin-settings-W6UHMH5M.cjs → intent-dispatcher-CFBKDZQR.cjs} +10 -14
- package/dist/lib/node/intent-dispatcher-CFBKDZQR.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-3TKCXP4S.cjs +45 -0
- package/dist/lib/node/intent-resolver-3TKCXP4S.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/store-4QMUUU2A.cjs +34 -0
- package/dist/lib/node/store-4QMUUU2A.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +98 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node/worker.cjs +99 -0
- package/dist/lib/node/worker.cjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs +138 -0
- package/dist/lib/node-esm/app-graph-builder-2QEX57NX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-44J2VZBB.mjs +1401 -0
- package/dist/lib/node-esm/chunk-44J2VZBB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +34 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HTLXL32I.mjs +286 -0
- package/dist/lib/node-esm/chunk-HTLXL32I.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +119 -642
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-dispatcher-LDQGDZ62.mjs +12 -0
- package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs +39 -0
- package/dist/lib/node-esm/intent-resolver-7VJWN67U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/store-VWDAYUQY.mjs +20 -0
- package/dist/lib/node-esm/store-VWDAYUQY.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +75 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/worker.mjs +78 -0
- package/dist/types/src/App.d.ts +22 -13
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +293 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -0
- package/dist/types/src/common/events.d.ts +48 -0
- package/dist/types/src/common/events.d.ts.map +1 -0
- package/dist/types/src/common/file.d.ts +14 -0
- package/dist/types/src/common/file.d.ts.map +1 -0
- package/dist/types/src/common/graph.d.ts +21 -0
- package/dist/types/src/common/graph.d.ts.map +1 -0
- package/dist/types/src/common/index.d.ts +8 -0
- package/dist/types/src/common/index.d.ts.map +1 -0
- package/dist/types/src/common/layout.d.ts +248 -0
- package/dist/types/src/common/layout.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
- package/dist/types/src/common/surface.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +11 -0
- package/dist/types/src/common/translations.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.d.ts +94 -0
- package/dist/types/src/core/capabilities.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.test.d.ts +2 -0
- package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
- package/dist/types/src/core/events.d.ts +58 -0
- package/dist/types/src/core/events.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -0
- package/dist/types/src/core/index.d.ts.map +1 -0
- package/dist/types/src/core/manager.d.ts +119 -0
- package/dist/types/src/core/manager.d.ts.map +1 -0
- package/dist/types/src/core/manager.test.d.ts +2 -0
- package/dist/types/src/core/manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +97 -0
- package/dist/types/src/core/plugin.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts +10 -0
- package/dist/types/src/helpers.d.ts.map +1 -0
- package/dist/types/src/helpers.test.d.ts +2 -0
- package/dist/types/src/helpers.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +6 -0
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
- package/dist/types/src/playground/debug/index.d.ts +2 -0
- package/dist/types/src/playground/debug/index.d.ts.map +1 -0
- package/dist/types/src/playground/debug/plugin.d.ts +2 -0
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Main.d.ts +6 -0
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/generator/generator.d.ts +7 -0
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
- package/dist/types/src/playground/generator/index.d.ts +3 -0
- package/dist/types/src/playground/generator/index.d.ts.map +1 -0
- package/dist/types/src/playground/generator/plugin.d.ts +2 -0
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/layout/Layout.d.ts +8 -0
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
- package/dist/types/src/playground/layout/index.d.ts +2 -0
- package/dist/types/src/playground/layout/index.d.ts.map +1 -0
- package/dist/types/src/playground/layout/plugin.d.ts +2 -0
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/logger/index.d.ts +2 -0
- package/dist/types/src/playground/logger/index.d.ts.map +1 -0
- package/dist/types/src/playground/logger/plugin.d.ts +2 -0
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/schema.d.ts +13 -0
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
- package/dist/types/src/playground/playground.stories.d.ts +10 -0
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/actions.d.ts +23 -0
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/errors.d.ts +16 -0
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/index.d.ts +5 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +113 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +8 -28
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/actions.d.ts +27 -0
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/index.d.ts +3 -0
- package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +4 -0
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/store.d.ts +5 -0
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/translations.d.ts +11 -0
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/src/{plugins/plugin-intent → react}/IntentContext.d.ts +2 -2
- package/dist/types/src/react/IntentContext.d.ts.map +1 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/react/Surface.d.ts +12 -0
- package/dist/types/src/react/Surface.d.ts.map +1 -0
- package/dist/types/src/react/Surface.stories.d.ts +16 -0
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
- package/dist/types/src/react/common.d.ts +12 -0
- package/dist/types/src/react/common.d.ts.map +1 -0
- package/dist/types/src/react/index.d.ts +7 -0
- package/dist/types/src/react/index.d.ts.map +1 -0
- package/dist/types/src/react/useCapabilities.d.ts +13 -0
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/react/useIntentResolver.d.ts +3 -0
- package/dist/types/src/react/useIntentResolver.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +10 -0
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
- package/dist/types/src/worker.d.ts +4 -0
- package/dist/types/src/worker.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -18
- package/project.json +4 -3
- package/src/App.tsx +139 -34
- package/src/common/capabilities.ts +91 -0
- package/src/common/events.ts +72 -0
- package/src/common/file.ts +22 -0
- package/src/common/graph.ts +30 -0
- package/src/{plugins/common → common}/index.ts +3 -2
- package/src/common/layout.ts +225 -0
- package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
- package/src/common/translations.ts +17 -0
- package/src/core/capabilities.test.ts +116 -0
- package/src/core/capabilities.ts +222 -0
- package/src/core/events.ts +58 -0
- package/src/core/index.ts +8 -0
- package/src/core/manager.test.ts +516 -0
- package/src/core/manager.ts +511 -0
- package/src/core/plugin.ts +131 -0
- package/src/helpers.test.ts +97 -0
- package/src/helpers.ts +45 -0
- package/src/index.ts +6 -3
- package/src/playground/debug/Debug.tsx +39 -0
- package/src/playground/debug/index.ts +5 -0
- package/src/playground/debug/plugin.ts +17 -0
- package/src/playground/generator/Main.tsx +71 -0
- package/src/playground/generator/Toolbar.tsx +46 -0
- package/src/playground/generator/generator.ts +48 -0
- package/src/playground/generator/index.ts +6 -0
- package/src/playground/generator/plugin.ts +23 -0
- package/src/playground/layout/Layout.tsx +33 -0
- package/src/playground/layout/index.ts +5 -0
- package/src/playground/layout/plugin.ts +17 -0
- package/src/playground/logger/Toolbar.tsx +29 -0
- package/src/playground/logger/index.ts +5 -0
- package/src/playground/logger/plugin.ts +36 -0
- package/src/playground/logger/schema.ts +12 -0
- package/src/playground/playground.stories.tsx +34 -0
- package/src/plugin-intent/IntentPlugin.tsx +20 -0
- package/src/plugin-intent/actions.ts +22 -0
- package/src/plugin-intent/errors.ts +39 -0
- package/src/plugin-intent/index.ts +8 -0
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +83 -63
- package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +114 -95
- package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +10 -26
- package/src/plugin-settings/SettingsPlugin.ts +35 -0
- package/src/plugin-settings/actions.ts +27 -0
- package/src/plugin-settings/app-graph-builder.ts +122 -0
- package/src/plugin-settings/index.ts +6 -0
- package/src/plugin-settings/intent-resolver.ts +28 -0
- package/src/plugin-settings/store.ts +20 -0
- package/src/plugin-settings/translations.ts +17 -0
- package/src/{plugins/plugin-intent → react}/IntentContext.tsx +13 -5
- package/src/react/PluginManagerProvider.ts +22 -0
- package/src/react/Surface.stories.tsx +96 -0
- package/src/react/Surface.tsx +75 -0
- package/src/react/common.ts +12 -0
- package/src/react/index.ts +10 -0
- package/src/react/useCapabilities.ts +39 -0
- package/src/react/useIntentResolver.ts +22 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/withPluginManager.stories.tsx +47 -0
- package/src/testing/withPluginManager.tsx +75 -0
- package/src/worker.ts +11 -0
- package/tsconfig.json +16 -4
- package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
- package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
- package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
- package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
- package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
- package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
- package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
- package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
- package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
- package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
- package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
- package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
- package/dist/lib/node/chunk-FCMHRU3M.cjs.map +0 -7
- package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
- package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
- package/dist/lib/node/chunk-VWHAALIN.cjs +0 -344
- package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
- package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
- package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
- package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
- package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
- package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
- package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
- package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
- package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs +0 -33
- package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
- package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
- package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs.map +0 -7
- package/dist/types/src/plugins/common/file.d.ts +0 -22
- package/dist/types/src/plugins/common/file.d.ts.map +0 -1
- package/dist/types/src/plugins/common/graph.d.ts +0 -51
- package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
- package/dist/types/src/plugins/common/index.d.ts +0 -7
- package/dist/types/src/plugins/common/index.d.ts.map +0 -1
- package/dist/types/src/plugins/common/layout.d.ts +0 -176
- package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
- package/dist/types/src/plugins/common/metadata.d.ts +0 -16
- package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
- package/dist/types/src/plugins/common/navigation.d.ts +0 -243
- package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
- package/dist/types/src/plugins/common/translations.d.ts +0 -22
- package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
- package/dist/types/src/plugins/helpers.d.ts +0 -41
- package/dist/types/src/plugins/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/index.d.ts +0 -7
- package/dist/types/src/plugins/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -16
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/index.d.ts +0 -6
- package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
- package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -7
- package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts +0 -107
- package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
- package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -26
- package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -7
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
- package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -17
- package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
- package/src/plugins/common/file.ts +0 -36
- package/src/plugins/common/graph.ts +0 -70
- package/src/plugins/common/layout.ts +0 -173
- package/src/plugins/common/metadata.ts +0 -29
- package/src/plugins/common/navigation.ts +0 -214
- package/src/plugins/common/translations.ts +0 -36
- package/src/plugins/helpers.ts +0 -92
- package/src/plugins/index.ts +0 -11
- package/src/plugins/plugin-host/HostPlugin.tsx +0 -88
- package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
- package/src/plugins/plugin-host/PluginContext.tsx +0 -79
- package/src/plugins/plugin-host/index.ts +0 -12
- package/src/plugins/plugin-host/plugin.test.ts +0 -158
- package/src/plugins/plugin-host/plugin.ts +0 -133
- package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
- package/src/plugins/plugin-intent/index.ts +0 -13
- package/src/plugins/plugin-intent/meta.ts +0 -11
- package/src/plugins/plugin-intent/provides.ts +0 -26
- package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
- package/src/plugins/plugin-settings/index.ts +0 -9
- package/src/plugins/plugin-settings/meta.ts +0 -9
- package/src/plugins/plugin-settings/provides.ts +0 -34
- package/src/plugins/plugin-surface/Surface.tsx +0 -62
- package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
- package/src/plugins/plugin-surface/helpers.ts +0 -22
- package/src/plugins/plugin-surface/index.ts +0 -14
- package/src/plugins/plugin-surface/meta.ts +0 -9
- package/src/plugins/plugin-surface/provides.ts +0 -27
- /package/dist/lib/browser/{plugin-intent-T7Y3MJ5C.mjs.map → intent-dispatcher-E6J7E5Y5.mjs.map} +0 -0
- /package/dist/lib/browser/{plugin-settings-5U2L2NRU.mjs.map → worker.mjs.map} +0 -0
- /package/dist/lib/{browser/plugin-surface-OKPF3EQI.mjs.map → node-esm/intent-dispatcher-LDQGDZ62.mjs.map} +0 -0
- /package/dist/lib/node-esm/{plugin-intent-W2HQC6LC.mjs.map → worker.mjs.map} +0 -0
- /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
- /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
- /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// TODO(wittjosiah): Reconcile with @dxos/protocols. Factor out errors.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* NOTE: Messages should be sentences (Start with a capital letter and end with a period).
|
|
9
|
+
* Errors can optionally include a JSON context object.
|
|
10
|
+
*/
|
|
11
|
+
export class BaseError extends Error {
|
|
12
|
+
constructor(
|
|
13
|
+
readonly code: string,
|
|
14
|
+
message?: string,
|
|
15
|
+
readonly context?: Record<string, any>,
|
|
16
|
+
) {
|
|
17
|
+
// TODO(dmaretskyi): Error.cause.
|
|
18
|
+
super(message ?? code);
|
|
19
|
+
this.name = code;
|
|
20
|
+
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
|
21
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class NoResolversError extends BaseError {
|
|
26
|
+
constructor(action: string) {
|
|
27
|
+
super('NO_RESOLVERS', 'No resolvers were found for the action', { action });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class CycleDetectedError extends BaseError {
|
|
32
|
+
constructor(context?: Record<string, any>) {
|
|
33
|
+
super(
|
|
34
|
+
'CYCLE_DETECTED',
|
|
35
|
+
'Intent execution limit exceeded. This is likely due to an infinite loop within intent resolvers.',
|
|
36
|
+
context,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema as S } from '@effect/schema';
|
|
5
6
|
import { Effect, Fiber, pipe } from 'effect';
|
|
6
7
|
import { describe, expect, test } from 'vitest';
|
|
7
8
|
|
|
8
|
-
import { S } from '@dxos/echo-schema';
|
|
9
|
-
|
|
10
9
|
import { chain, createIntent } from './intent';
|
|
11
|
-
import { createDispatcher, createResolver } from './intent-dispatcher';
|
|
10
|
+
import { type AnyIntentResolver, createDispatcher, createResolver } from './intent-dispatcher';
|
|
12
11
|
|
|
13
12
|
describe('Intent dispatcher', () => {
|
|
14
13
|
test('throws error if no resolver found', async () => {
|
|
15
|
-
const { dispatchPromise } = createDispatcher(
|
|
14
|
+
const { dispatchPromise } = createDispatcher(() => []);
|
|
16
15
|
const { data, error } = await dispatchPromise(createIntent(ToString, { value: 1 }));
|
|
17
16
|
|
|
18
17
|
expect(data).toBe(undefined);
|
|
@@ -20,7 +19,7 @@ describe('Intent dispatcher', () => {
|
|
|
20
19
|
});
|
|
21
20
|
|
|
22
21
|
test('matches intent to resolver and executes', async () => {
|
|
23
|
-
const { dispatchPromise } = createDispatcher(
|
|
22
|
+
const { dispatchPromise } = createDispatcher(() => [toStringResolver]);
|
|
24
23
|
const { data, error } = await dispatchPromise(createIntent(ToString, { value: 1 }));
|
|
25
24
|
|
|
26
25
|
expect(error).toBe(undefined);
|
|
@@ -28,18 +27,19 @@ describe('Intent dispatcher', () => {
|
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
test('update resolvers', async () => {
|
|
31
|
-
const
|
|
30
|
+
const resolvers: AnyIntentResolver[] = [];
|
|
31
|
+
const { dispatchPromise } = createDispatcher(() => resolvers);
|
|
32
32
|
const { error } = await dispatchPromise(createIntent(ToString, { value: 1 }));
|
|
33
33
|
|
|
34
34
|
expect(error).toBeInstanceOf(Error);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
resolvers.push(toStringResolver);
|
|
37
37
|
|
|
38
38
|
const { data } = await dispatchPromise(createIntent(ToString, { value: 1 }));
|
|
39
39
|
|
|
40
40
|
expect(data?.string).toBe('1');
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
resolvers.splice(resolvers.indexOf(toStringResolver), 1);
|
|
43
43
|
|
|
44
44
|
{
|
|
45
45
|
const { data, error } = await dispatchPromise(createIntent(ToString, { value: 1 }));
|
|
@@ -50,34 +50,34 @@ describe('Intent dispatcher', () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
test('compose intent effects', async () => {
|
|
53
|
-
const { dispatch } = createDispatcher(
|
|
53
|
+
const { dispatch } = createDispatcher(() => [computeResolver]);
|
|
54
54
|
const program = Effect.gen(function* () {
|
|
55
55
|
const a = yield* dispatch(createIntent(Compute, { value: 1 }));
|
|
56
56
|
const b = yield* dispatch(createIntent(Compute, { value: 2 }));
|
|
57
|
-
return b.
|
|
57
|
+
return b.value - a.value;
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
expect(await Effect.runPromise(program)).toBe(2);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
test('concurrent intent effects', async () => {
|
|
64
|
-
const { dispatch } = createDispatcher(
|
|
64
|
+
const { dispatch } = createDispatcher(() => [computeResolver]);
|
|
65
65
|
const program = Effect.gen(function* () {
|
|
66
66
|
const fiberA = yield* Effect.fork(dispatch(createIntent(Compute, { value: 5 })));
|
|
67
67
|
const fiberB = yield* Effect.fork(dispatch(createIntent(Compute, { value: 2 })));
|
|
68
68
|
const [a, b] = yield* Fiber.join(Fiber.zip(fiberA, fiberB));
|
|
69
|
-
return b.
|
|
69
|
+
return b.value - a.value;
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
expect(await Effect.runPromise(program)).toBe(-6);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
test('mix & match intent effects with promises', async () => {
|
|
76
|
-
const { dispatch, dispatchPromise } = createDispatcher(
|
|
76
|
+
const { dispatch, dispatchPromise } = createDispatcher(() => [toStringResolver, computeResolver]);
|
|
77
77
|
const program = Effect.gen(function* () {
|
|
78
78
|
const a = yield* dispatch(createIntent(Compute, { value: 2 }));
|
|
79
|
-
const b = yield* dispatch(createIntent(ToString, { value: a.
|
|
80
|
-
return b.
|
|
79
|
+
const b = yield* dispatch(createIntent(ToString, { value: a.value }));
|
|
80
|
+
return b.string;
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
expect(await Effect.runPromise(program)).toBe('4');
|
|
@@ -89,124 +89,135 @@ describe('Intent dispatcher', () => {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
test('undo intent', async () => {
|
|
92
|
-
const { dispatch, undo } = createDispatcher(
|
|
92
|
+
const { dispatch, undo } = createDispatcher(() => [computeResolver]);
|
|
93
93
|
const program = Effect.gen(function* () {
|
|
94
94
|
const a = yield* dispatch(createIntent(Compute, { value: 2 }));
|
|
95
95
|
|
|
96
|
-
expect(a.
|
|
96
|
+
expect(a.value).toBe(4);
|
|
97
97
|
|
|
98
98
|
const b = yield* undo();
|
|
99
99
|
|
|
100
|
-
expect(b
|
|
100
|
+
expect(b.value).toBe(2);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
await Effect.runPromise(program);
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
test('chain intents', async () => {
|
|
107
|
-
const { dispatch } = createDispatcher(
|
|
107
|
+
const { dispatch } = createDispatcher(() => [computeResolver, toStringResolver, concatResolver]);
|
|
108
108
|
const intent = pipe(createIntent(Compute, { value: 1 }), chain(ToString, {}), chain(Concat, { plus: '!' }));
|
|
109
109
|
|
|
110
|
-
expect(intent.first.
|
|
111
|
-
expect(intent.last.
|
|
110
|
+
expect(intent.first.id).toBe(Compute._tag);
|
|
111
|
+
expect(intent.last.id).toBe(Concat._tag);
|
|
112
112
|
expect(intent.all.length).toBe(3);
|
|
113
113
|
|
|
114
114
|
const program = Effect.gen(function* () {
|
|
115
|
-
const
|
|
116
|
-
return data
|
|
115
|
+
const data = yield* dispatch(intent);
|
|
116
|
+
return data.string;
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
expect(await Effect.runPromise(program)).toBe('2!');
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
test('undo chained intent', async () => {
|
|
123
|
-
const { dispatch, undo } = createDispatcher(
|
|
123
|
+
const { dispatch, undo } = createDispatcher(() => [computeResolver, toStringResolver, concatResolver]);
|
|
124
124
|
const intent = pipe(createIntent(Compute, { value: 1 }), chain(Compute, {}), chain(Compute, {}));
|
|
125
125
|
const program = Effect.gen(function* () {
|
|
126
126
|
const a = yield* dispatch(intent);
|
|
127
127
|
|
|
128
|
-
expect(a.
|
|
128
|
+
expect(a.value).toBe(8);
|
|
129
129
|
|
|
130
130
|
const b = yield* undo();
|
|
131
131
|
|
|
132
|
-
expect(b
|
|
132
|
+
expect(b.value).toBe(1);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
await Effect.runPromise(program);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
test('filter resolvers by plugin', async () => {
|
|
139
|
-
const otherComputeResolver = createResolver(
|
|
140
|
-
|
|
139
|
+
const otherComputeResolver = createResolver({
|
|
140
|
+
intent: Compute,
|
|
141
|
+
resolve: async (data) => ({ data: { value: data?.value * 3 } }),
|
|
142
|
+
});
|
|
143
|
+
const { dispatch } = createDispatcher((module) => (module === 'test' ? [computeResolver] : [otherComputeResolver]));
|
|
141
144
|
const program = Effect.gen(function* () {
|
|
142
145
|
const a = yield* dispatch(createIntent(Compute, { value: 1 }));
|
|
143
146
|
|
|
144
|
-
expect(a.
|
|
147
|
+
expect(a.value).toBe(3);
|
|
145
148
|
|
|
146
|
-
const b = yield* dispatch(createIntent(Compute, { value: 1 }, {
|
|
149
|
+
const b = yield* dispatch(createIntent(Compute, { value: 1 }, { module: 'test' }));
|
|
147
150
|
|
|
148
|
-
expect(b.
|
|
151
|
+
expect(b.value).toBe(2);
|
|
149
152
|
});
|
|
150
153
|
|
|
151
154
|
await Effect.runPromise(program);
|
|
152
155
|
});
|
|
153
156
|
|
|
154
157
|
test('filter resolvers by predicate', async () => {
|
|
155
|
-
const conditionalComputeResolver = createResolver(
|
|
158
|
+
const conditionalComputeResolver = createResolver({
|
|
159
|
+
intent: Compute,
|
|
156
160
|
filter: (data): data is { value: number } => data?.value > 1,
|
|
161
|
+
resolve: async (data) => ({ data: { value: data?.value * 3 } }),
|
|
157
162
|
});
|
|
158
|
-
const { dispatch } = createDispatcher(
|
|
163
|
+
const { dispatch } = createDispatcher(() => [conditionalComputeResolver, computeResolver]);
|
|
159
164
|
const program = Effect.gen(function* () {
|
|
160
165
|
const a = yield* dispatch(createIntent(Compute, { value: 1 }));
|
|
161
166
|
|
|
162
|
-
expect(a.
|
|
167
|
+
expect(a.value).toBe(2);
|
|
163
168
|
|
|
164
169
|
const b = yield* dispatch(createIntent(Compute, { value: 2 }));
|
|
165
170
|
|
|
166
|
-
expect(b.
|
|
171
|
+
expect(b.value).toBe(6);
|
|
167
172
|
});
|
|
168
173
|
|
|
169
174
|
await Effect.runPromise(program);
|
|
170
175
|
});
|
|
171
176
|
|
|
172
177
|
test('hoist resolvers', async () => {
|
|
173
|
-
const hoistedComputeResolver = createResolver(
|
|
174
|
-
|
|
178
|
+
const hoistedComputeResolver = createResolver({
|
|
179
|
+
intent: Compute,
|
|
180
|
+
position: 'hoist',
|
|
181
|
+
resolve: async (data) => ({ data: { value: data?.value * 3 } }),
|
|
175
182
|
});
|
|
176
|
-
const { dispatchPromise } = createDispatcher(
|
|
183
|
+
const { dispatchPromise } = createDispatcher(() => [computeResolver, hoistedComputeResolver]);
|
|
177
184
|
const { data } = await dispatchPromise(createIntent(Compute, { value: 1 }));
|
|
178
185
|
expect(data?.value).toBe(3);
|
|
179
186
|
});
|
|
180
187
|
|
|
181
188
|
test('fallback resolvers', async () => {
|
|
182
|
-
const conditionalComputeResolver = createResolver(
|
|
189
|
+
const conditionalComputeResolver = createResolver({
|
|
190
|
+
intent: Compute,
|
|
183
191
|
filter: (data): data is { value: number } => data?.value === 1,
|
|
192
|
+
resolve: async (data) => ({ data: { value: data?.value * 2 } }),
|
|
184
193
|
});
|
|
185
|
-
const fallbackComputeResolver = createResolver(
|
|
186
|
-
|
|
194
|
+
const fallbackComputeResolver = createResolver({
|
|
195
|
+
intent: Compute,
|
|
196
|
+
position: 'fallback',
|
|
197
|
+
resolve: async (data) => ({ data: { value: data?.value * 3 } }),
|
|
187
198
|
});
|
|
188
|
-
const { dispatch } = createDispatcher(
|
|
199
|
+
const { dispatch } = createDispatcher(() => [conditionalComputeResolver, fallbackComputeResolver]);
|
|
189
200
|
const program = Effect.gen(function* () {
|
|
190
201
|
const a = yield* dispatch(createIntent(Compute, { value: 1 }));
|
|
191
202
|
|
|
192
|
-
expect(a.
|
|
203
|
+
expect(a.value).toBe(2);
|
|
193
204
|
|
|
194
205
|
const b = yield* dispatch(createIntent(Compute, { value: 2 }));
|
|
195
206
|
|
|
196
|
-
expect(b.
|
|
207
|
+
expect(b.value).toBe(6);
|
|
197
208
|
});
|
|
198
209
|
|
|
199
210
|
await Effect.runPromise(program);
|
|
200
211
|
});
|
|
201
212
|
|
|
202
213
|
test('non-struct inputs & outputs', async () => {
|
|
203
|
-
const { dispatchPromise } = createDispatcher(
|
|
214
|
+
const { dispatchPromise } = createDispatcher(() => [addResolver]);
|
|
204
215
|
const { data } = await dispatchPromise(createIntent(Add, [1, 1]));
|
|
205
216
|
expect(data).toBe(2);
|
|
206
217
|
});
|
|
207
218
|
|
|
208
219
|
test('empty inputs & outputs', async () => {
|
|
209
|
-
const { dispatchPromise } = createDispatcher(
|
|
220
|
+
const { dispatchPromise } = createDispatcher(() => [sideEffectResolver]);
|
|
210
221
|
const { data } = await dispatchPromise(createIntent(SideEffect));
|
|
211
222
|
expect(data).toBe(undefined);
|
|
212
223
|
});
|
|
@@ -223,8 +234,9 @@ class ToString extends S.TaggedClass<ToString>()('ToString', {
|
|
|
223
234
|
}),
|
|
224
235
|
}) {}
|
|
225
236
|
|
|
226
|
-
const toStringResolver = createResolver(
|
|
227
|
-
|
|
237
|
+
const toStringResolver = createResolver({
|
|
238
|
+
intent: ToString,
|
|
239
|
+
resolve: async (data) => ({ data: { string: data.value.toString() } }),
|
|
228
240
|
});
|
|
229
241
|
|
|
230
242
|
class Compute extends S.TaggedClass<Compute>()('Compute', {
|
|
@@ -236,16 +248,19 @@ class Compute extends S.TaggedClass<Compute>()('Compute', {
|
|
|
236
248
|
}),
|
|
237
249
|
}) {}
|
|
238
250
|
|
|
239
|
-
const computeResolver = createResolver(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
const computeResolver = createResolver({
|
|
252
|
+
intent: Compute,
|
|
253
|
+
resolve: (data, undo) => {
|
|
254
|
+
return Effect.gen(function* () {
|
|
255
|
+
if (undo) {
|
|
256
|
+
return { data: { value: data.value / 2 } };
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
yield* Effect.sleep(data.value * 10);
|
|
260
|
+
const value = data.value * 2;
|
|
261
|
+
return { data: { value }, undoable: { message: 'test', data: { value } } };
|
|
262
|
+
});
|
|
263
|
+
},
|
|
249
264
|
});
|
|
250
265
|
|
|
251
266
|
class Concat extends S.TaggedClass<Concat>()('Concat', {
|
|
@@ -258,8 +273,9 @@ class Concat extends S.TaggedClass<Concat>()('Concat', {
|
|
|
258
273
|
}),
|
|
259
274
|
}) {}
|
|
260
275
|
|
|
261
|
-
const concatResolver = createResolver(
|
|
262
|
-
|
|
276
|
+
const concatResolver = createResolver({
|
|
277
|
+
intent: Concat,
|
|
278
|
+
resolve: async (data) => ({ data: { string: data.string + data.plus } }),
|
|
263
279
|
});
|
|
264
280
|
|
|
265
281
|
class Add extends S.TaggedClass<Add>()('Add', {
|
|
@@ -267,8 +283,9 @@ class Add extends S.TaggedClass<Add>()('Add', {
|
|
|
267
283
|
output: S.Number,
|
|
268
284
|
}) {}
|
|
269
285
|
|
|
270
|
-
const addResolver = createResolver(
|
|
271
|
-
|
|
286
|
+
const addResolver = createResolver({
|
|
287
|
+
intent: Add,
|
|
288
|
+
resolve: async (data) => ({ data: data[0] + data[1] }),
|
|
272
289
|
});
|
|
273
290
|
|
|
274
291
|
class SideEffect extends S.TaggedClass<SideEffect>()('SideEffect', {
|
|
@@ -276,4 +293,7 @@ class SideEffect extends S.TaggedClass<SideEffect>()('SideEffect', {
|
|
|
276
293
|
output: S.Void,
|
|
277
294
|
}) {}
|
|
278
295
|
|
|
279
|
-
const sideEffectResolver = createResolver(
|
|
296
|
+
const sideEffectResolver = createResolver({
|
|
297
|
+
intent: SideEffect,
|
|
298
|
+
resolve: async () => {},
|
|
299
|
+
});
|