@dxos/plugin-deck 0.8.4-main.b97322e → 0.8.4-main.c4373fc

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 (130) hide show
  1. package/dist/lib/browser/{app-graph-builder-JTFSDT2I.mjs → app-graph-builder-YYP67JHW.mjs} +17 -16
  2. package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-GCOL6YDT.mjs} +6 -6
  4. package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-D7KTFCUV.mjs → chunk-3SV2V3AN.mjs} +223 -222
  6. package/dist/lib/browser/chunk-3SV2V3AN.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-A4SRCSJX.mjs} +5 -5
  8. package/dist/lib/browser/chunk-A4SRCSJX.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-HUWUYTOI.mjs +16 -0
  10. package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-JFTXENFN.mjs → chunk-JH4ZCG5I.mjs} +9 -9
  12. package/dist/lib/browser/chunk-JH4ZCG5I.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-MHP4GPX5.mjs +11 -0
  14. package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-QDZO4AJ4.mjs → chunk-YRDCQS7E.mjs} +15 -15
  16. package/dist/lib/browser/chunk-YRDCQS7E.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +19 -14
  18. package/dist/lib/browser/index.mjs.map +3 -3
  19. package/dist/lib/browser/{intent-resolver-P2OBK5HK.mjs → intent-resolver-2NFDKRFG.mjs} +21 -18
  20. package/dist/lib/browser/intent-resolver-2NFDKRFG.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-PO64J7ML.mjs → react-root-JTWYCDJT.mjs} +11 -11
  23. package/dist/lib/browser/react-root-JTWYCDJT.mjs.map +7 -0
  24. package/dist/lib/browser/{react-surface-E45YOVF5.mjs → react-surface-PZKJ73JS.mjs} +13 -13
  25. package/dist/lib/browser/react-surface-PZKJ73JS.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-6AJZPZPM.mjs → settings-JK7UIZSB.mjs} +5 -5
  27. package/dist/lib/browser/{settings-6AJZPZPM.mjs.map → settings-JK7UIZSB.mjs.map} +2 -2
  28. package/dist/lib/browser/state-IFKFOBBX.mjs +12 -0
  29. package/dist/lib/browser/toolkit-L7C3UAEU.mjs +63 -0
  30. package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +7 -0
  31. package/dist/lib/browser/types/index.mjs +2 -2
  32. package/dist/lib/browser/{url-handler-7L7M6IKH.mjs → url-handler-MRYBE3HF.mjs} +7 -7
  33. package/dist/lib/browser/url-handler-MRYBE3HF.mjs.map +7 -0
  34. package/dist/types/src/DeckPlugin.d.ts +1 -1
  35. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
  40. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/index.d.ts +9 -9
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  44. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/react-root.d.ts +2 -2
  46. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  48. package/dist/types/src/capabilities/settings.d.ts +1 -1
  49. package/dist/types/src/capabilities/state.d.ts +2 -2
  50. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/toolkit.d.ts +6 -0
  52. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/tools.d.ts +1 -1
  54. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  56. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  57. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  59. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  60. package/dist/types/src/components/Plank/Plank.d.ts +1 -1
  61. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  62. package/dist/types/src/components/Plank/Plank.stories.d.ts +85 -5
  63. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  64. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  65. package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
  66. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  67. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  68. package/dist/types/src/events.d.ts.map +1 -1
  69. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  70. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  71. package/dist/types/src/meta.d.ts +0 -1
  72. package/dist/types/src/meta.d.ts.map +1 -1
  73. package/dist/types/src/translations.d.ts +1 -0
  74. package/dist/types/src/translations.d.ts.map +1 -1
  75. package/dist/types/src/types/schema.d.ts +3 -3
  76. package/dist/types/src/types/schema.d.ts.map +1 -1
  77. package/dist/types/tsconfig.tsbuildinfo +1 -1
  78. package/package.json +45 -41
  79. package/src/DeckPlugin.ts +64 -59
  80. package/src/capabilities/app-graph-builder.ts +13 -11
  81. package/src/capabilities/capabilities.ts +3 -3
  82. package/src/capabilities/check-app-scheme.ts +3 -3
  83. package/src/capabilities/index.ts +2 -1
  84. package/src/capabilities/intent-resolver.ts +21 -17
  85. package/src/capabilities/react-root.tsx +4 -3
  86. package/src/capabilities/react-surface.tsx +5 -5
  87. package/src/capabilities/settings.ts +1 -1
  88. package/src/capabilities/state.ts +6 -5
  89. package/src/capabilities/toolkit.ts +57 -0
  90. package/src/capabilities/tools.ts +10 -7
  91. package/src/capabilities/url-handler.ts +3 -2
  92. package/src/components/DeckLayout/Banner.tsx +3 -3
  93. package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
  94. package/src/components/DeckLayout/DeckLayout.tsx +16 -15
  95. package/src/components/DeckLayout/Fallback.tsx +2 -2
  96. package/src/components/DeckLayout/Toast.tsx +2 -2
  97. package/src/components/DeckSettings/DeckSettings.tsx +74 -65
  98. package/src/components/Plank/Plank.stories.tsx +9 -10
  99. package/src/components/Plank/Plank.tsx +12 -13
  100. package/src/components/Plank/PlankControls.tsx +3 -3
  101. package/src/components/Plank/PlankError.tsx +3 -2
  102. package/src/components/Plank/PlankHeading.tsx +10 -9
  103. package/src/components/Sidebar/ComplementarySidebar.tsx +9 -8
  104. package/src/components/Sidebar/Sidebar.tsx +2 -2
  105. package/src/components/Sidebar/SidebarButton.tsx +6 -6
  106. package/src/events.ts +2 -2
  107. package/src/hooks/useDeckCompanions.ts +2 -2
  108. package/src/hooks/useHoistStatusbar.ts +2 -2
  109. package/src/hooks/useNodeActionExpander.ts +1 -1
  110. package/src/meta.ts +1 -3
  111. package/src/translations.ts +1 -0
  112. package/src/types/schema.ts +3 -3
  113. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  114. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
  115. package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  119. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
  121. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  122. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  123. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
  124. package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
  125. package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
  126. package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
  127. package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
  128. package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
  129. package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
  130. /package/dist/lib/browser/{state-MVDYX77Y.mjs.map → state-IFKFOBBX.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-deck",
3
- "version": "0.8.4-main.b97322e",
3
+ "version": "0.8.4-main.c4373fc",
4
4
  "description": "DXOS Surface plugin for the main application layout.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,10 +10,12 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs"
15
16
  },
