@dxos/app-framework 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1

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.
Files changed (123) hide show
  1. package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs → app-graph-builder-576BHZC7.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-PWAAJE2Z.mjs → chunk-6AVTZPMT.mjs} +65 -45
  3. package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-CIP4C47B.mjs → chunk-PPIBZ5N4.mjs} +55 -11
  5. package/dist/lib/browser/chunk-PPIBZ5N4.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-CB3W6T5E.mjs → chunk-SFPT4Z2C.mjs} +1 -1
  7. package/dist/lib/browser/{chunk-CB3W6T5E.mjs.map → chunk-SFPT4Z2C.mjs.map} +2 -2
  8. package/dist/lib/browser/index.mjs +8 -7
  9. package/dist/lib/browser/index.mjs.map +3 -3
  10. package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs → intent-dispatcher-3Q67MHZZ.mjs} +2 -2
  11. package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs → intent-resolver-O763LCLG.mjs} +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/{store-5TN4OLFQ.mjs → store-URSN7DZI.mjs} +2 -2
  14. package/dist/lib/browser/testing/index.mjs +4 -3
  15. package/dist/lib/browser/testing/index.mjs.map +3 -3
  16. package/dist/lib/browser/worker.mjs +1 -1
  17. package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs → app-graph-builder-JZCSKYPY.cjs} +28 -28
  18. package/dist/lib/node/{chunk-SCHC4AZQ.cjs → chunk-JUSEAFDU.cjs} +4 -4
  19. package/dist/lib/node/{chunk-SCHC4AZQ.cjs.map → chunk-JUSEAFDU.cjs.map} +2 -2
  20. package/dist/lib/node/{chunk-XP4TI5DS.cjs → chunk-YIFTVCOR.cjs} +191 -171
  21. package/dist/lib/node/chunk-YIFTVCOR.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-JLQABYHB.cjs → chunk-YNTKVTVX.cjs} +70 -26
  23. package/dist/lib/node/chunk-YNTKVTVX.cjs.map +7 -0
  24. package/dist/lib/node/index.cjs +79 -78
  25. package/dist/lib/node/index.cjs.map +3 -3
  26. package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs → intent-dispatcher-H334XLFD.cjs} +8 -8
  27. package/dist/lib/node/{intent-dispatcher-EDW7NFJ4.cjs.map → intent-dispatcher-H334XLFD.cjs.map} +2 -2
  28. package/dist/lib/node/{intent-resolver-34J5IM27.cjs → intent-resolver-3F4POWAM.cjs} +12 -12
  29. package/dist/lib/node/meta.json +1 -1
  30. package/dist/lib/node/{store-3I3UFH5D.cjs → store-OFDHTDCB.cjs} +7 -7
  31. package/dist/lib/node/testing/index.cjs +10 -9
  32. package/dist/lib/node/testing/index.cjs.map +3 -3
  33. package/dist/lib/node/worker.cjs +37 -37
  34. package/dist/lib/node/worker.cjs.map +1 -1
  35. package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs → app-graph-builder-VYKLSMSZ.mjs} +3 -3
  36. package/dist/lib/node-esm/{chunk-NIVSBD3D.mjs → chunk-AHKIPS2L.mjs} +65 -45
  37. package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +7 -0
  38. package/dist/lib/node-esm/{chunk-BSYAFUZ7.mjs → chunk-PHOUQACM.mjs} +1 -1
  39. package/dist/lib/node-esm/{chunk-BSYAFUZ7.mjs.map → chunk-PHOUQACM.mjs.map} +2 -2
  40. package/dist/lib/node-esm/{chunk-T2URISUU.mjs → chunk-R6A7Z4LU.mjs} +55 -11
  41. package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +7 -0
  42. package/dist/lib/node-esm/index.mjs +8 -7
  43. package/dist/lib/node-esm/index.mjs.map +3 -3
  44. package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs → intent-dispatcher-YDE2ONZA.mjs} +2 -2
  45. package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs → intent-resolver-LAGJ7LXM.mjs} +3 -3
  46. package/dist/lib/node-esm/meta.json +1 -1
  47. package/dist/lib/node-esm/{store-PTKVELJP.mjs → store-EYSUVNCS.mjs} +2 -2
  48. package/dist/lib/node-esm/testing/index.mjs +4 -3
  49. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  50. package/dist/lib/node-esm/worker.mjs +1 -1
  51. package/dist/types/src/App.d.ts +5 -3
  52. package/dist/types/src/App.d.ts.map +1 -1
  53. package/dist/types/src/common/layout.d.ts +21 -20
  54. package/dist/types/src/common/layout.d.ts.map +1 -1
  55. package/dist/types/src/common/surface.d.ts +4 -7
  56. package/dist/types/src/common/surface.d.ts.map +1 -1
  57. package/dist/types/src/core/capabilities.d.ts +5 -3
  58. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  59. package/dist/types/src/core/plugin.d.ts +1 -1
  60. package/dist/types/src/core/plugin.d.ts.map +1 -1
  61. package/dist/types/src/playground/debug/Debug.d.ts +2 -1
  62. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
  63. package/dist/types/src/playground/generator/Main.d.ts +2 -1
  64. package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
  65. package/dist/types/src/playground/generator/Toolbar.d.ts +2 -1
  66. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  67. package/dist/types/src/playground/layout/Layout.d.ts +1 -1
  68. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -1
  69. package/dist/types/src/playground/logger/Toolbar.d.ts +2 -1
  70. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  71. package/dist/types/src/playground/playground.stories.d.ts +2 -1
  72. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  73. package/dist/types/src/plugin-intent/actions.d.ts +16 -2
  74. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  75. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +1 -1
  76. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  77. package/dist/types/src/plugin-intent/intent.d.ts +2 -2
  78. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
  79. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  80. package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
  81. package/dist/types/src/react/Surface.d.ts.map +1 -1
  82. package/dist/types/src/react/Surface.stories.d.ts +2 -1
  83. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  84. package/package.json +20 -19
  85. package/src/App.tsx +65 -8
  86. package/src/common/layout.ts +1 -0
  87. package/src/common/surface.ts +6 -1
  88. package/src/core/capabilities.test.ts +3 -2
  89. package/src/core/capabilities.ts +11 -3
  90. package/src/core/manager.test.ts +30 -30
  91. package/src/core/manager.ts +2 -2
  92. package/src/core/plugin.ts +1 -1
  93. package/src/playground/debug/plugin.ts +1 -1
  94. package/src/playground/generator/generator.ts +1 -1
  95. package/src/playground/generator/plugin.ts +1 -1
  96. package/src/playground/layout/plugin.ts +1 -1
  97. package/src/playground/logger/plugin.ts +1 -1
  98. package/src/playground/playground.stories.tsx +5 -1
  99. package/src/plugin-intent/IntentPlugin.tsx +1 -1
  100. package/src/plugin-intent/actions.ts +11 -0
  101. package/src/plugin-intent/intent-dispatcher.ts +18 -5
  102. package/src/plugin-settings/SettingsPlugin.ts +1 -1
  103. package/src/plugin-settings/actions.ts +2 -0
  104. package/src/react/Surface.tsx +5 -3
  105. package/src/testing/withPluginManager.stories.tsx +2 -2
  106. package/src/testing/withPluginManager.tsx +1 -1
  107. package/dist/lib/browser/chunk-CIP4C47B.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-PWAAJE2Z.mjs.map +0 -7
  109. package/dist/lib/node/chunk-JLQABYHB.cjs.map +0 -7
  110. package/dist/lib/node/chunk-XP4TI5DS.cjs.map +0 -7
  111. package/dist/lib/node-esm/chunk-NIVSBD3D.mjs.map +0 -7
  112. package/dist/lib/node-esm/chunk-T2URISUU.mjs.map +0 -7
  113. /package/dist/lib/browser/{app-graph-builder-IAEV7KKF.mjs.map → app-graph-builder-576BHZC7.mjs.map} +0 -0
  114. /package/dist/lib/browser/{intent-dispatcher-UR566RVO.mjs.map → intent-dispatcher-3Q67MHZZ.mjs.map} +0 -0
  115. /package/dist/lib/browser/{intent-resolver-LEJ3X6CP.mjs.map → intent-resolver-O763LCLG.mjs.map} +0 -0
  116. /package/dist/lib/browser/{store-5TN4OLFQ.mjs.map → store-URSN7DZI.mjs.map} +0 -0
  117. /package/dist/lib/node/{app-graph-builder-3RWOZENP.cjs.map → app-graph-builder-JZCSKYPY.cjs.map} +0 -0
  118. /package/dist/lib/node/{intent-resolver-34J5IM27.cjs.map → intent-resolver-3F4POWAM.cjs.map} +0 -0
  119. /package/dist/lib/node/{store-3I3UFH5D.cjs.map → store-OFDHTDCB.cjs.map} +0 -0
  120. /package/dist/lib/node-esm/{app-graph-builder-RG3DT2OD.mjs.map → app-graph-builder-VYKLSMSZ.mjs.map} +0 -0
  121. /package/dist/lib/node-esm/{intent-dispatcher-7GCMKMSQ.mjs.map → intent-dispatcher-YDE2ONZA.mjs.map} +0 -0
  122. /package/dist/lib/node-esm/{intent-resolver-7T6UOQOS.mjs.map → intent-resolver-LAGJ7LXM.mjs.map} +0 -0
  123. /package/dist/lib/node-esm/{store-PTKVELJP.mjs.map → store-EYSUVNCS.mjs.map} +0 -0
