@dxos/plugin-registry 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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/app-graph-builder-P3ZGGFAR.mjs +166 -0
- package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XPEFEID2.mjs → chunk-VOAOTNGS.mjs} +1 -1
- package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +223 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +22 -29
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs +24 -0
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs.map +7 -0
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs +337 -0
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs +167 -0
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +21 -0
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +224 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +63 -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/operation-resolver-3ZB5W3T3.mjs +25 -0
- package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs +338 -0
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +2 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/disable.d.ts +11 -0
- package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
- package/dist/types/src/cli/commands/enable.d.ts +11 -0
- package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +3 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/list.d.ts +7 -0
- package/dist/types/src/cli/commands/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/util.d.ts +11 -0
- package/dist/types/src/cli/commands/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +3 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/cli/storage.d.ts +18 -0
- package/dist/types/src/cli/storage.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail.d.ts +3 -3
- package/dist/types/src/components/PluginDetail.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts +1 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -1
- package/dist/types/src/components/PluginItem.d.ts +2 -2
- package/dist/types/src/components/PluginItem.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.d.ts +1 -1
- package/dist/types/src/components/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/components/RegistryContainer.d.ts +4 -3
- package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +47 -31
- package/src/RegistryPlugin.tsx +9 -24
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +136 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +99 -0
- package/src/cli/commands/disable.ts +47 -0
- package/src/cli/commands/enable.ts +44 -0
- package/src/cli/commands/index.ts +14 -0
- package/src/cli/commands/list.ts +41 -0
- package/src/cli/commands/util.ts +24 -0
- package/src/cli/index.ts +6 -0
- package/src/cli/plugin.ts +16 -0
- package/src/cli/storage.ts +57 -0
- package/src/components/PluginDetail.stories.tsx +14 -16
- package/src/components/PluginDetail.tsx +8 -11
- package/src/components/PluginItem.tsx +5 -5
- package/src/components/PluginList.stories.tsx +14 -17
- package/src/components/PluginList.tsx +2 -2
- package/src/components/RegistryContainer.tsx +43 -36
- package/src/meta.ts +2 -2
- package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs +0 -162
- package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs.map +0 -7
- package/dist/lib/browser/chunk-XPEFEID2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs +0 -23
- package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IGCXOVE2.mjs +0 -359
- package/dist/lib/browser/react-surface-IGCXOVE2.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- 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/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -156
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/capabilities/react-surface.tsx +0 -86
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
6
|
+
import * as Path from '@effect/platform/Path';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
|
+
|
|
10
|
+
import { DX_CONFIG, getProfilePath } from '@dxos/client-protocol';
|
|
11
|
+
|
|
12
|
+
// TODO(wittjosiah): Factor out to app-framework?
|
|
13
|
+
|
|
14
|
+
const PLUGINS_FILE = 'plugins.json';
|
|
15
|
+
|
|
16
|
+
const PluginsSchema = Schema.Array(Schema.String);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get the path to the plugins configuration file for a profile.
|
|
20
|
+
*/
|
|
21
|
+
const getPluginsPath = (profile: string): Effect.Effect<string, never, Path.Path> =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const path = yield* Path.Path;
|
|
24
|
+
return path.join(getProfilePath(DX_CONFIG, profile), PLUGINS_FILE);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Load enabled plugins from profile storage.
|
|
29
|
+
* Returns the list of enabled plugin IDs, or an empty array if the file doesn't exist.
|
|
30
|
+
*/
|
|
31
|
+
export const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: string }) {
|
|
32
|
+
const fs = yield* FileSystem.FileSystem;
|
|
33
|
+
const pluginsPath = yield* getPluginsPath(profile);
|
|
34
|
+
|
|
35
|
+
const content = yield* fs
|
|
36
|
+
.readFileString(pluginsPath)
|
|
37
|
+
.pipe(Effect.catchTag('SystemError', () => Effect.succeed('[]')));
|
|
38
|
+
|
|
39
|
+
const parsed = yield* Schema.decodeUnknown(Schema.parseJson(PluginsSchema))(content).pipe(
|
|
40
|
+
Effect.catchAll(() => Effect.succeed([] as string[])),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return parsed;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Save enabled plugins to profile storage.
|
|
48
|
+
*/
|
|
49
|
+
export const saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }: { profile: string; enabled: string[] }) {
|
|
50
|
+
const fs = yield* FileSystem.FileSystem;
|
|
51
|
+
const pluginsPath = yield* getPluginsPath(profile);
|
|
52
|
+
const profileDir = getProfilePath(DX_CONFIG, profile);
|
|
53
|
+
|
|
54
|
+
yield* fs.makeDirectory(profileDir, { recursive: true });
|
|
55
|
+
const encoded = Schema.encodeSync(Schema.parseJson(PluginsSchema))(enabled);
|
|
56
|
+
yield* fs.writeFileString(pluginsPath, encoded + '\n');
|
|
57
|
+
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
+
import { Plugin } from '@dxos/app-framework';
|
|
7
8
|
import { faker } from '@dxos/random';
|
|
8
9
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
10
|
|
|
@@ -14,7 +15,7 @@ import { PluginDetail } from './PluginDetail';
|
|
|
14
15
|
const meta = {
|
|
15
16
|
title: 'plugins/plugin-registry/PluginDetail',
|
|
16
17
|
component: PluginDetail,
|
|
17
|
-
decorators: [withTheme, withLayout({
|
|
18
|
+
decorators: [withTheme, withLayout({ layout: 'column' })],
|
|
18
19
|
parameters: {
|
|
19
20
|
translations,
|
|
20
21
|
},
|
|
@@ -26,20 +27,17 @@ type Story = StoryObj<typeof meta>;
|
|
|
26
27
|
|
|
27
28
|
export const Default: Story = {
|
|
28
29
|
args: {
|
|
29
|
-
plugin: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
modules: [],
|
|
43
|
-
},
|
|
30
|
+
plugin: Plugin.define({
|
|
31
|
+
id: 'example.com/plugin/test-plugin',
|
|
32
|
+
name: 'Test Plugin',
|
|
33
|
+
description: faker.lorem.paragraphs(2),
|
|
34
|
+
icon: 'ph--bug--regular',
|
|
35
|
+
iconHue: 'sky',
|
|
36
|
+
homePage: 'https://example.com',
|
|
37
|
+
source: 'https://github.com/example/test-plugin',
|
|
38
|
+
screenshots: [
|
|
39
|
+
'https://media.gcflearnfree.org/content/55e073de7dd48174331f51b3_01_17_2014/getting_started_interactive2.png',
|
|
40
|
+
],
|
|
41
|
+
}).pipe(Plugin.make)(),
|
|
44
42
|
},
|
|
45
43
|
};
|
|
@@ -6,18 +6,18 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { Icon, Input, Link, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import {
|
|
10
|
-
import { getStyles, mx } from '@dxos/
|
|
9
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
10
|
+
import { getStyles, mx } from '@dxos/ui-theme';
|
|
11
11
|
|
|
12
12
|
import { meta } from '../meta';
|
|
13
13
|
|
|
14
14
|
export type PluginDetailProps = {
|
|
15
|
-
plugin: Plugin;
|
|
15
|
+
plugin: Plugin.Plugin;
|
|
16
16
|
enabled?: boolean;
|
|
17
|
-
|
|
17
|
+
onEnabledChange?: (enabled: boolean) => void;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const PluginDetail = ({ plugin, enabled,
|
|
20
|
+
export const PluginDetail = ({ plugin, enabled, onEnabledChange }: PluginDetailProps) => {
|
|
21
21
|
const { t } = useTranslation(meta.id);
|
|
22
22
|
const {
|
|
23
23
|
id,
|
|
@@ -32,7 +32,7 @@ export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) =
|
|
|
32
32
|
const styles = getStyles(iconHue);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<
|
|
35
|
+
<Layout.Container scrollable>
|
|
36
36
|
<div role='none' className='grid grid-cols-[min-content_1fr] gap-4 container-max-width p-4'>
|
|
37
37
|
<div role='none'>
|
|
38
38
|
<Icon classNames={mx('p-1 rounded', styles.bg, styles.icon)} icon={icon} size={14} />
|
|
@@ -41,22 +41,19 @@ export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) =
|
|
|
41
41
|
<div role='none' className='grid grid-cols-[1fr_min-content] gap-x-3 is-full pbs-1'>
|
|
42
42
|
<h2 className='text-xl'>{name}</h2>
|
|
43
43
|
<Input.Root>
|
|
44
|
-
<Input.Switch classNames='self-center' checked={enabled}
|
|
44
|
+
<Input.Switch classNames='self-center' checked={enabled} onCheckedChange={onEnabledChange} />
|
|
45
45
|
</Input.Root>
|
|
46
46
|
<p className='pbs-0.5 text-sm text-description'>{id}</p>
|
|
47
47
|
</div>
|
|
48
|
-
|
|
49
48
|
<div role='none'>
|
|
50
49
|
<p className='text-description'>{description}</p>
|
|
51
50
|
</div>
|
|
52
|
-
|
|
53
51
|
{screenshots && screenshots.length > 0 && (
|
|
54
52
|
<div role='none' className='flex flex-col gap-2'>
|
|
55
53
|
<h2>Preview</h2>
|
|
56
54
|
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
57
55
|
</div>
|
|
58
56
|
)}
|
|
59
|
-
|
|
60
57
|
<div role='none' className='flex flex-col gap-2'>
|
|
61
58
|
<h2>Resources</h2>
|
|
62
59
|
<div className='flex gap-2'>
|
|
@@ -77,6 +74,6 @@ export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) =
|
|
|
77
74
|
</div>
|
|
78
75
|
</div>
|
|
79
76
|
</div>
|
|
80
|
-
</
|
|
77
|
+
</Layout.Container>
|
|
81
78
|
);
|
|
82
79
|
};
|
|
@@ -6,14 +6,14 @@ import React, { type MouseEvent, useCallback } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { type ChromaticPalette, Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionText, mx } from '@dxos/
|
|
10
|
-
import { getStyles } from '@dxos/
|
|
9
|
+
import { descriptionText, mx } from '@dxos/ui-theme';
|
|
10
|
+
import { getStyles } from '@dxos/ui-theme';
|
|
11
11
|
|
|
12
12
|
import { meta } from '../meta';
|
|
13
13
|
import { type RegistryTagType } from '../types';
|
|
14
14
|
|
|
15
15
|
export type PluginItemProps = {
|
|
16
|
-
plugin: Plugin;
|
|
16
|
+
plugin: Plugin.Plugin;
|
|
17
17
|
installed?: readonly string[];
|
|
18
18
|
enabled?: readonly string[];
|
|
19
19
|
onClick?: (id: string) => void;
|
|
@@ -27,7 +27,7 @@ export const PluginItem = ({
|
|
|
27
27
|
enabled = [],
|
|
28
28
|
onClick,
|
|
29
29
|
onChange,
|
|
30
|
-
hasSettings:
|
|
30
|
+
hasSettings: hasSettingsProp,
|
|
31
31
|
onSettings,
|
|
32
32
|
}: PluginItemProps) => {
|
|
33
33
|
const { t } = useTranslation(meta.id);
|
|
@@ -46,7 +46,7 @@ export const PluginItem = ({
|
|
|
46
46
|
[id, isEnabled, onChange],
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const hasSettings =
|
|
49
|
+
const hasSettings = hasSettingsProp?.(id) ?? false;
|
|
50
50
|
const handleSettings = useCallback(() => onSettings?.(id), [id, onSettings]);
|
|
51
51
|
const styles = getStyles(iconHue);
|
|
52
52
|
const gridCols = 'grid grid-cols-[5rem_1fr]';
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Plugin,
|
|
8
|
+
import { type Plugin, Plugin as PluginNS } from '@dxos/app-framework';
|
|
9
9
|
import { faker } from '@dxos/random';
|
|
10
10
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
-
import { getHashHue } from '@dxos/
|
|
11
|
+
import { getHashHue } from '@dxos/ui-theme';
|
|
12
12
|
|
|
13
13
|
import { translations } from '../translations';
|
|
14
14
|
import { RegistryTagType } from '../types';
|
|
@@ -27,22 +27,19 @@ const icons = [
|
|
|
27
27
|
];
|
|
28
28
|
|
|
29
29
|
const DefaultStory = () => {
|
|
30
|
-
const [plugins] = useState<Plugin[]>(
|
|
30
|
+
const [plugins] = useState<Plugin.Plugin[]>(
|
|
31
31
|
faker.helpers.multiple(
|
|
32
32
|
() =>
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
() => [],
|
|
45
|
-
)(),
|
|
33
|
+
PluginNS.define({
|
|
34
|
+
id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
|
|
35
|
+
name: `${faker.commerce.productName()}`,
|
|
36
|
+
description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
|
|
37
|
+
tags: faker.helpers.uniqueArray(RegistryTagType.literals as any, Math.floor(Math.random() * 3)),
|
|
38
|
+
icon: faker.helpers.arrayElement(icons),
|
|
39
|
+
iconHue: getHashHue(faker.string.uuid()),
|
|
40
|
+
homePage: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.url() : undefined,
|
|
41
|
+
source: faker.internet.url(),
|
|
42
|
+
}).pipe(PluginNS.make)(),
|
|
46
43
|
{ count: 32 },
|
|
47
44
|
),
|
|
48
45
|
);
|
|
@@ -69,7 +66,7 @@ export default meta;
|
|
|
69
66
|
type Story = StoryObj<typeof meta>;
|
|
70
67
|
|
|
71
68
|
export const Default: Story = {
|
|
72
|
-
decorators: [withTheme, withLayout({
|
|
69
|
+
decorators: [withTheme, withLayout({ layout: 'column', scroll: true })],
|
|
73
70
|
};
|
|
74
71
|
|
|
75
72
|
export const FullScreen: Story = {
|
|
@@ -10,12 +10,12 @@ import { List } from '@dxos/react-ui';
|
|
|
10
10
|
import { PluginItem, type PluginItemProps } from './PluginItem';
|
|
11
11
|
|
|
12
12
|
export type PluginListProps = Omit<PluginItemProps, 'plugin'> & {
|
|
13
|
-
plugins?: readonly Plugin[];
|
|
13
|
+
plugins?: readonly Plugin.Plugin[];
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const PluginList = ({ plugins = [], ...props }: PluginListProps) => {
|
|
17
17
|
return (
|
|
18
|
-
<List classNames='grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] gap-4 p-4'>
|
|
18
|
+
<List classNames='grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] auto-rows-[max-content] gap-4 p-4'>
|
|
19
19
|
{plugins.map((plugin) => (
|
|
20
20
|
<PluginItem key={plugin.meta.id} plugin={plugin} {...props} />
|
|
21
21
|
))}
|
|
@@ -2,75 +2,82 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
5
7
|
import React, { useCallback, useMemo } from 'react';
|
|
6
8
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Common, type Plugin, SettingsOperation } from '@dxos/app-framework';
|
|
10
|
+
import { useCapabilities, useOperationInvoker, usePluginManager } from '@dxos/app-framework/react';
|
|
11
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
12
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability/types';
|
|
13
|
+
import { Layout } from '@dxos/react-ui-mosaic';
|
|
11
14
|
|
|
12
15
|
import { PluginList } from './PluginList';
|
|
13
16
|
|
|
14
|
-
const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin, { meta: { name: b = '' } }: Plugin) =>
|
|
17
|
+
const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>
|
|
18
|
+
a.localeCompare(b);
|
|
15
19
|
|
|
16
|
-
export
|
|
20
|
+
export type RegistryContainerProps = {
|
|
21
|
+
id: string;
|
|
22
|
+
plugins: Plugin.Plugin[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const RegistryContainer = ({ id, plugins: pluginsProp }: RegistryContainerProps) => {
|
|
17
26
|
const manager = usePluginManager();
|
|
18
|
-
const {
|
|
19
|
-
const plugins = useMemo(() =>
|
|
20
|
-
const
|
|
27
|
+
const { invoke, invokePromise } = useOperationInvoker();
|
|
28
|
+
const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);
|
|
29
|
+
const enabled = useAtomValue(manager.enabled);
|
|
30
|
+
const allSettings = useCapabilities(Common.Capability.Settings);
|
|
21
31
|
|
|
22
32
|
// TODO(wittjosiah): Factor out to an intent?
|
|
23
33
|
const handleChange = useCallback(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
(id: string, enabled: boolean) =>
|
|
35
|
+
Effect.gen(function* () {
|
|
36
|
+
if (enabled) {
|
|
37
|
+
yield* manager.enable(id);
|
|
38
|
+
} else {
|
|
39
|
+
yield* manager.disable(id);
|
|
40
|
+
}
|
|
30
41
|
|
|
31
|
-
|
|
32
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
42
|
+
yield* invoke(ObservabilityOperation.SendEvent, {
|
|
33
43
|
name: 'plugins.toggle',
|
|
34
44
|
properties: {
|
|
35
45
|
plugin: id,
|
|
36
46
|
enabled,
|
|
37
47
|
},
|
|
38
|
-
})
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
[dispatch, manager],
|
|
48
|
+
});
|
|
49
|
+
}).pipe(runAndForwardErrors),
|
|
50
|
+
[invoke, manager],
|
|
42
51
|
);
|
|
43
52
|
|
|
44
53
|
const handleClick = useCallback(
|
|
45
54
|
(pluginId: string) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
),
|
|
54
|
-
[dispatch, id],
|
|
55
|
+
invokePromise(Common.LayoutOperation.Open, {
|
|
56
|
+
// TODO(wittjosiah): `/` currently is not supported in ids.
|
|
57
|
+
subject: [pluginId.replaceAll('/', ':')],
|
|
58
|
+
pivotId: id,
|
|
59
|
+
positioning: 'end',
|
|
60
|
+
}),
|
|
61
|
+
[invokePromise, id],
|
|
55
62
|
);
|
|
56
63
|
|
|
57
|
-
const hasSettings = useCallback((pluginId: string) =>
|
|
64
|
+
const hasSettings = useCallback((pluginId: string) => allSettings.some((s) => s.prefix === pluginId), [allSettings]);
|
|
58
65
|
|
|
59
66
|
const handleSettings = useCallback(
|
|
60
|
-
(pluginId: string) =>
|
|
61
|
-
[
|
|
67
|
+
(pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),
|
|
68
|
+
[invokePromise],
|
|
62
69
|
);
|
|
63
70
|
|
|
64
71
|
return (
|
|
65
|
-
<
|
|
72
|
+
<Layout.Container scrollable>
|
|
66
73
|
<PluginList
|
|
67
74
|
plugins={plugins}
|
|
68
|
-
enabled={
|
|
75
|
+
enabled={enabled}
|
|
69
76
|
onClick={handleClick}
|
|
70
77
|
onChange={handleChange}
|
|
71
78
|
hasSettings={hasSettings}
|
|
72
79
|
onSettings={handleSettings}
|
|
73
80
|
/>
|
|
74
|
-
</
|
|
81
|
+
</Layout.Container>
|
|
75
82
|
);
|
|
76
83
|
};
|
package/src/meta.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
// TODO(wittjosiah): Deck does not currently support `/` in ids.
|
|
@@ -11,7 +11,7 @@ import { trim } from '@dxos/util';
|
|
|
11
11
|
export const REGISTRY_ID = '!dxos:plugin-registry';
|
|
12
12
|
export const REGISTRY_KEY = 'plugin-registry';
|
|
13
13
|
|
|
14
|
-
export const meta:
|
|
14
|
+
export const meta: Plugin.Meta = {
|
|
15
15
|
id: 'dxos.org/plugin/registry',
|
|
16
16
|
name: 'Plugins',
|
|
17
17
|
description: trim`
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REGISTRY_ID,
|
|
3
|
-
REGISTRY_KEY,
|
|
4
|
-
meta
|
|
5
|
-
} from "./chunk-XPEFEID2.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/app-graph-builder.ts
|
|
8
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
9
|
-
import * as Function from "effect/Function";
|
|
10
|
-
import * as Option from "effect/Option";
|
|
11
|
-
import { Capabilities, SettingsAction, contributes, createIntent } from "@dxos/app-framework";
|
|
12
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
13
|
-
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
|
|
14
|
-
createExtension({
|
|
15
|
-
id: meta.id,
|
|
16
|
-
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
17
|
-
{
|
|
18
|
-
id: meta.id,
|
|
19
|
-
data: async () => {
|
|
20
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
21
|
-
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
22
|
-
},
|
|
23
|
-
properties: {
|
|
24
|
-
label: [
|
|
25
|
-
"open plugin registry label",
|
|
26
|
-
{
|
|
27
|
-
ns: meta.id
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
icon: "ph--squares-four--regular",
|
|
31
|
-
disposition: "menu"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]), Option.getOrElse(() => [])))
|
|
35
|
-
}),
|
|
36
|
-
createExtension({
|
|
37
|
-
id: meta.id,
|
|
38
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
39
|
-
{
|
|
40
|
-
id: REGISTRY_ID,
|
|
41
|
-
type: meta.id,
|
|
42
|
-
properties: {
|
|
43
|
-
label: [
|
|
44
|
-
"plugin registry label",
|
|
45
|
-
{
|
|
46
|
-
ns: meta.id
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
icon: "ph--squares-four--regular",
|
|
50
|
-
disposition: "pin-end",
|
|
51
|
-
testId: "treeView.pluginRegistry"
|
|
52
|
-
},
|
|
53
|
-
nodes: [
|
|
54
|
-
{
|
|
55
|
-
id: `${REGISTRY_KEY}+all`,
|
|
56
|
-
type: "category",
|
|
57
|
-
data: `${REGISTRY_KEY}+all`,
|
|
58
|
-
properties: {
|
|
59
|
-
label: [
|
|
60
|
-
"all plugins label",
|
|
61
|
-
{
|
|
62
|
-
ns: meta.id
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
icon: "ph--squares-four--regular",
|
|
66
|
-
key: REGISTRY_KEY,
|
|
67
|
-
testId: "pluginRegistry.all"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
72
|
-
type: "category",
|
|
73
|
-
data: `${REGISTRY_KEY}+installed`,
|
|
74
|
-
properties: {
|
|
75
|
-
label: [
|
|
76
|
-
"installed plugins label",
|
|
77
|
-
{
|
|
78
|
-
ns: meta.id
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
icon: "ph--check--regular",
|
|
82
|
-
key: REGISTRY_KEY,
|
|
83
|
-
testId: "pluginRegistry.installed"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
88
|
-
type: "category",
|
|
89
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
90
|
-
properties: {
|
|
91
|
-
label: [
|
|
92
|
-
"recommended plugins label",
|
|
93
|
-
{
|
|
94
|
-
ns: meta.id
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
icon: "ph--star--regular",
|
|
98
|
-
key: REGISTRY_KEY,
|
|
99
|
-
testId: "pluginRegistry.recommended"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
104
|
-
type: "category",
|
|
105
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
106
|
-
properties: {
|
|
107
|
-
label: [
|
|
108
|
-
"labs plugins label",
|
|
109
|
-
{
|
|
110
|
-
ns: meta.id
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
icon: "ph--flask--regular",
|
|
114
|
-
key: REGISTRY_KEY,
|
|
115
|
-
testId: "pluginRegistry.labs"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
]), Option.getOrElse(() => [])))
|
|
121
|
-
}),
|
|
122
|
-
createExtension({
|
|
123
|
-
id: `${meta.id}/actions`,
|
|
124
|
-
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
125
|
-
{
|
|
126
|
-
id: `${meta.id}/load-by-url`,
|
|
127
|
-
data: async () => {
|
|
128
|
-
},
|
|
129
|
-
properties: {
|
|
130
|
-
label: [
|
|
131
|
-
"load by url label",
|
|
132
|
-
{
|
|
133
|
-
ns: meta.id
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
icon: "ph--cloud-arrow-down--regular",
|
|
137
|
-
disabled: true
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
]), Option.getOrElse(() => [])))
|
|
141
|
-
}),
|
|
142
|
-
createExtension({
|
|
143
|
-
id: `${meta.id}/plugins`,
|
|
144
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
145
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
146
|
-
return manager.plugins.map((plugin) => ({
|
|
147
|
-
id: plugin.meta.id.replaceAll("/", ":"),
|
|
148
|
-
type: "dxos.org/plugin",
|
|
149
|
-
data: plugin,
|
|
150
|
-
properties: {
|
|
151
|
-
label: plugin.meta.name ?? plugin.meta.id,
|
|
152
|
-
icon: plugin.meta.icon ?? "ph--circle--regular",
|
|
153
|
-
disposition: "hidden"
|
|
154
|
-
}
|
|
155
|
-
}));
|
|
156
|
-
}), Option.getOrElse(() => [])))
|
|
157
|
-
})
|
|
158
|
-
]));
|
|
159
|
-
export {
|
|
160
|
-
app_graph_builder_default as default
|
|
161
|
-
};
|
|
162
|
-
//# sourceMappingURL=app-graph-builder-6CNBP3A4.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: meta.id,\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: meta.id,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.OpenPluginRegistry));\n },\n properties: {\n label: ['open plugin registry label', { ns: meta.id }],\n icon: 'ph--squares-four--regular',\n disposition: 'menu',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: meta.id,\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: REGISTRY_ID,\n type: meta.id,\n properties: {\n label: ['plugin registry label', { ns: meta.id }],\n icon: 'ph--squares-four--regular',\n disposition: 'pin-end',\n testId: 'treeView.pluginRegistry',\n },\n nodes: [\n {\n id: `${REGISTRY_KEY}+all`,\n type: 'category',\n data: `${REGISTRY_KEY}+all`,\n properties: {\n label: ['all plugins label', { ns: meta.id }],\n icon: 'ph--squares-four--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.all',\n },\n },\n {\n id: `${REGISTRY_KEY}+installed`,\n type: 'category',\n data: `${REGISTRY_KEY}+installed`,\n properties: {\n label: ['installed plugins label', { ns: meta.id }],\n icon: 'ph--check--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.installed',\n },\n },\n {\n id: `${REGISTRY_KEY}+recommended`,\n type: 'category',\n data: `${REGISTRY_KEY}+recommended`,\n properties: {\n label: ['recommended plugins label', { ns: meta.id }],\n icon: 'ph--star--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.recommended',\n },\n },\n {\n id: `${REGISTRY_KEY}+labs`,\n type: 'category',\n data: `${REGISTRY_KEY}+labs`,\n properties: {\n label: ['labs plugins label', { ns: meta.id }],\n icon: 'ph--flask--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.labs',\n },\n },\n ],\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/actions`,\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: `${meta.id}/load-by-url`,\n data: async () => {},\n properties: {\n label: ['load by url label', { ns: meta.id }],\n icon: 'ph--cloud-arrow-down--regular',\n disabled: true,\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/plugins`,\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const manager = context.getCapability(Capabilities.PluginManager);\n return manager.plugins.map((plugin) => ({\n id: plugin.meta.id.replaceAll('/', ':'),\n type: 'dxos.org/plugin',\n data: plugin,\n properties: {\n label: plugin.meta.name ?? plugin.meta.id,\n icon: plugin.meta.icon ?? 'ph--circle--regular',\n disposition: 'hidden',\n },\n }));\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Atom", "Function", "Option", "Capabilities", "SettingsAction", "contributes", "createIntent", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Atom", "make", "get", "pipe", "flatMap", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "SettingsAction", "OpenPluginRegistry", "properties", "label", "ns", "icon", "disposition", "getOrElse", "connector", "REGISTRY_ID", "type", "testId", "nodes", "REGISTRY_KEY", "key", "disabled", "manager", "PluginManager", "plugins", "plugin", "replaceAll", "name"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\n// TODO(wittjosiah): Deck does not currently support `/` in ids.\n// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n// Ideally this should be worked into the data model in a generic way.\nexport const REGISTRY_ID = '!dxos:plugin-registry';\nexport const REGISTRY_KEY = 'plugin-registry';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/registry',\n name: 'Plugins',\n description: trim`\n Plugin management system for discovering, installing, and configuring workspace extensions.\n Browse available plugins and customize your workspace capabilities.\n `,\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAKd,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;",
|
|
6
|
-
"names": ["trim", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name", "description", "trim"]
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REGISTRY_ID
|
|
3
|
-
} from "./chunk-XPEFEID2.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/intent-resolver.ts
|
|
6
|
-
import { Capabilities, LayoutAction, SettingsAction, contributes, createIntent, createResolver } from "@dxos/app-framework";
|
|
7
|
-
var intent_resolver_default = (() => contributes(Capabilities.IntentResolver, createResolver({
|
|
8
|
-
intent: SettingsAction.OpenPluginRegistry,
|
|
9
|
-
resolve: () => {
|
|
10
|
-
return {
|
|
11
|
-
intents: [
|
|
12
|
-
createIntent(LayoutAction.SwitchWorkspace, {
|
|
13
|
-
part: "workspace",
|
|
14
|
-
subject: REGISTRY_ID
|
|
15
|
-
})
|
|
16
|
-
]
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
})));
|
|
20
|
-
export {
|
|
21
|
-
intent_resolver_default as default
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=intent-resolver-LKNUYBTN.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n LayoutAction,\n SettingsAction,\n contributes,\n createIntent,\n createResolver,\n} from '@dxos/app-framework';\n\nimport { REGISTRY_ID } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: SettingsAction.OpenPluginRegistry,\n resolve: () => {\n return {\n intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],\n };\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SACEA,cACAC,cACAC,gBACAC,aACAC,cACAC,sBACK;AAIP,IAAA,2BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,MAAA;AACP,WAAO;MACLC,SAAS;QAACC,aAAaC,aAAaC,iBAAiB;UAAEC,MAAM;UAAaC,SAASC;QAAY,CAAA;;IACjG;EACF;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Capabilities", "LayoutAction", "SettingsAction", "contributes", "createIntent", "createResolver", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "SettingsAction", "OpenPluginRegistry", "resolve", "intents", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "REGISTRY_ID"]
|
|
7
|
-
}
|