16
17
  "./types": {
18
+ "source": "./src/types/index.ts",
17
19
  "types": "./dist/types/src/types/index.d.ts",
18
20
  "browser": "./dist/lib/browser/types/index.mjs"
19
21
  }
@@ -31,57 +33,59 @@
31
33
  "src"
32
34
  ],
33
35
  "dependencies": {
36
+ "@effect/ai": "0.29.1",
37
+ "@effect/experimental": "0.56.0",
34
38
  "@fluentui/react-tabster": "^9.24.2",
35
39
  "@preact-signals/safe-react": "^0.9.0",
36
- "@preact/signals-core": "^1.9.0",
40
+ "@preact/signals-core": "^1.12.1",
37
41
  "@radix-ui/react-context": "1.1.1",
38
- "effect": "3.17.0",
39
42
  "immer": "^10.1.1",
40
- "@dxos/ai": "0.8.4-main.b97322e",
41
- "@dxos/async": "0.8.4-main.b97322e",
42
- "@dxos/app-framework": "0.8.4-main.b97322e",
43
- "@dxos/blueprints": "0.8.4-main.b97322e",
44
- "@dxos/debug": "0.8.4-main.b97322e",
45
- "@dxos/echo": "0.8.4-main.b97322e",
46
- "@dxos/echo-schema": "0.8.4-main.b97322e",
47
- "@dxos/echo-signals": "0.8.4-main.b97322e",
48
- "@dxos/invariant": "0.8.4-main.b97322e",
49
- "@dxos/live-object": "0.8.4-main.b97322e",
50
- "@dxos/local-storage": "0.8.4-main.b97322e",
51
- "@dxos/keyboard": "0.8.4-main.b97322e",
52
- "@dxos/plugin-attention": "0.8.4-main.b97322e",
53
- "@dxos/log": "0.8.4-main.b97322e",
54
- "@dxos/plugin-graph": "0.8.4-main.b97322e",
55
- "@dxos/plugin-observability": "0.8.4-main.b97322e",
56
- "@dxos/react-client": "0.8.4-main.b97322e",
57
- "@dxos/react-ui-attention": "0.8.4-main.b97322e",
58
- "@dxos/plugin-theme": "0.8.4-main.b97322e",
59
- "@dxos/react-ui-form": "0.8.4-main.b97322e",
60
- "@dxos/react-ui-stack": "0.8.4-main.b97322e",
61
- "@dxos/react-ui-tabs": "0.8.4-main.b97322e",
62
- "@dxos/react-ui-text-tooltip": "0.8.4-main.b97322e",
63
- "@dxos/util": "0.8.4-main.b97322e"
43
+ "@dxos/ai": "0.8.4-main.c4373fc",
44
+ "@dxos/assistant": "0.8.4-main.c4373fc",
45
+ "@dxos/blueprints": "0.8.4-main.c4373fc",
46
+ "@dxos/async": "0.8.4-main.c4373fc",
47
+ "@dxos/debug": "0.8.4-main.c4373fc",
48
+ "@dxos/echo": "0.8.4-main.c4373fc",
49
+ "@dxos/echo-signals": "0.8.4-main.c4373fc",
50
+ "@dxos/invariant": "0.8.4-main.c4373fc",
51
+ "@dxos/live-object": "0.8.4-main.c4373fc",
52
+ "@dxos/local-storage": "0.8.4-main.c4373fc",
53
+ "@dxos/log": "0.8.4-main.c4373fc",
54
+ "@dxos/plugin-attention": "0.8.4-main.c4373fc",
55
+ "@dxos/app-framework": "0.8.4-main.c4373fc",
56
+ "@dxos/plugin-graph": "0.8.4-main.c4373fc",
57
+ "@dxos/keyboard": "0.8.4-main.c4373fc",
58
+ "@dxos/plugin-observability": "0.8.4-main.c4373fc",
59
+ "@dxos/plugin-theme": "0.8.4-main.c4373fc",
60
+ "@dxos/react-client": "0.8.4-main.c4373fc",
61
+ "@dxos/react-ui-attention": "0.8.4-main.c4373fc",
62
+ "@dxos/react-ui-form": "0.8.4-main.c4373fc",
63
+ "@dxos/react-ui-tabs": "0.8.4-main.c4373fc",
64
+ "@dxos/react-ui-text-tooltip": "0.8.4-main.c4373fc",
65
+ "@dxos/react-ui-stack": "0.8.4-main.c4373fc",
66
+ "@dxos/util": "0.8.4-main.c4373fc"
64
67
  },