@@ -3,12 +3,12 @@ import {
3
3
  SETTINGS_KEY,
4
4
  SETTINGS_PLUGIN,
5
5
  SettingsAction
6
- } from "./chunk-CB3W6T5E.mjs";
6
+ } from "./chunk-SFPT4Z2C.mjs";
7
7
  import {
8
8
  Capabilities,
9
9
  contributes,
10
10
  createIntent
11
- } from "./chunk-PWAAJE2Z.mjs";
11
+ } from "./chunk-6AVTZPMT.mjs";
12
12
 
13
13
  // packages/sdk/app-framework/src/plugin-settings/app-graph-builder.ts
14
14
  import { createExtension } from "@dxos/app-graph";
@@ -134,4 +134,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
134
134
  export {
135
135
  app_graph_builder_default as default
136
136
  };
137
- //# sourceMappingURL=app-graph-builder-IAEV7KKF.mjs.map
137
+ //# sourceMappingURL=app-graph-builder-576BHZC7.mjs.map
@@ -1,5 +1,5 @@
1
1
  // packages/sdk/app-framework/src/plugin-intent/intent-dispatcher.ts
2
- import { Effect as Effect2, Option, pipe as pipe2, Ref } from "effect";
2
+ import { Effect as Effect3, Option, pipe as pipe2, Ref } from "effect";
3
3
  import { create as create3 } from "@dxos/live-object";
