@dxos/app-framework 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3
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/.storybook/main.mts +11 -0
- package/.storybook/preview.mts +8 -0
- package/dist/lib/browser/{app-graph-builder-AFFC6VB2.mjs → app-graph-builder-OIEZZC45.mjs} +31 -30
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DND4XMN4.mjs → chunk-VFUKEZIN.mjs} +233 -191
- package/dist/lib/browser/chunk-VFUKEZIN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OZY7HV2A.mjs → chunk-WPW5VVAX.mjs} +281 -273
- package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -56
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-QG7UPGQX.mjs → intent-dispatcher-LZ4AE66E.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-4S4PSTM5.mjs → intent-resolver-QVCKRX6G.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react/index.mjs +34 -0
- package/dist/lib/browser/{store-6E33KLGK.mjs → store-CNPHOYTJ.mjs} +5 -5
- package/dist/lib/browser/store-CNPHOYTJ.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +14 -16
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{app-graph-builder-S4OAULX5.mjs → app-graph-builder-EBU4NVWD.mjs} +31 -30
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-E2TK7Z4P.mjs → chunk-IJOHO66N.mjs} +233 -191
- package/dist/lib/node-esm/chunk-IJOHO66N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-F63ZRXMK.mjs → chunk-XJZGUJ3H.mjs} +281 -273
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +14 -56
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-NXBGPJOX.mjs → intent-dispatcher-MGOJ3CHD.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-2ZKXI5ET.mjs → intent-resolver-URF3HN3G.mjs} +7 -7
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react/index.mjs +35 -0
- package/dist/lib/node-esm/{store-QQUTQHHT.mjs → store-RK5B4XEL.mjs} +5 -5
- package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +14 -16
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/common/capabilities.d.ts +41 -37
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +1 -1
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +1 -1
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +1 -3
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts +19 -16
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +1 -1
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +15 -15
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +1 -1
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +8 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +1 -1
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +0 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +5 -7
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +4 -4
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/meta.d.ts +3 -0
- package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +5 -7
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/meta.d.ts +3 -0
- package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/translations.d.ts +2 -1
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
- package/dist/types/src/react/App.d.ts +10 -0
- package/dist/types/src/react/App.d.ts.map +1 -0
- package/dist/types/src/react/App.stories.d.ts +14 -0
- package/dist/types/src/react/App.stories.d.ts.map +1 -0
- package/dist/types/src/react/DefaultFallback.d.ts +8 -0
- package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts +2 -2
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +5 -5
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +3 -7
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/index.d.ts +2 -0
- package/dist/types/src/react/index.d.ts.map +1 -1
- package/dist/types/src/react/types.d.ts +14 -0
- package/dist/types/src/react/types.d.ts.map +1 -0
- package/dist/types/src/{App.d.ts → react/useApp.d.ts} +7 -6
- package/dist/types/src/react/useApp.d.ts.map +1 -0
- package/dist/types/src/react/useLoading.d.ts +19 -0
- package/dist/types/src/react/useLoading.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +7 -8
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +5 -1
- package/package.json +44 -40
- package/src/common/capabilities.ts +34 -19
- package/src/common/collaboration.ts +3 -3
- package/src/common/file.ts +1 -1
- package/src/common/layout.ts +3 -4
- package/src/common/surface.ts +23 -21
- package/src/common/translations.ts +1 -1
- package/src/core/capabilities.test.ts +2 -2
- package/src/core/capabilities.ts +26 -22
- package/src/core/manager.test.ts +19 -19
- package/src/core/manager.ts +14 -7
- package/src/core/plugin.ts +13 -2
- package/src/index.ts +0 -2
- package/src/playground/debug/Debug.tsx +1 -1
- package/src/playground/debug/plugin.ts +7 -8
- package/src/playground/generator/Main.tsx +0 -1
- package/src/playground/generator/generator.ts +2 -2
- package/src/playground/generator/plugin.ts +12 -13
- package/src/playground/layout/plugin.ts +9 -8
- package/src/playground/logger/plugin.ts +27 -23
- package/src/playground/logger/schema.ts +1 -1
- package/src/playground/playground.stories.tsx +6 -7
- package/src/plugin-intent/IntentPlugin.ts +12 -13
- package/src/plugin-intent/actions.ts +4 -6
- package/src/plugin-intent/errors.ts +2 -1
- package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
- package/src/plugin-intent/intent-dispatcher.ts +13 -6
- package/src/plugin-intent/intent.ts +1 -1
- package/src/plugin-intent/meta.ts +10 -0
- package/src/plugin-settings/SettingsPlugin.ts +25 -27
- package/src/plugin-settings/actions.ts +9 -13
- package/src/plugin-settings/app-graph-builder.ts +22 -20
- package/src/plugin-settings/intent-resolver.ts +2 -2
- package/src/plugin-settings/meta.ts +10 -0
- package/src/plugin-settings/store.ts +2 -2
- package/src/plugin-settings/translations.ts +4 -4
- package/src/react/App.stories.tsx +33 -0
- package/src/react/App.tsx +59 -0
- package/src/react/DefaultFallback.tsx +26 -0
- package/src/react/ErrorBoundary.tsx +10 -8
- package/src/react/Surface.stories.tsx +70 -49
- package/src/react/Surface.tsx +67 -36
- package/src/react/index.ts +4 -0
- package/src/react/types.ts +37 -0
- package/src/{App.tsx → react/useApp.tsx} +35 -150
- package/src/react/useCapabilities.ts +2 -2
- package/src/react/useLoading.tsx +70 -0
- package/src/testing/withPluginManager.stories.tsx +1 -1
- package/src/testing/withPluginManager.tsx +24 -23
- package/tsconfig.json +11 -9
- package/vitest.config.ts +8 -6
- package/dist/lib/browser/app-graph-builder-AFFC6VB2.mjs.map +0 -7
- package/dist/lib/browser/chunk-DND4XMN4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZY7HV2A.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4S4PSTM5.mjs.map +0 -7
- package/dist/lib/browser/store-6E33KLGK.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -85
- package/dist/lib/node-esm/app-graph-builder-S4OAULX5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E2TK7Z4P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F63ZRXMK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2ZKXI5ET.mjs.map +0 -7
- package/dist/lib/node-esm/store-QQUTQHHT.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -86
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/worker.ts +0 -11
- /package/dist/lib/browser/{intent-dispatcher-QG7UPGQX.mjs.map → intent-dispatcher-LZ4AE66E.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → react/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-NXBGPJOX.mjs.map → intent-dispatcher-MGOJ3CHD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{worker.mjs.map → react/index.mjs.map} +0 -0
package/moon.yml
CHANGED
|
@@ -5,10 +5,14 @@ tags:
|
|
|
5
5
|
- ts-build
|
|
6
6
|
- ts-test
|
|
7
7
|
- typedoc
|
|
8
|
+
- storybook
|
|
8
9
|
tasks:
|
|
9
10
|
compile:
|
|
10
11
|
args:
|
|
11
12
|
- '--entryPoint=src/index.ts'
|
|
13
|
+
- '--entryPoint=src/react/index.ts'
|
|
12
14
|
- '--entryPoint=src/testing/index.ts'
|
|
13
|
-
- '--entryPoint=src/worker.ts'
|
|
14
15
|
- '--preactSignalTracking'
|
|
16
|
+
test:
|
|
17
|
+
inputs:
|
|
18
|
+
- .storybook/*
|
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.72ec0f3",
|
|
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",
|
|
@@ -15,69 +15,73 @@
|
|
|
15
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
16
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
|
+
"./react": {
|
|
19
|
+
"source": "./src/react/index.ts",
|
|
20
|
+
"types": "./dist/types/src/react/index.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/react/index.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/react/index.mjs"
|
|
23
|
+
},
|
|
18
24
|
"./testing": {
|
|
19
25
|
"source": "./src/testing/index.ts",
|
|
20
26
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
21
27
|
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
22
28
|
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
23
|
-
},
|
|
24
|
-
"./worker": {
|
|
25
|
-
"source": "./src/worker.ts",
|
|
26
|
-
"types": "./dist/types/src/worker.d.ts",
|
|
27
|
-
"browser": "./dist/lib/browser/worker.mjs",
|
|
28
|
-
"node": "./dist/lib/node-esm/worker.mjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"types": "dist/types/src/index.d.ts",
|
|
32
32
|
"typesVersions": {
|
|
33
33
|
"*": {
|
|
34
|
+
"react": [
|
|
35
|
+
"dist/types/src/react/index.d.ts"
|
|
36
|
+
],
|
|
34
37
|
"testing": [
|
|
35
38
|
"dist/types/src/testing/index.d.ts"
|
|
36
|
-
],
|
|
37
|
-
"worker": [
|
|
38
|
-
"dist/types/src/worker.d.ts"
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@effect/ai": "0.
|
|
43
|
+
"@effect/ai": "0.29.1",
|
|
44
|
+
"@effect/experimental": "0.56.0",
|
|
44
45
|
"@preact-signals/safe-react": "^0.9.0",
|
|
45
|
-
"@preact/signals-core": "^1.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/keys": "0.8.4-main.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
46
|
+
"@preact/signals-core": "^1.12.1",
|
|
47
|
+
"@dxos/app-graph": "0.8.4-main.72ec0f3",
|
|
48
|
+
"@dxos/assistant": "0.8.4-main.72ec0f3",
|
|
49
|
+
"@dxos/async": "0.8.4-main.72ec0f3",
|
|
50
|
+
"@dxos/blueprints": "0.8.4-main.72ec0f3",
|
|
51
|
+
"@dxos/ai": "0.8.4-main.72ec0f3",
|
|
52
|
+
"@dxos/echo": "0.8.4-main.72ec0f3",
|
|
53
|
+
"@dxos/functions": "0.8.4-main.72ec0f3",
|
|
54
|
+
"@dxos/live-object": "0.8.4-main.72ec0f3",
|
|
55
|
+
"@dxos/local-storage": "0.8.4-main.72ec0f3",
|
|
56
|
+
"@dxos/keys": "0.8.4-main.72ec0f3",
|
|
57
|
+
"@dxos/react-hooks": "0.8.4-main.72ec0f3",
|
|
58
|
+
"@dxos/debug": "0.8.4-main.72ec0f3",
|
|
59
|
+
"@dxos/client-protocol": "0.8.4-main.72ec0f3",
|
|
60
|
+
"@dxos/log": "0.8.4-main.72ec0f3",
|
|
61
|
+
"@dxos/invariant": "0.8.4-main.72ec0f3",
|
|
62
|
+
"@dxos/schema": "0.8.4-main.72ec0f3",
|
|
63
|
+
"@dxos/types": "0.8.4-main.72ec0f3",
|
|
64
|
+
"@dxos/util": "0.8.4-main.72ec0f3"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
|
-
"@effect-
|
|
65
|
-
"@effect/platform": "0.
|
|
66
|
-
"@types/react": "~
|
|
67
|
-
"effect": "3.
|
|
68
|
-
"react": "~
|
|
67
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
68
|
+
"@effect/platform": "0.92.1",
|
|
69
|
+
"@types/react": "~19.2.2",
|
|
70
|
+
"effect": "3.18.3",
|
|
71
|
+
"react": "~19.2.0",
|
|
69
72
|
"typedoc": "0.28.1",
|
|
70
|
-
"@dxos/echo-signals": "0.8.4-main.
|
|
71
|
-
"@dxos/random": "0.8.4-main.
|
|
72
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
73
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.
|
|
74
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
73
|
+
"@dxos/echo-signals": "0.8.4-main.72ec0f3",
|
|
74
|
+
"@dxos/random": "0.8.4-main.72ec0f3",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.72ec0f3",
|
|
76
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.72ec0f3",
|
|
77
|
+
"@dxos/storybook-utils": "0.8.4-main.72ec0f3",
|
|
78
|
+
"@dxos/react-ui-theme": "0.8.4-main.72ec0f3"
|
|
75
79
|
},
|
|
76
80
|
"peerDependencies": {
|
|
77
|
-
"@effect-
|
|
81
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
78
82
|
"@effect/platform": "^0.80.12",
|
|
79
83
|
"effect": "^3.13.3",
|
|
80
|
-
"react": "
|
|
84
|
+
"react": "^19.0.0"
|
|
81
85
|
},
|
|
82
86
|
"publishConfig": {
|
|
83
87
|
"access": "public"
|
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import { type Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Layer from 'effect/Layer';
|
|
7
|
+
import type * as Schema from 'effect/Schema';
|
|
8
8
|
import { type FC, type PropsWithChildren } from 'react';
|
|
9
9
|
|
|
10
|
+
import { type AiService } from '@dxos/ai';
|
|
11
|
+
import type * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
12
|
import { type BuilderExtensions, type GraphBuilder } from '@dxos/app-graph';
|
|
13
|
+
import { type GenericToolkit } from '@dxos/assistant';
|
|
11
14
|
import { type Blueprint } from '@dxos/blueprints';
|
|
12
15
|
import { type Space } from '@dxos/client-protocol';
|
|
13
16
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
14
17
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
15
|
-
import { type AnchoredTo } from '@dxos/
|
|
18
|
+
import { type AnchoredTo } from '@dxos/types';
|
|
16
19
|
|
|
17
20
|
import { type PluginManager, defineCapability } from '../core';
|
|
18
21
|
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
@@ -37,9 +40,13 @@ export namespace Capabilities {
|
|
|
37
40
|
/**
|
|
38
41
|
* @category Capability
|
|
39
42
|
*/
|
|
40
|
-
export const
|
|
43
|
+
export const AtomRegistry = defineCapability<Registry.Registry>('dxos.org/app-framework/capability/atom-registry');
|
|
41
44
|
|
|
42
|
-
export type ReactContext = Readonly<{
|
|
45
|
+
export type ReactContext = Readonly<{
|
|
46
|
+
id: string;
|
|
47
|
+
dependsOn?: string[];
|
|
48
|
+
context: FC<PropsWithChildren>;
|
|
49
|
+
}>;
|
|
43
50
|
|
|
44
51
|
/**
|
|
45
52
|
* @category Capability
|
|
@@ -147,7 +154,10 @@ export namespace Capabilities {
|
|
|
147
154
|
*/
|
|
148
155
|
export const Settings = defineCapability<Settings>('dxos.org/app-framework/capability/settings');
|
|
149
156
|
|
|
150
|
-
export type Metadata = Readonly<{
|
|
157
|
+
export type Metadata = Readonly<{
|
|
158
|
+
id: string;
|
|
159
|
+
metadata: Record<string, any>;
|
|
160
|
+
}>;
|
|
151
161
|
|
|
152
162
|
/**
|
|
153
163
|
* @category Capability
|
|
@@ -157,39 +167,44 @@ export namespace Capabilities {
|
|
|
157
167
|
/**
|
|
158
168
|
* @category Capability
|
|
159
169
|
*/
|
|
160
|
-
export const Toolkit = defineCapability<
|
|
170
|
+
export const Toolkit = defineCapability<GenericToolkit.GenericToolkit>(
|
|
171
|
+
'dxos.org/app-framework/capability/ai-toolkit',
|
|
172
|
+
);
|
|
161
173
|
|
|
162
174
|
/**
|
|
163
175
|
* @category Capability
|
|
164
176
|
*/
|
|
165
|
-
export const
|
|
166
|
-
'dxos.org/app-framework/capability/
|
|
177
|
+
export const BlueprintDefinition = defineCapability<Blueprint.Blueprint>(
|
|
178
|
+
'dxos.org/app-framework/capability/blueprint-definition',
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
182
|
+
export const AiServiceLayer = defineCapability<AiServiceLayer>(
|
|
183
|
+
'dxos.org/app-framework/capability/ai-service-factory',
|
|
167
184
|
);
|
|
168
185
|
|
|
169
186
|
/**
|
|
170
|
-
*
|
|
187
|
+
* Plugins can contribute them to provide model resolvers.
|
|
171
188
|
*/
|
|
172
|
-
export const
|
|
173
|
-
'dxos.org/app-framework/capability/
|
|
189
|
+
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
190
|
+
'dxos.org/app-framework/capability/ai-model-resolver',
|
|
174
191
|
);
|
|
175
192
|
|
|
176
193
|
/**
|
|
177
194
|
* @category Capability
|
|
178
195
|
*/
|
|
179
|
-
export const Functions = defineCapability<FunctionDefinition
|
|
180
|
-
'dxos.org/app-framework/capability/functions',
|
|
181
|
-
);
|
|
196
|
+
export const Functions = defineCapability<FunctionDefinition.Any[]>('dxos.org/app-framework/capability/functions');
|
|
182
197
|
|
|
183
|
-
export type FileUploader = (
|
|
198
|
+
export type FileUploader = (space: Space, file: File) => Promise<FileInfo | undefined>;
|
|
184
199
|
|
|
185
200
|
/**
|
|
186
201
|
* @category Capability
|
|
187
202
|
*/
|
|
188
203
|
export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');
|
|
189
204
|
|
|
190
|
-
type AnchorSort = {
|
|
205
|
+
export type AnchorSort = {
|
|
191
206
|
key: string;
|
|
192
|
-
sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
|
|
207
|
+
sort: (anchorA: AnchoredTo.AnchoredTo, anchorB: AnchoredTo.AnchoredTo) => number;
|
|
193
208
|
};
|
|
194
209
|
|
|
195
210
|
/**
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { ContentBlock } from '@dxos/types';
|
|
8
8
|
|
|
9
9
|
export namespace CollaborationActions {
|
|
10
10
|
export class AcceptProposal extends Schema.TaggedClass<AcceptProposal>()('collaboration/accept-proposal', {
|
|
11
11
|
input: Schema.Struct({
|
|
12
12
|
subject: Schema.Any,
|
|
13
13
|
anchor: Schema.String,
|
|
14
|
-
proposal:
|
|
14
|
+
proposal: ContentBlock.Proposal,
|
|
15
15
|
}),
|
|
16
16
|
output: Schema.Void,
|
|
17
17
|
}) {}
|
package/src/common/file.ts
CHANGED
package/src/common/layout.ts
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { Label } from '../plugin-intent';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
export const LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
9
|
+
const LAYOUT_PLUGIN = 'dxos.org/plugin/layout';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Expected payload for layout actions.
|
|
14
13
|
*/
|
|
15
14
|
export namespace LayoutAction {
|
|
16
|
-
export const UPDATE_LAYOUT = `${
|
|
15
|
+
export const UPDATE_LAYOUT = `${LAYOUT_PLUGIN}/action/update-layout`;
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* Generic layout action.
|
package/src/common/surface.ts
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type MakeOptional, type Position } from '@dxos/util';
|
|
8
8
|
|
|
9
9
|
import { type ErrorBoundary } from '../react';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* SurfaceProps are the props that are passed to the Surface component.
|
|
13
13
|
*/
|
|
14
|
-
export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
14
|
+
export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {
|
|
15
15
|
/**
|
|
16
16
|
* If specified, the Surface will be wrapped in an error boundary.
|
|
17
17
|
* The fallback component will be rendered if an error occurs.
|
|
@@ -23,17 +23,20 @@ export type SurfaceProps<T extends Record<string, any> = Record<string, unknown>
|
|
|
23
23
|
* The placeholder component will be rendered while the surface component is loading.
|
|
24
24
|
*/
|
|
25
25
|
placeholder?: ReactNode;
|
|
26
|
-
}> &
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
} & MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> &
|
|
27
|
+
/**
|
|
28
|
+
* Additional props to pass to the component.
|
|
29
|
+
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
30
|
+
* Exclude known prop names to prevent overriding well-defined props.
|
|
31
|
+
*/
|
|
32
|
+
{
|
|
33
|
+
[K in keyof Record<string, any>]: K extends keyof CoreSurfaceProps<T> | 'fallback' | 'placeholder' ? never : any;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.
|
|
38
|
+
*/
|
|
39
|
+
export type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
37
40
|
/**
|
|
38
41
|
* ID for debugging.
|
|
39
42
|
*/
|
|
@@ -46,6 +49,7 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
|
46
49
|
|
|
47
50
|
/**
|
|
48
51
|
* The data to be rendered by the surface.
|
|
52
|
+
* NOTE: This must be a stable value.
|
|
49
53
|
*/
|
|
50
54
|
data: T;
|
|
51
55
|
|
|
@@ -53,19 +57,17 @@ type CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> =
|
|
|
53
57
|
* If more than one component is resolved, the limit determines how many are rendered.
|
|
54
58
|
*/
|
|
55
59
|
limit?: number | undefined;
|
|
56
|
-
}
|
|
60
|
+
}>;
|
|
57
61
|
|
|
58
|
-
type SurfaceComponentProps<T extends Record<string, any> = Record<string,
|
|
59
|
-
|
|
60
|
-
>;
|
|
62
|
+
export type SurfaceComponentProps<T extends Record<string, any> = Record<string, any>> = CoreSurfaceProps<T> &
|
|
63
|
+
Record<string, any>;
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
66
|
* React component used to render a surface once is has matched.
|
|
64
67
|
*/
|
|
65
|
-
export type SurfaceComponent<T extends Record<string, any> = Record<string,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
) => JSX.Element | null;
|
|
68
|
+
export type SurfaceComponent<T extends Record<string, any> = Record<string, any>> = ComponentType<
|
|
69
|
+
SurfaceComponentProps<T>
|
|
70
|
+
>;
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
73
|
* Definition of when a SurfaceComponent should be rendered.
|
|
@@ -74,8 +76,8 @@ export type SurfaceDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
|
74
76
|
id: string;
|
|
75
77
|
role: string | string[];
|
|
76
78
|
position?: Position;
|
|
79
|
+
component: SurfaceComponent<T>;
|
|
77
80
|
filter?: (data: Record<string, unknown>) => data is T;
|
|
78
|
-
component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;
|
|
79
81
|
}>;
|
|
80
82
|
|
|
81
83
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
export const ResourceKey = Schema.Union(Schema.String, Schema.Record({ key: Schema.String, value: Schema.Any }));
|
|
8
8
|
export type ResourceKey = Schema.Schema.Type<typeof ResourceKey>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Registry } from '@effect-
|
|
6
|
-
import
|
|
5
|
+
import { Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
7
|
import { describe, expect, it, onTestFinished } from 'vitest';
|
|
8
8
|
|
|
9
9
|
import { PluginContext, defineCapability } from './capabilities';
|
package/src/core/capabilities.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Registry
|
|
6
|
-
import
|
|
5
|
+
import { Atom, type Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
@@ -41,17 +41,17 @@ export type Capability<T> = {
|
|
|
41
41
|
/**
|
|
42
42
|
* The interface definition of the capability.
|
|
43
43
|
*/
|
|
44
|
-
interface: InterfaceDef<T>;
|
|
44
|
+
readonly interface: InterfaceDef<T>;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* The implementation of the capability.
|
|
48
48
|
*/
|
|
49
|
-
implementation: T;
|
|
49
|
+
readonly implementation: T;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Called when the capability is deactivated.
|
|
53
53
|
*/
|
|
54
|
-
deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
|
|
54
|
+
readonly deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export type AnyCapability = Capability<any>;
|
|
@@ -78,7 +78,11 @@ export const contributes = <I extends InterfaceDef<any>>(
|
|
|
78
78
|
implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],
|
|
79
79
|
deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],
|
|
80
80
|
): Capability<I> => {
|
|
81
|
-
return {
|
|
81
|
+
return {
|
|
82
|
+
interface: interfaceDef,
|
|
83
|
+
implementation,
|
|
84
|
+
deactivate,
|
|
85
|
+
} satisfies Capability<I>;
|
|
82
86
|
};
|
|
83
87
|
|
|
84
88
|
type LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;
|
|
@@ -105,19 +109,19 @@ export const lazy =
|
|
|
105
109
|
export class PluginContext {
|
|
106
110
|
private readonly _registry: Registry.Registry;
|
|
107
111
|
|
|
108
|
-
private readonly _capabilityImpls =
|
|
109
|
-
return
|
|
112
|
+
private readonly _capabilityImpls = Atom.family<string, Atom.Writable<CapabilityImpl<unknown>[]>>(() => {
|
|
113
|
+
return Atom.make<CapabilityImpl<unknown>[]>([]).pipe(Atom.keepAlive);
|
|
110
114
|
});
|
|
111
115
|
|
|
112
|
-
readonly _capabilities =
|
|
113
|
-
return
|
|
116
|
+
readonly _capabilities = Atom.family<string, Atom.Atom<unknown[]>>((id: string) => {
|
|
117
|
+
return Atom.make((get) => {
|
|
114
118
|
const current = get(this._capabilityImpls(id));
|
|
115
119
|
return current.map((c) => c.implementation);
|
|
116
120
|
});
|
|
117
121
|
});
|
|
118
122
|
|
|
119
|
-
readonly _capability =
|
|
120
|
-
return
|
|
123
|
+
readonly _capability = Atom.family<string, Atom.Atom<unknown>>((id: string) => {
|
|
124
|
+
return Atom.make((get) => {
|
|
121
125
|
const current = get(this._capabilities(id));
|
|
122
126
|
invariant(current.length > 0, `No capability found for ${id}`);
|
|
123
127
|
return current[0];
|
|
@@ -189,26 +193,26 @@ export class PluginContext {
|
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
/**
|
|
192
|
-
* Get the
|
|
193
|
-
* Primarily useful for deriving other
|
|
196
|
+
* Get the Atom reference to the available capabilities for a given interface.
|
|
197
|
+
* Primarily useful for deriving other Atom values based on the capabilities or
|
|
194
198
|
* for subscribing to changes in the capabilities.
|
|
195
|
-
* @returns An
|
|
199
|
+
* @returns An atom reference to the available capabilities.
|
|
196
200
|
*/
|
|
197
|
-
capabilities<T>(interfaceDef: InterfaceDef<T>):
|
|
201
|
+
capabilities<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T[]> {
|
|
198
202
|
// NOTE: This the type-checking for capabilities is done at the time of contribution.
|
|
199
|
-
return this._capabilities(interfaceDef.identifier) as
|
|
203
|
+
return this._capabilities(interfaceDef.identifier) as Atom.Atom<T[]>;
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
/**
|
|
203
|
-
* Get the
|
|
204
|
-
* Primarily useful for deriving other
|
|
207
|
+
* Get the Atom reference to the available capabilities for a given interface.
|
|
208
|
+
* Primarily useful for deriving other Atom values based on the capability or
|
|
205
209
|
* for subscribing to changes in the capability.
|
|
206
|
-
* @returns An
|
|
210
|
+
* @returns An atom reference to the available capability.
|
|
207
211
|
* @throws If no capability is found.
|
|
208
212
|
*/
|
|
209
|
-
capability<T>(interfaceDef: InterfaceDef<T>):
|
|
213
|
+
capability<T>(interfaceDef: InterfaceDef<T>): Atom.Atom<T> {
|
|
210
214
|
// NOTE: This the type-checking for capabilities is done at the time of contribution.
|
|
211
|
-
return this._capability(interfaceDef.identifier) as
|
|
215
|
+
return this._capability(interfaceDef.identifier) as Atom.Atom<T>;
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
/**
|