65
68
  "devDependencies": {
66
- "@effect-rx/rx-react": "0.38.0",
67
- "@effect/platform": "0.89.0",
68
- "@types/react": "~18.2.0",
69
- "@types/react-dom": "~18.2.0",
70
- "react": "~18.2.0",
71
- "react-dom": "~18.2.0",
72
- "vite": "5.4.7",
73
- "@dxos/react-ui": "0.8.4-main.b97322e",
74
- "@dxos/react-ui-theme": "0.8.4-main.b97322e",
75
- "@dxos/storybook-utils": "0.8.4-main.b97322e"
69
+ "@effect-rx/rx-react": "0.42.4",
70
+ "@effect/platform": "0.92.1",
71
+ "@types/react": "~19.2.2",
72
+ "@types/react-dom": "~19.2.1",
73
+ "effect": "3.18.3",
74
+ "react": "~19.2.0",
75
+ "react-dom": "~19.2.0",
76
+ "vite": "7.1.9",
77
+ "@dxos/react-ui-theme": "0.8.4-main.c4373fc",
78
+ "@dxos/react-ui": "0.8.4-main.c4373fc",
79
+ "@dxos/storybook-utils": "0.8.4-main.c4373fc"
76
80
  },
77
81
  "peerDependencies": {
78
82
  "@effect-rx/rx-react": "^0.34.1",
79
83
  "@effect/platform": "^0.80.12",
80
84
  "effect": "^3.13.3",
81
- "react": "~18.2.0",
82
- "react-dom": "~18.2.0",
83
- "@dxos/react-ui": "0.8.4-main.b97322e",
84
- "@dxos/react-ui-theme": "0.8.4-main.b97322e"
85
+ "react": "^19.0.0",
86
+ "react-dom": "^19.0.0",
87
+ "@dxos/react-ui": "0.8.4-main.c4373fc",
88
+ "@dxos/react-ui-theme": "0.8.4-main.c4373fc"
85
89
  },