4
4
  import { log as log3 } from "@dxos/log";
5
5
  import { byPosition } from "@dxos/util";
@@ -55,6 +55,15 @@ var INTENT_PLUGIN = "dxos.org/plugin/intent";
55
55
  var INTENT_ACTION = `${INTENT_PLUGIN}/action`;
56
56
  var IntentAction;
57
57
  (function(IntentAction2) {
58
+ class Track extends S2.TaggedClass()(`${INTENT_ACTION}/track`, {
59
+ input: S2.Struct({
60
+ intents: S2.Array(S2.String),
61
+ error: S2.optional(S2.String)
62
+ }),
63
+ output: S2.Void
64
+ }) {
65
+ }
66
+ IntentAction2.Track = Track;
58
67
  class ShowUndo extends S2.TaggedClass()(`${INTENT_ACTION}/show-undo`, {
59
68
  input: S2.Struct({
60
69
  message: Label
@@ -92,6 +101,7 @@ var CycleDetectedError = class extends BaseError {
92
101
 
93
102
  // packages/sdk/app-framework/src/core/capabilities.ts
94
103
  import { effect, untracked } from "@preact/signals-core";
104
+ import { Effect } from "effect";
95
105
  import { Trigger } from "@dxos/async";
96
106
  import { invariant } from "@dxos/invariant";
97
107
  import { create } from "@dxos/live-object";
@@ -233,6 +243,12 @@ var PluginsContext = class {
233
243
  unsubscribe();
234
244
  return capability;
235
245
  }
246
+ async activatePromise(event) {
247
+ return this.activate(event).pipe(Effect.runPromise);
248
+ }
249
+ async resetPromise(event) {
250
+ return this.reset(event).pipe(Effect.runPromise);
251
+ }
236
252
  };
237
253
 
238
254
  // packages/sdk/app-framework/src/core/events.ts
@@ -259,7 +275,7 @@ var getEvents = (events) => "type" in events ? events.events : [
259
275
 
260
276
  // packages/sdk/app-framework/src/core/manager.ts
261
277
  import { untracked as untracked2 } from "@preact/signals-core";
262
- import { Array as A, Effect, Either, Match, pipe } from "effect";
278
+ import { Array as A, Effect as Effect2, Either, Match, pipe } from "effect";
263
279
  import { Event } from "@dxos/async";
264
280
  import { create as create2 } from "@dxos/live-object";
265
281
  import { log as log2 } from "@dxos/log";
@@ -271,8 +287,8 @@ var PluginManager = class {
271
287
  constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), enabled = [] }) {
272
288
  this.activation = new Event();
273
289
  this.context = new PluginsContext({
274
- activate: (event) => this.activate(event),
275
- reset: (id) => this.reset(id)
290
+ activate: (event) => this._activate(event),
291
+ reset: (id) => this._reset(id)
276
292
  });
277
293
  this._capabilities = /* @__PURE__ */ new Map();
278
294
  this._pluginLoader = pluginLoader;
@@ -399,7 +415,7 @@ var PluginManager = class {
399
415
  S: this,
400
416
  C: (f, a) => f(...a)
401
417
  });
402
- await Effect.runPromise(Effect.all(this.pendingReset.map((event) => this._activate(event)), {
418
+ await Effect2.runPromise(Effect2.all(this.pendingReset.map((event) => this._activate(event)), {
403
419
  concurrency: "unbounded"
404
420
  }));
405
421
  return true;
@@ -451,7 +467,7 @@ var PluginManager = class {
451
467
  const enabledIndex = this._state.enabled.findIndex((enabled) => enabled === id);
452
468
  if (enabledIndex !== -1) {
453
469
  this._state.enabled.splice(enabledIndex, 1);
454
- await Effect.runPromise(this._deactivate(id));
470
+ await Effect2.runPromise(this._deactivate(id));
455
471
  plugin.modules.forEach((module) => {
456
472
  this._removeModule(module.id);
457
473
  });
@@ -465,7 +481,7 @@ var PluginManager = class {
465
481
  * @returns Whether the activation was successful.
466
482
  */
467
483
  activate(event) {
468
- return untracked2(() => Effect.runPromise(this._activate(event)));
484
+ return untracked2(() => Effect2.runPromise(this._activate(event)));
469
485
  }
470
486
  /**
471
487
  * Deactivates all of the modules for a plugin.
@@ -473,7 +489,7 @@ var PluginManager = class {
473
489
  * @returns Whether the deactivation was successful.
474
490
  */
475
491
  deactivate(id) {
476
- return untracked2(() => Effect.runPromise(this._deactivate(id)));
492
+ return untracked2(() => Effect2.runPromise(this._deactivate(id)));
477
493
  }
478
494
  /**
479
495
  * Re-activates the modules that were activated by the event.
@@ -481,7 +497,7 @@ var PluginManager = class {
481
497
  * @returns Whether the reset was successful.
482
498
  */
483
499
  reset(event) {
484
- return untracked2(() => Effect.runPromise(this._reset(event)));
500
+ return untracked2(() => Effect2.runPromise(this._reset(event)));
485
501
  }
486
502
  _addPlugin(plugin) {
487
503
  untracked2(() => {
@@ -582,7 +598,7 @@ var PluginManager = class {
582
598
  */
583
599
  // TODO(wittjosiah): Improve error typing.
584
600
  _activate(event) {
585
- return Effect.gen(this, function* () {
601
+ return Effect2.gen(this, function* () {
586
602
  const key = typeof event === "string" ? event : eventKey(event);
587
603
  log2("activating", {
588
604
  key
@@ -631,7 +647,7 @@ var PluginManager = class {
631
647
  event: key,
632
648
  state: "activating"
633
649
  });
634
- const getCapabilities = yield* Effect.all(modules.map(({ activate }) => Effect.tryPromise({
650
+ const getCapabilities = yield* Effect2.all(modules.map(({ activate }) => Effect2.tryPromise({
635
651
  try: async () => activate(this.context),
636
652
  catch: (error) => error
637
653
  })), {
@@ -643,8 +659,8 @@ var PluginManager = class {
643
659
  A.map(([module, getCapabilities2]) => this._activateModule(module, getCapabilities2)),
644
660
  // TODO(wittjosiah): This currently can't be run in parallel.
645
661
  // Running this with concurrency causes races with `allOf` activation events.
646
- Effect.all,
647
- Effect.either
662
+ Effect2.all,
663
+ Effect2.either
648
664
  );
649
665
  if (Either.isLeft(result)) {
650
666
  this.activation.emit({
@@ -652,7 +668,7 @@ var PluginManager = class {
652
668
  state: "error",
653
669
  error: result.left
654
670
  });
655
- yield* Effect.fail(result.left);
671
+ yield* Effect2.fail(result.left);
656
672
  }
657
673
  if (!this._state.eventsFired.includes(key)) {
658
674
  this._state.eventsFired.push(key);
@@ -673,8 +689,8 @@ var PluginManager = class {
673
689
  });
674
690
  }
675
691
  _activateModule(module, getCapabilities) {
676
- return Effect.gen(this, function* () {
677
- yield* Effect.all(module.activatesBefore?.map((event) => this._activate(event)) ?? [], {
692
+ return Effect2.gen(this, function* () {
693
+ yield* Effect2.all(module.activatesBefore?.map((event) => this._activate(event)) ?? [], {
678
694
  concurrency: "unbounded"
679
695
  });
680
696
  log2("activating module...", {
@@ -689,11 +705,11 @@ var PluginManager = class {
689
705
  const resolvedCapabilities = yield* Match.value(maybeCapabilities).pipe(
690
706
  // TODO(wittjosiah): Activate with an effect?
691
707
  // Match.when(Effect.isEffect, (effect) => effect),
692
- Match.when(isPromise, (promise) => Effect.tryPromise({
708
+ Match.when(isPromise, (promise) => Effect2.tryPromise({
693
709
  try: () => promise,
694
710
  catch: (error) => error
695
711
  })),
696
- Match.orElse((program) => Effect.succeed(program))
712
+ Match.orElse((program) => Effect2.succeed(program))
697
713
  );
698
714
  const capabilities = Match.value(resolvedCapabilities).pipe(Match.when(Array.isArray, (array) => array), Match.orElse((value) => [
699
715
  value
@@ -714,26 +730,26 @@ var PluginManager = class {
714
730
  S: this,
715
731
  C: (f, a) => f(...a)
716
732
  });
717
- yield* Effect.all(module.activatesAfter?.map((event) => this._activate(event)) ?? [], {
733
+ yield* Effect2.all(module.activatesAfter?.map((event) => this._activate(event)) ?? [], {
718
734
  concurrency: "unbounded"
719
735
  });
720
736
  });
721
737
  }
722
738
  _deactivate(id) {
723
- return Effect.gen(this, function* () {
739
+ return Effect2.gen(this, function* () {
724
740
  const plugin = this._getPlugin(id);
725
741
  if (!plugin) {
726
742
  return false;
727
743
  }
728
744
  const modules = plugin.modules;
729
- const results = yield* Effect.all(modules.map((module) => this._deactivateModule(module)), {
745
+ const results = yield* Effect2.all(modules.map((module) => this._deactivateModule(module)), {
730
746
  concurrency: "unbounded"
731
747
  });
732
748
  return results.every((result) => result);
733
749
  });
734
750
  }
735
751
  _deactivateModule(module) {
736
- return Effect.gen(this, function* () {
752
+ return Effect2.gen(this, function* () {
737
753
  const id = module.id;
738
754
  log2("deactivating", {
739
755
  id
@@ -748,10 +764,10 @@ var PluginManager = class {
748
764
  for (const capability of capabilities) {
749
765
  this.context.removeCapability(capability.interface, capability.implementation);
750
766
  const program = capability.deactivate?.();
751
- yield* Match.value(program).pipe(Match.when(Effect.isEffect, (effect2) => effect2), Match.when(isPromise, (promise) => Effect.tryPromise({
767
+ yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (effect2) => effect2), Match.when(isPromise, (promise) => Effect2.tryPromise({
752
768
  try: () => promise,
753
769
  catch: (error) => error
754
- })), Match.orElse((program2) => Effect.succeed(program2)));
770
+ })), Match.orElse((program2) => Effect2.succeed(program2)));
755
771
  }
756
772
  this._capabilities.delete(id);
757
773
  }
@@ -771,7 +787,7 @@ var PluginManager = class {
771
787
  });
772
788
  }
773
789
  _reset(event) {
774
- return Effect.gen(this, function* () {
790
+ return Effect2.gen(this, function* () {
775
791
  const key = typeof event === "string" ? event : eventKey(event);
776
792
  log2("reset", {
777
793
  key
@@ -782,7 +798,7 @@ var PluginManager = class {
782
798
  C: (f, a) => f(...a)
783
799
  });
784
800
  const modules = this._getActiveModulesByEvent(key);
785
- const results = yield* Effect.all(modules.map((module) => this._deactivateModule(module)), {
801
+ const results = yield* Effect2.all(modules.map((module) => this._deactivateModule(module)), {
786
802
  concurrency: "unbounded"
787
803
  });
788
804
  if (results.every((result) => result)) {
@@ -889,7 +905,8 @@ import { Schema as S4 } from "effect";
889
905
 
890
906
  // packages/sdk/app-framework/src/plugin-intent/IntentPlugin.tsx
891
907
  var IntentPlugin = () => definePlugin({
892
- id: INTENT_PLUGIN
908
+ id: INTENT_PLUGIN,
909
+ name: "Intent"
893
910
  }, [
894
911
  defineModule({
895
912
  id: `${INTENT_PLUGIN}/module/dispatcher`,
@@ -900,7 +917,7 @@ var IntentPlugin = () => definePlugin({
900
917
  activatesAfter: [
901
918
  Events.DispatcherReady
902
919
  ],
903
- activate: lazy(() => import("./intent-dispatcher-UR566RVO.mjs"))
920
+ activate: lazy(() => import("./intent-dispatcher-3Q67MHZZ.mjs"))
904
921
  })
905
922
  ]);
906
923
 
@@ -1129,6 +1146,9 @@ var LayoutAction;
1129
1146
  state: S4.optional(S4.Literal(true).annotations({
1130
1147
  description: "The items are being added."
1131
1148
  })),
1149
+ variant: S4.optional(S4.String.annotations({
1150
+ description: "The variant of the item to open."
1151
+ })),
1132
1152
  key: S4.optional(S4.String.annotations({
1133
1153
  description: "If provided, will replace item with a matching key (id prefix)."
1134
1154
  })),
@@ -1244,23 +1264,23 @@ var HISTORY_LIMIT = 100;
1244
1264
  var createResolver = (resolver) => resolver;
1245
1265
  var isUndoable = (historyEntry) => historyEntry.length > 0 && historyEntry.every(({ undoable }) => !!undoable);
1246
1266
  var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {}) => {
1247
- const historyRef = Effect2.runSync(Ref.make([]));
1248
- const handleIntent = (intent) => Effect2.gen(function* () {
1249
- const candidates = getResolvers(intent.module).filter((r) => r.intent._tag === intent.id).filter((r) => !r.filter || r.filter(intent.data)).toSorted(byPosition);
1267
+ const historyRef = Effect3.runSync(Ref.make([]));
1268
+ const handleIntent = (intent) => Effect3.gen(function* () {
1269
+ const candidates = getResolvers(intent.module).filter((resolver) => resolver.intent._tag === intent.id).filter((resolver) => !resolver.filter || resolver.filter(intent.data)).toSorted(byPosition);
1250
1270
  if (candidates.length === 0) {
1251
- yield* Effect2.fail(new NoResolversError(intent.id));
1271
+ yield* Effect3.fail(new NoResolversError(intent.id));
1252
1272
  }
1253
1273
  const effect2 = candidates[0].resolve(intent.data, intent.undo ?? false);
1254
- const result = Effect2.isEffect(effect2) ? yield* effect2 : yield* Effect2.promise(async () => effect2);
1274
+ const result = Effect3.isEffect(effect2) ? yield* effect2 : yield* Effect3.promise(async () => effect2);
1255
1275
  return {
1256
1276
  _intent: intent,
1257
1277
  ...result
1258
1278
  };
1259
1279
  });
1260
1280
  const dispatch = (intentChain, depth = 0) => {
1261
- return Effect2.gen(function* () {
1281
+ return Effect3.gen(function* () {
1262
1282
  if (depth > executionLimit) {
1263
- yield* Effect2.fail(new CycleDetectedError());
1283
+ yield* Effect3.fail(new CycleDetectedError());
1264
1284
  }
1265
1285
  const resultsRef = yield* Ref.make([]);
1266
1286
  for (const intent of intentChain.all) {
@@ -1282,7 +1302,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
1282
1302
  }
1283
1303
  }
1284
1304
  if (result2.error) {
1285
- yield* Effect2.fail(result2.error);
1305
+ yield* Effect3.fail(result2.error);
1286
1306
  }
1287
1307
  }
1288
1308
  const results = yield* resultsRef.get;
@@ -1300,18 +1320,18 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
1300
1320
  if (result.undoable && isUndoable(results)) {
1301
1321
  yield* pipe2(dispatch(createIntent(IntentAction.ShowUndo, {
1302
1322
  message: result.undoable.message
1303
- })), Effect2.catchSome((err) => err instanceof NoResolversError ? Option.some(Effect2.succeed(void 0)) : Option.none()));
1323
+ })), Effect3.catchSome((err) => err instanceof NoResolversError ? Option.some(Effect3.succeed(void 0)) : Option.none()));
1304
1324
  }
1305
1325
  return result.data;
1306
1326
  });
1307
1327
  };
1308
1328
  const dispatchPromise = (intentChain) => {
1309
- return Effect2.runPromise(dispatch(intentChain)).then((data) => ({
1329
+ return Effect3.runPromise(dispatch(intentChain)).then((data) => ({
1310
1330
  data
1311
1331
  })).catch((error) => {
1312
1332
  log3.catch(error, void 0, {
1313
1333
  F: __dxlog_file3,
1314
- L: 241,
1334
+ L: 254,
1315
1335
  S: void 0,
1316
1336
  C: (f, a) => f(...a)
1317
1337
  });
@@ -1321,7 +1341,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
1321
1341
  });
1322
1342
  };
1323
1343
  const undo = () => {
1324
- return Effect2.gen(function* () {
1344
+ return Effect3.gen(function* () {
1325
1345
  const history = yield* historyRef.get;
1326
1346
  const last = history.findLastIndex(isUndoable);
1327
1347
  const result = last !== -1 ? history[last] : void 0;
@@ -1349,7 +1369,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
1349
1369
  });
1350
1370
  };
1351
1371
  const undoPromise = () => {
1352
- return Effect2.runPromise(undo()).then((data) => ({
1372
+ return Effect3.runPromise(undo()).then((data) => ({
1353
1373
  data
1354
1374
  })).catch((error) => ({
1355
1375
  error
@@ -1362,8 +1382,8 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
1362
1382
  undoPromise
1363
1383
  };
1364
1384
  };
1365
- var defaultEffect = () => Effect2.fail(new Error("Intent runtime not ready"));
1366
- var defaultPromise = () => Effect2.runPromise(defaultEffect());
1385
+ var defaultEffect = () => Effect3.fail(new Error("Intent runtime not ready"));
1386
+ var defaultPromise = () => Effect3.runPromise(defaultEffect());
1367
1387
  var intent_dispatcher_default = (context) => {
1368
1388
  const state = create3({
1369
1389
  dispatch: defaultEffect,
@@ -1376,7 +1396,7 @@ var intent_dispatcher_default = (context) => {
1376
1396
  }).flat());
1377
1397
  const manager = context.requestCapability(Capabilities.PluginManager);
1378
1398
  state.dispatch = (intentChain, depth) => {
1379
- return Effect2.gen(function* () {
1399
+ return Effect3.gen(function* () {
1380
1400
  yield* manager._activate(Events.SetupIntentResolver);
1381
1401
  return yield* dispatch(intentChain, depth);
1382
1402
  });
@@ -1429,4 +1449,4 @@ export {
1429
1449
  ResourceLanguage,
1430
1450
  Resource
1431
1451
  };
1432
- //# sourceMappingURL=chunk-PWAAJE2Z.mjs.map
1452
+ //# sourceMappingURL=chunk-6AVTZPMT.mjs.map