@dxos/app-framework 0.8.4-main.c1de068 → 0.8.4-main.fd6878d
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/v7_linux_x86_64_13.0.0/c614d7475354583212fbd7669acbae95b9832c305bf51bdaabe2e6de05abb6bf +0 -0
- package/dist/lib/browser/{app-graph-builder-LYF7EKNN.mjs → app-graph-builder-MOVKFH3J.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-MOVKFH3J.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMN65HSW.mjs → chunk-NKCIDYDI.mjs} +302 -223
- package/dist/lib/browser/chunk-NKCIDYDI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FO2PH7M3.mjs → chunk-OSBZFKMO.mjs} +35 -22
- package/dist/lib/browser/chunk-OSBZFKMO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs → intent-dispatcher-FTTJLVGN.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-ZTNOSO3A.mjs → intent-resolver-ZCGEAG3E.mjs} +2 -2
- package/dist/lib/browser/intent-resolver-ZCGEAG3E.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-KML2R4IE.mjs → store-3QB6Q2BC.mjs} +2 -2
- package/dist/lib/browser/{store-KML2R4IE.mjs.map → store-3QB6Q2BC.mjs.map} +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/browser/worker.mjs +1 -1
- package/dist/lib/node-esm/{app-graph-builder-SAOWGJDK.mjs → app-graph-builder-ODE4B5GT.mjs} +3 -3
- package/dist/lib/node-esm/app-graph-builder-ODE4B5GT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73HGSHKE.mjs → chunk-WU3QN5B6.mjs} +35 -22
- package/dist/lib/node-esm/chunk-WU3QN5B6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZEZ4FVEU.mjs → chunk-YEN7NKTF.mjs} +302 -223
- package/dist/lib/node-esm/chunk-YEN7NKTF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs → intent-dispatcher-YQIQ55LJ.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-W7Z7WFFM.mjs → intent-resolver-KG27L7EQ.mjs} +2 -2
- package/dist/lib/node-esm/intent-resolver-KG27L7EQ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs → store-TIJAVO3D.mjs} +2 -2
- package/dist/lib/node-esm/{store-QEXGXLWZ.mjs.map → store-TIJAVO3D.mjs.map} +1 -1
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/worker.mjs +1 -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 +79 -6
- package/dist/types/src/common/capabilities.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.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/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +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.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +2 -2
- 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.map +1 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +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.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.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -24
- package/src/App.tsx +11 -3
- package/src/common/capabilities.ts +96 -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 +1 -0
- 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 +4 -3
- package/src/plugin-intent/IntentPlugin.ts +2 -1
- package/src/plugin-intent/intent-dispatcher.test.ts +1 -1
- package/src/plugin-intent/intent-dispatcher.ts +6 -5
- 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 +3 -2
- 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 +3 -2
- package/src/testing/withPluginManager.tsx +8 -5
- 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-FTTJLVGN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-6CYNGPSW.mjs.map → intent-dispatcher-YQIQ55LJ.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.fd6878d",
|
|
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,16 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./testing": {
|
|
19
|
+
"source": "./src/testing/index.ts",
|
|
18
20
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
21
23
|
},
|
|
22
24
|
"./worker": {
|
|
25
|
+
"source": "./src/worker.ts",
|
|
23
26
|
"types": "./dist/types/src/worker.d.ts",
|
|
24
27
|
"browser": "./dist/lib/browser/worker.mjs",
|
|
25
28
|
"node": "./dist/lib/node-esm/worker.mjs"
|
|
@@ -37,37 +40,38 @@
|
|
|
37
40
|
}
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
43
|
+
"@effect/ai": "0.25.2",
|
|
40
44
|
"@preact-signals/safe-react": "^0.9.0",
|
|
41
45
|
"@preact/signals-core": "^1.9.0",
|
|
42
|
-
"@dxos/ai": "0.8.4-main.
|
|
43
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
44
|
-
"@dxos/async": "0.8.4-main.
|
|
45
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/invariant": "0.8.4-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/schema": "0.8.4-main.
|
|
56
|
-
"@dxos/util": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
46
|
+
"@dxos/ai": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/app-graph": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/blueprints": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/client-protocol": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/functions": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/keys": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
58
|
+
"@dxos/react-hooks": "0.8.4-main.fd6878d",
|
|
59
|
+
"@dxos/schema": "0.8.4-main.fd6878d",
|
|
60
|
+
"@dxos/util": "0.8.4-main.fd6878d",
|
|
61
|
+
"@dxos/debug": "0.8.4-main.fd6878d"
|
|
58
62
|
},
|
|
59
63
|
"devDependencies": {
|
|
60
64
|
"@effect-rx/rx-react": "0.38.0",
|
|
61
|
-
"@effect/platform": "0.
|
|
65
|
+
"@effect/platform": "0.90.2",
|
|
62
66
|
"@types/react": "~18.2.0",
|
|
63
|
-
"effect": "3.17.
|
|
67
|
+
"effect": "3.17.7",
|
|
64
68
|
"react": "~18.2.0",
|
|
65
69
|
"typedoc": "0.28.1",
|
|
66
|
-
"@dxos/echo-signals": "0.8.4-main.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
70
|
+
"@dxos/echo-signals": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
72
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.fd6878d",
|
|
73
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
74
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
71
75
|
},
|
|
72
76
|
"peerDependencies": {
|
|
73
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
11
|
import { 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
|
|
|
@@ -248,7 +248,15 @@ const App = ({ placeholder: Placeholder, state }: AppProps) => {
|
|
|
248
248
|
// Default fallback does not use tailwind or theme.
|
|
249
249
|
const DefaultFallback = ({ error }: { error: Error }) => {
|
|
250
250
|
return (
|
|
251
|
-
<div
|
|
251
|
+
<div
|
|
252
|
+
style={{
|
|
253
|
+
margin: '1rem',
|
|
254
|
+
padding: '1rem',
|
|
255
|
+
overflow: 'hidden',
|
|
256
|
+
border: '4px solid teal',
|
|
257
|
+
borderRadius: '1rem',
|
|
258
|
+
}}
|
|
259
|
+
>
|
|
252
260
|
{/* TODO(wittjosiah): Link to docs for replacing default. */}
|
|
253
261
|
<h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>[ERROR]: {error.message}</h1>
|
|
254
262
|
<pre style={{ overflow: 'auto', fontSize: '1rem', whiteSpace: 'pre-wrap', color: '#888888' }}>{error.stack}</pre>
|
|
@@ -2,44 +2,75 @@
|
|
|
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
10
|
import { type ExecutableTool } from '@dxos/ai';
|
|
10
|
-
import { type
|
|
11
|
-
import { type
|
|
11
|
+
import { type BuilderExtensions, type GraphBuilder } from '@dxos/app-graph';
|
|
12
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
12
13
|
import { type Space } from '@dxos/client-protocol';
|
|
13
14
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
14
15
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
15
16
|
import { type AnchoredTo } from '@dxos/schema';
|
|
16
17
|
|
|
18
|
+
import { type PluginManager, defineCapability } from '../core';
|
|
19
|
+
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
20
|
+
|
|
17
21
|
import { type FileInfo } from './file';
|
|
18
22
|
import { type NodeSerializer } from './graph';
|
|
19
23
|
import { type SurfaceDefinition } from './surface';
|
|
20
24
|
import { type Resource } from './translations';
|
|
21
|
-
import { type PluginManager, defineCapability } from '../core';
|
|
22
|
-
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
23
25
|
|
|
26
|
+
// TODO(burdon): Sort.
|
|
24
27
|
export namespace Capabilities {
|
|
28
|
+
/**
|
|
29
|
+
* @category Capability
|
|
30
|
+
*/
|
|
25
31
|
export const Null = defineCapability<null>('dxos.org/app-framework/capability/null');
|
|
26
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @category Capability
|
|
35
|
+
*/
|
|
27
36
|
export const PluginManager = defineCapability<PluginManager>('dxos.org/app-framework/capability/plugin-manager');
|
|
28
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @category Capability
|
|
40
|
+
*/
|
|
29
41
|
export const RxRegistry = defineCapability<Registry.Registry>('dxos.org/app-framework/capability/rx-registry');
|
|
30
42
|
|
|
31
43
|
export type ReactContext = Readonly<{ id: string; dependsOn?: string[]; context: FC<PropsWithChildren> }>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @category Capability
|
|
47
|
+
*/
|
|
32
48
|
export const ReactContext = defineCapability<ReactContext>('dxos.org/app-framework/capability/react-context');
|
|
33
49
|
|
|
34
50
|
export type ReactRoot = Readonly<{ id: string; root: FC<PropsWithChildren> }>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @category Capability
|
|
54
|
+
*/
|
|
35
55
|
export const ReactRoot = defineCapability<ReactRoot>('dxos.org/app-framework/capability/react-root');
|
|
36
56
|
|
|
37
57
|
export type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @category Capability
|
|
61
|
+
*/
|
|
38
62
|
export const ReactSurface = defineCapability<ReactSurface>('dxos.org/app-framework/common/react-surface');
|
|
39
63
|
|
|
40
64
|
export type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @category Capability
|
|
68
|
+
*/
|
|
41
69
|
export const IntentResolver = defineCapability<IntentResolver>('dxos.org/app-framework/capability/intent-resolver');
|
|
42
70
|
|
|
71
|
+
/**
|
|
72
|
+
* @category Capability
|
|
73
|
+
*/
|
|
43
74
|
export const IntentDispatcher = defineCapability<IntentContext>(
|
|
44
75
|
'dxos.org/app-framework/capability/intent-dispatcher',
|
|
45
76
|
);
|
|
@@ -66,23 +97,41 @@ export namespace Capabilities {
|
|
|
66
97
|
*/
|
|
67
98
|
scrollIntoView: string | undefined;
|
|
68
99
|
}>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @category Capability
|
|
103
|
+
*/
|
|
69
104
|
export const Layout = defineCapability<Layout>('dxos.org/app-framework/capability/layout');
|
|
70
105
|
|
|
71
|
-
|
|
106
|
+
/**
|
|
107
|
+
* @category Capability
|
|
108
|
+
*/
|
|
72
109
|
export const Translations = defineCapability<Readonly<Resource[]>>('dxos.org/app-framework/capability/translations');
|
|
73
110
|
|
|
111
|
+
/**
|
|
112
|
+
* @category Capability
|
|
113
|
+
*/
|
|
74
114
|
export const AppGraph = defineCapability<Readonly<Pick<GraphBuilder, 'graph' | 'explore'>>>(
|
|
75
115
|
'dxos.org/app-framework/capability/app-graph',
|
|
76
116
|
);
|
|
77
117
|
|
|
118
|
+
/**
|
|
119
|
+
* @category Capability
|
|
120
|
+
*/
|
|
78
121
|
export const AppGraphBuilder = defineCapability<BuilderExtensions>(
|
|
79
122
|
'dxos.org/app-framework/capability/app-graph-builder',
|
|
80
123
|
);
|
|
81
124
|
|
|
125
|
+
/**
|
|
126
|
+
* @category Capability
|
|
127
|
+
*/
|
|
82
128
|
export const AppGraphSerializer = defineCapability<NodeSerializer[]>(
|
|
83
129
|
'dxos.org/app-framework/capability/app-graph-serializer',
|
|
84
130
|
);
|
|
85
131
|
|
|
132
|
+
/**
|
|
133
|
+
* @category Capability
|
|
134
|
+
*/
|
|
86
135
|
export const SettingsStore = defineCapability<RootSettingsStore>('dxos.org/app-framework/capability/settings-store');
|
|
87
136
|
|
|
88
137
|
// TODO(wittjosiah): The generics caused type inference issues for schemas when contributing settings.
|
|
@@ -93,26 +142,65 @@ export namespace Capabilities {
|
|
|
93
142
|
schema: Schema.Schema.All;
|
|
94
143
|
value?: Record<string, any>;
|
|
95
144
|
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @category Capability
|
|
148
|
+
*/
|
|
96
149
|
export const Settings = defineCapability<Settings>('dxos.org/app-framework/capability/settings');
|
|
97
150
|
|
|
98
151
|
export type Metadata = Readonly<{ id: string; metadata: Record<string, any> }>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @category Capability
|
|
155
|
+
*/
|
|
99
156
|
export const Metadata = defineCapability<Metadata>('dxos.org/app-framework/capability/metadata');
|
|
100
157
|
|
|
158
|
+
/**
|
|
159
|
+
* @category Capability
|
|
160
|
+
* @deprecated
|
|
161
|
+
*/
|
|
101
162
|
export const Tools = defineCapability<ExecutableTool[]>('dxos.org/app-framework/capability/tools');
|
|
102
|
-
|
|
103
|
-
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @category Capability
|
|
166
|
+
*/
|
|
167
|
+
export const Toolkit = defineCapability<AiToolkit.Any>('dxos.org/app-framework/capability/ai-toolkit');
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @category Capability
|
|
171
|
+
*/
|
|
172
|
+
export const ToolkitHandler = defineCapability<Layer.Layer<AiTool.ToHandler<AiTool.AiTool<any>>, never, never>>(
|
|
173
|
+
'dxos.org/app-framework/capability/ai-toolkit-handler',
|
|
104
174
|
);
|
|
105
175
|
|
|
176
|
+
/**
|
|
177
|
+
* @category Capability
|
|
178
|
+
*/
|
|
179
|
+
export const BlueprintDefinition = defineCapability<Blueprint.Blueprint>(
|
|
180
|
+
'dxos.org/app-framework/capability/blueprint-definition',
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @category Capability
|
|
185
|
+
*/
|
|
106
186
|
export const Functions = defineCapability<FunctionDefinition<any, any>[]>(
|
|
107
187
|
'dxos.org/app-framework/capability/functions',
|
|
108
188
|
);
|
|
109
189
|
|
|
110
190
|
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @category Capability
|
|
194
|
+
*/
|
|
111
195
|
export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');
|
|
112
196
|
|
|
113
197
|
type AnchorSort = {
|
|
114
198
|
key: string;
|
|
115
199
|
sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
|
|
116
200
|
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @category Capability
|
|
204
|
+
*/
|
|
117
205
|
export const AnchorSort = defineCapability<AnchorSort>('dxos.org/app-framework/capability/anchor-sort');
|
|
118
206
|
}
|
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
|
@@ -79,6 +79,7 @@ export const contributes = <T>(
|
|
|
79
79
|
|
|
80
80
|
type LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;
|
|
81
81
|
type LoadCapabilities<T> = () => Promise<{ default: (props: T) => MaybePromise<AnyCapability[]> }>;
|
|
82
|
+
|
|
82
83
|
// TODO(wittjosiah): Not having the array be `any` causes type errors when using the lazy capability.
|
|
83
84
|
type LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;
|
|
84
85
|
|
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
|
|