86
90
  "publishConfig": {
87
91
  "access": "public"
package/src/DeckPlugin.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { setAutoFreeze } from 'immer';
6
6
 
7
- import { allOf, Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';
7
+ import { Capabilities, Events, allOf, contributes, defineModule, definePlugin, oneOf } from '@dxos/app-framework';
8
8
  import { translations as stackTranslations } from '@dxos/react-ui-stack';
9
9
 
10
10
  import {
@@ -15,7 +15,7 @@ import {
15
15
  LayoutIntentResolver,
16
16
  ReactRoot,
17
17
  ReactSurface,
18
- Tools,
18
+ Toolkit,
19
19
  UrlHandler,
20
20
  } from './capabilities';
21
21
  import { DeckEvents } from './events';
@@ -27,60 +27,65 @@ import { translations } from './translations';
27
27
  // TODO(Zan): Move this to a more global location if we use immer more broadly.
28
28
  setAutoFreeze(false);
29
29
 
30
- export const DeckPlugin = () =>
31
- definePlugin(meta, [
32
- defineModule({
33
- id: `${meta.id}/module/check-app-scheme`,
34
- activatesOn: Events.SettingsReady,
35
- activate: CheckAppScheme,
36
- }),
37
- defineModule({
38
- id: `${meta.id}/module/settings`,
39
- activatesOn: Events.SetupSettings,
40
- activate: DeckSettings,
41
- }),
42
- defineModule({
43
- id: `${meta.id}/module/layout`,
44
- // TODO(wittjosiah): Does not integrate with settings store.
45
- // Should this be a different event?
46
- // Should settings store be renamed to be more generic?
47
- activatesOn: oneOf(Events.SetupSettings, Events.SetupAppGraph),
48
- activatesAfter: [Events.LayoutReady, DeckEvents.StateReady],
49
- activate: DeckState,
50
- }),
51
- defineModule({
52
- id: `${meta.id}/module/translations`,
53
- activatesOn: Events.SetupTranslations,
54
- activate: () => contributes(Capabilities.Translations, [...translations, ...stackTranslations]),
55
- }),
56
- defineModule({
57
- id: `${meta.id}/module/react-root`,
58
- activatesOn: Events.Startup,
59
- activate: ReactRoot,
60
- }),
61
- defineModule({
62
- id: `${meta.id}/module/react-surface`,
63
- activatesOn: Events.SetupReactSurface,
64
- activate: ReactSurface,
65
- }),
66
- defineModule({
67
- id: `${meta.id}/module/layout-intent-resolver`,
68
- activatesOn: Events.SetupIntentResolver,
69
- activate: LayoutIntentResolver,
70
- }),
71
- defineModule({
72
- id: `${meta.id}/module/app-graph-builder`,
73
- activatesOn: Events.SetupAppGraph,
74
- activate: AppGraphBuilder,
75
- }),
76
- defineModule({
77
- id: `${meta.id}/module/tools`,
78
- activatesOn: Events.SetupArtifactDefinition,
79
- activate: Tools,
80
- }),
81
- defineModule({
82
- id: `${meta.id}/module/url`,
83
- activatesOn: allOf(Events.DispatcherReady, DeckEvents.StateReady),
84
- activate: UrlHandler,
85
- }),
86
- ]);
30
+ export const DeckPlugin = definePlugin(meta, () => [
31
+ defineModule({
32
+ id: `${meta.id}/module/check-app-scheme`,
33
+ activatesOn: Events.SettingsReady,
34
+ activate: CheckAppScheme,
35
+ }),
36
+ defineModule({
37
+ id: `${meta.id}/module/settings`,
38
+ activatesOn: Events.SetupSettings,
39
+ activate: DeckSettings,
40
+ }),
41
+ defineModule({
42
+ id: `${meta.id}/module/layout`,
43
+ // TODO(wittjosiah): Does not integrate with settings store.
44
+ // Should this be a different event?
45
+ // Should settings store be renamed to be more generic?
46
+ activatesOn: oneOf(Events.SetupSettings, Events.SetupAppGraph),
47
+ activatesAfter: [Events.LayoutReady, DeckEvents.StateReady],
48
+ activate: DeckState,
49
+ }),
50
+ defineModule({
51
+ id: `${meta.id}/module/translations`,
52
+ activatesOn: Events.SetupTranslations,
53
+ activate: () => contributes(Capabilities.Translations, [...translations, ...stackTranslations]),
54
+ }),
55
+ defineModule({
56
+ id: `${meta.id}/module/react-root`,
57
+ activatesOn: Events.Startup,
58
+ activate: ReactRoot,
59
+ }),
60
+ defineModule({
61
+ id: `${meta.id}/module/react-surface`,
62
+ activatesOn: Events.SetupReactSurface,
63
+ activate: ReactSurface,
64
+ }),
65
+ defineModule({
66
+ id: `${meta.id}/module/layout-intent-resolver`,
67
+ activatesOn: Events.SetupIntentResolver,
68
+ activate: LayoutIntentResolver,
69
+ }),
70
+ defineModule({
71
+ id: `${meta.id}/module/app-graph-builder`,
72
+ activatesOn: Events.SetupAppGraph,
73
+ activate: AppGraphBuilder,
74
+ }),
75
+ // defineModule({
76
+ // id: `${meta.id}/module/tools`,
77
+ // activatesOn: Events.SetupArtifactDefinition,
78
+ // activate: Tools,
79
+ // }),
80
+ defineModule({
81
+ id: `${meta.id}/module/toolkit`,
82
+ // TODO(wittjosiah): Shouldn't use the startup event.
83
+ activatesOn: Events.Startup,
84
+ activate: Toolkit,
85
+ }),
86
+ defineModule({
87
+ id: `${meta.id}/module/url`,
88
+ activatesOn: allOf(Events.DispatcherReady, DeckEvents.StateReady),
89
+ activate: UrlHandler,
90
+ }),
91
+ ]);
@@ -3,23 +3,25 @@
3
3
  //
4
4
 
5
5
  import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
7
8
 
8
- import { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';
9
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
9
10
  import { AttentionCapabilities } from '@dxos/plugin-attention';
10
- import { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';
11
+ import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
12
+
13
+ import { meta } from '../meta';
11
14
 
12
15
  import { DeckCapabilities } from './capabilities';
13
- import { DECK_PLUGIN } from '../meta';
14
16
 
15
17
  export default (context: PluginContext) =>
16
18
  contributes(
17
19
  Capabilities.AppGraphBuilder,
18
20
  createExtension({
19
- id: DECK_PLUGIN,
21
+ id: meta.id,
20
22
  actions: (node) =>
21
23
  Rx.make((get) =>
22
- pipe(
24
+ Function.pipe(
23
25
  get(node),
24
26
  Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
25
27
  Option.map(() => {
@@ -36,7 +38,7 @@ export default (context: PluginContext) =>
36
38
  );
37
39
  },
38
40
  properties: {
39
- label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],
41
+ label: ['toggle fullscreen label', { ns: meta.id }],
40
42
  icon: 'ph--arrows-out--regular',
41
43
  keyBinding: {
42
44
  macos: 'ctrl+meta+f',
@@ -62,7 +64,7 @@ export default (context: PluginContext) =>
62
64
  }
63
65
  },
64
66
  properties: {
65
- label: ['close current label', { ns: DECK_PLUGIN }],
67
+ label: ['close current label', { ns: meta.id }],
66
68
  icon: 'ph--x--regular',
67
69
  },
68
70
  };
@@ -79,7 +81,7 @@ export default (context: PluginContext) =>
79
81
  );
80
82
  },
81
83
  properties: {
82
- label: ['close others label', { ns: DECK_PLUGIN }],
84
+ label: ['close others label', { ns: meta.id }],
83
85
  icon: 'ph--x-square--regular',
84
86
  },
85
87
  };
@@ -97,7 +99,7 @@ export default (context: PluginContext) =>
97
99
  );
98
100
  },
99
101
  properties: {
100
- label: ['close all label', { ns: DECK_PLUGIN }],
102
+ label: ['close all label', { ns: meta.id }],
101
103
  icon: 'ph--x-circle--regular',
102
104
  },
103
105
  };
@@ -116,7 +118,7 @@ export default (context: PluginContext) =>
116
118
  : 'open navigation sidebar label',
117
119
  ),
118
120
  ),
119
- { ns: DECK_PLUGIN },
121
+ { ns: meta.id },
120
122
  ],
