@dxos/plugin-registry 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203
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-YOD5EGAY.mjs +167 -0
- package/dist/lib/browser/app-graph-builder-YOD5EGAY.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 +224 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -29
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs +25 -0
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs +337 -0
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.mjs +168 -0
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.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 +225 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +64 -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-B24QW6IF.mjs +26 -0
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-SEJBWRMR.mjs +338 -0
- package/dist/lib/node-esm/react-surface-SEJBWRMR.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 +2 -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 +48 -31
- package/src/RegistryPlugin.tsx +10 -24
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -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 +24 -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 +17 -0
- package/src/cli/storage.ts +57 -0
- package/src/components/PluginDetail.stories.tsx +15 -16
- package/src/components/PluginDetail.tsx +43 -44
- package/src/components/PluginItem.tsx +5 -5
- package/src/components/PluginList.stories.tsx +23 -19
- package/src/components/PluginList.tsx +2 -2
- package/src/components/RegistryContainer.tsx +53 -43
- 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
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { createExtension } from '@dxos/plugin-graph';
|
|
11
|
-
|
|
12
|
-
import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginContext) =>
|
|
15
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
16
|
-
createExtension({
|
|
17
|
-
id: meta.id,
|
|
18
|
-
actions: (node) =>
|
|
19
|
-
Atom.make((get) =>
|
|
20
|
-
Function.pipe(
|
|
21
|
-
get(node),
|
|
22
|
-
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
23
|
-
Option.map((node) => [
|
|
24
|
-
{
|
|
25
|
-
id: meta.id,
|
|
26
|
-
data: async () => {
|
|
27
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
28
|
-
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
29
|
-
},
|
|
30
|
-
properties: {
|
|
31
|
-
label: ['open plugin registry label', { ns: meta.id }],
|
|
32
|
-
icon: 'ph--squares-four--regular',
|
|
33
|
-
disposition: 'menu',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
]),
|
|
37
|
-
Option.getOrElse(() => []),
|
|
38
|
-
),
|
|
39
|
-
),
|
|
40
|
-
}),
|
|
41
|
-
createExtension({
|
|
42
|
-
id: meta.id,
|
|
43
|
-
connector: (node) =>
|
|
44
|
-
Atom.make((get) =>
|
|
45
|
-
Function.pipe(
|
|
46
|
-
get(node),
|
|
47
|
-
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
48
|
-
Option.map((node) => [
|
|
49
|
-
{
|
|
50
|
-
id: REGISTRY_ID,
|
|
51
|
-
type: meta.id,
|
|
52
|
-
properties: {
|
|
53
|
-
label: ['plugin registry label', { ns: meta.id }],
|
|
54
|
-
icon: 'ph--squares-four--regular',
|
|
55
|
-
disposition: 'pin-end',
|
|
56
|
-
testId: 'treeView.pluginRegistry',
|
|
57
|
-
},
|
|
58
|
-
nodes: [
|
|
59
|
-
{
|
|
60
|
-
id: `${REGISTRY_KEY}+all`,
|
|
61
|
-
type: 'category',
|
|
62
|
-
data: `${REGISTRY_KEY}+all`,
|
|
63
|
-
properties: {
|
|
64
|
-
label: ['all plugins label', { ns: meta.id }],
|
|
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: ['installed plugins label', { ns: meta.id }],
|
|
76
|
-
icon: 'ph--check--regular',
|
|
77
|
-
key: REGISTRY_KEY,
|
|
78
|
-
testId: 'pluginRegistry.installed',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
83
|
-
type: 'category',
|
|
84
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
85
|
-
properties: {
|
|
86
|
-
label: ['recommended plugins label', { ns: meta.id }],
|
|
87
|
-
icon: 'ph--star--regular',
|
|
88
|
-
key: REGISTRY_KEY,
|
|
89
|
-
testId: 'pluginRegistry.recommended',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
94
|
-
type: 'category',
|
|
95
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
96
|
-
properties: {
|
|
97
|
-
label: ['labs plugins label', { ns: meta.id }],
|
|
98
|
-
icon: 'ph--flask--regular',
|
|
99
|
-
key: REGISTRY_KEY,
|
|
100
|
-
testId: 'pluginRegistry.labs',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
]),
|
|
106
|
-
Option.getOrElse(() => []),
|
|
107
|
-
),
|
|
108
|
-
),
|
|
109
|
-
}),
|
|
110
|
-
createExtension({
|
|
111
|
-
id: `${meta.id}/actions`,
|
|
112
|
-
actions: (node) =>
|
|
113
|
-
Atom.make((get) =>
|
|
114
|
-
Function.pipe(
|
|
115
|
-
get(node),
|
|
116
|
-
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
117
|
-
Option.map(() => [
|
|
118
|
-
{
|
|
119
|
-
id: `${meta.id}/load-by-url`,
|
|
120
|
-
data: async () => {},
|
|
121
|
-
properties: {
|
|
122
|
-
label: ['load by url label', { ns: meta.id }],
|
|
123
|
-
icon: 'ph--cloud-arrow-down--regular',
|
|
124
|
-
disabled: true,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
]),
|
|
128
|
-
Option.getOrElse(() => []),
|
|
129
|
-
),
|
|
130
|
-
),
|
|
131
|
-
}),
|
|
132
|
-
createExtension({
|
|
133
|
-
id: `${meta.id}/plugins`,
|
|
134
|
-
connector: (node) =>
|
|
135
|
-
Atom.make((get) =>
|
|
136
|
-
Function.pipe(
|
|
137
|
-
get(node),
|
|
138
|
-
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
139
|
-
Option.map(() => {
|
|
140
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
141
|
-
return manager.plugins.map((plugin) => ({
|
|
142
|
-
id: plugin.meta.id.replaceAll('/', ':'),
|
|
143
|
-
type: 'dxos.org/plugin',
|
|
144
|
-
data: plugin,
|
|
145
|
-
properties: {
|
|
146
|
-
label: plugin.meta.name ?? plugin.meta.id,
|
|
147
|
-
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
148
|
-
disposition: 'hidden',
|
|
149
|
-
},
|
|
150
|
-
}));
|
|
151
|
-
}),
|
|
152
|
-
Option.getOrElse(() => []),
|
|
153
|
-
),
|
|
154
|
-
),
|
|
155
|
-
}),
|
|
156
|
-
]);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Capabilities,
|
|
7
|
-
LayoutAction,
|
|
8
|
-
SettingsAction,
|
|
9
|
-
contributes,
|
|
10
|
-
createIntent,
|
|
11
|
-
createResolver,
|
|
12
|
-
} from '@dxos/app-framework';
|
|
13
|
-
|
|
14
|
-
import { REGISTRY_ID } from '../meta';
|
|
15
|
-
|
|
16
|
-
export default () =>
|
|
17
|
-
contributes(
|
|
18
|
-
Capabilities.IntentResolver,
|
|
19
|
-
createResolver({
|
|
20
|
-
intent: SettingsAction.OpenPluginRegistry,
|
|
21
|
-
resolve: () => {
|
|
22
|
-
return {
|
|
23
|
-
intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, Plugin, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { usePluginManager } from '@dxos/app-framework/react';
|
|
9
|
-
|
|
10
|
-
import { PluginDetail, RegistryContainer } from '../components';
|
|
11
|
-
import { REGISTRY_KEY, meta } from '../meta';
|
|
12
|
-
|
|
13
|
-
export default () =>
|
|
14
|
-
contributes(Capabilities.ReactSurface, [
|
|
15
|
-
createSurface({
|
|
16
|
-
id: `${meta.id}/all`,
|
|
17
|
-
role: 'article',
|
|
18
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
19
|
-
component: () => {
|
|
20
|
-
const manager = usePluginManager();
|
|
21
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
|
|
22
|
-
|
|
23
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
createSurface({
|
|
27
|
-
id: `${meta.id}/installed`,
|
|
28
|
-
role: 'article',
|
|
29
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
30
|
-
component: () => {
|
|
31
|
-
const manager = usePluginManager();
|
|
32
|
-
const filtered = useMemo(
|
|
33
|
-
() =>
|
|
34
|
-
manager.plugins
|
|
35
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
36
|
-
.filter(({ meta }) => manager.enabled.includes(meta.id)),
|
|
37
|
-
[],
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
createSurface({
|
|
44
|
-
id: `${meta.id}/recommended`,
|
|
45
|
-
role: 'article',
|
|
46
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
47
|
-
component: () => {
|
|
48
|
-
const manager = usePluginManager();
|
|
49
|
-
const filtered = useMemo(
|
|
50
|
-
() =>
|
|
51
|
-
manager.plugins
|
|
52
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
53
|
-
.filter(({ meta }) => !meta.tags?.includes('labs')),
|
|
54
|
-
[],
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
createSurface({
|
|
61
|
-
id: `${meta.id}/labs`,
|
|
62
|
-
role: 'article',
|
|
63
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
|
|
64
|
-
component: () => {
|
|
65
|
-
const manager = usePluginManager();
|
|
66
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('labs')), []);
|
|
67
|
-
|
|
68
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;
|
|
69
|
-
},
|
|
70
|
-
}),
|
|
71
|
-
createSurface({
|
|
72
|
-
id: `${meta.id}/plugin-details`,
|
|
73
|
-
role: 'article',
|
|
74
|
-
filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
|
|
75
|
-
component: ({ data: { subject } }) => {
|
|
76
|
-
const manager = usePluginManager();
|
|
77
|
-
const enabled = manager.enabled.includes(subject.meta.id);
|
|
78
|
-
const handleEnable = useCallback(
|
|
79
|
-
() => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),
|
|
80
|
-
[manager, subject.meta.id, enabled],
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
return <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />;
|
|
84
|
-
},
|
|
85
|
-
}),
|
|
86
|
-
]);
|