@dxos/app-framework 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/.swc/plugins/{v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 → linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7} +0 -0
- package/dist/lib/browser/{app-graph-builder-LYF7EKNN.mjs → app-graph-builder-AFFC6VB2.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-AFFC6VB2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FO2PH7M3.mjs → chunk-DND4XMN4.mjs} +59 -33
- package/dist/lib/browser/chunk-DND4XMN4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMN65HSW.mjs → chunk-OZY7HV2A.mjs} +376 -252
- package/dist/lib/browser/chunk-OZY7HV2A.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs → intent-dispatcher-QG7UPGQX.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-ZTNOSO3A.mjs → intent-resolver-4S4PSTM5.mjs} +2 -2
- package/dist/lib/browser/intent-resolver-4S4PSTM5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-KML2R4IE.mjs → store-6E33KLGK.mjs} +2 -2
- package/dist/lib/browser/{store-KML2R4IE.mjs.map → store-6E33KLGK.mjs.map} +1 -1
- package/dist/lib/browser/testing/index.mjs +5 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/worker.mjs +7 -1
- package/dist/lib/node-esm/{app-graph-builder-SAOWGJDK.mjs → app-graph-builder-S4OAULX5.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-S4OAULX5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73HGSHKE.mjs → chunk-E2TK7Z4P.mjs} +59 -33
- package/dist/lib/node-esm/chunk-E2TK7Z4P.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZEZ4FVEU.mjs → chunk-F63ZRXMK.mjs} +376 -252
- package/dist/lib/node-esm/chunk-F63ZRXMK.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +11 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs → intent-dispatcher-NXBGPJOX.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-W7Z7WFFM.mjs → intent-resolver-2ZKXI5ET.mjs} +2 -2
- package/dist/lib/node-esm/intent-resolver-2ZKXI5ET.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs → store-QQUTQHHT.mjs} +2 -2
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs.map → store-QQUTQHHT.mjs.map} +1 -1
- package/dist/lib/node-esm/testing/index.mjs +5 -7
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +7 -1
- package/dist/types/src/App.d.ts +1 -1
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +75 -8
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +9 -8
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -1
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts +1 -1
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +4 -1
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +6 -2
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +1 -1
- package/dist/types/src/playground/generator/Main.d.ts +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/layout/Layout.d.ts +2 -2
- package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +5 -3
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/index.d.ts +1 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +3 -3
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/store.d.ts +1 -1
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/IntentContext.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +6 -4
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/common.d.ts.map +1 -1
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +2 -0
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -30
- package/src/App.tsx +18 -14
- package/src/common/capabilities.ts +91 -10
- package/src/common/collaboration.ts +5 -8
- package/src/common/events.ts +3 -1
- package/src/common/index.ts +1 -1
- package/src/common/surface.ts +1 -1
- package/src/core/capabilities.test.ts +1 -1
- package/src/core/capabilities.ts +11 -6
- package/src/core/manager.test.ts +4 -3
- package/src/core/manager.ts +132 -54
- package/src/helpers.test.ts +1 -1
- package/src/playground/generator/Toolbar.tsx +2 -1
- package/src/playground/generator/generator.ts +2 -2
- package/src/playground/layout/plugin.ts +1 -1
- package/src/playground/logger/Toolbar.tsx +2 -1
- package/src/playground/logger/plugin.ts +3 -2
- package/src/playground/playground.stories.tsx +15 -10
- package/src/plugin-intent/IntentPlugin.ts +2 -1
- package/src/plugin-intent/index.ts +1 -0
- package/src/plugin-intent/intent-dispatcher.test.ts +1 -1
- package/src/plugin-intent/intent-dispatcher.ts +10 -8
- package/src/plugin-settings/SettingsPlugin.ts +3 -2
- package/src/plugin-settings/app-graph-builder.ts +4 -3
- package/src/plugin-settings/intent-resolver.ts +3 -2
- package/src/plugin-settings/store.ts +1 -1
- package/src/react/ErrorBoundary.tsx +24 -15
- package/src/react/IntentContext.tsx +3 -2
- package/src/react/Surface.stories.tsx +21 -13
- package/src/react/Surface.tsx +4 -3
- package/src/react/common.ts +2 -1
- package/src/react/useCapabilities.ts +2 -1
- package/src/testing/withPluginManager.stories.tsx +9 -5
- package/src/testing/withPluginManager.tsx +11 -11
- package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
- package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
- package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
- /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → intent-dispatcher-QG7UPGQX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs.map → intent-dispatcher-NXBGPJOX.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.5ea62a8",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,22 +10,22 @@
|
|
|
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
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./testing": {
|
|
19
|
+
"source": "./src/testing/index.ts",
|
|
19
20
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
20
21
|
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
22
|
-
"source": "./src/testing/index.ts"
|
|
22
|
+
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
23
23
|
},
|
|
24
24
|
"./worker": {
|
|
25
|
+
"source": "./src/worker.ts",
|
|
25
26
|
"types": "./dist/types/src/worker.d.ts",
|
|
26
27
|
"browser": "./dist/lib/browser/worker.mjs",
|
|
27
|
-
"node": "./dist/lib/node-esm/worker.mjs"
|
|
28
|
-
"source": "./src/worker.ts"
|
|
28
|
+
"node": "./dist/lib/node-esm/worker.mjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -40,37 +40,38 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@effect/ai": "0.25.2",
|
|
43
44
|
"@preact-signals/safe-react": "^0.9.0",
|
|
44
45
|
"@preact/signals-core": "^1.9.0",
|
|
45
|
-
"@dxos/ai": "0.8.4-main.
|
|
46
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
47
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/functions": "0.8.4-main.
|
|
53
|
-
"@dxos/invariant": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
46
|
+
"@dxos/ai": "0.8.4-main.5ea62a8",
|
|
47
|
+
"@dxos/app-graph": "0.8.4-main.5ea62a8",
|
|
48
|
+
"@dxos/blueprints": "0.8.4-main.5ea62a8",
|
|
49
|
+
"@dxos/client-protocol": "0.8.4-main.5ea62a8",
|
|
50
|
+
"@dxos/async": "0.8.4-main.5ea62a8",
|
|
51
|
+
"@dxos/debug": "0.8.4-main.5ea62a8",
|
|
52
|
+
"@dxos/echo-schema": "0.8.4-main.5ea62a8",
|
|
53
|
+
"@dxos/functions": "0.8.4-main.5ea62a8",
|
|
54
|
+
"@dxos/invariant": "0.8.4-main.5ea62a8",
|
|
55
|
+
"@dxos/keys": "0.8.4-main.5ea62a8",
|
|
56
|
+
"@dxos/live-object": "0.8.4-main.5ea62a8",
|
|
57
|
+
"@dxos/log": "0.8.4-main.5ea62a8",
|
|
58
|
+
"@dxos/local-storage": "0.8.4-main.5ea62a8",
|
|
59
|
+
"@dxos/react-hooks": "0.8.4-main.5ea62a8",
|
|
60
|
+
"@dxos/schema": "0.8.4-main.5ea62a8",
|
|
61
|
+
"@dxos/util": "0.8.4-main.5ea62a8"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@effect-rx/rx-react": "0.38.0",
|
|
64
|
-
"@effect/platform": "0.
|
|
65
|
+
"@effect/platform": "0.90.2",
|
|
65
66
|
"@types/react": "~18.2.0",
|
|
66
|
-
"effect": "3.17.
|
|
67
|
+
"effect": "3.17.7",
|
|
67
68
|
"react": "~18.2.0",
|
|
68
69
|
"typedoc": "0.28.1",
|
|
69
|
-
"@dxos/echo-signals": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-ui
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
70
|
+
"@dxos/echo-signals": "0.8.4-main.5ea62a8",
|
|
71
|
+
"@dxos/random": "0.8.4-main.5ea62a8",
|
|
72
|
+
"@dxos/react-ui": "0.8.4-main.5ea62a8",
|
|
73
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.5ea62a8",
|
|
74
|
+
"@dxos/storybook-utils": "0.8.4-main.5ea62a8"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
77
|
"@effect-rx/rx-react": "^0.34.1",
|
package/src/App.tsx
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { RegistryContext } from '@effect-rx/rx-react';
|
|
6
6
|
import { effect } from '@preact/signals-core';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useState
|
|
7
|
+
import React, { type FC, type PropsWithChildren, useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
import { live } from '@dxos/live-object';
|
|
11
|
-
import { useDefaultValue } from '@dxos/react-hooks';
|
|
11
|
+
import { useAsyncEffect, useDefaultValue } from '@dxos/react-hooks';
|
|
12
12
|
|
|
13
13
|
import { Capabilities, Events } from './common';
|
|
14
|
-
import { PluginManager, type PluginManagerOptions
|
|
14
|
+
import { type Plugin, PluginManager, type PluginManagerOptions } from './core';
|
|
15
15
|
import { topologicalSort } from './helpers';
|
|
16
16
|
import { ErrorBoundary, PluginManagerProvider, useCapabilities } from './react';
|
|
17
17
|
|
|
@@ -134,16 +134,12 @@ export const useApp = ({
|
|
|
134
134
|
setupDevtools(manager);
|
|
135
135
|
}, [manager]);
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
]);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
return () => clearTimeout(timeout);
|
|
137
|
+
useAsyncEffect(async () => {
|
|
138
|
+
await Promise.all([
|
|
139
|
+
// TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
|
|
140
|
+
manager.activate(Events.SetupReactSurface),
|
|
141
|
+
manager.activate(Events.Startup),
|
|
142
|
+
]);
|
|
147
143
|
}, [manager]);
|
|
148
144
|
|
|
149
145
|
return useCallback(
|
|
@@ -248,7 +244,15 @@ const App = ({ placeholder: Placeholder, state }: AppProps) => {
|
|
|
248
244
|
// Default fallback does not use tailwind or theme.
|
|
249
245
|
const DefaultFallback = ({ error }: { error: Error }) => {
|
|
250
246
|
return (
|
|
251
|
-
<div
|
|
247
|
+
<div
|
|
248
|
+
style={{
|
|
249
|
+
margin: '1rem',
|
|
250
|
+
padding: '1rem',
|
|
251
|
+
overflow: 'hidden',
|
|
252
|
+
border: '4px solid teal',
|
|
253
|
+
borderRadius: '1rem',
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
252
256
|
{/* TODO(wittjosiah): Link to docs for replacing default. */}
|
|
253
257
|
<h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>[ERROR]: {error.message}</h1>
|
|
254
258
|
<pre style={{ overflow: 'auto', fontSize: '1rem', whiteSpace: 'pre-wrap', color: '#888888' }}>{error.stack}</pre>
|
|
@@ -2,44 +2,74 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type AiTool, type AiToolkit } from '@effect/ai';
|
|
5
6
|
import { type Registry } from '@effect-rx/rx-react';
|
|
6
|
-
import { type Schema } from 'effect';
|
|
7
|
+
import { type Layer, type Schema } from 'effect';
|
|
7
8
|
import { type FC, type PropsWithChildren } from 'react';
|
|
8
9
|
|
|
9
|
-
import { type
|
|
10
|
-
import { type
|
|
11
|
-
import { type ArtifactDefinition } from '@dxos/blueprints';
|
|
10
|
+
import { type BuilderExtensions, type GraphBuilder } from '@dxos/app-graph';
|
|
11
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
12
12
|
import { type Space } from '@dxos/client-protocol';
|
|
13
13
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
14
14
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
15
15
|
import { type AnchoredTo } from '@dxos/schema';
|
|
16
16
|
|
|
17
|
+
import { type PluginManager, defineCapability } from '../core';
|
|
18
|
+
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
19
|
+
|
|
17
20
|
import { type FileInfo } from './file';
|
|
18
21
|
import { type NodeSerializer } from './graph';
|
|
19
22
|
import { type SurfaceDefinition } from './surface';
|
|
20
23
|
import { type Resource } from './translations';
|
|
21
|
-
import { type PluginManager, defineCapability } from '../core';
|
|
22
|
-
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
23
24
|
|
|
25
|
+
// TODO(burdon): Sort.
|
|
24
26
|
export namespace Capabilities {
|
|
27
|
+
/**
|
|
28
|
+
* @category Capability
|
|
29
|
+
*/
|
|
25
30
|
export const Null = defineCapability<null>('dxos.org/app-framework/capability/null');
|
|
26
31
|
|
|
32
|
+
/**
|
|
33
|
+
* @category Capability
|
|
34
|
+
*/
|
|
27
35
|
export const PluginManager = defineCapability<PluginManager>('dxos.org/app-framework/capability/plugin-manager');
|
|
28
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @category Capability
|
|
39
|
+
*/
|
|
29
40
|
export const RxRegistry = defineCapability<Registry.Registry>('dxos.org/app-framework/capability/rx-registry');
|
|
30
41
|
|
|
31
42
|
export type ReactContext = Readonly<{ id: string; dependsOn?: string[]; context: FC<PropsWithChildren> }>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @category Capability
|
|
46
|
+
*/
|
|
32
47
|
export const ReactContext = defineCapability<ReactContext>('dxos.org/app-framework/capability/react-context');
|
|
33
48
|
|
|
34
49
|
export type ReactRoot = Readonly<{ id: string; root: FC<PropsWithChildren> }>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @category Capability
|
|
53
|
+
*/
|
|
35
54
|
export const ReactRoot = defineCapability<ReactRoot>('dxos.org/app-framework/capability/react-root');
|
|
36
55
|
|
|
37
56
|
export type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @category Capability
|
|
60
|
+
*/
|
|
38
61
|
export const ReactSurface = defineCapability<ReactSurface>('dxos.org/app-framework/common/react-surface');
|
|
39
62
|
|
|
40
63
|
export type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @category Capability
|
|
67
|
+
*/
|
|
41
68
|
export const IntentResolver = defineCapability<IntentResolver>('dxos.org/app-framework/capability/intent-resolver');
|
|
42
69
|
|
|
70
|
+
/**
|
|
71
|
+
* @category Capability
|
|
72
|
+
*/
|
|
43
73
|
export const IntentDispatcher = defineCapability<IntentContext>(
|
|
44
74
|
'dxos.org/app-framework/capability/intent-dispatcher',
|
|
45
75
|
);
|
|
@@ -66,23 +96,41 @@ export namespace Capabilities {
|
|
|
66
96
|
*/
|
|
67
97
|
scrollIntoView: string | undefined;
|
|
68
98
|
}>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @category Capability
|
|
102
|
+
*/
|
|
69
103
|
export const Layout = defineCapability<Layout>('dxos.org/app-framework/capability/layout');
|
|
70
104
|
|
|
71
|
-
|
|
105
|
+
/**
|
|
106
|
+
* @category Capability
|
|
107
|
+
*/
|
|
72
108
|
export const Translations = defineCapability<Readonly<Resource[]>>('dxos.org/app-framework/capability/translations');
|
|
73
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @category Capability
|
|
112
|
+
*/
|
|
74
113
|
export const AppGraph = defineCapability<Readonly<Pick<GraphBuilder, 'graph' | 'explore'>>>(
|
|
75
114
|
'dxos.org/app-framework/capability/app-graph',
|
|
76
115
|
);
|
|
77
116
|
|
|
117
|
+
/**
|
|
118
|
+
* @category Capability
|
|
119
|
+
*/
|
|
78
120
|
export const AppGraphBuilder = defineCapability<BuilderExtensions>(
|
|
79
121
|
'dxos.org/app-framework/capability/app-graph-builder',
|
|
80
122
|
);
|
|
81
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @category Capability
|
|
126
|
+
*/
|
|
82
127
|
export const AppGraphSerializer = defineCapability<NodeSerializer[]>(
|
|
83
128
|
'dxos.org/app-framework/capability/app-graph-serializer',
|
|
84
129
|
);
|
|
85
130
|
|
|
131
|
+
/**
|
|
132
|
+
* @category Capability
|
|
133
|
+
*/
|
|
86
134
|
export const SettingsStore = defineCapability<RootSettingsStore>('dxos.org/app-framework/capability/settings-store');
|
|
87
135
|
|
|
88
136
|
// TODO(wittjosiah): The generics caused type inference issues for schemas when contributing settings.
|
|
@@ -93,26 +141,59 @@ export namespace Capabilities {
|
|
|
93
141
|
schema: Schema.Schema.All;
|
|
94
142
|
value?: Record<string, any>;
|
|
95
143
|
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @category Capability
|
|
147
|
+
*/
|
|
96
148
|
export const Settings = defineCapability<Settings>('dxos.org/app-framework/capability/settings');
|
|
97
149
|
|
|
98
150
|
export type Metadata = Readonly<{ id: string; metadata: Record<string, any> }>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @category Capability
|
|
154
|
+
*/
|
|
99
155
|
export const Metadata = defineCapability<Metadata>('dxos.org/app-framework/capability/metadata');
|
|
100
156
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
157
|
+
/**
|
|
158
|
+
* @category Capability
|
|
159
|
+
*/
|
|
160
|
+
export const Toolkit = defineCapability<AiToolkit.Any>('dxos.org/app-framework/capability/ai-toolkit');
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @category Capability
|
|
164
|
+
*/
|
|
165
|
+
export const ToolkitHandler = defineCapability<Layer.Layer<AiTool.ToHandler<AiTool.AiTool<any>>, never, never>>(
|
|
166
|
+
'dxos.org/app-framework/capability/ai-toolkit-handler',
|
|
104
167
|
);
|
|
105
168
|
|
|
169
|
+
/**
|
|
170
|
+
* @category Capability
|
|
171
|
+
*/
|
|
172
|
+
export const BlueprintDefinition = defineCapability<Blueprint.Blueprint>(
|
|
173
|
+
'dxos.org/app-framework/capability/blueprint-definition',
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @category Capability
|
|
178
|
+
*/
|
|
106
179
|
export const Functions = defineCapability<FunctionDefinition<any, any>[]>(
|
|
107
180
|
'dxos.org/app-framework/capability/functions',
|
|
108
181
|
);
|
|
109
182
|
|
|
110
183
|
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @category Capability
|
|
187
|
+
*/
|
|
111
188
|
export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');
|
|
112
189
|
|
|
113
190
|
type AnchorSort = {
|
|
114
191
|
key: string;
|
|
115
192
|
sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
|
|
116
193
|
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @category Capability
|
|
197
|
+
*/
|
|
117
198
|
export const AnchorSort = defineCapability<AnchorSort>('dxos.org/app-framework/capability/anchor-sort');
|
|
118
199
|
}
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { DataType } from '@dxos/schema';
|
|
8
8
|
|
|
9
9
|
export namespace CollaborationActions {
|
|
10
|
-
export class
|
|
10
|
+
export class AcceptProposal extends Schema.TaggedClass<AcceptProposal>()('collaboration/accept-proposal', {
|
|
11
11
|
input: Schema.Struct({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
label: Schema.String.pipe(Schema.optional),
|
|
16
|
-
}).annotations({
|
|
17
|
-
description: 'Enables plugins to inject content blocks or references into a related entity.',
|
|
12
|
+
subject: Schema.Any,
|
|
13
|
+
anchor: Schema.String,
|
|
14
|
+
proposal: DataType.MessageBlock.Proposal,
|
|
18
15
|
}),
|
|
19
16
|
output: Schema.Void,
|
|
20
17
|
}) {}
|
package/src/common/events.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities } from './capabilities';
|
|
6
5
|
import { defineEvent } from '../core';
|
|
7
6
|
|
|
7
|
+
import { Capabilities } from './capabilities';
|
|
8
|
+
|
|
8
9
|
export namespace Events {
|
|
9
10
|
/**
|
|
10
11
|
* Fired when the app is started.
|
|
@@ -48,6 +49,7 @@ export namespace Events {
|
|
|
48
49
|
/**
|
|
49
50
|
* Fired to load any newly available artifacts definitions.
|
|
50
51
|
*/
|
|
52
|
+
// TODO(burdon): Rename.
|
|
51
53
|
export const SetupArtifactDefinition = defineEvent('dxos.org/app-framework/event/setup-artifact-definition');
|
|
52
54
|
|
|
53
55
|
//
|
package/src/common/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from './capabilities';
|
|
|
6
6
|
export * from './collaboration';
|
|
7
7
|
export * from './events';
|
|
8
8
|
export * from './file';
|
|
9
|
-
export
|
|
9
|
+
export * from './graph';
|
|
10
10
|
export * from './layout';
|
|
11
11
|
export * from './surface';
|
|
12
12
|
export * from './translations';
|
package/src/common/surface.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type ForwardedRef, type JSX, type PropsWithChildren, type ReactNode } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type GuardedType, type MakeOptional, type Position } from '@dxos/util';
|
|
8
8
|
|
|
@@ -6,7 +6,7 @@ import { Registry } from '@effect-rx/rx-react';
|
|
|
6
6
|
import { Effect } from 'effect';
|
|
7
7
|
import { describe, expect, it, onTestFinished } from 'vitest';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { PluginContext, defineCapability } from './capabilities';
|
|
10
10
|
|
|
11
11
|
const defaultOptions = {
|
|
12
12
|
activate: () => Effect.succeed(false),
|
package/src/core/capabilities.ts
CHANGED
|
@@ -22,6 +22,10 @@ export type InterfaceDef<T> = {
|
|
|
22
22
|
identifier: string;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
export namespace InterfaceDef {
|
|
26
|
+
export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
/**
|
|
26
30
|
* Helper to define the interface of a capability.
|
|
27
31
|
*/
|
|
@@ -69,16 +73,17 @@ class CapabilityImpl<T> {
|
|
|
69
73
|
/**
|
|
70
74
|
* Helper to define the implementation of a capability.
|
|
71
75
|
*/
|
|
72
|
-
export const contributes = <
|
|
73
|
-
interfaceDef:
|
|
74
|
-
implementation: Capability<
|
|
75
|
-
deactivate?: Capability<
|
|
76
|
-
): Capability<
|
|
77
|
-
return { interface: interfaceDef, implementation, deactivate } satisfies Capability<
|
|
76
|
+
export const contributes = <I extends InterfaceDef<any>>(
|
|
77
|
+
interfaceDef: I,
|
|
78
|
+
implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],
|
|
79
|
+
deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],
|
|
80
|
+
): Capability<I> => {
|
|
81
|
+
return { interface: interfaceDef, implementation, deactivate } satisfies Capability<I>;
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
type LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;
|
|
81
85
|
type LoadCapabilities<T> = () => Promise<{ default: (props: T) => MaybePromise<AnyCapability[]> }>;
|
|
86
|
+
|
|
82
87
|
// TODO(wittjosiah): Not having the array be `any` causes type errors when using the lazy capability.
|
|
83
88
|
type LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;
|
|
84
89
|
|
package/src/core/manager.test.ts
CHANGED
|
@@ -12,11 +12,12 @@ import { registerSignalsRuntime } from '@dxos/echo-signals';
|
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { live } from '@dxos/live-object';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { Events } from '../common';
|
|
16
|
+
|
|
17
|
+
import { type PluginContext, contributes, defineCapability } from './capabilities';
|
|
16
18
|
import { allOf, defineEvent, oneOf } from './events';
|
|
17
19
|
import { PluginManager } from './manager';
|
|
18
|
-
import {
|
|
19
|
-
import { Events } from '../common';
|
|
20
|
+
import { type Plugin, defineModule, definePlugin } from './plugin';
|
|
20
21
|
|
|
21
22
|
registerSignalsRuntime();
|
|
22
23
|
|