121
123
  icon: 'ph--sidebar--regular',
122
124
  keyBinding: {
@@ -5,10 +5,10 @@
5
5
  import { defineCapability } from '@dxos/app-framework';
6
6
  import { type DeepReadonly } from '@dxos/util';
7
7
 
8
- import { DECK_PLUGIN } from '../meta';
8
+ import { meta } from '../meta';
9
9
  import { type DeckPluginState } from '../types';
10
10
 
11
11
  export namespace DeckCapabilities {
12
- export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${DECK_PLUGIN}/capability/state`);
13
- export const MutableDeckState = defineCapability<DeckPluginState>(`${DECK_PLUGIN}/capability/state`);
12
+ export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${meta.id}/capability/state`);
13
+ export const MutableDeckState = defineCapability<DeckPluginState>(`${meta.id}/capability/state`);
14
14
  }
@@ -2,9 +2,9 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
5
+ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
6
6
 
7
- import { DECK_PLUGIN } from '../meta';
7
+ import { meta } from '../meta';
8
8
  import { type DeckSettingsProps } from '../types';
9
9
 
10
10
  const isSocket = !!(globalThis as any).__args;
@@ -31,7 +31,7 @@ const checkAppScheme = (url: string) => {
31
31
  };
32
32
 
33
33
  export default async (context: PluginContext) => {
34
- const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
34
+ const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)?.value;
35
35
  if (!isSocket && settings?.enableNativeRedirect) {
36
36
  checkAppScheme(appScheme);
37
37
  }
