@dxos/app-framework 0.8.2-staging.7ac8446 → 0.8.2
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-576BHZC7.mjs → app-graph-builder-DYEAGZPS.mjs} +23 -23
- package/dist/lib/browser/app-graph-builder-DYEAGZPS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6AVTZPMT.mjs → chunk-5GE2ERNU.mjs} +340 -275
- package/dist/lib/browser/chunk-5GE2ERNU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SFPT4Z2C.mjs → chunk-WWEJRWFX.mjs} +10 -10
- package/dist/lib/browser/chunk-WWEJRWFX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PPIBZ5N4.mjs → chunk-ZMXJV64L.mjs} +123 -63
- package/dist/lib/browser/chunk-ZMXJV64L.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -10
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs → intent-dispatcher-ELZN5EM7.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-O763LCLG.mjs → intent-resolver-SGWLINTO.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-URSN7DZI.mjs → store-YIU6IPZ2.mjs} +7 -6
- package/dist/lib/browser/store-YIU6IPZ2.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +30 -14
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/worker.mjs +5 -3
- package/dist/lib/node/app-graph-builder-GBLISL7L.cjs +146 -0
- package/dist/lib/node/app-graph-builder-GBLISL7L.cjs.map +7 -0
- package/dist/lib/node/{chunk-JUSEAFDU.cjs → chunk-G774ASXO.cjs} +5 -5
- package/dist/lib/node/chunk-G774ASXO.cjs.map +7 -0
- package/dist/lib/node/{chunk-YIFTVCOR.cjs → chunk-HIVITTZD.cjs} +319 -255
- package/dist/lib/node/chunk-HIVITTZD.cjs.map +7 -0
- package/dist/lib/node/{chunk-YNTKVTVX.cjs → chunk-Z2PMVDJ5.cjs} +155 -95
- package/dist/lib/node/chunk-Z2PMVDJ5.cjs.map +7 -0
- package/dist/lib/node/index.cjs +82 -80
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs → intent-dispatcher-LFXZJTAS.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs.map → intent-dispatcher-LFXZJTAS.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-3F4POWAM.cjs → intent-resolver-EPSFTHL6.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-OFDHTDCB.cjs → store-CVVRXUTH.cjs} +10 -9
- package/dist/lib/node/store-CVVRXUTH.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +34 -17
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node/worker.cjs +40 -38
- package/dist/lib/node/worker.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-VYKLSMSZ.mjs → app-graph-builder-LUBDEIT6.mjs} +23 -23
- package/dist/lib/node-esm/app-graph-builder-LUBDEIT6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-R6A7Z4LU.mjs → chunk-6IKYKERU.mjs} +123 -63
- package/dist/lib/node-esm/chunk-6IKYKERU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PHOUQACM.mjs → chunk-I6BVZMAH.mjs} +10 -10
- package/dist/lib/node-esm/chunk-I6BVZMAH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AHKIPS2L.mjs → chunk-Z2ZHH4HN.mjs} +340 -275
- package/dist/lib/node-esm/chunk-Z2ZHH4HN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -10
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs → intent-dispatcher-A2JCMWRD.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs → intent-resolver-5C4O43GK.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-EYSUVNCS.mjs → store-HRZXZ2D2.mjs} +7 -6
- package/dist/lib/node-esm/store-HRZXZ2D2.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +30 -14
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +5 -3
- package/dist/types/src/App.d.ts +3 -1
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +40 -222
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +19 -0
- package/dist/types/src/common/collaboration.d.ts.map +1 -0
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +7 -7
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -0
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +166 -158
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +7 -7
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +33 -15
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/events.d.ts +4 -1
- package/dist/types/src/core/events.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +14 -11
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +4 -3
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +6 -6
- 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-intent/actions.d.ts +14 -14
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +29 -3
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +14 -20
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +10 -10
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +2 -195
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/store.d.ts +2 -2
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/IntentContext.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +2 -2
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/useCapabilities.d.ts +2 -2
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/react/useIntentResolver.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +6 -2
- 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/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -21
- package/project.json +2 -1
- package/src/App.tsx +98 -48
- package/src/common/capabilities.ts +18 -7
- package/src/common/collaboration.ts +21 -0
- package/src/common/file.ts +7 -7
- package/src/common/index.ts +1 -0
- package/src/common/layout.ts +167 -128
- package/src/common/translations.ts +7 -7
- package/src/core/capabilities.test.ts +55 -36
- package/src/core/capabilities.ts +84 -60
- package/src/core/events.ts +4 -1
- package/src/core/manager.test.ts +22 -22
- package/src/core/manager.ts +34 -26
- package/src/core/plugin.ts +4 -3
- package/src/playground/generator/generator.ts +4 -4
- package/src/playground/logger/schema.ts +5 -5
- package/src/playground/playground.stories.tsx +13 -9
- package/src/plugin-intent/actions.ts +9 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +23 -42
- package/src/plugin-intent/intent-dispatcher.ts +25 -13
- package/src/plugin-intent/intent.ts +22 -20
- package/src/plugin-settings/actions.ts +8 -8
- package/src/plugin-settings/app-graph-builder.ts +129 -94
- package/src/plugin-settings/store.ts +20 -17
- package/src/react/ErrorBoundary.tsx +3 -3
- package/src/react/Surface.stories.tsx +1 -1
- package/src/react/Surface.tsx +3 -3
- package/src/react/useCapabilities.ts +9 -19
- package/src/testing/withPluginManager.stories.tsx +0 -1
- package/src/testing/withPluginManager.tsx +35 -16
- package/tsconfig.json +1 -53
- package/typedoc/.nojekyll +1 -0
- package/typedoc/assets/hierarchy.js +1 -0
- package/typedoc/assets/highlight.css +106 -0
- package/typedoc/assets/icons.js +18 -0
- package/typedoc/assets/icons.svg +1 -0
- package/typedoc/assets/main.js +60 -0
- package/typedoc/assets/navigation.js +1 -0
- package/typedoc/assets/search.js +1 -0
- package/typedoc/assets/style.css +1640 -0
- package/typedoc/classes/CollaborationActions.InsertContent.html +421 -0
- package/typedoc/classes/ErrorBoundary.html +125 -0
- package/typedoc/classes/IntentAction.ShowUndo.html +227 -0
- package/typedoc/classes/IntentAction.Track.html +266 -0
- package/typedoc/classes/LayoutAction.AddToast.html +265 -0
- package/typedoc/classes/LayoutAction.Close.html +382 -0
- package/typedoc/classes/LayoutAction.Expose.html +265 -0
- package/typedoc/classes/LayoutAction.Open.html +1123 -0
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +343 -0
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +460 -0
- package/typedoc/classes/LayoutAction.Set.html +460 -0
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +499 -0
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +265 -0
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +616 -0
- package/typedoc/classes/LayoutAction.UpdateDialog.html +1123 -0
- package/typedoc/classes/LayoutAction.UpdateLayout.html +461 -0
- package/typedoc/classes/LayoutAction.UpdatePopover.html +1435 -0
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +616 -0
- package/typedoc/classes/Plugin.html +6 -0
- package/typedoc/classes/PluginContext.html +38 -0
- package/typedoc/classes/PluginManager.html +43 -0
- package/typedoc/classes/PluginModule.html +18 -0
- package/typedoc/classes/SettingsAction.Open.html +226 -0
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +265 -0
- package/typedoc/functions/Events.createStateEvent.html +2 -0
- package/typedoc/functions/IntentPlugin.html +1 -0
- package/typedoc/functions/SettingsPlugin.html +1 -0
- package/typedoc/functions/allOf.html +2 -0
- package/typedoc/functions/chain.html +3 -0
- package/typedoc/functions/contributes.html +2 -0
- package/typedoc/functions/createDispatcher.html +3 -0
- package/typedoc/functions/createIntent.html +6 -0
- package/typedoc/functions/createResolver.html +2 -0
- package/typedoc/functions/createSurface.html +2 -0
- package/typedoc/functions/defineCapability.html +2 -0
- package/typedoc/functions/defineEvent.html +2 -0
- package/typedoc/functions/defineModule.html +2 -0
- package/typedoc/functions/definePlugin.html +2 -0
- package/typedoc/functions/eventKey.html +2 -0
- package/typedoc/functions/getEvents.html +2 -0
- package/typedoc/functions/isAllOf.html +2 -0
- package/typedoc/functions/isOneOf.html +2 -0
- package/typedoc/functions/isSurfaceAvailable.html +2 -0
- package/typedoc/functions/lazy.html +2 -0
- package/typedoc/functions/oneOf.html +2 -0
- package/typedoc/functions/useApp.html +6 -0
- package/typedoc/functions/useAppGraph.html +1 -0
- package/typedoc/functions/useCapabilities.html +3 -0
- package/typedoc/functions/useCapability.html +4 -0
- package/typedoc/functions/useIntentDispatcher.html +1 -0
- package/typedoc/functions/useIntentResolver.html +1 -0
- package/typedoc/functions/useLayout.html +1 -0
- package/typedoc/functions/usePluginManager.html +2 -0
- package/typedoc/hierarchy.html +1 -0
- package/typedoc/index.html +16 -0
- package/typedoc/interfaces/LayoutAction.Toast.html +10 -0
- package/typedoc/media/LICENSE +8 -0
- package/typedoc/modules/Capabilities.html +1 -0
- package/typedoc/modules/CollaborationActions.html +1 -0
- package/typedoc/modules/Events.html +1 -0
- package/typedoc/modules/IntentAction.html +1 -0
- package/typedoc/modules/LayoutAction.html +2 -0
- package/typedoc/modules/SettingsAction.html +1 -0
- package/typedoc/modules.html +1 -0
- package/typedoc/types/ActivationEvent.html +8 -0
- package/typedoc/types/ActivationEvents.html +2 -0
- package/typedoc/types/AnyCapability.html +1 -0
- package/typedoc/types/AnyIntent.html +1 -0
- package/typedoc/types/AnyIntentChain.html +1 -0
- package/typedoc/types/AnyIntentEffectResult.html +1 -0
- package/typedoc/types/AnyIntentResolver.html +1 -0
- package/typedoc/types/AnyIntentResult.html +1 -0
- package/typedoc/types/Capabilities.FileUploader.html +1 -0
- package/typedoc/types/Capabilities.IntentResolver.html +1 -0
- package/typedoc/types/Capabilities.Layout.html +1 -0
- package/typedoc/types/Capabilities.Metadata.html +1 -0
- package/typedoc/types/Capabilities.ReactContext.html +1 -0
- package/typedoc/types/Capabilities.ReactRoot.html +1 -0
- package/typedoc/types/Capabilities.ReactSurface.html +1 -0
- package/typedoc/types/Capabilities.Settings.html +4 -0
- package/typedoc/types/Capability.html +9 -0
- package/typedoc/types/CreateAppOptions.html +10 -0
- package/typedoc/types/FileInfo.html +1 -0
- package/typedoc/types/Intent.html +10 -0
- package/typedoc/types/IntentChain.html +6 -0
- package/typedoc/types/IntentContext.html +5 -0
- package/typedoc/types/IntentData.html +1 -0
- package/typedoc/types/IntentDispatcher.html +2 -0
- package/typedoc/types/IntentDispatcherResult.html +2 -0
- package/typedoc/types/IntentEffectDefinition.html +2 -0
- package/typedoc/types/IntentEffectResult.html +15 -0
- package/typedoc/types/IntentParams.html +3 -0
- package/typedoc/types/IntentResolver.html +2 -0
- package/typedoc/types/IntentResultData.html +1 -0
- package/typedoc/types/IntentSchema.html +1 -0
- package/typedoc/types/IntentUndo.html +2 -0
- package/typedoc/types/InterfaceDef.html +4 -0
- package/typedoc/types/Label.html +1 -0
- package/typedoc/types/NodeSerializer.html +8 -0
- package/typedoc/types/PluginManagerOptions.html +6 -0
- package/typedoc/types/PluginMeta.html +21 -0
- package/typedoc/types/PromiseIntentDispatcher.html +2 -0
- package/typedoc/types/PromiseIntentUndo.html +2 -0
- package/typedoc/types/Resource.html +1 -0
- package/typedoc/types/ResourceKey.html +1 -0
- package/typedoc/types/ResourceLanguage.html +1 -0
- package/typedoc/types/SerializedNode.html +4 -0
- package/typedoc/types/SurfaceComponent.html +2 -0
- package/typedoc/types/SurfaceDefinition.html +2 -0
- package/typedoc/types/SurfaceProps.html +4 -0
- package/typedoc/variables/Capabilities.AnchorSort.html +1 -0
- package/typedoc/variables/Capabilities.AppGraph.html +1 -0
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +1 -0
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +1 -0
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +1 -0
- package/typedoc/variables/Capabilities.FileUploader.html +1 -0
- package/typedoc/variables/Capabilities.IntentDispatcher.html +1 -0
- package/typedoc/variables/Capabilities.IntentResolver.html +1 -0
- package/typedoc/variables/Capabilities.Layout.html +1 -0
- package/typedoc/variables/Capabilities.Metadata.html +1 -0
- package/typedoc/variables/Capabilities.Null.html +1 -0
- package/typedoc/variables/Capabilities.PluginManager.html +1 -0
- package/typedoc/variables/Capabilities.ReactContext.html +1 -0
- package/typedoc/variables/Capabilities.ReactRoot.html +1 -0
- package/typedoc/variables/Capabilities.ReactSurface.html +1 -0
- package/typedoc/variables/Capabilities.RxRegistry.html +1 -0
- package/typedoc/variables/Capabilities.Settings.html +1 -0
- package/typedoc/variables/Capabilities.SettingsStore.html +1 -0
- package/typedoc/variables/Capabilities.Tools.html +1 -0
- package/typedoc/variables/Capabilities.Translations.html +1 -0
- package/typedoc/variables/Events.AppGraphReady.html +2 -0
- package/typedoc/variables/Events.DispatcherReady.html +2 -0
- package/typedoc/variables/Events.LayoutReady.html +1 -0
- package/typedoc/variables/Events.SettingsReady.html +2 -0
- package/typedoc/variables/Events.SetupAppGraph.html +2 -0
- package/typedoc/variables/Events.SetupArtifactDefinition.html +2 -0
- package/typedoc/variables/Events.SetupIntentResolver.html +2 -0
- package/typedoc/variables/Events.SetupMetadata.html +2 -0
- package/typedoc/variables/Events.SetupReactSurface.html +2 -0
- package/typedoc/variables/Events.SetupSettings.html +2 -0
- package/typedoc/variables/Events.SetupTranslations.html +2 -0
- package/typedoc/variables/Events.Startup.html +2 -0
- package/typedoc/variables/FileInfoSchema.html +1 -0
- package/typedoc/variables/INTENT_ACTION.html +1 -0
- package/typedoc/variables/INTENT_PLUGIN.html +1 -0
- package/typedoc/variables/LAYOUT_ACTION.html +1 -0
- package/typedoc/variables/LAYOUT_PLUGIN.html +1 -0
- package/typedoc/variables/Label.html +1 -0
- package/typedoc/variables/LayoutAction.Toast.html +1 -0
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +1 -0
- package/typedoc/variables/PluginManagerProvider.html +2 -0
- package/typedoc/variables/Resource.html +2 -0
- package/typedoc/variables/ResourceKey.html +1 -0
- package/typedoc/variables/ResourceLanguage.html +1 -0
- package/typedoc/variables/SETTINGS_ACTION.html +1 -0
- package/typedoc/variables/SETTINGS_ID.html +1 -0
- package/typedoc/variables/SETTINGS_KEY.html +1 -0
- package/typedoc/variables/SETTINGS_PLUGIN.html +1 -0
- package/typedoc/variables/Surface.html +2 -0
- package/typedoc/variables/defaultFileTypes.html +1 -0
- package/dist/lib/browser/app-graph-builder-576BHZC7.mjs.map +0 -7
- package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +0 -7
- package/dist/lib/browser/chunk-PPIBZ5N4.mjs.map +0 -7
- package/dist/lib/browser/chunk-SFPT4Z2C.mjs.map +0 -7
- package/dist/lib/browser/store-URSN7DZI.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-JZCSKYPY.cjs +0 -146
- package/dist/lib/node/app-graph-builder-JZCSKYPY.cjs.map +0 -7
- package/dist/lib/node/chunk-JUSEAFDU.cjs.map +0 -7
- package/dist/lib/node/chunk-YIFTVCOR.cjs.map +0 -7
- package/dist/lib/node/chunk-YNTKVTVX.cjs.map +0 -7
- package/dist/lib/node/store-OFDHTDCB.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-VYKLSMSZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PHOUQACM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +0 -7
- package/dist/lib/node-esm/store-EYSUVNCS.mjs.map +0 -7
- /package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs.map → intent-dispatcher-ELZN5EM7.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-O763LCLG.mjs.map → intent-resolver-SGWLINTO.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-3F4POWAM.cjs.map → intent-resolver-EPSFTHL6.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs.map → intent-dispatcher-A2JCMWRD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs.map → intent-resolver-5C4O43GK.mjs.map} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// packages/sdk/app-framework/src/plugin-intent/intent-dispatcher.ts
|
|
4
|
-
import { Effect as Effect3, Option, pipe as pipe2, Ref } from "effect";
|
|
5
|
-
import {
|
|
4
|
+
import { Effect as Effect3, Option, pipe as pipe2, Ref as Ref2 } from "effect";
|
|
5
|
+
import { live as live2 } from "@dxos/live-object";
|
|
6
6
|
import { log as log3 } from "@dxos/log";
|
|
7
7
|
import { byPosition } from "@dxos/util";
|
|
8
8
|
|
|
9
9
|
// packages/sdk/app-framework/src/plugin-intent/actions.ts
|
|
10
|
-
import { Schema as
|
|
10
|
+
import { Schema as Schema2 } from "effect";
|
|
11
11
|
|
|
12
12
|
// packages/sdk/app-framework/src/plugin-intent/intent.ts
|
|
13
|
-
import { Schema
|
|
13
|
+
import { Schema } from "effect";
|
|
14
14
|
var createIntent = (schema, data = {}, params = {}) => {
|
|
15
|
-
const _ =
|
|
15
|
+
const _ = Schema.validateSync(schema.fields.input)(data);
|
|
16
16
|
const intent = {
|
|
17
17
|
...params,
|
|
18
18
|
_schema: schema,
|
|
@@ -47,43 +47,41 @@ var chain = (schema, data = {}, params = {}) => (intent) => {
|
|
|
47
47
|
]
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
var Label =
|
|
51
|
-
ns:
|
|
52
|
-
count:
|
|
50
|
+
var Label = Schema.Union(Schema.String, Schema.mutable(Schema.Tuple(Schema.String, Schema.mutable(Schema.Struct({
|
|
51
|
+
ns: Schema.String,
|
|
52
|
+
count: Schema.optional(Schema.Number)
|
|
53
53
|
})))));
|
|
54
54
|
|
|
55
55
|
// packages/sdk/app-framework/src/plugin-intent/actions.ts
|
|
56
56
|
var INTENT_PLUGIN = "dxos.org/plugin/intent";
|
|
57
57
|
var INTENT_ACTION = `${INTENT_PLUGIN}/action`;
|
|
58
|
-
var IntentAction;
|
|
59
58
|
(function(IntentAction2) {
|
|
60
|
-
class Track extends
|
|
61
|
-
input:
|
|
62
|
-
intents:
|
|
63
|
-
error:
|
|
59
|
+
class Track extends Schema2.TaggedClass()(`${INTENT_ACTION}/track`, {
|
|
60
|
+
input: Schema2.Struct({
|
|
61
|
+
intents: Schema2.Array(Schema2.String),
|
|
62
|
+
error: Schema2.optional(Schema2.String)
|
|
64
63
|
}),
|
|
65
|
-
output:
|
|
64
|
+
output: Schema2.Void
|
|
66
65
|
}) {
|
|
67
66
|
}
|
|
68
67
|
IntentAction2.Track = Track;
|
|
69
|
-
class ShowUndo extends
|
|
70
|
-
input:
|
|
68
|
+
class ShowUndo extends Schema2.TaggedClass()(`${INTENT_ACTION}/show-undo`, {
|
|
69
|
+
input: Schema2.Struct({
|
|
71
70
|
message: Label
|
|
72
71
|
}),
|
|
73
|
-
output:
|
|
72
|
+
output: Schema2.Void
|
|
74
73
|
}) {
|
|
75
74
|
}
|
|
76
75
|
IntentAction2.ShowUndo = ShowUndo;
|
|
77
76
|
})(IntentAction || (IntentAction = {}));
|
|
77
|
+
var IntentAction;
|
|
78
78
|
|
|
79
79
|
// packages/sdk/app-framework/src/plugin-intent/errors.ts
|
|
80
80
|
var BaseError = class extends Error {
|
|
81
81
|
constructor(code, message, context) {
|
|
82
82
|
super(message ?? code, {
|
|
83
83
|
cause: context
|
|
84
|
-
});
|
|
85
|
-
this.code = code;
|
|
86
|
-
this.context = context;
|
|
84
|
+
}), this.code = code, this.context = context;
|
|
87
85
|
this.name = code;
|
|
88
86
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
89
87
|
}
|
|
@@ -102,11 +100,10 @@ var CycleDetectedError = class extends BaseError {
|
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
// packages/sdk/app-framework/src/core/capabilities.ts
|
|
105
|
-
import {
|
|
103
|
+
import { Rx } from "@effect-rx/rx-react";
|
|
106
104
|
import { Effect } from "effect";
|
|
107
105
|
import { Trigger } from "@dxos/async";
|
|
108
106
|
import { invariant } from "@dxos/invariant";
|
|
109
|
-
import { create } from "@dxos/live-object";
|
|
110
107
|
import { log } from "@dxos/log";
|
|
111
108
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/capabilities.ts";
|
|
112
109
|
var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
|
|
@@ -132,9 +129,33 @@ var lazy = (c) => async (props) => {
|
|
|
132
129
|
const { default: getCapability } = await c();
|
|
133
130
|
return async () => getCapability(props);
|
|
134
131
|
};
|
|
135
|
-
var
|
|
136
|
-
constructor({ activate, reset }) {
|
|
137
|
-
this.
|
|
132
|
+
var PluginContext = class {
|
|
133
|
+
constructor({ registry, activate, reset }) {
|
|
134
|
+
this._capabilityImpls = Rx.family(() => {
|
|
135
|
+
return Rx.make([]).pipe(Rx.keepAlive);
|
|
136
|
+
});
|
|
137
|
+
this._capabilities = Rx.family((id) => {
|
|
138
|
+
return Rx.make((get) => {
|
|
139
|
+
const current = get(this._capabilityImpls(id));
|
|
140
|
+
return current.map((c) => c.implementation);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
this._capability = Rx.family((id) => {
|
|
144
|
+
return Rx.make((get) => {
|
|
145
|
+
const current = get(this._capabilities(id));
|
|
146
|
+
invariant(current.length > 0, `No capability found for ${id}`, {
|
|
147
|
+
F: __dxlog_file,
|
|
148
|
+
L: 117,
|
|
149
|
+
S: this,
|
|
150
|
+
A: [
|
|
151
|
+
"current.length > 0",
|
|
152
|
+
"`No capability found for ${id}`"
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
return current[0];
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
this._registry = registry;
|
|
138
159
|
this.activate = activate;
|
|
139
160
|
this.reset = reset;
|
|
140
161
|
}
|
|
@@ -142,22 +163,22 @@ var PluginsContext = class {
|
|
|
142
163
|
* @internal
|
|
143
164
|
*/
|
|
144
165
|
contributeCapability({ module: moduleId, interface: interfaceDef, implementation }) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
current = untracked(() => object.value);
|
|
151
|
-
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
166
|
+
const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
|
|
167
|
+
const capability = new CapabilityImpl(moduleId, implementation);
|
|
168
|
+
if (current.includes(capability)) {
|
|
169
|
+
return;
|
|
152
170
|
}
|
|
153
|
-
|
|
171
|
+
this._registry.set(this._capabilityImpls(interfaceDef.identifier), [
|
|
172
|
+
...current,
|
|
173
|
+
capability
|
|
174
|
+
]);
|
|
154
175
|
log("capability contributed", {
|
|
155
176
|
id: interfaceDef.identifier,
|
|
156
177
|
moduleId,
|
|
157
|
-
count:
|
|
178
|
+
count: current.length
|
|
158
179
|
}, {
|
|
159
180
|
F: __dxlog_file,
|
|
160
|
-
L:
|
|
181
|
+
L: 161,
|
|
161
182
|
S: this,
|
|
162
183
|
C: (f, a) => f(...a)
|
|
163
184
|
});
|
|
@@ -166,19 +187,19 @@ var PluginsContext = class {
|
|
|
166
187
|
* @internal
|
|
167
188
|
*/
|
|
168
189
|
removeCapability(interfaceDef, implementation) {
|
|
169
|
-
const current = this.
|
|
170
|
-
if (
|
|
190
|
+
const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
|
|
191
|
+
if (current.length === 0) {
|
|
171
192
|
return;
|
|
172
193
|
}
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
|
|
194
|
+
const next = current.filter((c) => c.implementation !== implementation);
|
|
195
|
+
if (next.length !== current.length) {
|
|
196
|
+
this._registry.set(this._capabilityImpls(interfaceDef.identifier), next);
|
|
176
197
|
log("capability removed", {
|
|
177
198
|
id: interfaceDef.identifier,
|
|
178
|
-
count:
|
|
199
|
+
count: current.length
|
|
179
200
|
}, {
|
|
180
201
|
F: __dxlog_file,
|
|
181
|
-
L:
|
|
202
|
+
L: 180,
|
|
182
203
|
S: this,
|
|
183
204
|
C: (f, a) => f(...a)
|
|
184
205
|
});
|
|
@@ -187,63 +208,64 @@ var PluginsContext = class {
|
|
|
187
208
|
id: interfaceDef.identifier
|
|
188
209
|
}, {
|
|
189
210
|
F: __dxlog_file,
|
|
190
|
-
L:
|
|
211
|
+
L: 182,
|
|
191
212
|
S: this,
|
|
192
213
|
C: (f, a) => f(...a)
|
|
193
214
|
});
|
|
194
215
|
}
|
|
195
216
|
}
|
|
196
217
|
/**
|
|
197
|
-
*
|
|
218
|
+
* Get the Rx reference to the available capabilities for a given interface.
|
|
219
|
+
* Primarily useful for deriving other Rx values based on the capabilities or
|
|
220
|
+
* for subscribing to changes in the capabilities.
|
|
221
|
+
* @returns An Rx reference to the available capabilities.
|
|
222
|
+
*/
|
|
223
|
+
capabilities(interfaceDef) {
|
|
224
|
+
return this._capabilities(interfaceDef.identifier);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Get the Rx reference to the available capabilities for a given interface.
|
|
228
|
+
* Primarily useful for deriving other Rx values based on the capability or
|
|
229
|
+
* for subscribing to changes in the capability.
|
|
230
|
+
* @returns An Rx reference to the available capability.
|
|
231
|
+
* @throws If no capability is found.
|
|
232
|
+
*/
|
|
233
|
+
capability(interfaceDef) {
|
|
234
|
+
return this._capability(interfaceDef.identifier);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get capabilities from the plugin context.
|
|
198
238
|
* @returns An array of capabilities.
|
|
199
|
-
* @reactive
|
|
200
239
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (!current) {
|
|
204
|
-
const object = create({
|
|
205
|
-
value: []
|
|
206
|
-
});
|
|
207
|
-
current = untracked(() => object.value);
|
|
208
|
-
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
209
|
-
}
|
|
210
|
-
const capabilities = filter ? current.filter((c) => filter(c.implementation, c.moduleId)) : current;
|
|
211
|
-
return capabilities.map((c) => c.implementation);
|
|
240
|
+
getCapabilities(interfaceDef) {
|
|
241
|
+
return this._registry.get(this.capabilities(interfaceDef));
|
|
212
242
|
}
|
|
213
243
|
/**
|
|
214
244
|
* Requests a single capability from the plugin context.
|
|
215
245
|
* @returns The capability.
|
|
216
246
|
* @throws If no capability is found.
|
|
217
|
-
* @reactive
|
|
218
247
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
invariant(capability, `No capability found for ${interfaceDef.identifier}`, {
|
|
222
|
-
F: __dxlog_file,
|
|
223
|
-
L: 199,
|
|
224
|
-
S: this,
|
|
225
|
-
A: [
|
|
226
|
-
"capability",
|
|
227
|
-
"`No capability found for ${interfaceDef.identifier}`"
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
return capability;
|
|
248
|
+
getCapability(interfaceDef) {
|
|
249
|
+
return this._registry.get(this.capability(interfaceDef));
|
|
231
250
|
}
|
|
232
251
|
/**
|
|
233
|
-
* Waits for a capability to be
|
|
252
|
+
* Waits for a capability to be available.
|
|
234
253
|
* @returns The capability.
|
|
235
254
|
*/
|
|
236
|
-
async waitForCapability(interfaceDef
|
|
255
|
+
async waitForCapability(interfaceDef) {
|
|
256
|
+
const [capability] = this.getCapabilities(interfaceDef);
|
|
257
|
+
if (capability) {
|
|
258
|
+
return capability;
|
|
259
|
+
}
|
|
237
260
|
const trigger = new Trigger();
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
if (capabilities[0]) {
|
|
261
|
+
const cancel = this._registry.subscribe(this.capabilities(interfaceDef), (capabilities) => {
|
|
262
|
+
if (capabilities.length > 0) {
|
|
241
263
|
trigger.wake(capabilities[0]);
|
|
242
264
|
}
|
|
243
265
|
});
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
return
|
|
266
|
+
const result = await trigger.wait();
|
|
267
|
+
cancel();
|
|
268
|
+
return result;
|
|
247
269
|
}
|
|
248
270
|
async activatePromise(event) {
|
|
249
271
|
return this.activate(event).pipe(Effect.runPromise);
|
|
@@ -276,25 +298,28 @@ var getEvents = (events) => "type" in events ? events.events : [
|
|
|
276
298
|
];
|
|
277
299
|
|
|
278
300
|
// packages/sdk/app-framework/src/core/manager.ts
|
|
279
|
-
import {
|
|
301
|
+
import { Registry } from "@effect-rx/rx-react";
|
|
302
|
+
import { untracked } from "@preact/signals-core";
|
|
280
303
|
import { Array as A, Effect as Effect2, Either, Match, pipe } from "effect";
|
|
281
304
|
import { Event } from "@dxos/async";
|
|
282
|
-
import {
|
|
305
|
+
import { live } from "@dxos/live-object";
|
|
283
306
|
import { log as log2 } from "@dxos/log";
|
|
284
307
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/manager.ts";
|
|
285
308
|
var isPromise = (value) => {
|
|
286
309
|
return value !== null && typeof value === "object" && "then" in value;
|
|
287
310
|
};
|
|
288
311
|
var PluginManager = class {
|
|
289
|
-
constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), enabled = [] }) {
|
|
312
|
+
constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), enabled = [], registry }) {
|
|
290
313
|
this.activation = new Event();
|
|
291
|
-
this.
|
|
314
|
+
this._capabilities = /* @__PURE__ */ new Map();
|
|
315
|
+
this.registry = registry ?? Registry.make();
|
|
316
|
+
this.context = new PluginContext({
|
|
317
|
+
registry: this.registry,
|
|
292
318
|
activate: (event) => this._activate(event),
|
|
293
319
|
reset: (id) => this._reset(id)
|
|
294
320
|
});
|
|
295
|
-
this._capabilities = /* @__PURE__ */ new Map();
|
|
296
321
|
this._pluginLoader = pluginLoader;
|
|
297
|
-
this._state =
|
|
322
|
+
this._state = live({
|
|
298
323
|
plugins,
|
|
299
324
|
core,
|
|
300
325
|
enabled,
|
|
@@ -368,12 +393,12 @@ var PluginManager = class {
|
|
|
368
393
|
* @param id The id of the plugin.
|
|
369
394
|
*/
|
|
370
395
|
async add(id) {
|
|
371
|
-
return
|
|
396
|
+
return untracked(async () => {
|
|
372
397
|
log2("add plugin", {
|
|
373
398
|
id
|
|
374
399
|
}, {
|
|
375
400
|
F: __dxlog_file2,
|
|
376
|
-
L:
|
|
401
|
+
L: 154,
|
|
377
402
|
S: this,
|
|
378
403
|
C: (f, a) => f(...a)
|
|
379
404
|
});
|
|
@@ -387,12 +412,12 @@ var PluginManager = class {
|
|
|
387
412
|
* @param id The id of the plugin.
|
|
388
413
|
*/
|
|
389
414
|
enable(id) {
|
|
390
|
-
return
|
|
415
|
+
return untracked(async () => {
|
|
391
416
|
log2("enable plugin", {
|
|
392
417
|
id
|
|
393
418
|
}, {
|
|
394
419
|
F: __dxlog_file2,
|
|
395
|
-
L:
|
|
420
|
+
L: 167,
|
|
396
421
|
S: this,
|
|
397
422
|
C: (f, a) => f(...a)
|
|
398
423
|
});
|
|
@@ -413,7 +438,7 @@ var PluginManager = class {
|
|
|
413
438
|
]
|
|
414
439
|
}, {
|
|
415
440
|
F: __dxlog_file2,
|
|
416
|
-
L:
|
|
441
|
+
L: 182,
|
|
417
442
|
S: this,
|
|
418
443
|
C: (f, a) => f(...a)
|
|
419
444
|
});
|
|
@@ -428,12 +453,12 @@ var PluginManager = class {
|
|
|
428
453
|
* @param id The id of the plugin.
|
|
429
454
|
*/
|
|
430
455
|
remove(id) {
|
|
431
|
-
return
|
|
456
|
+
return untracked(() => {
|
|
432
457
|
log2("remove plugin", {
|
|
433
458
|
id
|
|
434
459
|
}, {
|
|
435
460
|
F: __dxlog_file2,
|
|
436
|
-
L:
|
|
461
|
+
L: 200,
|
|
437
462
|
S: this,
|
|
438
463
|
C: (f, a) => f(...a)
|
|
439
464
|
});
|
|
@@ -450,12 +475,12 @@ var PluginManager = class {
|
|
|
450
475
|
* @param id The id of the plugin.
|
|
451
476
|
*/
|
|
452
477
|
disable(id) {
|
|
453
|
-
return
|
|
478
|
+
return untracked(async () => {
|
|
454
479
|
log2("disable plugin", {
|
|
455
480
|
id
|
|
456
481
|
}, {
|
|
457
482
|
F: __dxlog_file2,
|
|
458
|
-
L:
|
|
483
|
+
L: 217,
|
|
459
484
|
S: this,
|
|
460
485
|
C: (f, a) => f(...a)
|
|
461
486
|
});
|
|
@@ -483,7 +508,7 @@ var PluginManager = class {
|
|
|
483
508
|
* @returns Whether the activation was successful.
|
|
484
509
|
*/
|
|
485
510
|
activate(event) {
|
|
486
|
-
return
|
|
511
|
+
return untracked(() => Effect2.runPromise(this._activate(event)));
|
|
487
512
|
}
|
|
488
513
|
/**
|
|
489
514
|
* Deactivates all of the modules for a plugin.
|
|
@@ -491,7 +516,7 @@ var PluginManager = class {
|
|
|
491
516
|
* @returns Whether the deactivation was successful.
|
|
492
517
|
*/
|
|
493
518
|
deactivate(id) {
|
|
494
|
-
return
|
|
519
|
+
return untracked(() => Effect2.runPromise(this._deactivate(id)));
|
|
495
520
|
}
|
|
496
521
|
/**
|
|
497
522
|
* Re-activates the modules that were activated by the event.
|
|
@@ -499,15 +524,15 @@ var PluginManager = class {
|
|
|
499
524
|
* @returns Whether the reset was successful.
|
|
500
525
|
*/
|
|
501
526
|
reset(event) {
|
|
502
|
-
return
|
|
527
|
+
return untracked(() => Effect2.runPromise(this._reset(event)));
|
|
503
528
|
}
|
|
504
529
|
_addPlugin(plugin) {
|
|
505
|
-
|
|
530
|
+
untracked(() => {
|
|
506
531
|
log2("add plugin", {
|
|
507
532
|
id: plugin.meta.id
|
|
508
533
|
}, {
|
|
509
534
|
F: __dxlog_file2,
|
|
510
|
-
L:
|
|
535
|
+
L: 270,
|
|
511
536
|
S: this,
|
|
512
537
|
C: (f, a) => f(...a)
|
|
513
538
|
});
|
|
@@ -517,12 +542,12 @@ var PluginManager = class {
|
|
|
517
542
|
});
|
|
518
543
|
}
|
|
519
544
|
_removePlugin(id) {
|
|
520
|
-
|
|
545
|
+
untracked(() => {
|
|
521
546
|
log2("remove plugin", {
|
|
522
547
|
id
|
|
523
548
|
}, {
|
|
524
549
|
F: __dxlog_file2,
|
|
525
|
-
L:
|
|
550
|
+
L: 279,
|
|
526
551
|
S: this,
|
|
527
552
|
C: (f, a) => f(...a)
|
|
528
553
|
});
|
|
@@ -533,12 +558,12 @@ var PluginManager = class {
|
|
|
533
558
|
});
|
|
534
559
|
}
|
|
535
560
|
_addModule(module) {
|
|
536
|
-
|
|
561
|
+
untracked(() => {
|
|
537
562
|
log2("add module", {
|
|
538
563
|
id: module.id
|
|
539
564
|
}, {
|
|
540
565
|
F: __dxlog_file2,
|
|
541
|
-
L:
|
|
566
|
+
L: 289,
|
|
542
567
|
S: this,
|
|
543
568
|
C: (f, a) => f(...a)
|
|
544
569
|
});
|
|
@@ -548,12 +573,12 @@ var PluginManager = class {
|
|
|
548
573
|
});
|
|
549
574
|
}
|
|
550
575
|
_removeModule(id) {
|
|
551
|
-
|
|
576
|
+
untracked(() => {
|
|
552
577
|
log2("remove module", {
|
|
553
578
|
id
|
|
554
579
|
}, {
|
|
555
580
|
F: __dxlog_file2,
|
|
556
|
-
L:
|
|
581
|
+
L: 298,
|
|
557
582
|
S: this,
|
|
558
583
|
C: (f, a) => f(...a)
|
|
559
584
|
});
|
|
@@ -579,7 +604,7 @@ var PluginManager = class {
|
|
|
579
604
|
return this._getInactiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));
|
|
580
605
|
}
|
|
581
606
|
_setPendingResetByModule(module) {
|
|
582
|
-
return
|
|
607
|
+
return untracked(() => {
|
|
583
608
|
const activationEvents = getEvents(module.activatesOn).map(eventKey).filter((key) => this._state.eventsFired.includes(key));
|
|
584
609
|
const pendingReset = Array.from(new Set(activationEvents)).filter((event) => !this._state.pendingReset.includes(event));
|
|
585
610
|
if (pendingReset.length > 0) {
|
|
@@ -587,7 +612,7 @@ var PluginManager = class {
|
|
|
587
612
|
events: pendingReset
|
|
588
613
|
}, {
|
|
589
614
|
F: __dxlog_file2,
|
|
590
|
-
L:
|
|
615
|
+
L: 336,
|
|
591
616
|
S: this,
|
|
592
617
|
C: (f, a) => f(...a)
|
|
593
618
|
});
|
|
@@ -606,7 +631,7 @@ var PluginManager = class {
|
|
|
606
631
|
key
|
|
607
632
|
}, {
|
|
608
633
|
F: __dxlog_file2,
|
|
609
|
-
L:
|
|
634
|
+
L: 349,
|
|
610
635
|
S: this,
|
|
611
636
|
C: (f, a) => f(...a)
|
|
612
637
|
});
|
|
@@ -627,7 +652,7 @@ var PluginManager = class {
|
|
|
627
652
|
key
|
|
628
653
|
}, {
|
|
629
654
|
F: __dxlog_file2,
|
|
630
|
-
L:
|
|
655
|
+
L: 365,
|
|
631
656
|
S: this,
|
|
632
657
|
C: (f, a) => f(...a)
|
|
633
658
|
});
|
|
@@ -641,7 +666,7 @@ var PluginManager = class {
|
|
|
641
666
|
modules: modules.map((module) => module.id)
|
|
642
667
|
}, {
|
|
643
668
|
F: __dxlog_file2,
|
|
644
|
-
L:
|
|
669
|
+
L: 372,
|
|
645
670
|
S: this,
|
|
646
671
|
C: (f, a) => f(...a)
|
|
647
672
|
});
|
|
@@ -683,7 +708,7 @@ var PluginManager = class {
|
|
|
683
708
|
key
|
|
684
709
|
}, {
|
|
685
710
|
F: __dxlog_file2,
|
|
686
|
-
L:
|
|
711
|
+
L: 406,
|
|
687
712
|
S: this,
|
|
688
713
|
C: (f, a) => f(...a)
|
|
689
714
|
});
|
|
@@ -699,7 +724,7 @@ var PluginManager = class {
|
|
|
699
724
|
module: module.id
|
|
700
725
|
}, {
|
|
701
726
|
F: __dxlog_file2,
|
|
702
|
-
L:
|
|
727
|
+
L: 421,
|
|
703
728
|
S: this,
|
|
704
729
|
C: (f, a) => f(...a)
|
|
705
730
|
});
|
|
@@ -728,7 +753,7 @@ var PluginManager = class {
|
|
|
728
753
|
module: module.id
|
|
729
754
|
}, {
|
|
730
755
|
F: __dxlog_file2,
|
|
731
|
-
L:
|
|
756
|
+
L: 444,
|
|
732
757
|
S: this,
|
|
733
758
|
C: (f, a) => f(...a)
|
|
734
759
|
});
|
|
@@ -757,7 +782,7 @@ var PluginManager = class {
|
|
|
757
782
|
id
|
|
758
783
|
}, {
|
|
759
784
|
F: __dxlog_file2,
|
|
760
|
-
L:
|
|
785
|
+
L: 471,
|
|
761
786
|
S: this,
|
|
762
787
|
C: (f, a) => f(...a)
|
|
763
788
|
});
|
|
@@ -766,7 +791,7 @@ var PluginManager = class {
|
|
|
766
791
|
for (const capability of capabilities) {
|
|
767
792
|
this.context.removeCapability(capability.interface, capability.implementation);
|
|
768
793
|
const program = capability.deactivate?.();
|
|
769
|
-
yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (
|
|
794
|
+
yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (effect) => effect), Match.when(isPromise, (promise) => Effect2.tryPromise({
|
|
770
795
|
try: () => promise,
|
|
771
796
|
catch: (error) => error
|
|
772
797
|
})), Match.orElse((program2) => Effect2.succeed(program2)));
|
|
@@ -781,7 +806,7 @@ var PluginManager = class {
|
|
|
781
806
|
id
|
|
782
807
|
}, {
|
|
783
808
|
F: __dxlog_file2,
|
|
784
|
-
L:
|
|
809
|
+
L: 497,
|
|
785
810
|
S: this,
|
|
786
811
|
C: (f, a) => f(...a)
|
|
787
812
|
});
|
|
@@ -795,7 +820,7 @@ var PluginManager = class {
|
|
|
795
820
|
key
|
|
796
821
|
}, {
|
|
797
822
|
F: __dxlog_file2,
|
|
798
|
-
L:
|
|
823
|
+
L: 505,
|
|
799
824
|
S: this,
|
|
800
825
|
C: (f, a) => f(...a)
|
|
801
826
|
});
|
|
@@ -834,10 +859,10 @@ var definePlugin = (meta, modules) => {
|
|
|
834
859
|
};
|
|
835
860
|
|
|
836
861
|
// packages/sdk/app-framework/src/common/capabilities.ts
|
|
837
|
-
var Capabilities;
|
|
838
862
|
(function(Capabilities2) {
|
|
839
863
|
Capabilities2.PluginManager = defineCapability("dxos.org/app-framework/capability/plugin-manager");
|
|
840
864
|
Capabilities2.Null = defineCapability("dxos.org/app-framework/capability/null");
|
|
865
|
+
Capabilities2.RxRegistry = defineCapability("dxos.org/app-framework/capability/rx-registry");
|
|
841
866
|
Capabilities2.ReactContext = defineCapability("dxos.org/app-framework/capability/react-context");
|
|
842
867
|
Capabilities2.ReactRoot = defineCapability("dxos.org/app-framework/capability/react-root");
|
|
843
868
|
Capabilities2.ReactSurface = defineCapability("dxos.org/app-framework/common/react-surface");
|
|
@@ -854,10 +879,31 @@ var Capabilities;
|
|
|
854
879
|
Capabilities2.Tools = defineCapability("dxos.org/app-framework/capability/tools");
|
|
855
880
|
Capabilities2.ArtifactDefinition = defineCapability("dxos.org/app-framework/capability/artifact-definition");
|
|
856
881
|
Capabilities2.FileUploader = defineCapability("dxos.org/app-framework/capability/file-uploader");
|
|
882
|
+
Capabilities2.AnchorSort = defineCapability("dxos.org/app-framework/capability/anchor-sort");
|
|
857
883
|
})(Capabilities || (Capabilities = {}));
|
|
884
|
+
var Capabilities;
|
|
885
|
+
|
|
886
|
+
// packages/sdk/app-framework/src/common/collaboration.ts
|
|
887
|
+
import { Schema as Schema3 } from "effect";
|
|
888
|
+
import { Expando, Ref } from "@dxos/echo-schema";
|
|
889
|
+
(function(CollaborationActions2) {
|
|
890
|
+
class InsertContent extends Schema3.TaggedClass()("assistant/intent-content", {
|
|
891
|
+
input: Schema3.Struct({
|
|
892
|
+
target: Expando,
|
|
893
|
+
object: Ref(Expando),
|
|
894
|
+
at: Schema3.optional(Schema3.String),
|
|
895
|
+
label: Schema3.String.pipe(Schema3.optional)
|
|
896
|
+
}).annotations({
|
|
897
|
+
description: "Enables plugins to inject content blocks or references into a related entity."
|
|
898
|
+
}),
|
|
899
|
+
output: Schema3.Void
|
|
900
|
+
}) {
|
|
901
|
+
}
|
|
902
|
+
CollaborationActions2.InsertContent = InsertContent;
|
|
903
|
+
})(CollaborationActions || (CollaborationActions = {}));
|
|
904
|
+
var CollaborationActions;
|
|
858
905
|
|
|
859
906
|
// packages/sdk/app-framework/src/common/events.ts
|
|
860
|
-
var Events;
|
|
861
907
|
(function(Events2) {
|
|
862
908
|
Events2.Startup = defineEvent("dxos.org/app-framework/event/startup");
|
|
863
909
|
Events2.SetupReactSurface = defineEvent("dxos.org/app-framework/event/setup-react-surface");
|
|
@@ -873,9 +919,10 @@ var Events;
|
|
|
873
919
|
Events2.createStateEvent = (specifier) => defineEvent("dxos.org/app-framework/event/state", specifier);
|
|
874
920
|
Events2.LayoutReady = Events2.createStateEvent(Capabilities.Layout.identifier);
|
|
875
921
|
})(Events || (Events = {}));
|
|
922
|
+
var Events;
|
|
876
923
|
|
|
877
924
|
// packages/sdk/app-framework/src/common/file.ts
|
|
878
|
-
import { Schema as
|
|
925
|
+
import { Schema as Schema4 } from "effect";
|
|
879
926
|
var defaultFileTypes = {
|
|
880
927
|
images: [
|
|
881
928
|
"png",
|
|
@@ -895,15 +942,15 @@ var defaultFileTypes = {
|
|
|
895
942
|
"md"
|
|
896
943
|
]
|
|
897
944
|
};
|
|
898
|
-
var FileInfoSchema =
|
|
899
|
-
name:
|
|
900
|
-
type:
|
|
901
|
-
url:
|
|
902
|
-
cid:
|
|
945
|
+
var FileInfoSchema = Schema4.Struct({
|
|
946
|
+
name: Schema4.String,
|
|
947
|
+
type: Schema4.String,
|
|
948
|
+
url: Schema4.optional(Schema4.String),
|
|
949
|
+
cid: Schema4.optional(Schema4.String)
|
|
903
950
|
});
|
|
904
951
|
|
|
905
952
|
// packages/sdk/app-framework/src/common/layout.ts
|
|
906
|
-
import { Schema as
|
|
953
|
+
import { Schema as Schema5 } from "effect";
|
|
907
954
|
|
|
908
955
|
// packages/sdk/app-framework/src/plugin-intent/IntentPlugin.tsx
|
|
909
956
|
var IntentPlugin = () => definePlugin({
|
|
@@ -919,343 +966,362 @@ var IntentPlugin = () => definePlugin({
|
|
|
919
966
|
activatesAfter: [
|
|
920
967
|
Events.DispatcherReady
|
|
921
968
|
],
|
|
922
|
-
activate: lazy(() => import("./intent-dispatcher-
|
|
969
|
+
activate: lazy(() => import("./intent-dispatcher-A2JCMWRD.mjs"))
|
|
923
970
|
})
|
|
924
971
|
]);
|
|
925
972
|
|
|
926
973
|
// packages/sdk/app-framework/src/common/layout.ts
|
|
927
974
|
var LAYOUT_PLUGIN = "dxos.org/plugin/layout";
|
|
928
975
|
var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
929
|
-
var LayoutAction;
|
|
930
976
|
(function(LayoutAction2) {
|
|
931
977
|
LayoutAction2.UPDATE_LAYOUT = `${LAYOUT_ACTION}/update-layout`;
|
|
932
|
-
class UpdateLayout extends
|
|
933
|
-
input:
|
|
934
|
-
part:
|
|
978
|
+
class UpdateLayout extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
979
|
+
input: Schema5.Struct({
|
|
980
|
+
part: Schema5.String.annotations({
|
|
935
981
|
description: "The part of the layout to mutate."
|
|
936
982
|
}),
|
|
937
|
-
subject:
|
|
983
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
938
984
|
description: "The subject of the layout update."
|
|
939
985
|
})),
|
|
940
|
-
options:
|
|
941
|
-
key:
|
|
942
|
-
value:
|
|
986
|
+
options: Schema5.optional(Schema5.Record({
|
|
987
|
+
key: Schema5.String,
|
|
988
|
+
value: Schema5.Any
|
|
943
989
|
}).annotations({
|
|
944
990
|
description: "Additional options for the layout action."
|
|
945
991
|
}))
|
|
946
992
|
}),
|
|
947
|
-
output:
|
|
993
|
+
output: Schema5.Void
|
|
948
994
|
}) {
|
|
949
995
|
}
|
|
950
996
|
LayoutAction2.UpdateLayout = UpdateLayout;
|
|
951
|
-
class SetLayoutMode extends
|
|
952
|
-
input:
|
|
953
|
-
part:
|
|
997
|
+
class SetLayoutMode extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
998
|
+
input: Schema5.Struct({
|
|
999
|
+
part: Schema5.Literal("mode").annotations({
|
|
954
1000
|
description: "Setting the layout mode."
|
|
955
1001
|
}),
|
|
956
|
-
subject:
|
|
1002
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
957
1003
|
description: "Item which is the subject of the new layout mode."
|
|
958
1004
|
})),
|
|
959
|
-
options:
|
|
960
|
-
mode:
|
|
1005
|
+
options: Schema5.Union(Schema5.Struct({
|
|
1006
|
+
mode: Schema5.String.annotations({
|
|
961
1007
|
description: "The new layout mode."
|
|
962
1008
|
})
|
|
963
|
-
}),
|
|
964
|
-
revert:
|
|
1009
|
+
}), Schema5.Struct({
|
|
1010
|
+
revert: Schema5.Boolean.annotations({
|
|
965
1011
|
description: "Revert to the previous layout mode."
|
|
966
1012
|
})
|
|
967
1013
|
}))
|
|
968
1014
|
}),
|
|
969
|
-
output:
|
|
1015
|
+
output: Schema5.Void
|
|
970
1016
|
}) {
|
|
971
1017
|
}
|
|
972
1018
|
LayoutAction2.SetLayoutMode = SetLayoutMode;
|
|
973
|
-
class UpdateSidebar extends
|
|
974
|
-
input:
|
|
975
|
-
part:
|
|
1019
|
+
class UpdateSidebar extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1020
|
+
input: Schema5.Struct({
|
|
1021
|
+
part: Schema5.Literal("sidebar").annotations({
|
|
976
1022
|
description: "Updating the sidebar."
|
|
977
1023
|
}),
|
|
978
|
-
subject:
|
|
1024
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
979
1025
|
description: "URI of the component to display in the sidebar."
|
|
980
1026
|
})),
|
|
981
|
-
options:
|
|
982
|
-
state:
|
|
1027
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1028
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
983
1029
|
description: "Whether the sidebar is closed, collapsed, or expanded."
|
|
984
1030
|
})
|
|
985
1031
|
}))
|
|
986
1032
|
}),
|
|
987
|
-
output:
|
|
1033
|
+
output: Schema5.Void
|
|
988
1034
|
}) {
|
|
989
1035
|
}
|
|
990
1036
|
LayoutAction2.UpdateSidebar = UpdateSidebar;
|
|
991
|
-
class UpdateComplementary extends
|
|
992
|
-
input:
|
|
993
|
-
part:
|
|
1037
|
+
class UpdateComplementary extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1038
|
+
input: Schema5.Struct({
|
|
1039
|
+
part: Schema5.Literal("complementary").annotations({
|
|
994
1040
|
description: "Updating the complementary sidebar."
|
|
995
1041
|
}),
|
|
996
|
-
subject:
|
|
1042
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
997
1043
|
description: "URI of the component to display in the complementary area."
|
|
998
1044
|
})),
|
|
999
|
-
options:
|
|
1000
|
-
state:
|
|
1045
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1046
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
1001
1047
|
description: "Whether the complementary sidebar is closed, collapsed, or expanded."
|
|
1002
1048
|
})
|
|
1003
1049
|
}))
|
|
1004
1050
|
}),
|
|
1005
|
-
output:
|
|
1051
|
+
output: Schema5.Void
|
|
1006
1052
|
}) {
|
|
1007
1053
|
}
|
|
1008
1054
|
LayoutAction2.UpdateComplementary = UpdateComplementary;
|
|
1009
|
-
class UpdateDialog extends
|
|
1010
|
-
input:
|
|
1011
|
-
part:
|
|
1055
|
+
class UpdateDialog extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1056
|
+
input: Schema5.Struct({
|
|
1057
|
+
part: Schema5.Literal("dialog").annotations({
|
|
1012
1058
|
description: "Updating the dialog."
|
|
1013
1059
|
}),
|
|
1014
|
-
subject:
|
|
1060
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1015
1061
|
description: "URI of the component to display in the dialog."
|
|
1016
1062
|
})),
|
|
1017
|
-
options:
|
|
1018
|
-
state:
|
|
1063
|
+
options: Schema5.Struct({
|
|
1064
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1019
1065
|
description: "Whether the dialog is open or closed."
|
|
1020
1066
|
})),
|
|
1021
|
-
|
|
1067
|
+
type: Schema5.optional(Schema5.Literal("default", "alert").annotations({
|
|
1068
|
+
description: "The type of dialog."
|
|
1069
|
+
})),
|
|
1070
|
+
blockAlign: Schema5.optional(Schema5.Literal("start", "center", "end").annotations({
|
|
1022
1071
|
description: "The alignment of the dialog."
|
|
1023
1072
|
})),
|
|
1024
|
-
|
|
1025
|
-
description: "
|
|
1073
|
+
overlayClasses: Schema5.optional(Schema5.String.annotations({
|
|
1074
|
+
description: "Additional classes for the dialog overlay."
|
|
1075
|
+
})),
|
|
1076
|
+
overlayStyle: Schema5.optional(Schema5.Record({
|
|
1077
|
+
key: Schema5.String,
|
|
1078
|
+
value: Schema5.Any
|
|
1079
|
+
}).annotations({
|
|
1080
|
+
description: "Additional styles for the dialog overlay."
|
|
1026
1081
|
})),
|
|
1027
|
-
props:
|
|
1028
|
-
key:
|
|
1029
|
-
value:
|
|
1082
|
+
props: Schema5.optional(Schema5.Record({
|
|
1083
|
+
key: Schema5.String,
|
|
1084
|
+
value: Schema5.Any
|
|
1030
1085
|
}).annotations({
|
|
1031
1086
|
description: "Additional props for the dialog."
|
|
1032
1087
|
}))
|
|
1033
1088
|
})
|
|
1034
1089
|
}),
|
|
1035
|
-
output:
|
|
1090
|
+
output: Schema5.Void
|
|
1036
1091
|
}) {
|
|
1037
1092
|
}
|
|
1038
1093
|
LayoutAction2.UpdateDialog = UpdateDialog;
|
|
1039
|
-
class UpdatePopover extends
|
|
1040
|
-
input:
|
|
1041
|
-
part:
|
|
1094
|
+
class UpdatePopover extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1095
|
+
input: Schema5.Struct({
|
|
1096
|
+
part: Schema5.Literal("popover").annotations({
|
|
1042
1097
|
description: "Updating the popover."
|
|
1043
1098
|
}),
|
|
1044
|
-
subject:
|
|
1045
|
-
description: "URI of the component to display in the popover."
|
|
1099
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
1100
|
+
description: "URI of the component to display in the popover or data to pass to the popover."
|
|
1046
1101
|
})),
|
|
1047
|
-
options:
|
|
1048
|
-
|
|
1049
|
-
description: "The id of the element to anchor the popover to."
|
|
1050
|
-
}),
|
|
1051
|
-
side: S4.optional(S4.Literal("top", "right", "bottom", "left").annotations({
|
|
1102
|
+
options: Schema5.Struct({
|
|
1103
|
+
side: Schema5.optional(Schema5.Literal("top", "right", "bottom", "left").annotations({
|
|
1052
1104
|
description: "The side of the anchor."
|
|
1053
1105
|
})),
|
|
1054
|
-
state:
|
|
1106
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1055
1107
|
description: "Whether the popover is open or closed."
|
|
1056
1108
|
})),
|
|
1057
|
-
props:
|
|
1058
|
-
key:
|
|
1059
|
-
value:
|
|
1109
|
+
props: Schema5.optional(Schema5.Record({
|
|
1110
|
+
key: Schema5.String,
|
|
1111
|
+
value: Schema5.Any
|
|
1060
1112
|
}).annotations({
|
|
1061
1113
|
description: "Additional props for the popover."
|
|
1062
1114
|
}))
|
|
1063
|
-
})
|
|
1115
|
+
}).pipe(Schema5.extend(Schema5.Union(Schema5.Struct({
|
|
1116
|
+
variant: Schema5.Literal("virtual"),
|
|
1117
|
+
anchor: Schema5.Any.annotations({
|
|
1118
|
+
description: "The DOM element to anchor the popover to."
|
|
1119
|
+
})
|
|
1120
|
+
}), Schema5.Struct({
|
|
1121
|
+
variant: Schema5.optional(Schema5.Literal("react")),
|
|
1122
|
+
anchorId: Schema5.String.annotations({
|
|
1123
|
+
description: "An id that can be used to determine whether to render the anchor subcomponent."
|
|
1124
|
+
})
|
|
1125
|
+
}))))
|
|
1064
1126
|
}),
|
|
1065
|
-
output:
|
|
1127
|
+
output: Schema5.Void
|
|
1066
1128
|
}) {
|
|
1067
1129
|
}
|
|
1068
1130
|
LayoutAction2.UpdatePopover = UpdatePopover;
|
|
1069
|
-
LayoutAction2.Toast =
|
|
1070
|
-
id:
|
|
1131
|
+
LayoutAction2.Toast = Schema5.Struct({
|
|
1132
|
+
id: Schema5.String.annotations({
|
|
1071
1133
|
description: "The id of the toast."
|
|
1072
1134
|
}),
|
|
1073
|
-
title:
|
|
1135
|
+
title: Schema5.optional(Label.annotations({
|
|
1074
1136
|
description: "The title of the toast."
|
|
1075
1137
|
})),
|
|
1076
|
-
description:
|
|
1138
|
+
description: Schema5.optional(Label.annotations({
|
|
1077
1139
|
description: "The description of the toast."
|
|
1078
1140
|
})),
|
|
1079
|
-
icon:
|
|
1141
|
+
icon: Schema5.optional(Schema5.String.annotations({
|
|
1080
1142
|
description: "The icon of the toast."
|
|
1081
1143
|
})),
|
|
1082
|
-
duration:
|
|
1144
|
+
duration: Schema5.optional(Schema5.Number.annotations({
|
|
1083
1145
|
description: "The duration of the toast."
|
|
1084
1146
|
})),
|
|
1085
|
-
closeLabel:
|
|
1147
|
+
closeLabel: Schema5.optional(Label.annotations({
|
|
1086
1148
|
description: "The label of the close button."
|
|
1087
1149
|
})),
|
|
1088
|
-
actionLabel:
|
|
1150
|
+
actionLabel: Schema5.optional(Label.annotations({
|
|
1089
1151
|
description: "The label of the action button."
|
|
1090
1152
|
})),
|
|
1091
|
-
actionAlt:
|
|
1153
|
+
actionAlt: Schema5.optional(Label.annotations({
|
|
1092
1154
|
description: "The alt text of the action button."
|
|
1093
1155
|
})),
|
|
1094
|
-
onAction:
|
|
1156
|
+
onAction: Schema5.optional(Schema5.Any.annotations({
|
|
1095
1157
|
description: "The action to perform when the action button is clicked."
|
|
1096
1158
|
}))
|
|
1097
1159
|
});
|
|
1098
|
-
class AddToast extends
|
|
1099
|
-
input:
|
|
1100
|
-
part:
|
|
1160
|
+
class AddToast extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1161
|
+
input: Schema5.Struct({
|
|
1162
|
+
part: Schema5.Literal("toast").annotations({
|
|
1101
1163
|
description: "Adding a toast."
|
|
1102
1164
|
}),
|
|
1103
1165
|
subject: LayoutAction2.Toast.annotations({
|
|
1104
1166
|
description: "The toast to add."
|
|
1105
1167
|
})
|
|
1106
1168
|
}),
|
|
1107
|
-
output:
|
|
1169
|
+
output: Schema5.Void
|
|
1108
1170
|
}) {
|
|
1109
1171
|
}
|
|
1110
1172
|
LayoutAction2.AddToast = AddToast;
|
|
1111
|
-
class SwitchWorkspace extends
|
|
1112
|
-
input:
|
|
1113
|
-
part:
|
|
1173
|
+
class SwitchWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1174
|
+
input: Schema5.Struct({
|
|
1175
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1114
1176
|
description: "Switching the workspace."
|
|
1115
1177
|
}),
|
|
1116
|
-
subject:
|
|
1178
|
+
subject: Schema5.String.annotations({
|
|
1117
1179
|
description: "The id of the workspace to switch to."
|
|
1118
1180
|
})
|
|
1119
1181
|
}),
|
|
1120
|
-
output:
|
|
1182
|
+
output: Schema5.Void
|
|
1121
1183
|
}) {
|
|
1122
1184
|
}
|
|
1123
1185
|
LayoutAction2.SwitchWorkspace = SwitchWorkspace;
|
|
1124
|
-
class RevertWorkspace extends
|
|
1125
|
-
input:
|
|
1126
|
-
part:
|
|
1186
|
+
class RevertWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1187
|
+
input: Schema5.Struct({
|
|
1188
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1127
1189
|
description: "Switching the workspace."
|
|
1128
1190
|
}),
|
|
1129
|
-
options:
|
|
1130
|
-
revert:
|
|
1191
|
+
options: Schema5.Struct({
|
|
1192
|
+
revert: Schema5.Literal(true).annotations({
|
|
1131
1193
|
description: "Revert to the previous workspace."
|
|
1132
1194
|
})
|
|
1133
1195
|
})
|
|
1134
1196
|
}),
|
|
1135
|
-
output:
|
|
1197
|
+
output: Schema5.Void
|
|
1136
1198
|
}) {
|
|
1137
1199
|
}
|
|
1138
1200
|
LayoutAction2.RevertWorkspace = RevertWorkspace;
|
|
1139
|
-
class Open extends
|
|
1140
|
-
input:
|
|
1141
|
-
part:
|
|
1201
|
+
class Open extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1202
|
+
input: Schema5.Struct({
|
|
1203
|
+
part: Schema5.Literal("main").annotations({
|
|
1142
1204
|
description: "Opening an item in the main content area."
|
|
1143
1205
|
}),
|
|
1144
|
-
subject:
|
|
1206
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1145
1207
|
description: "Ids of the items to open."
|
|
1146
1208
|
})),
|
|
1147
|
-
options:
|
|
1148
|
-
state:
|
|
1209
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1210
|
+
state: Schema5.optional(Schema5.Literal(true).annotations({
|
|
1149
1211
|
description: "The items are being added."
|
|
1150
1212
|
})),
|
|
1151
|
-
variant:
|
|
1213
|
+
variant: Schema5.optional(Schema5.String.annotations({
|
|
1152
1214
|
description: "The variant of the item to open."
|
|
1153
1215
|
})),
|
|
1154
|
-
key:
|
|
1216
|
+
key: Schema5.optional(Schema5.String.annotations({
|
|
1155
1217
|
description: "If provided, will replace item with a matching key (id prefix)."
|
|
1156
1218
|
})),
|
|
1157
|
-
|
|
1219
|
+
workspace: Schema5.optional(Schema5.String.annotations({
|
|
1220
|
+
description: "The workspace to open the items in."
|
|
1221
|
+
})),
|
|
1222
|
+
scrollIntoView: Schema5.optional(Schema5.Boolean.annotations({
|
|
1158
1223
|
description: "Scroll the items into view."
|
|
1159
1224
|
})),
|
|
1160
|
-
pivotId:
|
|
1225
|
+
pivotId: Schema5.optional(Schema5.String.annotations({
|
|
1161
1226
|
description: "The id of the item to place new items next to."
|
|
1162
1227
|
})),
|
|
1163
|
-
positioning:
|
|
1228
|
+
positioning: Schema5.optional(Schema5.Union(Schema5.Literal("start").annotations({
|
|
1164
1229
|
description: "The items are being added before the pivot item."
|
|
1165
|
-
}),
|
|
1230
|
+
}), Schema5.Literal("end").annotations({
|
|
1166
1231
|
description: "The items are being added after the pivot item."
|
|
1167
1232
|
})))
|
|
1168
1233
|
}))
|
|
1169
1234
|
}),
|
|
1170
|
-
output:
|
|
1235
|
+
output: Schema5.Void
|
|
1171
1236
|
}) {
|
|
1172
1237
|
}
|
|
1173
1238
|
LayoutAction2.Open = Open;
|
|
1174
|
-
class Set2 extends
|
|
1175
|
-
input:
|
|
1176
|
-
part:
|
|
1239
|
+
class Set2 extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1240
|
+
input: Schema5.Struct({
|
|
1241
|
+
part: Schema5.Literal("main").annotations({
|
|
1177
1242
|
description: "Setting items in the main content area."
|
|
1178
1243
|
}),
|
|
1179
|
-
subject:
|
|
1244
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1180
1245
|
description: "Ids of the items to set."
|
|
1181
1246
|
})),
|
|
1182
|
-
options:
|
|
1183
|
-
override:
|
|
1247
|
+
options: Schema5.Struct({
|
|
1248
|
+
override: Schema5.Literal(true).annotations({
|
|
1184
1249
|
description: "Override the current items in the main content area."
|
|
1185
1250
|
})
|
|
1186
1251
|
})
|
|
1187
1252
|
}),
|
|
1188
|
-
output:
|
|
1253
|
+
output: Schema5.Void
|
|
1189
1254
|
}) {
|
|
1190
1255
|
}
|
|
1191
1256
|
LayoutAction2.Set = Set2;
|
|
1192
|
-
class Close extends
|
|
1193
|
-
input:
|
|
1194
|
-
part:
|
|
1257
|
+
class Close extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1258
|
+
input: Schema5.Struct({
|
|
1259
|
+
part: Schema5.Literal("main").annotations({
|
|
1195
1260
|
description: "Closing items in the main content area."
|
|
1196
1261
|
}),
|
|
1197
|
-
subject:
|
|
1262
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1198
1263
|
description: "Ids of the items to close."
|
|
1199
1264
|
})),
|
|
1200
|
-
options:
|
|
1201
|
-
state:
|
|
1265
|
+
options: Schema5.Struct({
|
|
1266
|
+
state: Schema5.Literal(false).annotations({
|
|
1202
1267
|
description: "The items are being removed."
|
|
1203
1268
|
})
|
|
1204
1269
|
})
|
|
1205
1270
|
}),
|
|
1206
|
-
output:
|
|
1271
|
+
output: Schema5.Void
|
|
1207
1272
|
}) {
|
|
1208
1273
|
}
|
|
1209
1274
|
LayoutAction2.Close = Close;
|
|
1210
|
-
class ScrollIntoView extends
|
|
1211
|
-
input:
|
|
1212
|
-
part:
|
|
1275
|
+
class ScrollIntoView extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1276
|
+
input: Schema5.Struct({
|
|
1277
|
+
part: Schema5.Literal("current").annotations({
|
|
1213
1278
|
description: "Setting the current item"
|
|
1214
1279
|
}),
|
|
1215
|
-
subject:
|
|
1280
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1216
1281
|
description: "The id of the item to set as current."
|
|
1217
1282
|
})),
|
|
1218
|
-
options:
|
|
1219
|
-
key:
|
|
1220
|
-
value:
|
|
1283
|
+
options: Schema5.optional(Schema5.Record({
|
|
1284
|
+
key: Schema5.String,
|
|
1285
|
+
value: Schema5.Any
|
|
1221
1286
|
}).annotations({
|
|
1222
1287
|
description: "Additional options for the scroll into view."
|
|
1223
1288
|
}))
|
|
1224
1289
|
}),
|
|
1225
|
-
output:
|
|
1290
|
+
output: Schema5.Void
|
|
1226
1291
|
}) {
|
|
1227
1292
|
}
|
|
1228
1293
|
LayoutAction2.ScrollIntoView = ScrollIntoView;
|
|
1229
|
-
class Expose extends
|
|
1230
|
-
input:
|
|
1231
|
-
part:
|
|
1294
|
+
class Expose extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1295
|
+
input: Schema5.Struct({
|
|
1296
|
+
part: Schema5.Literal("navigation").annotations({
|
|
1232
1297
|
description: "Exposing an item in the navigation area."
|
|
1233
1298
|
}),
|
|
1234
|
-
subject:
|
|
1299
|
+
subject: Schema5.String.annotations({
|
|
1235
1300
|
description: "The id of the item to expose."
|
|
1236
1301
|
})
|
|
1237
1302
|
}),
|
|
1238
|
-
output:
|
|
1303
|
+
output: Schema5.Void
|
|
1239
1304
|
}) {
|
|
1240
1305
|
}
|
|
1241
1306
|
LayoutAction2.Expose = Expose;
|
|
1242
1307
|
})(LayoutAction || (LayoutAction = {}));
|
|
1308
|
+
var LayoutAction;
|
|
1243
1309
|
|
|
1244
1310
|
// packages/sdk/app-framework/src/common/surface.ts
|
|
1245
1311
|
var createSurface = (definition) => definition;
|
|
1246
1312
|
|
|
1247
1313
|
// packages/sdk/app-framework/src/common/translations.ts
|
|
1248
|
-
import { Schema as
|
|
1249
|
-
var ResourceKey =
|
|
1250
|
-
key:
|
|
1251
|
-
value:
|
|
1314
|
+
import { Schema as Schema6 } from "effect";
|
|
1315
|
+
var ResourceKey = Schema6.Union(Schema6.String, Schema6.Record({
|
|
1316
|
+
key: Schema6.String,
|
|
1317
|
+
value: Schema6.Any
|
|
1252
1318
|
}));
|
|
1253
|
-
var ResourceLanguage =
|
|
1254
|
-
key:
|
|
1319
|
+
var ResourceLanguage = Schema6.Record({
|
|
1320
|
+
key: Schema6.String,
|
|
1255
1321
|
value: ResourceKey
|
|
1256
1322
|
});
|
|
1257
|
-
var Resource =
|
|
1258
|
-
key:
|
|
1323
|
+
var Resource = Schema6.Record({
|
|
1324
|
+
key: Schema6.String,
|
|
1259
1325
|
value: ResourceLanguage
|
|
1260
1326
|
});
|
|
1261
1327
|
|
|
@@ -1266,14 +1332,14 @@ var HISTORY_LIMIT = 100;
|
|
|
1266
1332
|
var createResolver = (resolver) => resolver;
|
|
1267
1333
|
var isUndoable = (historyEntry) => historyEntry.length > 0 && historyEntry.every(({ undoable }) => !!undoable);
|
|
1268
1334
|
var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {}) => {
|
|
1269
|
-
const historyRef = Effect3.runSync(
|
|
1335
|
+
const historyRef = Effect3.runSync(Ref2.make([]));
|
|
1270
1336
|
const handleIntent = (intent) => Effect3.gen(function* () {
|
|
1271
|
-
const candidates = getResolvers(
|
|
1337
|
+
const candidates = getResolvers().filter((resolver) => resolver.intent._tag === intent.id).filter((resolver) => !resolver.filter || resolver.filter(intent.data)).toSorted(byPosition);
|
|
1272
1338
|
if (candidates.length === 0) {
|
|
1273
1339
|
yield* Effect3.fail(new NoResolversError(intent.id));
|
|
1274
1340
|
}
|
|
1275
|
-
const
|
|
1276
|
-
const result = Effect3.isEffect(
|
|
1341
|
+
const effect = candidates[0].resolve(intent.data, intent.undo ?? false);
|
|
1342
|
+
const result = Effect3.isEffect(effect) ? yield* effect : yield* Effect3.promise(async () => effect);
|
|
1277
1343
|
return {
|
|
1278
1344
|
_intent: intent,
|
|
1279
1345
|
...result
|
|
@@ -1284,7 +1350,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1284
1350
|
if (depth > executionLimit) {
|
|
1285
1351
|
yield* Effect3.fail(new CycleDetectedError());
|
|
1286
1352
|
}
|
|
1287
|
-
const resultsRef = yield*
|
|
1353
|
+
const resultsRef = yield* Ref2.make([]);
|
|
1288
1354
|
for (const intent of intentChain.all) {
|
|
1289
1355
|
const { data: prev } = (yield* resultsRef.get)[0] ?? {};
|
|
1290
1356
|
const result2 = yield* handleIntent({
|
|
@@ -1294,7 +1360,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1294
1360
|
...prev
|
|
1295
1361
|
}
|
|
1296
1362
|
});
|
|
1297
|
-
yield*
|
|
1363
|
+
yield* Ref2.update(resultsRef, (results2) => [
|
|
1298
1364
|
result2,
|
|
1299
1365
|
...results2
|
|
1300
1366
|
]);
|
|
@@ -1309,7 +1375,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1309
1375
|
}
|
|
1310
1376
|
const results = yield* resultsRef.get;
|
|
1311
1377
|
const result = results[0];
|
|
1312
|
-
yield*
|
|
1378
|
+
yield* Ref2.update(historyRef, (history) => {
|
|
1313
1379
|
const next = [
|
|
1314
1380
|
...history,
|
|
1315
1381
|
results
|
|
@@ -1333,7 +1399,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1333
1399
|
})).catch((error) => {
|
|
1334
1400
|
log3.catch(error, void 0, {
|
|
1335
1401
|
F: __dxlog_file3,
|
|
1336
|
-
L:
|
|
1402
|
+
L: 270,
|
|
1337
1403
|
S: void 0,
|
|
1338
1404
|
C: (f, a) => f(...a)
|
|
1339
1405
|
});
|
|
@@ -1365,7 +1431,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1365
1431
|
last: all.at(-1),
|
|
1366
1432
|
all
|
|
1367
1433
|
};
|
|
1368
|
-
yield*
|
|
1434
|
+
yield* Ref2.update(historyRef, (h) => h.filter((_, index) => index !== last));
|
|
1369
1435
|
return yield* dispatch(intent);
|
|
1370
1436
|
}
|
|
1371
1437
|
});
|
|
@@ -1387,16 +1453,14 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1387
1453
|
var defaultEffect = () => Effect3.fail(new Error("Intent runtime not ready"));
|
|
1388
1454
|
var defaultPromise = () => Effect3.runPromise(defaultEffect());
|
|
1389
1455
|
var intent_dispatcher_default = (context) => {
|
|
1390
|
-
const state =
|
|
1456
|
+
const state = live2({
|
|
1391
1457
|
dispatch: defaultEffect,
|
|
1392
1458
|
dispatchPromise: defaultPromise,
|
|
1393
1459
|
undo: defaultEffect,
|
|
1394
1460
|
undoPromise: defaultPromise
|
|
1395
1461
|
});
|
|
1396
|
-
const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher((
|
|
1397
|
-
|
|
1398
|
-
}).flat());
|
|
1399
|
-
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
1462
|
+
const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher(() => context.getCapabilities(Capabilities.IntentResolver).flat());
|
|
1463
|
+
const manager = context.getCapability(Capabilities.PluginManager);
|
|
1400
1464
|
state.dispatch = (intentChain, depth) => {
|
|
1401
1465
|
return Effect3.gen(function* () {
|
|
1402
1466
|
yield* manager._activate(Events.SetupIntentResolver);
|
|
@@ -1416,7 +1480,7 @@ export {
|
|
|
1416
1480
|
defineCapability,
|
|
1417
1481
|
contributes,
|
|
1418
1482
|
lazy,
|
|
1419
|
-
|
|
1483
|
+
PluginContext,
|
|
1420
1484
|
defineEvent,
|
|
1421
1485
|
eventKey,
|
|
1422
1486
|
oneOf,
|
|
@@ -1430,6 +1494,7 @@ export {
|
|
|
1430
1494
|
Plugin,
|
|
1431
1495
|
definePlugin,
|
|
1432
1496
|
Capabilities,
|
|
1497
|
+
CollaborationActions,
|
|
1433
1498
|
Events,
|
|
1434
1499
|
defaultFileTypes,
|
|
1435
1500
|
FileInfoSchema,
|
|
@@ -1451,4 +1516,4 @@ export {
|
|
|
1451
1516
|
ResourceLanguage,
|
|
1452
1517
|
Resource
|
|
1453
1518
|
};
|
|
1454
|
-
//# sourceMappingURL=chunk-
|
|
1519
|
+
//# sourceMappingURL=chunk-Z2ZHH4HN.mjs.map
|