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