@@ -11,7 +11,8 @@ export const DeckState = lazy(() => import('./state'));
11
11
  export const LayoutIntentResolver = lazy(() => import('./intent-resolver'));
12
12
  export const ReactRoot = lazy(() => import('./react-root'));
13
13
  export const ReactSurface = lazy(() => import('./react-surface'));
14
- export const Tools = lazy(() => import('./tools'));
14
+ // export const Tools = lazy(() => import('./tools'));
15
+ export const Toolkit = lazy(() => import('./toolkit'));
15
16
  export const UrlHandler = lazy(() => import('./url-handler'));
16
17
 
17
18
  export * from './capabilities';
@@ -3,17 +3,20 @@
3
3
  //
4
4
 
5
5
  import { batch } from '@preact/signals-core';
6
- import { Schema, Effect, pipe, Option } from 'effect';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Function from 'effect/Function';
8
+ import * as Option from 'effect/Option';
9
+ import * as Schema from 'effect/Schema';
7
10
 
8
11
  import {
9
12
  Capabilities,
10
- createResolver,
11
- contributes,
12
13
  IntentAction,
13
14
  LayoutAction,
14
15
  type PluginContext,
15
- createIntent,
16
16
  chain,
17
+ contributes,
18
+ createIntent,
19
+ createResolver,
17
20
  } from '@dxos/app-framework';
18
21
  import { Obj } from '@dxos/echo';
19
22
  import { invariant } from '@dxos/invariant';
@@ -24,20 +27,21 @@ import { isActionLike } from '@dxos/plugin-graph';
24
27
  import { ObservabilityAction } from '@dxos/plugin-observability/types';
25
28
  import { byPosition, isNonNullable } from '@dxos/util';
26
29
 
27
- import { DeckCapabilities } from './capabilities';
28
30
  import { closeEntry, createEntryId, incrementPlank, openEntry } from '../layout';
29
- import { DECK_PLUGIN } from '../meta';
31
+ import { meta } from '../meta';
30
32
  import {
31
33
  DeckAction,
32
- type LayoutMode,
33
34
  type DeckSettingsProps,
34
- isLayoutMode,
35
- getMode,
36
- defaultDeck,
35
+ type LayoutMode,
37
36
  PLANK_COMPANION_TYPE,
37
+ defaultDeck,
38
+ getMode,
39
+ isLayoutMode,
38
40
  } from '../types';
39
41
  import { setActive } from '../util';
40
42
 
43
+ import { DeckCapabilities } from './capabilities';
44
+
41
45
  export default (context: PluginContext) =>
