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