@dxos/app-framework 0.8.4-main.3f58842 → 0.8.4-main.548089c

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 (224) hide show
  1. package/.storybook/main.mts +11 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  4. package/.swc/plugins/{v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 → linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7} +0 -0
  5. package/dist/lib/browser/{app-graph-builder-LYF7EKNN.mjs → app-graph-builder-JPUFNED5.mjs} +32 -31
  6. package/dist/lib/browser/app-graph-builder-JPUFNED5.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-FMN65HSW.mjs → chunk-LVSO2N4X.mjs} +351 -263
  8. package/dist/lib/browser/chunk-LVSO2N4X.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
  10. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-FO2PH7M3.mjs → chunk-XRAWIHTQ.mjs} +247 -184
  12. package/dist/lib/browser/chunk-XRAWIHTQ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +20 -56
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs → intent-dispatcher-TNEVDPI6.mjs} +2 -2
  16. package/dist/lib/browser/{intent-resolver-ZTNOSO3A.mjs → intent-resolver-SYLXP62Y.mjs} +7 -7
  17. package/dist/lib/browser/intent-resolver-SYLXP62Y.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/react/index.mjs +32 -0
  20. package/dist/lib/browser/{store-KML2R4IE.mjs → store-3HDXKFXP.mjs} +4 -4
  21. package/dist/lib/browser/{store-KML2R4IE.mjs.map → store-3HDXKFXP.mjs.map} +2 -2
  22. package/dist/lib/browser/testing/index.mjs +17 -21
  23. package/dist/lib/browser/testing/index.mjs.map +3 -3
  24. package/dist/lib/node-esm/{app-graph-builder-SAOWGJDK.mjs → app-graph-builder-VO6RTSOS.mjs} +32 -31
  25. package/dist/lib/node-esm/app-graph-builder-VO6RTSOS.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-ZEZ4FVEU.mjs → chunk-FO5NIDOR.mjs} +351 -263
  27. package/dist/lib/node-esm/chunk-FO5NIDOR.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-73HGSHKE.mjs → chunk-JH3SFOXA.mjs} +247 -184
  29. package/dist/lib/node-esm/chunk-JH3SFOXA.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
  31. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +20 -56
  33. package/dist/lib/node-esm/index.mjs.map +3 -3
  34. package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs → intent-dispatcher-WUNOPJES.mjs} +2 -2
  35. package/dist/lib/node-esm/{intent-resolver-W7Z7WFFM.mjs → intent-resolver-VTZI3NO7.mjs} +7 -7
  36. package/dist/lib/node-esm/intent-resolver-VTZI3NO7.mjs.map +7 -0
  37. package/dist/lib/node-esm/meta.json +1 -1
  38. package/dist/lib/node-esm/react/index.mjs +33 -0
  39. package/dist/lib/node-esm/{store-QEXGXLWZ.mjs → store-PAJPVOLG.mjs} +4 -4
  40. package/dist/lib/node-esm/{store-QEXGXLWZ.mjs.map → store-PAJPVOLG.mjs.map} +2 -2
  41. package/dist/lib/node-esm/testing/index.mjs +17 -21
  42. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  43. package/dist/types/src/common/capabilities.d.ts +110 -39
  44. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  45. package/dist/types/src/common/collaboration.d.ts +10 -9
  46. package/dist/types/src/common/collaboration.d.ts.map +1 -1
  47. package/dist/types/src/common/events.d.ts.map +1 -1
  48. package/dist/types/src/common/file.d.ts +1 -1
  49. package/dist/types/src/common/file.d.ts.map +1 -1
  50. package/dist/types/src/common/index.d.ts +1 -1
  51. package/dist/types/src/common/index.d.ts.map +1 -1
  52. package/dist/types/src/common/layout.d.ts +1 -3
  53. package/dist/types/src/common/layout.d.ts.map +1 -1
  54. package/dist/types/src/common/surface.d.ts +8 -13
  55. package/dist/types/src/common/surface.d.ts.map +1 -1
  56. package/dist/types/src/common/translations.d.ts +1 -1
  57. package/dist/types/src/common/translations.d.ts.map +1 -1
  58. package/dist/types/src/core/capabilities.d.ts +17 -14
  59. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  60. package/dist/types/src/core/manager.d.ts +7 -3
  61. package/dist/types/src/core/manager.d.ts.map +1 -1
  62. package/dist/types/src/core/plugin.d.ts +8 -1
  63. package/dist/types/src/core/plugin.d.ts.map +1 -1
  64. package/dist/types/src/index.d.ts +0 -2
  65. package/dist/types/src/index.d.ts.map +1 -1
  66. package/dist/types/src/playground/debug/Debug.d.ts +1 -1
  67. package/dist/types/src/playground/debug/plugin.d.ts +1 -1
  68. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
  69. package/dist/types/src/playground/generator/Main.d.ts +1 -1
  70. package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
  71. package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
  72. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  73. package/dist/types/src/playground/generator/generator.d.ts +1 -1
  74. package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
  75. package/dist/types/src/playground/generator/plugin.d.ts +1 -1
  76. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
  77. package/dist/types/src/playground/layout/Layout.d.ts +2 -2
  78. package/dist/types/src/playground/layout/plugin.d.ts +1 -1
  79. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
  80. package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
  81. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  82. package/dist/types/src/playground/logger/plugin.d.ts +1 -1
  83. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
  84. package/dist/types/src/playground/logger/schema.d.ts +1 -1
  85. package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
  86. package/dist/types/src/playground/playground.stories.d.ts +5 -4
  87. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  88. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
  89. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
  90. package/dist/types/src/plugin-intent/actions.d.ts +5 -7
  91. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  92. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
  93. package/dist/types/src/plugin-intent/index.d.ts +1 -0
  94. package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
  95. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +7 -7
  96. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  97. package/dist/types/src/plugin-intent/intent.d.ts +1 -1
  98. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
  99. package/dist/types/src/plugin-intent/meta.d.ts +3 -0
  100. package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
  101. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
  102. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
  103. package/dist/types/src/plugin-settings/actions.d.ts +5 -7
  104. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  105. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
  106. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
  107. package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
  108. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
  109. package/dist/types/src/plugin-settings/meta.d.ts +3 -0
  110. package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
  111. package/dist/types/src/plugin-settings/store.d.ts +1 -1
  112. package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
  113. package/dist/types/src/plugin-settings/translations.d.ts +2 -1
  114. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
  115. package/dist/types/src/react/App.d.ts +10 -0
  116. package/dist/types/src/react/App.d.ts.map +1 -0
  117. package/dist/types/src/react/App.stories.d.ts +14 -0
  118. package/dist/types/src/react/App.stories.d.ts.map +1 -0
  119. package/dist/types/src/react/DefaultFallback.d.ts +8 -0
  120. package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
  121. package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
  122. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
  123. package/dist/types/src/react/IntentContext.d.ts.map +1 -1
  124. package/dist/types/src/react/Surface.d.ts +5 -5
  125. package/dist/types/src/react/Surface.d.ts.map +1 -1
  126. package/dist/types/src/react/Surface.stories.d.ts +8 -10
  127. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  128. package/dist/types/src/react/common.d.ts.map +1 -1
  129. package/dist/types/src/react/index.d.ts +2 -0
  130. package/dist/types/src/react/index.d.ts.map +1 -1
  131. package/dist/types/src/react/types.d.ts +6 -0
  132. package/dist/types/src/react/types.d.ts.map +1 -0
  133. package/dist/types/src/{App.d.ts → react/useApp.d.ts} +7 -6
  134. package/dist/types/src/react/useApp.d.ts.map +1 -0
  135. package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
  136. package/dist/types/src/react/useLoading.d.ts +19 -0
  137. package/dist/types/src/react/useLoading.d.ts.map +1 -0
  138. package/dist/types/src/testing/withPluginManager.d.ts +9 -8
  139. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  140. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  141. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  142. package/dist/types/tsconfig.tsbuildinfo +1 -1
  143. package/moon.yml +5 -1
  144. package/package.json +46 -38
  145. package/src/common/capabilities.ts +116 -18
  146. package/src/common/collaboration.ts +6 -9
  147. package/src/common/events.ts +3 -1
  148. package/src/common/file.ts +1 -1
  149. package/src/common/index.ts +1 -1
  150. package/src/common/layout.ts +3 -4
  151. package/src/common/surface.ts +16 -18
  152. package/src/common/translations.ts +1 -1
  153. package/src/core/capabilities.test.ts +3 -3
  154. package/src/core/capabilities.ts +34 -25
  155. package/src/core/manager.test.ts +22 -21
  156. package/src/core/manager.ts +141 -56
  157. package/src/core/plugin.ts +13 -2
  158. package/src/helpers.test.ts +1 -1
  159. package/src/index.ts +0 -2
  160. package/src/playground/debug/Debug.tsx +1 -1
  161. package/src/playground/debug/plugin.ts +7 -8
  162. package/src/playground/generator/Main.tsx +0 -1
  163. package/src/playground/generator/Toolbar.tsx +2 -1
  164. package/src/playground/generator/generator.ts +4 -4
  165. package/src/playground/generator/plugin.ts +12 -13
  166. package/src/playground/layout/plugin.ts +10 -9
  167. package/src/playground/logger/Toolbar.tsx +2 -1
  168. package/src/playground/logger/plugin.ts +30 -25
  169. package/src/playground/logger/schema.ts +1 -1
  170. package/src/playground/playground.stories.tsx +20 -16
  171. package/src/plugin-intent/IntentPlugin.ts +13 -13
  172. package/src/plugin-intent/actions.ts +4 -6
  173. package/src/plugin-intent/errors.ts +2 -1
  174. package/src/plugin-intent/index.ts +1 -0
  175. package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
  176. package/src/plugin-intent/intent-dispatcher.ts +16 -12
  177. package/src/plugin-intent/intent.ts +1 -1
  178. package/src/plugin-intent/meta.ts +10 -0
  179. package/src/plugin-settings/SettingsPlugin.ts +27 -28
  180. package/src/plugin-settings/actions.ts +9 -13
  181. package/src/plugin-settings/app-graph-builder.ts +25 -22
  182. package/src/plugin-settings/intent-resolver.ts +5 -4
  183. package/src/plugin-settings/meta.ts +10 -0
  184. package/src/plugin-settings/store.ts +1 -1
  185. package/src/plugin-settings/translations.ts +4 -4
  186. package/src/react/App.stories.tsx +33 -0
  187. package/src/react/App.tsx +59 -0
  188. package/src/react/DefaultFallback.tsx +26 -0
  189. package/src/react/ErrorBoundary.tsx +26 -15
  190. package/src/react/IntentContext.tsx +3 -2
  191. package/src/react/Surface.stories.tsx +81 -52
  192. package/src/react/Surface.tsx +70 -38
  193. package/src/react/common.ts +2 -1
  194. package/src/react/index.ts +4 -0
  195. package/src/react/types.ts +13 -0
  196. package/src/react/useApp.tsx +165 -0
  197. package/src/react/useCapabilities.ts +4 -3
  198. package/src/react/useLoading.tsx +70 -0
  199. package/src/testing/withPluginManager.stories.tsx +9 -5
  200. package/src/testing/withPluginManager.tsx +33 -32
  201. package/tsconfig.json +11 -9
  202. package/vitest.config.ts +8 -6
  203. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  204. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
  206. package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
  207. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  208. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
  209. package/dist/lib/browser/worker.mjs +0 -79
  210. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
  211. package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  213. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
  214. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
  215. package/dist/lib/node-esm/worker.mjs +0 -80
  216. package/dist/types/src/App.d.ts.map +0 -1
  217. package/dist/types/src/worker.d.ts +0 -4
  218. package/dist/types/src/worker.d.ts.map +0 -1
  219. package/src/App.tsx +0 -276
  220. package/src/worker.ts +0 -11
  221. /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → intent-dispatcher-TNEVDPI6.mjs.map} +0 -0
  222. /package/dist/lib/browser/{worker.mjs.map → react/index.mjs.map} +0 -0
  223. /package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs.map → intent-dispatcher-WUNOPJES.mjs.map} +0 -0
  224. /package/dist/lib/node-esm/{worker.mjs.map → react/index.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  useApp
4
- } from "../chunk-73HGSHKE.mjs";
4
+ } from "../chunk-JH3SFOXA.mjs";
5
5
  import {
6
6
  Capabilities,
7
7
  Events,
@@ -9,29 +9,28 @@ import {
9
9
  contributes,
10
10
  defineModule,
11
11
  definePlugin
12
- } from "../chunk-ZEZ4FVEU.mjs";
12
+ } from "../chunk-FO5NIDOR.mjs";
13
13
 