42
46
  contributes(Capabilities.IntentResolver, [
43
47
  createResolver({
@@ -55,11 +59,11 @@ export default (context: PluginContext) =>
55
59
  ...layout.toasts,
56
60
  {
57
61
  id: layout.currentUndoId,
58
- title: data.message ?? ['undo available label', { ns: DECK_PLUGIN }],
62
+ title: data.message ?? ['undo available label', { ns: meta.id }],
59
63
  duration: 10_000,
60
- actionLabel: ['undo action label', { ns: DECK_PLUGIN }],
61
- actionAlt: ['undo action alt', { ns: DECK_PLUGIN }],
62
- closeLabel: ['undo close label', { ns: DECK_PLUGIN }],
64
+ actionLabel: ['undo action label', { ns: meta.id }],
65
+ actionAlt: ['undo action alt', { ns: meta.id }],
66
+ closeLabel: ['undo close label', { ns: meta.id }],
63
67
  onAction: () => undo(),
64
68
  },
65
69
  ];
@@ -260,7 +264,7 @@ export default (context: PluginContext) =>
260
264
  const attention = context.getCapability(AttentionCapabilities.Attention);
261
265
  const settings = context
262
266
  .getCapabilities(Capabilities.SettingsStore)[0]
263
- ?.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
267
+ ?.getStore<DeckSettingsProps>(meta.id)?.value;
264
268
 
265
269
  if (options?.workspace && state.activeDeck !== options?.workspace) {
266
270
  const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
@@ -402,7 +406,7 @@ export default (context: PluginContext) =>
402
406
  }
403
407
 
404
408
  if (adjustment.type === 'companion') {
405
- return pipe(
409
+ return Function.pipe(
406
410
  graph.getNode(adjustment.id),
407
411
  Option.map((node) =>
408
412
  graph
@@ -453,7 +457,7 @@ export default (context: PluginContext) =>
453
457
  return {
454
458
  intents: [
455
459
  // NOTE: The order of these is important.
456
- pipe(
460
+ Function.pipe(
457
461
  createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }),
458
462
  chain(LayoutAction.Open, { part: 'main', subject: [entryId] }),
459
463
  ),
@@ -6,13 +6,14 @@ import React, { useCallback } from 'react';
6
6
 
7
7
  import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
8
8
 
9
- import { DeckCapabilities } from './capabilities';
10
9
  import { DeckLayout } from '../components';
11
- import { DECK_PLUGIN } from '../meta';
10
+ import { meta } from '../meta';
11
+
12
+ import { DeckCapabilities } from './capabilities';
12
13
 
13
14
  export default () =>
14
15
  contributes(Capabilities.ReactRoot, {
15
- id: DECK_PLUGIN,
16
+ id: meta.id,
16
17
  root: () => {
17
18
  const layout = useCapability(DeckCapabilities.MutableDeckState);
18
19
 
@@ -7,21 +7,21 @@ import React from 'react';
7
7
  import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
8
  import { SettingsStore } from '@dxos/local-storage';
9
9
 
10
- import { DeckSettings, Banner } from '../components';
11
- import { DECK_PLUGIN } from '../meta';
10
+ import { Banner, DeckSettings } from '../components';
11
+ import { meta } from '../meta';
12
12
  import { type DeckSettingsProps } from '../types';
13
13
 
14
14
  export default () =>
15
15
  contributes(Capabilities.ReactSurface, [
16
16
  createSurface({
17
- id: `${DECK_PLUGIN}/plugin-settings`,
17
+ id: `${meta.id}/plugin-settings`,
18
18
  role: 'article',
19
19
  filter: (data): data is { subject: SettingsStore<DeckSettingsProps> } =>
20
- data.subject instanceof SettingsStore && data.subject.prefix === DECK_PLUGIN,
20
+ data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
21
21
  component: ({ data: { subject } }) => <DeckSettings settings={subject.value} />,
22
22
  }),
23
23
  createSurface({
24
- id: `${DECK_PLUGIN}/banner`,
24
+ id: `${meta.id}/banner`,
25
25
  role: 'banner',
26
26
  component: ({ data }) => {
27
27
  return <Banner variant={data.variant} />;
@@ -6,7 +6,7 @@ import { Capabilities, contributes } from '@dxos/app-framework';
6
6
  import { live } from '@dxos/live-object';
7
7
 
8
8
  import { meta } from '../meta';
9
- import { DeckSettingsSchema, type DeckSettingsProps } from '../types';
9
+ import { type DeckSettingsProps, DeckSettingsSchema } from '../types';
10
10
 
11
11
  export default () => {
12
12
  const settings = live<DeckSettingsProps>({
@@ -8,17 +8,18 @@ import { live } from '@dxos/live-object';
8
8
  import { LocalStorageStore } from '@dxos/local-storage';
9
9
  import { type SidebarState } from '@dxos/react-ui';
10
10
 
11
+ import { meta } from '../meta';
12
+ import { type DeckPluginState, type DeckState, defaultDeck, getMode } from '../types';
13
+
11
14
  import { DeckCapabilities } from './capabilities';
12
- import { DECK_PLUGIN } from '../meta';
13
- import { getMode, type DeckPluginState, defaultDeck, type DeckState } from '../types';
14
15
 
15
16
  const boolean = /true|false/;
16
17
 
17
18
  // TODO(thure, 18 Feb 2025): Remove after the next release.
18
19
 
19
20
  const migrateSidebarStateDefaults = {
20
- [`${DECK_PLUGIN}/complementary-sidebar-state`]: 'expanded',
21
- [`${DECK_PLUGIN}/sidebar-state`]: 'collapsed',
21
+ [`${meta.id}/complementary-sidebar-state`]: 'expanded',
22
+ [`${meta.id}/sidebar-state`]: 'collapsed',
22
23
  };
23
24
 
24
25
  const migrateSidebarState = () => {
@@ -32,7 +33,7 @@ const migrateSidebarState = () => {
32
33
  export const DeckStateFactory = () => {
33
34
  migrateSidebarState();
34
35
 
35
- const state = new LocalStorageStore<DeckPluginState>(DECK_PLUGIN, {
36
+ const state = new LocalStorageStore<DeckPluginState>(meta.id, {
36
37
  sidebarState: 'expanded',
37
38
  complementarySidebarState: 'collapsed',
38
39
  complementarySidebarPanel: undefined,
@@ -0,0 +1,57 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Tool from '@effect/ai/Tool';
6
+ import * as Toolkit from '@effect/ai/Toolkit';
7
+ import * as Effect from 'effect/Effect';
8
+ import * as Schema from 'effect/Schema';
9
+
10
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
11
+ import { ArtifactId } from '@dxos/assistant';
12
+ import { type SpaceId } from '@dxos/keys';
13
+ import { trim } from '@dxos/util';
14
+
15
+ import { DeckCapabilities } from './capabilities';
16
+
17
+ class DeckToolkit extends Toolkit.make(
18
+ Tool.make('open-item', {
19
+ description: trim`
20
+ Opens an item in the application.
21
+ `,
22
+ parameters: {
23
+ id: ArtifactId,
24
+ },
25
+ success: Schema.Any,
26
+ failure: Schema.Never,
27
+ }),
28
+ ) {
29
+ static layer = (context: PluginContext) =>
30
+ DeckToolkit.toLayer({
31
+ 'open-item': ({ id }) =>
32
+ Effect.gen(function* () {
33
+ const state = context.getCapability(DeckCapabilities.DeckState);
34
+ const dxn = ArtifactId.toDXN(id, state.activeDeck as SpaceId);
35
+
36
+ // TODO(wittjosiah): Support other variants.
37
+ const echoDxn = dxn.asEchoDXN();
38
+ if (!echoDxn) {
39
+ throw new Error(`Invalid object ID: ${id}`);
40
+ }
41
+
42
+ // TODO(wittjosiah): Get capabilities via layers.
43
+ const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
44
+ yield* dispatch(
45
+ createIntent(LayoutAction.Open, {
46
+ subject: [`${echoDxn.spaceId!}:${echoDxn.echoId}`],
47
+ part: 'main',
48
+ }),
49
+ );
50
+ }).pipe(Effect.orDie),
51
+ });
52
+ }
53
+
54
+ export default (context: PluginContext) => [
55
+ contributes(Capabilities.Toolkit, DeckToolkit),
56
+ contributes(Capabilities.ToolkitHandler, DeckToolkit.layer(context)),
57
+ ];