@dxos/plugin-registry 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef
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/dist/lib/browser/cli/index.mjs +32 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -61
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +35 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +34 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +33 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/translations.mjs +37 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +3 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/RegistryPlugin.node.d.ts +4 -0
- package/dist/types/src/RegistryPlugin.node.d.ts.map +1 -0
- package/dist/types/src/RegistryPlugin.test.d.ts +2 -0
- package/dist/types/src/RegistryPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +7 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/commands/disable.d.ts +11 -0
- package/dist/types/src/commands/disable.d.ts.map +1 -0
- package/dist/types/src/commands/enable.d.ts +11 -0
- package/dist/types/src/commands/enable.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts +3 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/list.d.ts +7 -0
- package/dist/types/src/commands/list.d.ts.map +1 -0
- package/dist/types/src/commands/util.d.ts +11 -0
- package/dist/types/src/commands/util.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +22 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +42 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
- package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts +26 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts +13 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +41 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/index.d.ts +2 -0
- package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts +8 -0
- package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/CommunityRegistry/index.d.ts +2 -0
- package/dist/types/src/containers/CommunityRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts +2 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +14 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts +2 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
- package/dist/types/src/hooks/use-community-plugins.d.ts +16 -0
- package/dist/types/src/hooks/use-community-plugins.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +7 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
- package/dist/types/src/storage.d.ts +18 -0
- package/dist/types/src/storage.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +22 -16
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +14 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +77 -37
- package/src/RegistryPlugin.node.ts +19 -0
- package/src/RegistryPlugin.test.ts +24 -0
- package/src/RegistryPlugin.tsx +18 -25
- package/src/capabilities/app-graph-builder.ts +173 -135
- package/src/capabilities/index.ts +9 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +108 -73
- package/src/capabilities/state.ts +38 -0
- package/src/cli/index.ts +5 -0
- package/src/commands/disable.ts +47 -0
- package/src/commands/enable.ts +44 -0
- package/src/commands/index.ts +14 -0
- package/src/commands/list.ts +41 -0
- package/src/commands/util.ts +24 -0
- package/src/components/PluginDetail/PluginDetail.stories.tsx +44 -0
- package/src/components/PluginDetail/PluginDetail.tsx +106 -0
- package/src/components/PluginDetail/index.ts +5 -0
- package/src/components/PluginList/PluginItem.tsx +187 -0
- package/src/components/PluginList/PluginList.stories.tsx +87 -0
- package/src/components/PluginList/PluginList.tsx +29 -0
- package/src/components/PluginList/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/containers/CommunityRegistry/CommunityRegistry.tsx +181 -0
- package/src/containers/CommunityRegistry/index.ts +5 -0
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +86 -0
- package/src/containers/LoadPluginDialog/index.ts +5 -0
- package/src/containers/PluginArticle/PluginArticle.tsx +73 -0
- package/src/containers/PluginArticle/index.ts +5 -0
- package/src/containers/PluginRegistry/PluginRegistry.tsx +98 -0
- package/src/containers/PluginRegistry/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-auto-tags.ts +52 -0
- package/src/hooks/use-community-plugins.ts +35 -0
- package/src/index.ts +5 -1
- package/src/meta.ts +19 -7
- package/src/operations/index.ts +7 -0
- package/src/operations/open-plugin-registry.ts +21 -0
- package/src/storage.ts +50 -0
- package/src/translations.ts +22 -15
- package/src/types.ts +30 -1
- package/dist/lib/browser/app-graph-builder-YN3N2KW4.mjs +0 -161
- package/dist/lib/browser/app-graph-builder-YN3N2KW4.mjs.map +0 -7
- package/dist/lib/browser/chunk-MWZPWWWF.mjs +0 -14
- package/dist/lib/browser/chunk-MWZPWWWF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs +0 -23
- package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3CDFJHV3.mjs +0 -335
- package/dist/lib/browser/react-surface-3CDFJHV3.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Icon.stories.d.ts +0 -14
- package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.d.ts +0 -9
- package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts +0 -33
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/PluginItem.d.ts +0 -13
- package/dist/types/src/components/PluginItem.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.d.ts +0 -8
- package/dist/types/src/components/PluginList.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.stories.d.ts +0 -37
- package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
- package/dist/types/src/components/RegistryContainer.d.ts +0 -7
- package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/components/Icon.stories.tsx +0 -110
- package/src/components/PluginDetail.stories.tsx +0 -45
- package/src/components/PluginDetail.tsx +0 -65
- package/src/components/PluginItem.tsx +0 -119
- package/src/components/PluginList.stories.tsx +0 -83
- package/src/components/PluginList.tsx +0 -26
- package/src/components/RegistryContainer.tsx +0 -84
package/package.json
CHANGED
|
@@ -1,64 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-registry",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.abd8ff62ef",
|
|
4
4
|
"description": "Braneframe plugin gallery",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#meta": "./src/meta.ts",
|
|
20
|
+
"#operations": "./src/operations/index.ts",
|
|
21
|
+
"#translations": "./src/translations.ts",
|
|
22
|
+
"#plugin": {
|
|
23
|
+
"browser": "./src/RegistryPlugin.tsx",
|
|
24
|
+
"node": "./src/RegistryPlugin.node.ts",
|
|
25
|
+
"default": "./src/RegistryPlugin.tsx"
|
|
26
|
+
},
|
|
27
|
+
"#types": "./src/types.ts"
|
|
28
|
+
},
|
|
11
29
|
"exports": {
|
|
12
30
|
".": {
|
|
13
31
|
"source": "./src/index.ts",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
32
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
33
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
34
|
+
"types": "./dist/types/src/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./cli": {
|
|
37
|
+
"source": "./src/cli/index.ts",
|
|
38
|
+
"browser": "./dist/lib/browser/cli/index.mjs",
|
|
39
|
+
"node": "./dist/lib/node-esm/cli/index.mjs",
|
|
40
|
+
"types": "./dist/types/src/cli/index.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./translations": {
|
|
43
|
+
"source": "./src/translations.ts",
|
|
44
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
45
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
46
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
16
47
|
}
|
|
17
48
|
},
|
|
18
49
|
"types": "dist/types/src/index.d.ts",
|
|
19
|
-
"typesVersions": {
|
|
20
|
-
"*": {}
|
|
21
|
-
},
|
|
22
50
|
"files": [
|
|
23
51
|
"dist",
|
|
24
52
|
"src"
|
|
25
53
|
],
|
|
26
54
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
55
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
56
|
+
"@effect/cli": "0.73.2",
|
|
57
|
+
"yaml": "^2.8.2",
|
|
58
|
+
"@dxos/app-framework": "0.8.4-main.abd8ff62ef",
|
|
59
|
+
"@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
|
|
60
|
+
"@dxos/cli-util": "0.8.4-main.abd8ff62ef",
|
|
61
|
+
"@dxos/client-protocol": "0.8.4-main.abd8ff62ef",
|
|
62
|
+
"@dxos/context": "0.8.4-main.abd8ff62ef",
|
|
63
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
64
|
+
"@dxos/edge-client": "0.8.4-main.abd8ff62ef",
|
|
65
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
66
|
+
"@dxos/compute": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/invariant": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/log": "0.8.4-main.abd8ff62ef",
|
|
70
|
+
"@dxos/plugin-observability": "0.8.4-main.abd8ff62ef",
|
|
71
|
+
"@dxos/protocols": "0.8.4-main.abd8ff62ef",
|
|
72
|
+
"@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
|
|
73
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.abd8ff62ef",
|
|
74
|
+
"@dxos/react-edge-client": "0.8.4-main.abd8ff62ef",
|
|
75
|
+
"@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
|
|
76
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef",
|
|
77
|
+
"@dxos/plugin-client": "0.8.4-main.abd8ff62ef"
|
|
38
78
|
},
|
|
39
79
|
"devDependencies": {
|
|
40
|
-
"@effect-
|
|
41
|
-
"@effect/platform": "0.
|
|
42
|
-
"@
|
|
43
|
-
"@types/react": "~19.2.
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"react": "~19.2.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
80
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
81
|
+
"@effect/platform": "0.94.4",
|
|
82
|
+
"@types/react": "~19.2.7",
|
|
83
|
+
"@types/react-dom": "~19.2.3",
|
|
84
|
+
"effect": "3.20.0",
|
|
85
|
+
"react": "~19.2.3",
|
|
86
|
+
"react-dom": "~19.2.3",
|
|
87
|
+
"vite": "^8.0.10",
|
|
88
|
+
"@dxos/plugin-testing": "0.8.4-main.abd8ff62ef",
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
90
|
+
"@dxos/storybook-utils": "0.8.4-main.abd8ff62ef",
|
|
91
|
+
"@dxos/random": "0.8.4-main.abd8ff62ef",
|
|
92
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
53
93
|
},
|
|
54
94
|
"peerDependencies": {
|
|
55
|
-
"@effect-
|
|
56
|
-
"@effect/platform": "
|
|
57
|
-
"effect": "
|
|
58
|
-
"react": "
|
|
59
|
-
"react-dom": "
|
|
60
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
95
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
96
|
+
"@effect/platform": "0.94.4",
|
|
97
|
+
"effect": "3.20.0",
|
|
98
|
+
"react": "~19.2.3",
|
|
99
|
+
"react-dom": "~19.2.3",
|
|
100
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
101
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
62
102
|
},
|
|
63
103
|
"publishConfig": {
|
|
64
104
|
"access": "public"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { meta } from '#meta';
|
|
9
|
+
|
|
10
|
+
import { plugin } from './commands';
|
|
11
|
+
|
|
12
|
+
export const RegistryPlugin = Plugin.define(meta).pipe(
|
|
13
|
+
AppPlugin.addCommandModule({
|
|
14
|
+
commands: [plugin],
|
|
15
|
+
}),
|
|
16
|
+
Plugin.make,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default RegistryPlugin;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
8
|
+
|
|
9
|
+
import { RegistryPlugin } from '#plugin';
|
|
10
|
+
|
|
11
|
+
import { meta } from './meta';
|
|
12
|
+
|
|
13
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
14
|
+
|
|
15
|
+
describe('RegistryPlugin', () => {
|
|
16
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
17
|
+
await using harness = await createComposerTestApp({
|
|
18
|
+
plugins: [RegistryPlugin()],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// CLI commands activate on startup.
|
|
22
|
+
expect(harness.manager.getActive()).toContain(moduleId('cli-commands'));
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/RegistryPlugin.tsx
CHANGED
|
@@ -2,31 +2,24 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
6
8
|
|
|
7
|
-
import { AppGraphBuilder,
|
|
8
|
-
import { meta } from '
|
|
9
|
-
import { translations } from '
|
|
9
|
+
import { AppGraphBuilder, OperationHandler, ReactSurface, RegistryState } from '#capabilities';
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { translations } from '#translations';
|
|
10
12
|
|
|
11
|
-
export const RegistryPlugin =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const RegistryPlugin = Plugin.define(meta).pipe(
|
|
14
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
15
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
16
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
17
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
18
|
+
Plugin.addModule({
|
|
19
|
+
activatesOn: ClientEvents.ClientReady,
|
|
20
|
+
activate: RegistryState,
|
|
16
21
|
}),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
defineModule({
|
|
23
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
24
|
-
activatesOn: Events.SetupIntentResolver,
|
|
25
|
-
activate: IntentResolver,
|
|
26
|
-
}),
|
|
27
|
-
defineModule({
|
|
28
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
29
|
-
activatesOn: Events.SetupAppGraph,
|
|
30
|
-
activate: AppGraphBuilder,
|
|
31
|
-
}),
|
|
32
|
-
]);
|
|
22
|
+
Plugin.make,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default RegistryPlugin;
|
|
@@ -2,154 +2,192 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { Option, pipe } from 'effect';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
7
|
+
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
+
import { type PluginEntry } from '@dxos/protocols';
|
|
10
12
|
|
|
11
|
-
import { REGISTRY_ID, REGISTRY_KEY, meta } from '
|
|
13
|
+
import { REGISTRY_ID, REGISTRY_KEY, registryCategoryId, meta } from '#meta';
|
|
14
|
+
import { RegistryCapabilities } from '#types';
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
import { LOAD_PLUGIN_DIALOG } from '../containers';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Turns a community manifest entry into a minimal {@link Plugin.Plugin} so it
|
|
20
|
+
* can be attached as the graph node's `data`. The synthesized plugin has no
|
|
21
|
+
* modules and only exists so the article surface can render details for
|
|
22
|
+
* community plugins that haven't been installed yet.
|
|
23
|
+
*/
|
|
24
|
+
const toDisplayPlugin = (entry: PluginEntry): Plugin.Plugin =>
|
|
25
|
+
({
|
|
26
|
+
[Plugin.PluginTypeId]: Plugin.PluginTypeId,
|
|
27
|
+
meta: entry.meta,
|
|
28
|
+
modules: [],
|
|
29
|
+
}) as Plugin.Plugin;
|
|
30
|
+
|
|
31
|
+
export default Capability.makeModule(
|
|
32
|
+
Effect.fnUntraced(function* () {
|
|
33
|
+
const capabilities = yield* Capability.Service;
|
|
34
|
+
|
|
35
|
+
const extensions = yield* Effect.all([
|
|
36
|
+
GraphBuilder.createExtension({
|
|
37
|
+
id: 'open-registry',
|
|
38
|
+
match: NodeMatcher.whenRoot,
|
|
39
|
+
actions: () =>
|
|
40
|
+
Effect.succeed([
|
|
41
|
+
{
|
|
42
|
+
id: 'open-registry',
|
|
43
|
+
data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
|
|
44
|
+
properties: {
|
|
45
|
+
label: ['open-plugin-registry.label', { ns: meta.id }],
|
|
46
|
+
icon: 'ph--squares-four--regular',
|
|
47
|
+
disposition: 'menu',
|
|
34
48
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
},
|
|
50
|
+
]),
|
|
51
|
+
}),
|
|
52
|
+
GraphBuilder.createExtension({
|
|
53
|
+
id: 'registry',
|
|
54
|
+
match: NodeMatcher.whenRoot,
|
|
55
|
+
connector: () =>
|
|
56
|
+
Effect.succeed([
|
|
57
|
+
Node.make({
|
|
58
|
+
id: REGISTRY_ID,
|
|
59
|
+
type: meta.id,
|
|
60
|
+
properties: {
|
|
61
|
+
label: ['plugin-registry.label', { ns: meta.id }],
|
|
62
|
+
icon: 'ph--squares-four--regular',
|
|
63
|
+
disposition: 'pin-end',
|
|
64
|
+
position: 'hoist',
|
|
65
|
+
testId: 'treeView.pluginRegistry',
|
|
66
|
+
},
|
|
67
|
+
nodes: [
|
|
68
|
+
Node.make({
|
|
69
|
+
id: registryCategoryId('official'),
|
|
70
|
+
type: 'category',
|
|
71
|
+
data: registryCategoryId('official'),
|
|
72
|
+
properties: {
|
|
73
|
+
label: ['official-plugins.label', { ns: meta.id }],
|
|
74
|
+
icon: 'ph--squares-four--regular',
|
|
75
|
+
key: REGISTRY_KEY,
|
|
76
|
+
testId: 'pluginRegistry.official',
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
Node.make({
|
|
80
|
+
id: registryCategoryId('installed'),
|
|
81
|
+
type: 'category',
|
|
82
|
+
data: registryCategoryId('installed'),
|
|
83
|
+
properties: {
|
|
84
|
+
label: ['installed-plugins.label', { ns: meta.id }],
|
|
85
|
+
icon: 'ph--check--regular',
|
|
86
|
+
key: REGISTRY_KEY,
|
|
87
|
+
testId: 'pluginRegistry.installed',
|
|
68
88
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
}),
|
|
90
|
+
Node.make({
|
|
91
|
+
id: registryCategoryId('recommended'),
|
|
92
|
+
type: 'category',
|
|
93
|
+
data: registryCategoryId('recommended'),
|
|
94
|
+
properties: {
|
|
95
|
+
label: ['recommended-plugins.label', { ns: meta.id }],
|
|
96
|
+
icon: 'ph--star--regular',
|
|
97
|
+
key: REGISTRY_KEY,
|
|
98
|
+
testId: 'pluginRegistry.recommended',
|
|
79
99
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
}),
|
|
101
|
+
Node.make({
|
|
102
|
+
id: registryCategoryId('labs'),
|
|
103
|
+
type: 'category',
|
|
104
|
+
data: registryCategoryId('labs'),
|
|
105
|
+
properties: {
|
|
106
|
+
label: ['labs-plugins.label', { ns: meta.id }],
|
|
107
|
+
icon: 'ph--flask--regular',
|
|
108
|
+
key: REGISTRY_KEY,
|
|
109
|
+
testId: 'pluginRegistry.labs',
|
|
90
110
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
}),
|
|
112
|
+
Node.make({
|
|
113
|
+
id: registryCategoryId('community'),
|
|
114
|
+
type: 'category',
|
|
115
|
+
data: registryCategoryId('community'),
|
|
116
|
+
properties: {
|
|
117
|
+
label: ['community-plugins.label', { ns: meta.id }],
|
|
118
|
+
icon: 'ph--users-three--regular',
|
|
119
|
+
key: REGISTRY_KEY,
|
|
120
|
+
testId: 'pluginRegistry.community',
|
|
101
121
|
},
|
|
102
|
-
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
}),
|
|
125
|
+
]),
|
|
126
|
+
}),
|
|
127
|
+
GraphBuilder.createExtension({
|
|
128
|
+
id: 'actions',
|
|
129
|
+
match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
|
|
130
|
+
actions: () =>
|
|
131
|
+
Effect.succeed([
|
|
132
|
+
{
|
|
133
|
+
id: 'load-by-url',
|
|
134
|
+
data: Effect.fnUntraced(function* () {
|
|
135
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
136
|
+
subject: LOAD_PLUGIN_DIALOG,
|
|
137
|
+
state: true,
|
|
138
|
+
});
|
|
139
|
+
}),
|
|
140
|
+
properties: {
|
|
141
|
+
label: ['load-by-url.label', { ns: meta.id }],
|
|
142
|
+
icon: 'ph--cloud-arrow-down--regular',
|
|
143
|
+
disposition: 'list-item-primary',
|
|
103
144
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
145
|
+
},
|
|
146
|
+
]),
|
|
147
|
+
}),
|
|
148
|
+
GraphBuilder.createExtension({
|
|
149
|
+
id: 'plugins',
|
|
150
|
+
match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
|
|
151
|
+
connector: (_node, get) => {
|
|
152
|
+
const manager = capabilities.get(Capabilities.PluginManager);
|
|
153
|
+
const installedIds = new Set(manager.getPlugins().map((plugin) => plugin.meta.id));
|
|
154
|
+
const stateAtom = capabilities.getAll(RegistryCapabilities.State).at(0);
|
|
155
|
+
|
|
156
|
+
const installedNodes = manager.getPlugins().map((plugin) =>
|
|
157
|
+
Node.make({
|
|
158
|
+
id: plugin.meta.id,
|
|
159
|
+
type: 'org.dxos.plugin',
|
|
160
|
+
data: plugin,
|
|
161
|
+
properties: {
|
|
162
|
+
label: plugin.meta.name ?? plugin.meta.id,
|
|
163
|
+
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
164
|
+
disposition: 'hidden',
|
|
125
165
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
138
|
-
Option.map(() => {
|
|
139
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
140
|
-
return manager.plugins.map((plugin) => ({
|
|
141
|
-
id: plugin.meta.id.replaceAll('/', ':'),
|
|
142
|
-
type: 'dxos.org/plugin',
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const communityEntries = stateAtom ? get(stateAtom).entries : [];
|
|
170
|
+
const communityNodes = communityEntries
|
|
171
|
+
.filter((entry) => !installedIds.has(entry.meta.id))
|
|
172
|
+
.map((entry) => {
|
|
173
|
+
const plugin = toDisplayPlugin(entry);
|
|
174
|
+
return Node.make({
|
|
175
|
+
id: plugin.meta.id,
|
|
176
|
+
type: 'org.dxos.plugin',
|
|
143
177
|
data: plugin,
|
|
144
178
|
properties: {
|
|
145
179
|
label: plugin.meta.name ?? plugin.meta.id,
|
|
146
180
|
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
147
181
|
disposition: 'hidden',
|
|
148
182
|
},
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
return Effect.succeed([...installedNodes, ...communityNodes]);
|
|
187
|
+
},
|
|
188
|
+
}),
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
192
|
+
}),
|
|
193
|
+
);
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
7
|
|
|
7
|
-
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
-
export const
|
|
9
|
-
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
14
|
+
export const RegistryState = Capability.lazy('RegistryState', () => import('./state'));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { RegistryOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, RegistryOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|