14
14
  // src/testing/withPluginManager.tsx
15
15
  import React, { useEffect, useMemo } from "react";
16
16
  import { raise } from "@dxos/debug";
17
- var getValue = (providerOrValue, context) => {
18
- return typeof providerOrValue === "function" ? providerOrValue(context) : providerOrValue;
19
- };
17
+ import { useAsyncEffect } from "@dxos/react-hooks";
18
+ import { getProviderValue } from "@dxos/util";
20
19
  var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ meta }) => meta.id), ...options } = {}) => {
21
20
  const pluginManager = new PluginManager({
22
21
  pluginLoader: () => raise(new Error("Not implemented")),
23
22
  plugins: [
24
- storyPlugin(),
23
+ StoryPlugin(),
25
24
  ...plugins
26
25
  ],
27
26
  core: [
28
- STORY_PLUGIN,
27
+ StoryPlugin.meta.id,
29
28
  ...core
30
29
  ],
31
30
  ...options
32
31
  });
33
32
  if (capabilities) {
34
- getValue(capabilities, pluginManager.context).forEach((capability) => {
33
+ getProviderValue(capabilities, pluginManager.context).forEach((capability) => {
35
34
  pluginManager.context.contributeCapability({
36
35
  interface: capability.interface,
37
36
  implementation: capability.implementation,
@@ -41,10 +40,11 @@ var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ me
41
40
  }
42
41
  return pluginManager;
43
42
  };
44
- var withPluginManager = (options = {}) => {
43
+ var withPluginManager = (init = {}) => {
45
44
  return (Story, context) => {
45
+ const options = typeof init === "function" ? init(context) : init;
46
46
  const pluginManager = useMemo(() => setupPluginManager(options), [
47
- options
47
+ init
48
48
  ]);
49
49
  useEffect(() => {
50
50
  const capability = contributes(Capabilities.ReactRoot, {
@@ -62,11 +62,8 @@ var withPluginManager = (options = {}) => {
62
62
  pluginManager,
63
63
  context
64
64
  ]);
65
- useEffect(() => {
66
- const timeout = setTimeout(async () => {
67
- await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
68
- });
69
- return () => clearTimeout(timeout);
65
+ useAsyncEffect(async () => {
66
+ await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
70
67
  }, [
71
68
  pluginManager
72
69
  ]);
@@ -76,19 +73,18 @@ var withPluginManager = (options = {}) => {
76
73
  return /* @__PURE__ */ React.createElement(App, null);
77
74
  };
78
75
  };
79
- var STORY_PLUGIN = "dxos.org/app-framework/story";
80
- var storyPlugin = () => definePlugin({
81
- id: STORY_PLUGIN,
76
+ var storyMeta = {
77
+ id: "dxos.org/app-framework/story",
82
78
  name: "Story"
83
- }, [
79
+ };
80
+ var StoryPlugin = definePlugin(storyMeta, () => [
84
81
  defineModule({
85
- id: STORY_PLUGIN,
82
+ id: storyMeta.id,
86
83
  activatesOn: Events.Startup,
87
84
  activate: () => []
88
85
  })
89
86
  ]);
90
87
  export {
91
- getValue,
92
88
  setupPluginManager,
93
89
  withPluginManager
94
90
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/withPluginManager.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { useApp, type CreateAppOptions } from '../App';\nimport { Capabilities, Events } from '../common';\nimport {\n contributes,\n defineModule,\n definePlugin,\n type ActivationEvent,\n type AnyCapability,\n PluginManager,\n type PluginContext,\n} from '../core';\n\n// TODO(burdon): Factor out (use consistently in plugin framework?)\nexport type Provider<C, R> = (context: C) => R;\nexport type ProviderOrValue<C, R> = Provider<C, R> | R;\nexport const getValue = <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C): R => {\n return typeof providerOrValue === 'function' ? (providerOrValue as Provider<C, R>)(context) : providerOrValue;\n};\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: CreateAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [storyPlugin(), ...plugins],\n core: [STORY_PLUGIN, ...core],\n ...options,\n });\n\n if (capabilities) {\n getValue(capabilities, pluginManager.context).forEach((capability) => {\n pluginManager.context.contributeCapability({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\nexport type WithPluginManagerOptions = CreateAppOptions & {\n capabilities?: ProviderOrValue<PluginContext, AnyCapability[]>;\n fireEvents?: (ActivationEvent | string)[];\n};\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = (options: WithPluginManagerOptions = {}): Decorator => {\n return (Story, context) => {\n const pluginManager = useMemo(() => setupPluginManager(options), [options]);\n\n // Set-up root capability.\n useEffect(() => {\n const capability = contributes(Capabilities.ReactRoot, {\n id: context.id,\n root: () => <Story />,\n });\n\n pluginManager.context.contributeCapability({\n ...capability,\n module: 'dxos.org/app-framework/withPluginManager',\n });\n\n return () => {\n pluginManager.context.removeCapability(capability.interface, capability.implementation);\n };\n }, [pluginManager, context]);\n\n // Fire events.\n useEffect(() => {\n const timeout = setTimeout(async () => {\n await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n });\n\n return () => clearTimeout(timeout);\n }, [pluginManager]);\n\n // Create app.\n const App = useApp({ pluginManager });\n\n return <App />;\n };\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst STORY_PLUGIN = 'dxos.org/app-framework/story';\nconst storyPlugin = () =>\n definePlugin({ id: STORY_PLUGIN, name: 'Story' }, [\n defineModule({ id: STORY_PLUGIN, activatesOn: Events.Startup, activate: () => [] }),\n ]);\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAKA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,aAAa;AAiBf,IAAMC,WAAW,CAAOC,iBAAwCC,YAAAA;AACrE,SAAO,OAAOD,oBAAoB,aAAcA,gBAAmCC,OAAAA,IAAWD;AAChG;AAKO,IAAME,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IACkE,CAAC,MAAC;AACvE,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACW;SAAiBX;;IACxB,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBJ,aAASI,cAAcO,cAAcT,OAAO,EAAEgB,QAAQ,CAACC,eAAAA;AACrDR,oBAAcT,QAAQkB,qBAAqB;QACzCC,WAAWF,WAAWE;QACtBC,gBAAgBH,WAAWG;QAC3BC,QAAQ;MACV,CAAA;IACF,CAAA;EACF;AAEA,SAAOZ;AACT;AAWO,IAAMa,oBAAoB,CAACd,UAAoC,CAAC,MAAC;AACtE,SAAO,CAACe,OAAOvB,YAAAA;AACb,UAAMS,gBAAgBe,QAAQ,MAAMvB,mBAAmBO,OAAAA,GAAU;MAACA;KAAQ;AAG1EiB,cAAU,MAAA;AACR,YAAMR,aAAaS,YAAYC,aAAaC,WAAW;QACrDrB,IAAIP,QAAQO;QACZsB,MAAM,MAAM,sBAAA,cAACN,OAAAA,IAAAA;MACf,CAAA;AAEAd,oBAAcT,QAAQkB,qBAAqB;QACzC,GAAGD;QACHI,QAAQ;MACV,CAAA;AAEA,aAAO,MAAA;AACLZ,sBAAcT,QAAQ8B,iBAAiBb,WAAWE,WAAWF,WAAWG,cAAc;MACxF;IACF,GAAG;MAACX;MAAeT;KAAQ;AAG3ByB,cAAU,MAAA;AACR,YAAMM,UAAUC,WAAW,YAAA;AACzB,cAAMC,QAAQC,IAAI1B,QAAQ2B,YAAY9B,IAAI,CAAC+B,UAAU3B,cAAc4B,SAASD,KAAAA,CAAAA,KAAW,CAAA,CAAE;MAC3F,CAAA;AAEA,aAAO,MAAME,aAAaP,OAAAA;IAC5B,GAAG;MAACtB;KAAc;AAGlB,UAAM8B,MAAMC,OAAO;MAAE/B;IAAc,CAAA;AAEnC,WAAO,sBAAA,cAAC8B,KAAAA,IAAAA;EACV;AACF;AAIA,IAAMxB,eAAe;AACrB,IAAMD,cAAc,MAClB2B,aAAa;EAAElC,IAAIQ;EAAc2B,MAAM;AAAQ,GAAG;EAChDC,aAAa;IAAEpC,IAAIQ;IAAc6B,aAAaC,OAAOC;IAAST,UAAU,MAAM,CAAA;EAAG,CAAA;CAClF;",
6
- "names": ["React", "useEffect", "useMemo", "raise", "getValue", "providerOrValue", "context", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "storyPlugin", "STORY_PLUGIN", "forEach", "capability", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "Story", "useMemo", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "timeout", "setTimeout", "Promise", "all", "fireEvents", "event", "activate", "clearTimeout", "App", "useApp", "definePlugin", "name", "defineModule", "activatesOn", "Events", "Startup"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { type MaybeProvider, getProviderValue } from '@dxos/util';\n\nimport { Capabilities, Events } from '../common';\nimport {\n type ActivationEvent,\n type AnyCapability,\n type PluginContext,\n PluginManager,\n contributes,\n defineModule,\n definePlugin,\n} from '../core';\nimport { type UseAppOptions, useApp } from '../react';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: UseAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = new PluginManager({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin(), ...plugins],\n core: [StoryPlugin.meta.id, ...core],\n ...options,\n });\n\n if (capabilities) {\n getProviderValue(capabilities, pluginManager.context).forEach((capability) => {\n pluginManager.context.contributeCapability({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\nexport type WithPluginManagerOptions = UseAppOptions & {\n /** @deprecated */\n capabilities?: MaybeProvider<AnyCapability[], PluginContext>;\n /** @deprecated */\n fireEvents?: (ActivationEvent | string)[];\n};\n\nexport type WithPluginManagerInitializer<Args = void> =\n | WithPluginManagerOptions\n | ((context: StoryContext<Args>) => WithPluginManagerOptions);\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = <Args,>(init: WithPluginManagerInitializer<Args> = {}): Decorator => {\n return (Story, context) => {\n const options = typeof init === 'function' ? init(context as any) : init;\n const pluginManager = useMemo(() => setupPluginManager(options), [init]);\n\n // Set-up root capability.\n useEffect(() => {\n const capability = contributes(Capabilities.ReactRoot, {\n id: context.id,\n root: () => <Story />,\n });\n\n pluginManager.context.contributeCapability({\n ...capability,\n module: 'dxos.org/app-framework/withPluginManager',\n });\n\n return () => {\n pluginManager.context.removeCapability(capability.interface, capability.implementation);\n };\n }, [pluginManager, context]);\n\n // Fire events.\n useAsyncEffect(async () => {\n await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n }, [pluginManager]);\n\n // Create app.\n const App = useApp({ pluginManager });\n\n return <App />;\n };\n};\n\nconst storyMeta = {\n id: 'dxos.org/app-framework/story',\n name: 'Story',\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst StoryPlugin = definePlugin(storyMeta, () => [\n defineModule({ id: storyMeta.id, activatesOn: Events.Startup, activate: () => [] }),\n]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAKA,OAAOA,SAASC,WAAWC,eAAe;AAE1C,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAA6BC,wBAAwB;AAiB9C,IAAMC,qBAAqB,CAAC,EACjCC,cACAC,UAAU,CAAA,GACVC,OAAOD,QAAQE,IAAI,CAAC,EAAEC,KAAI,MAAOA,KAAKC,EAAE,GACxC,GAAGC,QAAAA,IAC+D,CAAC,MAAC;AACpE,QAAMC,gBAAgB,IAAIC,cAAc;IACtCC,cAAc,MAAMC,MAAM,IAAIC,MAAM,iBAAA,CAAA;IACpCV,SAAS;MAACW,YAAAA;SAAkBX;;IAC5BC,MAAM;MAACU,YAAYR,KAAKC;SAAOH;;IAC/B,GAAGI;EACL,CAAA;AAEA,MAAIN,cAAc;AAChBa,qBAAiBb,cAAcO,cAAcO,OAAO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ue", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "pluginLoader", "raise", "Error", "StoryPlugin", "getProviderValue", "context", "forEach", "capability", "contributeCapability", "interface", "implementation", "module", "withPluginManager", "init", "Story", "useMemo", "useEffect", "contributes", "Capabilities", "ReactRoot", "root", "removeCapability", "useAsyncEffect", "Promise", "all", "fireEvents", "event", "activate", "App", "useApp", "storyMeta", "name", "definePlugin", "defineModule", "activatesOn", "Events", "Startup"]
7
7
  }
@@ -1,46 +1,73 @@
1
- import { type Registry } from '@effect-rx/rx-react';
2
- import { type Schema } from 'effect';
1
+ import { type Registry } from '@effect-atom/atom-react';
2
+ import type * as Layer from 'effect/Layer';
3
+ import type * as Schema from 'effect/Schema';
3
4
  import { type FC, type PropsWithChildren } from 'react';
4
- import { type ExecutableTool } from '@dxos/ai';
5
- import { type GraphBuilder, type BuilderExtensions } from '@dxos/app-graph';
6
- import { type ArtifactDefinition } from '@dxos/blueprints';
5
+ import { type AiService } from '@dxos/ai';
6
+ import type * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
7
+ import { type BuilderExtensions, type GraphBuilder } from '@dxos/app-graph';
8
+ import { type GenericToolkit } from '@dxos/assistant';
9
+ import { type Blueprint } from '@dxos/blueprints';
7
10
  import { type Space } from '@dxos/client-protocol';
8
11
  import { type FunctionDefinition } from '@dxos/functions';
9
12
  import { type RootSettingsStore } from '@dxos/local-storage';
10
- import { type AnchoredTo } from '@dxos/schema';
13
+ import { type AnchoredTo } from '@dxos/types';
14
+ import { type PluginManager } from '../core';
15
+ import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
11
16
  import { type FileInfo } from './file';
12
17
  import { type NodeSerializer } from './graph';
13
18
  import { type SurfaceDefinition } from './surface';
14
- import { type PluginManager } from '../core';
15
- import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
16
19
  export declare namespace Capabilities {
17
- export const Null: import("..").InterfaceDef<null>;
18
- export const PluginManager: import("..").InterfaceDef<PluginManager>;
19
- export const RxRegistry: import("..").InterfaceDef<Registry.Registry>;
20
- export type ReactContext = Readonly<{
20
+ /**
21
+ * @category Capability
22
+ */
23
+ const Null: import("..").InterfaceDef<null>;
24
+ /**
25
+ * @category Capability
26
+ */
27
+ const PluginManager: import("..").InterfaceDef<PluginManager>;
28
+ /**
29
+ * @category Capability
30
+ */
31
+ const RxRegistry: import("..").InterfaceDef<Registry.Registry>;
32
+ type ReactContext = Readonly<{
21
33
  id: string;
22
34
  dependsOn?: string[];
23
35
  context: FC<PropsWithChildren>;
24
36
  }>;
25
- export const ReactContext: import("..").InterfaceDef<Readonly<{
37
+ /**
38
+ * @category Capability
39
+ */
40
+ const ReactContext: import("..").InterfaceDef<Readonly<{
26
41
  id: string;
27
42
  dependsOn?: string[];
28
43
  context: FC<PropsWithChildren>;
29
44
  }>>;
30
- export type ReactRoot = Readonly<{
45
+ type ReactRoot = Readonly<{
31
46
  id: string;
32
47
  root: FC<PropsWithChildren>;
33
48
  }>;
34
- export const ReactRoot: import("..").InterfaceDef<Readonly<{
49
+ /**
50
+ * @category Capability
51
+ */
52
+ const ReactRoot: import("..").InterfaceDef<Readonly<{
35
53
  id: string;
36
54
  root: FC<PropsWithChildren>;
37
55
  }>>;
38
- export type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];
39
- export const ReactSurface: import("..").InterfaceDef<ReactSurface>;
40
- export type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];
41
- export const IntentResolver: import("..").InterfaceDef<IntentResolver>;
42
- export const IntentDispatcher: import("..").InterfaceDef<IntentContext>;
43
- export type Layout = Readonly<{
56
+ type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];
57
+ /**
58
+ * @category Capability
59
+ */
60
+ const ReactSurface: import("..").InterfaceDef<ReactSurface>;
61
+ type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];
62
+ /**
63
+ * @category Capability
64
+ */
65
+ const IntentResolver: import("..").InterfaceDef<IntentResolver>;
66
+ /**
67
+ * @category Capability
68
+ */
69
+ const IntentDispatcher: import("..").InterfaceDef<IntentContext>;
70
+ type Layout = Readonly<{
44
71
  mode: string;
45
72
  dialogOpen: boolean;
46
73
  sidebarOpen: boolean;
@@ -62,7 +89,10 @@ export declare namespace Capabilities {
62
89
  */
63
90
  scrollIntoView: string | undefined;
64
91
  }>;
65
- export const Layout: import("..").InterfaceDef<Readonly<{
92
+ /**
93
+ * @category Capability
94
+ */
95
+ const Layout: import("..").InterfaceDef<Readonly<{
66
96
  mode: string;
67
97
  dialogOpen: boolean;
68
98
  sidebarOpen: boolean;
@@ -84,41 +114,82 @@ export declare namespace Capabilities {
84
114
  */
85
115
  scrollIntoView: string | undefined;
86
116
  }>>;
87
- export const Translations: import("..").InterfaceDef<readonly {
117
+ /**
118
+ * @category Capability
119
+ */
120
+ const Translations: import("..").InterfaceDef<readonly {
88
121
  readonly [x: string]: {
89
122
  readonly [x: string]: string | {
90
123
  readonly [x: string]: any;
91
124
  };
92
125
  };
93
126
  }[]>;
94
- export const AppGraph: import("..").InterfaceDef<Readonly<Pick<GraphBuilder, "graph" | "explore">>>;
95
- export const AppGraphBuilder: import("..").InterfaceDef<BuilderExtensions>;
96
- export const AppGraphSerializer: import("..").InterfaceDef<NodeSerializer[]>;
97
- export const SettingsStore: import("..").InterfaceDef<RootSettingsStore>;
98
- export type Settings = {
127
+ /**
128
+ * @category Capability
129
+ */
130
+ const AppGraph: import("..").InterfaceDef<Readonly<Pick<GraphBuilder, "graph" | "explore">>>;
131
+ /**
132
+ * @category Capability
133
+ */
134
+ const AppGraphBuilder: import("..").InterfaceDef<BuilderExtensions>;
135
+ /**
136
+ * @category Capability
137
+ */
138
+ const AppGraphSerializer: import("..").InterfaceDef<NodeSerializer[]>;
139
+ /**
140
+ * @category Capability
141
+ */
142
+ const SettingsStore: import("..").InterfaceDef<RootSettingsStore>;
143
+ type Settings = {
99
144
  prefix: string;
100
145
  schema: Schema.Schema.All;
101
146
  value?: Record<string, any>;
102
147
  };
103
- export const Settings: import("..").InterfaceDef<Settings>;
104
- export type Metadata = Readonly<{
148
+ /**
149
+ * @category Capability
150
+ */
151
+ const Settings: import("..").InterfaceDef<Settings>;
152
+ type Metadata = Readonly<{
105
153
  id: string;
106
154
  metadata: Record<string, any>;
107
155
  }>;
108
- export const Metadata: import("..").InterfaceDef<Readonly<{
156
+ /**
157
+ * @category Capability
158
+ */
159
+ const Metadata: import("..").InterfaceDef<Readonly<{
109
160
  id: string;
110
161
  metadata: Record<string, any>;
111
162
  }>>;
112
- export const Tools: import("..").InterfaceDef<ExecutableTool[]>;
113
- export const ArtifactDefinition: import("..").InterfaceDef<ArtifactDefinition>;
114
- export const Functions: import("..").InterfaceDef<FunctionDefinition<any, any>[]>;
115
- export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
116
- export const FileUploader: import("..").InterfaceDef<FileUploader>;
163
+ /**
164
+ * @category Capability
165
+ */
166
+ const Toolkit: import("..").InterfaceDef<GenericToolkit.GenericToolkit<never, never, never>>;
167
+ /**
168
+ * @category Capability
169
+ */
170
+ const BlueprintDefinition: import("..").InterfaceDef<Blueprint.Blueprint>;
171
+ type AiServiceLayer = Layer.Layer<AiService.AiService>;
172
+ const AiServiceLayer: import("..").InterfaceDef<AiServiceLayer>;
173
+ /**
174
+ * Plugins can contribute them to provide model resolvers.
175
+ */
176
+ const AiModelResolver: import("..").InterfaceDef<Layer.Layer<AiServiceRouter.AiModelResolver, never, never>>;
177
+ /**
178
+ * @category Capability
179
+ */
180
+ const Functions: import("..").InterfaceDef<FunctionDefinition<any, any>[]>;
181
+ type FileUploader = (space: Space, file: File) => Promise<FileInfo | undefined>;
182
+ /**
183
+ * @category Capability
184
+ */
185
+ const FileUploader: import("..").InterfaceDef<FileUploader>;
117
186
  type AnchorSort = {
118
187
  key: string;
119
- sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
188
+ sort: (anchorA: AnchoredTo.AnchoredTo, anchorB: AnchoredTo.AnchoredTo) => number;
120
189
  };
121
- export const AnchorSort: import("..").InterfaceDef<AnchorSort>;
122
- export {};
190
+ /**
191
+ * @category Capability
192
+ */
193
+ const AnchorSort: import("..").InterfaceDef<AnchorSort>;
123
194
  }
124
195
  //# sourceMappingURL=capabilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/common/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9E,yBAAiB,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,I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G;IACI,MAAM,OAAO,+EAEnB,CAAC;IAEF;;OAEG;IACI,MAAM,mBAAmB,gDAE/B,CAAC;IAEF,KAAY,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,cAAc,2CAE1B,CAAC;IAEF;;OAEG;IACI,MAAM,eAAe,uFAE3B,CAAC;IAEF;;OAEG;IACI,MAAM,SAAS,2DAErB,CAAC;IAEF,KAAY,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAEvF;;OAEG;IACI,MAAM,YAAY,yCAAoF,CAAC;IAE9G,KAAY,UAAU,GAAG;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,KAAK,MAAM,CAAC;KAClF,CAAC;IAEF;;OAEG;IACI,MAAM,UAAU,uCAAgF,CAAC;CACzG"}
@@ -1,18 +1,19 @@
1
- import { Schema } from 'effect';
2
- import { Expando } from '@dxos/echo-schema';
1
+ import * as Schema from 'effect/Schema';
3
2
  export declare namespace CollaborationActions {
4
- const InsertContent_base: Schema.TaggedClass<InsertContent, "assistant/intent-content", {
5
- readonly _tag: Schema.tag<"assistant/intent-content">;
3
+ const AcceptProposal_base: Schema.TaggedClass<AcceptProposal, "collaboration/accept-proposal", {
4
+ readonly _tag: Schema.tag<"collaboration/accept-proposal">;
6
5
  } & {
7
6
  input: Schema.Struct<{
8
- target: Schema.Schema<Expando, Expando, never>;
9
- object: import("@dxos/echo-schema").Ref$<Expando>;
10
- at: Schema.optional<typeof Schema.String>;
11
- label: Schema.optional<typeof Schema.String>;
7
+ subject: typeof Schema.Any;
8
+ anchor: typeof Schema.String;
9
+ proposal: Schema.mutable<Schema.TaggedStruct<"proposal", {
10
+ pending: Schema.optional<typeof Schema.Boolean>;
11
+ text: typeof Schema.String;
12
+ }>>;
12
13
  }>;
13
14
  output: typeof Schema.Void;
14
15
  }>;
15
- export class InsertContent extends InsertContent_base {
16
+ export class AcceptProposal extends AcceptProposal_base {
16
17
  }
17
18
  export {};
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collaboration.d.ts","sourceRoot":"","sources":["../../../../src/common/collaboration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAO,MAAM,mBAAmB,CAAC;AAEjD,yBAAiB,oBAAoB,CAAC;;;;;;;;;;;;IACpC,MAAM,OAAO,aAAc,SAAQ,kBAUjC;KAAG;;CACN"}
1
+ {"version":3,"file":"collaboration.d.ts","sourceRoot":"","sources":["../../../../src/common/collaboration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,yBAAiB,oBAAoB,CAAC;;;;;;;;;;;;;;IACpC,MAAM,OAAO,cAAe,SAAQ,mBAOlC;KAAG;;CACN"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"AAOA,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,OAAO,8BAAsD,CAAC;IAM3E;;OAEG;IACI,MAAM,iBAAiB,8BAAkE,CAAC;IAEjG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,mBAAmB,8BAAoE,CAAC;IAErG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,iBAAiB,8BAAiE,CAAC;IAEhG;;OAEG;IACI,MAAM,uBAAuB,8BAAwE,CAAC;IAM7G;;OAEG;IACI,MAAM,eAAe,8BAA+D,CAAC;IAE5F;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,gBAAgB,GAAI,WAAW,MAAM,iCAAiE,CAAC;IAC7G,MAAM,WAAW,8BAAmD,CAAC;CAC7E"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/common/events.ts"],"names":[],"mappings":"AAQA,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,OAAO,8BAAsD,CAAC;IAM3E;;OAEG;IACI,MAAM,iBAAiB,8BAAkE,CAAC;IAEjG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,mBAAmB,8BAAoE,CAAC;IAErG;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,iBAAiB,8BAAiE,CAAC;IAEhG;;OAEG;IAEI,MAAM,uBAAuB,8BAAwE,CAAC;IAM7G;;OAEG;IACI,MAAM,eAAe,8BAA+D,CAAC;IAE5F;;OAEG;IACI,MAAM,aAAa,8BAA6D,CAAC;IAExF;;OAEG;IACI,MAAM,aAAa,8BAA0D,CAAC;IAErF;;OAEG;IACI,MAAM,gBAAgB,GAAI,WAAW,MAAM,iCAAiE,CAAC;IAC7G,MAAM,WAAW,8BAAmD,CAAC;CAC7E"}
@@ -1,4 +1,4 @@
1
- import { Schema } from 'effect';
1
+ import * as Schema from 'effect/Schema';
2
2
  export declare const defaultFileTypes: {
3
3
  images: string[];
4
4
  media: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/common/file.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/common/file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -2,7 +2,7 @@ export * from './capabilities';
2
2
  export * from './collaboration';
3
3
  export * from './events';
4
4
  export * from './file';
5
- export type * from './graph';
5
+ export * from './graph';
6
6
  export * from './layout';
7
7
  export * from './surface';
8
8
  export * from './translations';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,mBAAmB,SAAS,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,4 @@
1
- import { Schema } from 'effect';
2
- export declare const LAYOUT_PLUGIN = "dxos.org/plugin/layout";
3
- export declare const LAYOUT_ACTION = "dxos.org/plugin/layout/action";
1
+ import * as Schema from 'effect/Schema';
4
2
  /**
5
3
  * Expected payload for layout actions.
6
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD;;GAEG;AACH,yBAAiB,YAAY,CAAC;IAC5B,MAAM,CAAC,MAAM,aAAa,gDAAmC,CAAC;;;;;;;;;;;IAE9D;;OAEG;IACH,MAAM,OAAO,YAAa,SAAQ,iBAWhC;KAAG;;;;;;;;;;;;;;;IAYL,MAAM,OAAO,aAAc,SAAQ,kBAYjC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAejC;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,mBAAoB,SAAQ,wBAevC;KAAG;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,YAAa,SAAQ,iBA4BhC;KAAG;;;;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,aAAc,SAAQ,kBAoCjC;KAAG;IAEL,MAAM,CAAC,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAYhB,CAAC;IAEH,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,UAAU,CAAC;QAC/E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;KACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAED,MAAM,OAAO,QAAS,SAAQ,aAM5B;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;KAAG;;;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAQnC;KAAG;;;;;;;;;;;;;;;;;;;IAEL,MAA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AgB,SAAQ,oBAMnC;KAAG;;;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAQnC;KAAG;;;;;;;;;;;;;;;;;;;IAEL,MAAM,OAAO,IAAK,SAAQ,SA4BxB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,GAAI,SAAQ,QAWvB;KAAG;;;;;;;;;;;;;IAEL,MAAM,OAAO,KAAM,SAAQ,UASzB;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAWlC;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,MAAO,SAAQ,WAM1B;KAAG;;CACN"}
@@ -1,10 +1,10 @@
1
- import { type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';
1
+ import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
2
2
  import { type GuardedType, type MakeOptional, type Position } from '@dxos/util';
3
3
  import { type ErrorBoundary } from '../react';
4
4
  /**
5
5
  * SurfaceProps are the props that are passed to the Surface component.
6
6
  */
7
- export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
7
+ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
8
8
  /**
9
9
  * If specified, the Surface will be wrapped in an error boundary.
10
10
  * The fallback component will be rendered if an error occurs.
@@ -15,14 +15,10 @@ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>
15
15
  * The placeholder component will be rendered while the surface component is loading.
16
16
  */
17
17
  placeholder?: ReactNode;
18
- }> & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {
19
- /**
20
- * Additional props to pass to the component.
21
- * These props are not used by Surface itself but may be used by components which resolve the surface.
22
- */
23
- [key: string]: unknown;
18
+ } & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {
19
+ [K in keyof Record<string, any>]: K extends keyof CoreSurfaceProps<T> | 'fallback' | 'placeholder' ? never : any;
24
20
  };
25
- type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
21
+ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
26
22
  /**
27
23
  * ID for debugging.
28
24
  */
@@ -33,20 +29,19 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
33
29
  role: string;
34
30
  /**
35
31
  * The data to be rendered by the surface.
32
+ * NOTE: This must be a stable value.
36
33
  */
37
34
  data: T;
38
35
  /**
39
36
  * If more than one component is resolved, the limit determines how many are rendered.
40
37
  */
41
38
  limit?: number | undefined;
42
- };
43
- type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<CoreSurfaceProps<T> & {
44
- [key: string]: unknown;
45
39
  }>;
40
+ type SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = CoreSurfaceProps<T> & Record<string, any>;
46
41
  /**
47
42
  * React component used to render a surface once is has matched.
48
43
  */
49
- export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = (props: SurfaceComponentProps<T>, forwardedRef: ForwardedRef<HTMLElement>) => JSX.Element | null;
44
+ export type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = ComponentType<SurfaceComponentProps<T>>;
50
45
  /**
51
46
  * Definition of when a SurfaceComponent should be rendered.
52
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/common/surface.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAA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E,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;IACtD,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC1E,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAC/D,YAAY,iBAAiB,CAAC,CAAC,CAAC,KAC/B,iBAAiB,CAAC,CAAC,CAAe,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Schema } from 'effect';
1
+ import * as Schema from 'effect/Schema';
2
2
  export declare const ResourceKey: Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>;
3
3
  export type ResourceKey = Schema.Schema.Type<typeof ResourceKey>;
4
4
  export declare const ResourceLanguage: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Any>]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,WAAW,+FAAwF,CAAC;AACjH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qIAA4D,CAAC;AAC1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,QAAQ,2KAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/common/translations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,WAAW,+FAAwF,CAAC;AACjH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qIAA4D,CAAC;AAC1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,QAAQ,2KAAiE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { type Registry, Rx } from '@effect-rx/rx-react';
2
- import { Effect } from 'effect';
1
+ import { Atom, type Registry } from '@effect-atom/atom-react';
2
+ import * as Effect from 'effect/Effect';
3
3
  import { type MaybePromise } from '@dxos/util';
4
4
  import { type ActivationEvent } from './events';
5
5
  declare const InterfaceDefTypeId: unique symbol;
@@ -10,6 +10,9 @@ export type InterfaceDef<T> = {
10
10
  [InterfaceDefTypeId]: T;
11
11
  identifier: string;
12
12
  };
13
+ export declare namespace InterfaceDef {
14
+ type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
15
+ }
13
16
  /**
14
17
  * Helper to define the interface of a capability.
15
18
  */
@@ -22,15 +25,15 @@ export type Capability<T> = {
22
25
  /**
23
26
  * The interface definition of the capability.
24
27
  */
25
- interface: InterfaceDef<T>;
28
+ readonly interface: InterfaceDef<T>;
26
29
  /**
27
30
  * The implementation of the capability.
28
31
  */
29
- implementation: T;
32
+ readonly implementation: T;
30
33
  /**
31
34
  * Called when the capability is deactivated.
32
35
  */
33
- deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
36
+ readonly deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
34
37
  };
35
38
  export type AnyCapability = Capability<any>;
36
39
  type PluginsContextOptions = {
@@ -41,7 +44,7 @@ type PluginsContextOptions = {
41
44
  /**
42
45
  * Helper to define the implementation of a capability.
43
46
  */
44
- export declare const contributes: <T>(interfaceDef: Capability<T>["interface"], implementation: Capability<T>["implementation"], deactivate?: Capability<T>["deactivate"]) => Capability<T>;
47
+ export declare const contributes: <I extends InterfaceDef<any>>(interfaceDef: I, implementation: Capability<InterfaceDef.Implementation<I>>["implementation"], deactivate?: Capability<InterfaceDef.Implementation<I>>["deactivate"]) => Capability<I>;
45
48
  type LoadCapability<T, U> = () => Promise<{
46
49
  default: (props: T) => MaybePromise<Capability<U>>;
47
50
  }>;
@@ -61,8 +64,8 @@ export declare const lazy: <T, U>(c: LoadCapability<T, U> | LoadCapabilities<T>)
61
64
  export declare class PluginContext {
62
65
  private readonly _registry;
63
66
  private readonly _capabilityImpls;
64
- readonly _capabilities: (arg: string) => Rx.Rx<unknown[]>;
65
- readonly _capability: (arg: string) => Rx.Rx<unknown>;
67
+ readonly _capabilities: (arg: string) => Atom.Atom<unknown[]>;
68
+ readonly _capability: (arg: string) => Atom.Atom<unknown>;
66
69
  /**
67
70
  * Activates plugins based on the activation event.
68
71
  * @param event The activation event.
@@ -77,20 +80,20 @@ export declare class PluginContext {
77
80
  readonly reset: PluginsContextOptions['reset'];
78
81
  constructor({ registry, activate, reset }: PluginsContextOptions);
79
82
  /**
80
- * Get the Rx reference to the available capabilities for a given interface.
81
- * Primarily useful for deriving other Rx values based on the capabilities or
83
+ * Get the Atom reference to the available capabilities for a given interface.
84
+ * Primarily useful for deriving other Atom values based on the capabilities or
82
85
  * for subscribing to changes in the capabilities.
83
86
  * @returns An Rx reference to the available capabilities.
84
87
  */
85
- capabilities<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T[]>;
88
+ capabilities<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T[]>;
86
89
  /**
87
- * Get the Rx reference to the available capabilities for a given interface.
88
- * Primarily useful for deriving other Rx values based on the capability or
90
+ * Get the Atom reference to the available capabilities for a given interface.
91
+ * Primarily useful for deriving other Atom values based on the capability or
89
92
  * for subscribing to changes in the capability.
90
93
  * @returns An Rx reference to the available capability.
91
94
  * @throws If no capability is found.
92
95
  */
93
- capability<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T>;
96
+ capability<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T>;
94
97
  /**
95
98
  * Get capabilities from the plugin context.
96
99
  * @returns An array of capabilities.