@dxos/plugin-registry 0.8.4-main.c85a9c8dae → 0.8.4-main.d05673bc65
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/{PluginArticle-MLBF7AFA.mjs → PluginArticle-74DKRXJH.mjs} +3 -3
- package/dist/lib/browser/{PluginRegistry-ENAI4SAY.mjs → PluginRegistry-DORQQ7GM.mjs} +6 -5
- package/dist/lib/browser/PluginRegistry-DORQQ7GM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-2HXD7SOS.mjs → app-graph-builder-AHS5BI4Y.mjs} +9 -9
- package/dist/lib/browser/{app-graph-builder-2HXD7SOS.mjs.map → app-graph-builder-AHS5BI4Y.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-VOAOTNGS.mjs → chunk-KMUDYITM.mjs} +4 -2
- package/dist/lib/browser/chunk-KMUDYITM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TSNK3SAR.mjs → chunk-QQUG6FNW.mjs} +2 -2
- package/dist/lib/browser/cli/index.mjs +12 -14
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +6 -4
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-7P3NNVSR.mjs → operation-resolver-PK4B2BZQ.mjs} +4 -4
- package/dist/lib/browser/operation-resolver-PK4B2BZQ.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-DH25DIRH.mjs → react-surface-HPLHM3SK.mjs} +9 -9
- package/dist/lib/browser/{react-surface-DH25DIRH.mjs.map → react-surface-HPLHM3SK.mjs.map} +1 -1
- package/dist/lib/node-esm/{PluginArticle-TP2G6GGI.mjs → PluginArticle-JPVC7NXQ.mjs} +3 -3
- package/dist/lib/node-esm/{PluginRegistry-CWIZIQNX.mjs → PluginRegistry-3ZB4DFF7.mjs} +6 -5
- package/dist/lib/node-esm/PluginRegistry-3ZB4DFF7.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-2LNPN72O.mjs → app-graph-builder-DBDL5WWF.mjs} +9 -9
- package/dist/lib/node-esm/{app-graph-builder-2LNPN72O.mjs.map → app-graph-builder-DBDL5WWF.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-SALMIZ2W.mjs → chunk-ENSNUFQK.mjs} +4 -2
- package/dist/lib/node-esm/chunk-ENSNUFQK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4XO63XB6.mjs → chunk-II5WBDYI.mjs} +2 -2
- package/dist/lib/node-esm/cli/index.mjs +12 -14
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +6 -4
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-B24QW6IF.mjs → operation-resolver-CCHN4NBP.mjs} +4 -4
- package/dist/lib/node-esm/operation-resolver-CCHN4NBP.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-3YBEVL65.mjs → react-surface-GM64KKI3.mjs} +9 -9
- package/dist/lib/node-esm/{react-surface-3YBEVL65.mjs.map → react-surface-GM64KKI3.mjs.map} +1 -1
- package/dist/types/src/cli/commands/disable.d.ts +2 -2
- package/dist/types/src/cli/commands/enable.d.ts +2 -2
- package/dist/types/src/cli/storage.d.ts +4 -4
- package/dist/types/src/cli/storage.d.ts.map +1 -1
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -21
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +7 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +5 -5
- package/src/cli/storage.ts +14 -21
- package/src/components/PluginList/PluginList.stories.tsx +1 -1
- package/src/containers/PluginRegistry/PluginRegistry.tsx +2 -2
- package/src/meta.ts +4 -4
- package/dist/lib/browser/PluginRegistry-ENAI4SAY.mjs.map +0 -7
- package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +0 -7
- package/dist/lib/node-esm/PluginRegistry-CWIZIQNX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +0 -7
- /package/dist/lib/browser/{PluginArticle-MLBF7AFA.mjs.map → PluginArticle-74DKRXJH.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-TSNK3SAR.mjs.map → chunk-QQUG6FNW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{PluginArticle-TP2G6GGI.mjs.map → PluginArticle-JPVC7NXQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-4XO63XB6.mjs.map → chunk-II5WBDYI.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-registry",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.d05673bc65",
|
|
4
4
|
"description": "Braneframe plugin gallery",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -37,20 +37,21 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@effect-atom/atom-react": "^0.5.0",
|
|
39
39
|
"@effect/cli": "0.73.2",
|
|
40
|
-
"
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/effect": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/
|
|
40
|
+
"yaml": "^2.7.0",
|
|
41
|
+
"@dxos/app-toolkit": "0.8.4-main.d05673bc65",
|
|
42
|
+
"@dxos/client-protocol": "0.8.4-main.d05673bc65",
|
|
43
|
+
"@dxos/echo": "0.8.4-main.d05673bc65",
|
|
44
|
+
"@dxos/app-framework": "0.8.4-main.d05673bc65",
|
|
45
|
+
"@dxos/effect": "0.8.4-main.d05673bc65",
|
|
46
|
+
"@dxos/cli-util": "0.8.4-main.d05673bc65",
|
|
47
|
+
"@dxos/invariant": "0.8.4-main.d05673bc65",
|
|
48
|
+
"@dxos/operation": "0.8.4-main.d05673bc65",
|
|
49
|
+
"@dxos/plugin-graph": "0.8.4-main.d05673bc65",
|
|
50
|
+
"@dxos/plugin-observability": "0.8.4-main.d05673bc65",
|
|
51
|
+
"@dxos/react-ui-form": "0.8.4-main.d05673bc65",
|
|
52
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.d05673bc65",
|
|
53
|
+
"@dxos/react-ui-stack": "0.8.4-main.d05673bc65",
|
|
54
|
+
"@dxos/util": "0.8.4-main.d05673bc65"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -61,10 +62,10 @@
|
|
|
61
62
|
"react": "~19.2.3",
|
|
62
63
|
"react-dom": "~19.2.3",
|
|
63
64
|
"vite": "^7.1.11",
|
|
64
|
-
"@dxos/random": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
65
|
+
"@dxos/random": "0.8.4-main.d05673bc65",
|
|
66
|
+
"@dxos/storybook-utils": "0.8.4-main.d05673bc65",
|
|
67
|
+
"@dxos/react-ui": "0.8.4-main.d05673bc65",
|
|
68
|
+
"@dxos/ui-theme": "0.8.4-main.d05673bc65"
|
|
68
69
|
},
|
|
69
70
|
"peerDependencies": {
|
|
70
71
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -72,8 +73,8 @@
|
|
|
72
73
|
"effect": "3.19.16",
|
|
73
74
|
"react": "~19.2.3",
|
|
74
75
|
"react-dom": "~19.2.3",
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/ui
|
|
76
|
+
"@dxos/ui-theme": "0.8.4-main.d05673bc65",
|
|
77
|
+
"@dxos/react-ui": "0.8.4-main.d05673bc65"
|
|
77
78
|
},
|
|
78
79
|
"publishConfig": {
|
|
79
80
|
"access": "public"
|
|
@@ -96,12 +96,12 @@ export default Capability.makeModule(
|
|
|
96
96
|
]),
|
|
97
97
|
}),
|
|
98
98
|
GraphBuilder.createExtension({
|
|
99
|
-
id: `${meta.id}
|
|
100
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
99
|
+
id: `${meta.id}.actions`,
|
|
100
|
+
match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
|
|
101
101
|
actions: () =>
|
|
102
102
|
Effect.succeed([
|
|
103
103
|
{
|
|
104
|
-
id: `${meta.id}
|
|
104
|
+
id: `${meta.id}.load-by-url`,
|
|
105
105
|
data: Effect.fnUntraced(function* () {}),
|
|
106
106
|
properties: {
|
|
107
107
|
label: ['load by url label', { ns: meta.id }],
|
|
@@ -112,14 +112,14 @@ export default Capability.makeModule(
|
|
|
112
112
|
]),
|
|
113
113
|
}),
|
|
114
114
|
GraphBuilder.createExtension({
|
|
115
|
-
id: `${meta.id}
|
|
116
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
115
|
+
id: `${meta.id}.plugins`,
|
|
116
|
+
match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
|
|
117
117
|
connector: () => {
|
|
118
118
|
const manager = capabilities.get(Capabilities.PluginManager);
|
|
119
119
|
return Effect.succeed(
|
|
120
120
|
manager.getPlugins().map((plugin) => ({
|
|
121
|
-
id: plugin.meta.id
|
|
122
|
-
type: 'dxos.
|
|
121
|
+
id: plugin.meta.id,
|
|
122
|
+
type: 'org.dxos.plugin',
|
|
123
123
|
data: plugin,
|
|
124
124
|
properties: {
|
|
125
125
|
label: plugin.meta.name ?? plugin.meta.id,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
8
|
+
import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation, OperationResolver } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
import { REGISTRY_ID } from '../../meta';
|
|
@@ -16,7 +16,7 @@ export default Capability.makeModule(
|
|
|
16
16
|
OperationResolver.make({
|
|
17
17
|
operation: SettingsOperation.OpenPluginRegistry,
|
|
18
18
|
handler: Effect.fnUntraced(function* () {
|
|
19
|
-
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: REGISTRY_ID });
|
|
19
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(REGISTRY_ID) });
|
|
20
20
|
}),
|
|
21
21
|
}),
|
|
22
22
|
]);
|
|
@@ -15,7 +15,7 @@ export default Capability.makeModule(() =>
|
|
|
15
15
|
Effect.succeed(
|
|
16
16
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
17
17
|
Surface.create({
|
|
18
|
-
id: `${meta.id}
|
|
18
|
+
id: `${meta.id}.all`,
|
|
19
19
|
role: 'article',
|
|
20
20
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}>all`,
|
|
21
21
|
component: () => {
|
|
@@ -29,7 +29,7 @@ export default Capability.makeModule(() =>
|
|
|
29
29
|
},
|
|
30
30
|
}),
|
|
31
31
|
Surface.create({
|
|
32
|
-
id: `${meta.id}
|
|
32
|
+
id: `${meta.id}.installed`,
|
|
33
33
|
role: 'article',
|
|
34
34
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}>installed`,
|
|
35
35
|
component: () => {
|
|
@@ -47,7 +47,7 @@ export default Capability.makeModule(() =>
|
|
|
47
47
|
},
|
|
48
48
|
}),
|
|
49
49
|
Surface.create({
|
|
50
|
-
id: `${meta.id}
|
|
50
|
+
id: `${meta.id}.recommended`,
|
|
51
51
|
role: 'article',
|
|
52
52
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}>recommended`,
|
|
53
53
|
component: () => {
|
|
@@ -65,7 +65,7 @@ export default Capability.makeModule(() =>
|
|
|
65
65
|
},
|
|
66
66
|
}),
|
|
67
67
|
Surface.create({
|
|
68
|
-
id: `${meta.id}
|
|
68
|
+
id: `${meta.id}.labs`,
|
|
69
69
|
role: 'article',
|
|
70
70
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}>labs`,
|
|
71
71
|
component: () => {
|
|
@@ -76,7 +76,7 @@ export default Capability.makeModule(() =>
|
|
|
76
76
|
},
|
|
77
77
|
}),
|
|
78
78
|
Surface.create({
|
|
79
|
-
id: `${meta.id}
|
|
79
|
+
id: `${meta.id}.plugin-details`,
|
|
80
80
|
role: 'article',
|
|
81
81
|
filter: (data): data is { subject: Plugin.Plugin } => Plugin.isPlugin(data.subject),
|
|
82
82
|
component: ({ data: { subject } }) => {
|
package/src/cli/storage.ts
CHANGED
|
@@ -6,37 +6,31 @@ import * as FileSystem from '@effect/platform/FileSystem';
|
|
|
6
6
|
import * as Path from '@effect/platform/Path';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
import * as Schema from 'effect/Schema';
|
|
9
|
+
import * as Yaml from 'yaml';
|
|
9
10
|
|
|
10
|
-
import { DX_CONFIG
|
|
11
|
+
import { DX_CONFIG } from '@dxos/client-protocol';
|
|
11
12
|
|
|
12
13
|
// TODO(wittjosiah): Factor out to app-framework?
|
|
13
14
|
|
|
14
|
-
const PLUGINS_FILE = 'plugins.json';
|
|
15
|
-
|
|
16
15
|
const PluginsSchema = Schema.Array(Schema.String);
|
|
17
16
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
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
|
-
});
|
|
17
|
+
/** CLI-only: path to plugins/<profile>.yml (sibling to profile/). */
|
|
18
|
+
const getPluginsConfigPath = (profile: string) => `${DX_CONFIG}/plugins/${profile}.yml`;
|
|
26
19
|
|
|
27
20
|
/**
|
|
28
|
-
* Load enabled plugins from profile
|
|
21
|
+
* Load enabled plugins from plugins/<profile>.yml (sibling to profile/).
|
|
29
22
|
* Returns the list of enabled plugin IDs, or an empty array if the file doesn't exist.
|
|
30
23
|
*/
|
|
31
24
|
export const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: string }) {
|
|
32
25
|
const fs = yield* FileSystem.FileSystem;
|
|
33
|
-
const pluginsPath =
|
|
26
|
+
const pluginsPath = getPluginsConfigPath(profile);
|
|
34
27
|
|
|
35
28
|
const content = yield* fs
|
|
36
29
|
.readFileString(pluginsPath)
|
|
37
30
|
.pipe(Effect.catchTag('SystemError', () => Effect.succeed('[]')));
|
|
38
31
|
|
|
39
|
-
const
|
|
32
|
+
const raw = Yaml.parse(content);
|
|
33
|
+
const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(
|
|
40
34
|
Effect.catchAll(() => Effect.succeed([] as string[])),
|
|
41
35
|
);
|
|
42
36
|
|
|
@@ -44,14 +38,13 @@ export const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: s
|
|
|
44
38
|
});
|
|
45
39
|
|
|
46
40
|
/**
|
|
47
|
-
* Save enabled plugins to profile
|
|
41
|
+
* Save enabled plugins to plugins/<profile>.yml.
|
|
48
42
|
*/
|
|
49
43
|
export const saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }: { profile: string; enabled: string[] }) {
|
|
50
44
|
const fs = yield* FileSystem.FileSystem;
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
yield* fs.writeFileString(pluginsPath, encoded + '\n');
|
|
45
|
+
const path = yield* Path.Path;
|
|
46
|
+
const pluginsPath = getPluginsConfigPath(profile);
|
|
47
|
+
yield* fs.makeDirectory(path.dirname(pluginsPath), { recursive: true });
|
|
48
|
+
const encoded = Yaml.stringify(enabled);
|
|
49
|
+
yield* fs.writeFileString(pluginsPath, encoded);
|
|
57
50
|
});
|
|
@@ -32,7 +32,7 @@ const DefaultStory = () => {
|
|
|
32
32
|
faker.helpers.multiple(
|
|
33
33
|
() =>
|
|
34
34
|
PluginNS.define({
|
|
35
|
-
id: `dxos.
|
|
35
|
+
id: `org.dxos.plugin.plugin-${faker.string.uuid()}`,
|
|
36
36
|
name: `${faker.commerce.productName()}`,
|
|
37
37
|
description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
|
|
38
38
|
tags: faker.helpers.uniqueArray(RegistryTagType.literals as any, Math.floor(Math.random() * 3)),
|
|
@@ -14,6 +14,7 @@ import { ObservabilityOperation } from '@dxos/plugin-observability/types';
|
|
|
14
14
|
import { ScrollArea } from '@dxos/react-ui';
|
|
15
15
|
|
|
16
16
|
import { PluginList } from '../../components';
|
|
17
|
+
import { getPluginPath } from '../../meta';
|
|
17
18
|
|
|
18
19
|
const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>
|
|
19
20
|
a.localeCompare(b);
|
|
@@ -54,8 +55,7 @@ export const PluginRegistry = ({ id, plugins: pluginsProp }: PluginRegistryProps
|
|
|
54
55
|
const handleClick = useCallback(
|
|
55
56
|
(pluginId: string) =>
|
|
56
57
|
invokePromise(LayoutOperation.Open, {
|
|
57
|
-
|
|
58
|
-
subject: [pluginId.replaceAll('/', ':')],
|
|
58
|
+
subject: [getPluginPath(pluginId)],
|
|
59
59
|
pivotId: id,
|
|
60
60
|
positioning: 'end',
|
|
61
61
|
}),
|
package/src/meta.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
// TODO(wittjosiah): Deck does not currently support `/` in ids.
|
|
9
|
-
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
10
|
-
// Ideally this should be worked into the data model in a generic way.
|
|
11
8
|
export const REGISTRY_ID = '!dxos:plugin-registry';
|
|
12
9
|
export const REGISTRY_KEY = 'plugin-registry';
|
|
13
10
|
|
|
11
|
+
/** Qualified graph path to a specific plugin node. */
|
|
12
|
+
export const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/${pluginId}`;
|
|
13
|
+
|
|
14
14
|
export const meta: Plugin.Meta = {
|
|
15
|
-
id: 'dxos.
|
|
15
|
+
id: 'org.dxos.plugin.registry',
|
|
16
16
|
name: 'Plugins',
|
|
17
17
|
description: trim`
|
|
18
18
|
Plugin management system for discovering, installing, and configuring workspace extensions.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/PluginRegistry/PluginRegistry.tsx", "../../../src/containers/PluginRegistry/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { useCapabilities, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { ScrollArea } from '@dxos/react-ui';\n\nimport { PluginList } from '../../components';\n\nconst sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>\n a.localeCompare(b);\n\nexport type PluginRegistryProps = {\n id: string;\n plugins: Plugin.Plugin[];\n};\n\nexport const PluginRegistry = ({ id, plugins: pluginsProp }: PluginRegistryProps) => {\n const manager = usePluginManager();\n const { invoke, invokePromise } = useOperationInvoker();\n const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);\n const enabled = useAtomValue(manager.enabled);\n const allSettings = useCapabilities(AppCapabilities.Settings);\n\n // TODO(wittjosiah): Factor out to an intent?\n const handleChange = useCallback(\n (id: string, enabled: boolean) =>\n Effect.gen(function* () {\n if (enabled) {\n yield* manager.enable(id);\n } else {\n yield* manager.disable(id);\n }\n\n yield* invoke(ObservabilityOperation.SendEvent, {\n name: 'plugins.toggle',\n properties: {\n plugin: id,\n enabled,\n },\n });\n }).pipe(runAndForwardErrors),\n [invoke, manager],\n );\n\n const handleClick = useCallback(\n (pluginId: string) =>\n invokePromise(LayoutOperation.Open, {\n // TODO(wittjosiah): `/` currently is not supported in ids.\n subject: [pluginId.replaceAll('/', ':')],\n pivotId: id,\n positioning: 'end',\n }),\n [invokePromise, id],\n );\n\n const hasSettings = useCallback((pluginId: string) => allSettings.some((s) => s.prefix === pluginId), [allSettings]);\n\n const handleSettings = useCallback(\n (pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),\n [invokePromise],\n );\n\n return (\n <ScrollArea.Root orientation='vertical'>\n <ScrollArea.Viewport>\n <PluginList\n plugins={plugins}\n enabled={enabled}\n onClick={handleClick}\n onChange={handleChange}\n hasSettings={hasSettings}\n onSettings={handleSettings}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PluginRegistry } from './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;IAAC5B;IAAeN;GAAG;AAGrB,QAAMmC,cAAclB,YAAY,CAACW,aAAqBhB,YAAYwB,KAAK,CAACC,MAAMA,EAAEC,WAAWV,QAAAA,GAAW;IAAChB;GAAY;AAEnH,QAAM2B,iBAAiBtB,YACrB,CAACW,aAAqBtB,cAAckC,kBAAkBV,MAAM;IAAEN,QAAQI;EAAS,CAAA,GAC/E;IAACtB;GAAc;AAGjB,SACE,sBAAA,cAACmC,WAAWC,MAAI;IAACC,aAAY;KAC3B,sBAAA,cAACF,WAAWG,UAAQ,MAClB,sBAAA,cAACC,YAAAA;IACC5C;IACAS;IACAoC,SAASnB;IACToB,UAAU/B;IACVmB;IACAa,YAAYT;;AAKtB;;;AC/EA,IAAA,yBAAeU;",
|
|
6
|
-
"names": ["useAtomValue", "Effect", "React", "useCallback", "useMemo", "useCapabilities", "useOperationInvoker", "usePluginManager", "AppCapabilities", "LayoutOperation", "SettingsOperation", "runAndForwardErrors", "ObservabilityOperation", "ScrollArea", "sortByPluginMeta", "meta", "name", "a", "b", "localeCompare", "PluginRegistry", "id", "plugins", "pluginsProp", "manager", "usePluginManager", "invoke", "invokePromise", "useOperationInvoker", "useMemo", "sort", "enabled", "useAtomValue", "allSettings", "useCapabilities", "AppCapabilities", "Settings", "handleChange", "useCallback", "gen", "enable", "disable", "ObservabilityOperation", "SendEvent", "properties", "plugin", "pipe", "runAndForwardErrors", "handleClick", "pluginId", "LayoutOperation", "Open", "subject", "replaceAll", "pivotId", "positioning", "hasSettings", "some", "s", "prefix", "handleSettings", "SettingsOperation", "ScrollArea", "Root", "orientation", "Viewport", "PluginList", "onClick", "onChange", "onSettings", "PluginRegistry"]
|
|
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 Plugin } 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: Plugin.Meta = {\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,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;",
|
|
6
|
-
"names": ["trim", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name", "description", "trim"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { Operation, OperationResolver } from '@dxos/operation';\n\nimport { REGISTRY_ID } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: REGISTRY_ID });\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,WAAWC,yBAAyB;AAI7C,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;IAC5DA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAgBR,kBAAW,aAAA;AACzB,eAAOS,UAAUC,OAAOC,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;MAClF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "Operation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "SettingsOperation", "OpenPluginRegistry", "handler", "Operation", "invoke", "LayoutOperation", "SwitchWorkspace", "subject", "REGISTRY_ID"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/PluginRegistry/PluginRegistry.tsx", "../../../src/containers/PluginRegistry/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { useCapabilities, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { ScrollArea } from '@dxos/react-ui';\n\nimport { PluginList } from '../../components';\n\nconst sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>\n a.localeCompare(b);\n\nexport type PluginRegistryProps = {\n id: string;\n plugins: Plugin.Plugin[];\n};\n\nexport const PluginRegistry = ({ id, plugins: pluginsProp }: PluginRegistryProps) => {\n const manager = usePluginManager();\n const { invoke, invokePromise } = useOperationInvoker();\n const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);\n const enabled = useAtomValue(manager.enabled);\n const allSettings = useCapabilities(AppCapabilities.Settings);\n\n // TODO(wittjosiah): Factor out to an intent?\n const handleChange = useCallback(\n (id: string, enabled: boolean) =>\n Effect.gen(function* () {\n if (enabled) {\n yield* manager.enable(id);\n } else {\n yield* manager.disable(id);\n }\n\n yield* invoke(ObservabilityOperation.SendEvent, {\n name: 'plugins.toggle',\n properties: {\n plugin: id,\n enabled,\n },\n });\n }).pipe(runAndForwardErrors),\n [invoke, manager],\n );\n\n const handleClick = useCallback(\n (pluginId: string) =>\n invokePromise(LayoutOperation.Open, {\n // TODO(wittjosiah): `/` currently is not supported in ids.\n subject: [pluginId.replaceAll('/', ':')],\n pivotId: id,\n positioning: 'end',\n }),\n [invokePromise, id],\n );\n\n const hasSettings = useCallback((pluginId: string) => allSettings.some((s) => s.prefix === pluginId), [allSettings]);\n\n const handleSettings = useCallback(\n (pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),\n [invokePromise],\n );\n\n return (\n <ScrollArea.Root orientation='vertical'>\n <ScrollArea.Viewport>\n <PluginList\n plugins={plugins}\n enabled={enabled}\n onClick={handleClick}\n onChange={handleChange}\n hasSettings={hasSettings}\n onSettings={handleSettings}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PluginRegistry } from './PluginRegistry';\n\nexport default PluginRegistry;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,oBAAoB;AAC7B,YAAYC,YAAY;AACxB,OAAOC,SAASC,aAAaC,eAAe;AAG5C,SAASC,iBAAiBC,qBAAqBC,wBAAwB;AACvE,SAASC,iBAAiBC,iBAAiBC,yBAAyB;AACpE,SAASC,2BAA2B;AACpC,SAASC,8BAA8B;AACvC,SA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E,sBAAA,cAACmC,WAAWC,MAAI;IAACC,aAAY;KAC3B,sBAAA,cAACF,WAAWG,UAAQ,MAClB,sBAAA,cAACC,YAAAA;IACC5C;IACAS;IACAoC,SAASnB;IACToB,UAAU/B;IACVmB;IACAa,YAAYT;;AAKtB;;;AC/EA,IAAA,yBAAeU;",
|
|
6
|
-
"names": ["useAtomValue", "Effect", "React", "useCallback", "useMemo", "useCapabilities", "useOperationInvoker", "usePluginManager", "AppCapabilities", "LayoutOperation", "SettingsOperation", "runAndForwardErrors", "ObservabilityOperation", "ScrollArea", "sortByPluginMeta", "meta", "name", "a", "b", "localeCompare", "PluginRegistry", "id", "plugins", "pluginsProp", "manager", "usePluginManager", "invoke", "invokePromise", "useOperationInvoker", "useMemo", "sort", "enabled", "useAtomValue", "allSettings", "useCapabilities", "AppCapabilities", "Settings", "handleChange", "useCallback", "gen", "enable", "disable", "ObservabilityOperation", "SendEvent", "properties", "plugin", "pipe", "runAndForwardErrors", "handleClick", "pluginId", "LayoutOperation", "Open", "subject", "replaceAll", "pivotId", "positioning", "hasSettings", "some", "s", "prefix", "handleSettings", "SettingsOperation", "ScrollArea", "Root", "orientation", "Viewport", "PluginList", "onClick", "onChange", "onSettings", "PluginRegistry"]
|
|
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 Plugin } 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: Plugin.Meta = {\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,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;",
|
|
6
|
-
"names": ["trim", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name", "description", "trim"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { Operation, OperationResolver } from '@dxos/operation';\n\nimport { REGISTRY_ID } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: REGISTRY_ID });\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,WAAWC,yBAAyB;AAI7C,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;IAC5DA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAgBR,kBAAW,aAAA;AACzB,eAAOS,UAAUC,OAAOC,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;MAClF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "Operation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "SettingsOperation", "OpenPluginRegistry", "handler", "Operation", "invoke", "LayoutOperation", "SwitchWorkspace", "subject", "REGISTRY_ID"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{PluginArticle-TP2G6GGI.mjs.map → PluginArticle-JPVC7NXQ.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|