@dxos/plugin-registry 0.8.3-staging.0fa589b → 0.8.4-main.1068cf700f
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-VOAOTNGS.mjs +19 -0
- 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 +28 -36
- 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 +30 -5
- 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 +31 -8
- 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 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +19 -19
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -35
- package/src/RegistryPlugin.tsx +11 -26
- 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 +23 -24
- package/src/components/PluginDetail.tsx +61 -43
- package/src/components/PluginItem.tsx +55 -54
- package/src/components/PluginList.stories.tsx +37 -35
- package/src/components/PluginList.tsx +3 -5
- package/src/components/RegistryContainer.tsx +53 -51
- package/src/meta.ts +8 -5
- package/src/translations.ts +6 -4
- package/src/types.ts +5 -1
- package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs +0 -161
- package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ISC56E5F.mjs +0 -16
- package/dist/lib/browser/chunk-ISC56E5F.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs +0 -23
- package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W5RNDLXV.mjs +0 -335
- package/dist/lib/browser/react-surface-W5RNDLXV.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/dist/types/src/components/Icon.stories.d.ts +0 -6
- package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -155
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/capabilities/react-surface.tsx +0 -90
- package/src/components/Icon.stories.tsx +0 -107
|
@@ -2,83 +2,85 @@
|
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
useCapability,
|
|
14
|
-
useIntentDispatcher,
|
|
15
|
-
usePluginManager,
|
|
16
|
-
} from '@dxos/app-framework';
|
|
17
|
-
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
18
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
10
|
+
import { useCapabilities, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';
|
|
11
|
+
import { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability/types';
|
|
14
|
+
import { ScrollArea } from '@dxos/react-ui';
|
|
19
15
|
|
|
20
16
|
import { PluginList } from './PluginList';
|
|
21
17
|
|
|
22
|
-
const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin, { meta: { name: b = '' } }: Plugin) =>
|
|
18
|
+
const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>
|
|
19
|
+
a.localeCompare(b);
|
|
23
20
|
|
|
24
|
-
export
|
|
21
|
+
export type RegistryContainerProps = {
|
|
22
|
+
id: string;
|
|
23
|
+
plugins: Plugin.Plugin[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const RegistryContainer = ({ id, plugins: pluginsProp }: RegistryContainerProps) => {
|
|
25
27
|
const manager = usePluginManager();
|
|
26
|
-
const {
|
|
27
|
-
const plugins = useMemo(() =>
|
|
28
|
-
const
|
|
28
|
+
const { invoke, invokePromise } = useOperationInvoker();
|
|
29
|
+
const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);
|
|
30
|
+
const enabled = useAtomValue(manager.enabled);
|
|
31
|
+
const allSettings = useCapabilities(AppCapabilities.Settings);
|
|
29
32
|
|
|
30
33
|
// TODO(wittjosiah): Factor out to an intent?
|
|
31
34
|
const handleChange = useCallback(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
(id: string, enabled: boolean) =>
|
|
36
|
+
Effect.gen(function* () {
|
|
37
|
+
if (enabled) {
|
|
38
|
+
yield* manager.enable(id);
|
|
39
|
+
} else {
|
|
40
|
+
yield* manager.disable(id);
|
|
41
|
+
}
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
createIntent(ObservabilityAction.SendEvent, {
|
|
43
|
+
yield* invoke(ObservabilityOperation.SendEvent, {
|
|
41
44
|
name: 'plugins.toggle',
|
|
42
45
|
properties: {
|
|
43
46
|
plugin: id,
|
|
44
47
|
enabled,
|
|
45
48
|
},
|
|
46
|
-
})
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
[dispatch, manager],
|
|
49
|
+
});
|
|
50
|
+
}).pipe(runAndForwardErrors),
|
|
51
|
+
[invoke, manager],
|
|
50
52
|
);
|
|
51
53
|
|
|
52
54
|
const handleClick = useCallback(
|
|
53
55
|
(pluginId: string) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
),
|
|
62
|
-
[dispatch, id],
|
|
56
|
+
invokePromise(LayoutOperation.Open, {
|
|
57
|
+
// TODO(wittjosiah): `/` currently is not supported in ids.
|
|
58
|
+
subject: [pluginId.replaceAll('/', ':')],
|
|
59
|
+
pivotId: id,
|
|
60
|
+
positioning: 'end',
|
|
61
|
+
}),
|
|
62
|
+
[invokePromise, id],
|
|
63
63
|
);
|
|
64
64
|
|
|
65
|
-
const hasSettings = useCallback((pluginId: string) =>
|
|
65
|
+
const hasSettings = useCallback((pluginId: string) => allSettings.some((s) => s.prefix === pluginId), [allSettings]);
|
|
66
66
|
|
|
67
67
|
const handleSettings = useCallback(
|
|
68
|
-
(pluginId: string) =>
|
|
69
|
-
[
|
|
68
|
+
(pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),
|
|
69
|
+
[invokePromise],
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
<ScrollArea.Root orientation='vertical'>
|
|
74
|
+
<ScrollArea.Viewport>
|
|
75
|
+
<PluginList
|
|
76
|
+
plugins={plugins}
|
|
77
|
+
enabled={enabled}
|
|
78
|
+
onClick={handleClick}
|
|
79
|
+
onChange={handleChange}
|
|
80
|
+
hasSettings={hasSettings}
|
|
81
|
+
onSettings={handleSettings}
|
|
82
|
+
/>
|
|
83
|
+
</ScrollArea.Viewport>
|
|
84
|
+
</ScrollArea.Root>
|
|
83
85
|
);
|
|
84
86
|
};
|
package/src/meta.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
8
|
// TODO(wittjosiah): Deck does not currently support `/` in ids.
|
|
10
9
|
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
@@ -12,7 +11,11 @@ export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
|
|
|
12
11
|
export const REGISTRY_ID = '!dxos:plugin-registry';
|
|
13
12
|
export const REGISTRY_KEY = 'plugin-registry';
|
|
14
13
|
|
|
15
|
-
export const meta:
|
|
16
|
-
id:
|
|
14
|
+
export const meta: Plugin.Meta = {
|
|
15
|
+
id: 'dxos.org/plugin/registry',
|
|
17
16
|
name: 'Plugins',
|
|
17
|
+
description: trim`
|
|
18
|
+
Plugin management system for discovering, installing, and configuring workspace extensions.
|
|
19
|
+
Browse available plugins and customize your workspace capabilities.
|
|
20
|
+
`,
|
|
18
21
|
};
|
package/src/translations.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const translations = [
|
|
8
10
|
{
|
|
9
11
|
'en-US': {
|
|
10
|
-
[
|
|
12
|
+
[meta.id]: {
|
|
11
13
|
'plugin name': 'Registry',
|
|
12
14
|
'details label': 'Details',
|
|
13
15
|
'home page label': 'Website',
|
|
@@ -25,4 +27,4 @@ export default [
|
|
|
25
27
|
},
|
|
26
28
|
},
|
|
27
29
|
},
|
|
28
|
-
];
|
|
30
|
+
] as const satisfies Resource[];
|
package/src/types.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
export const RegistrySettingsSchema = Schema.mutable(
|
|
8
8
|
Schema.Struct({
|
|
@@ -11,3 +11,7 @@ export const RegistrySettingsSchema = Schema.mutable(
|
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
export type RegistrySettings = Schema.Schema.Type<typeof RegistrySettingsSchema>;
|
|
14
|
+
|
|
15
|
+
export const RegistryTagType = Schema.Literal('new', 'beta', 'labs', 'popular', 'featured', 'experimental');
|
|
16
|
+
|
|
17
|
+
export type RegistryTagType = Schema.Schema.Type<typeof RegistryTagType>;
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REGISTRY_ID,
|
|
3
|
-
REGISTRY_KEY,
|
|
4
|
-
REGISTRY_PLUGIN
|
|
5
|
-
} from "./chunk-ISC56E5F.mjs";
|
|
6
|
-
|
|
7
|
-
// packages/plugins/plugin-registry/src/capabilities/app-graph-builder.ts
|
|
8
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
9
|
-
import { Option, pipe } from "effect";
|
|
10
|
-
import { Capabilities, contributes, createIntent, SettingsAction } from "@dxos/app-framework";
|
|
11
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
12
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
13
|
-
createExtension({
|
|
14
|
-
id: REGISTRY_PLUGIN,
|
|
15
|
-
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
16
|
-
{
|
|
17
|
-
id: REGISTRY_PLUGIN,
|
|
18
|
-
data: async () => {
|
|
19
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
20
|
-
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
21
|
-
},
|
|
22
|
-
properties: {
|
|
23
|
-
label: [
|
|
24
|
-
"open plugin registry label",
|
|
25
|
-
{
|
|
26
|
-
ns: REGISTRY_PLUGIN
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
icon: "ph--squares-four--regular",
|
|
30
|
-
disposition: "menu"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]), Option.getOrElse(() => [])))
|
|
34
|
-
}),
|
|
35
|
-
createExtension({
|
|
36
|
-
id: REGISTRY_PLUGIN,
|
|
37
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
|
|
38
|
-
{
|
|
39
|
-
id: REGISTRY_ID,
|
|
40
|
-
type: REGISTRY_PLUGIN,
|
|
41
|
-
properties: {
|
|
42
|
-
label: [
|
|
43
|
-
"plugin registry label",
|
|
44
|
-
{
|
|
45
|
-
ns: REGISTRY_PLUGIN
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
icon: "ph--squares-four--regular",
|
|
49
|
-
disposition: "pin-end",
|
|
50
|
-
testId: "treeView.pluginRegistry"
|
|
51
|
-
},
|
|
52
|
-
nodes: [
|
|
53
|
-
{
|
|
54
|
-
id: `${REGISTRY_KEY}+all`,
|
|
55
|
-
type: "category",
|
|
56
|
-
data: `${REGISTRY_KEY}+all`,
|
|
57
|
-
properties: {
|
|
58
|
-
label: [
|
|
59
|
-
"all plugins label",
|
|
60
|
-
{
|
|
61
|
-
ns: REGISTRY_PLUGIN
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
icon: "ph--squares-four--regular",
|
|
65
|
-
key: REGISTRY_KEY,
|
|
66
|
-
testId: "pluginRegistry.all"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
71
|
-
type: "category",
|
|
72
|
-
data: `${REGISTRY_KEY}+installed`,
|
|
73
|
-
properties: {
|
|
74
|
-
label: [
|
|
75
|
-
"installed plugins label",
|
|
76
|
-
{
|
|
77
|
-
ns: REGISTRY_PLUGIN
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
icon: "ph--check--regular",
|
|
81
|
-
key: REGISTRY_KEY,
|
|
82
|
-
testId: "pluginRegistry.installed"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
87
|
-
type: "category",
|
|
88
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
89
|
-
properties: {
|
|
90
|
-
label: [
|
|
91
|
-
"recommended plugins label",
|
|
92
|
-
{
|
|
93
|
-
ns: REGISTRY_PLUGIN
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
icon: "ph--star--regular",
|
|
97
|
-
key: REGISTRY_KEY,
|
|
98
|
-
testId: "pluginRegistry.recommended"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
103
|
-
type: "category",
|
|
104
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
105
|
-
properties: {
|
|
106
|
-
label: [
|
|
107
|
-
"labs plugins label",
|
|
108
|
-
{
|
|
109
|
-
ns: REGISTRY_PLUGIN
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
icon: "ph--flask--regular",
|
|
113
|
-
key: REGISTRY_KEY,
|
|
114
|
-
testId: "pluginRegistry.labs"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
]), Option.getOrElse(() => [])))
|
|
120
|
-
}),
|
|
121
|
-
createExtension({
|
|
122
|
-
id: `${REGISTRY_PLUGIN}/actions`,
|
|
123
|
-
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
124
|
-
{
|
|
125
|
-
id: `${REGISTRY_PLUGIN}/load-by-url`,
|
|
126
|
-
data: async () => {
|
|
127
|
-
},
|
|
128
|
-
properties: {
|
|
129
|
-
label: [
|
|
130
|
-
"load by url label",
|
|
131
|
-
{
|
|
132
|
-
ns: REGISTRY_PLUGIN
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
icon: "ph--cloud-arrow-down--regular",
|
|
136
|
-
disabled: true
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
]), Option.getOrElse(() => [])))
|
|
140
|
-
}),
|
|
141
|
-
createExtension({
|
|
142
|
-
id: `${REGISTRY_PLUGIN}/plugins`,
|
|
143
|
-
connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
144
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
145
|
-
return manager.plugins.map((plugin) => ({
|
|
146
|
-
id: plugin.meta.id.replaceAll("/", ":"),
|
|
147
|
-
type: "dxos.org/plugin",
|
|
148
|
-
data: plugin,
|
|
149
|
-
properties: {
|
|
150
|
-
label: plugin.meta.name ?? plugin.meta.id,
|
|
151
|
-
icon: plugin.meta.icon ?? "ph--circle--regular",
|
|
152
|
-
disposition: "hidden"
|
|
153
|
-
}
|
|
154
|
-
}));
|
|
155
|
-
}), Option.getOrElse(() => [])))
|
|
156
|
-
})
|
|
157
|
-
]);
|
|
158
|
-
export {
|
|
159
|
-
app_graph_builder_default as default
|
|
160
|
-
};
|
|
161
|
-
//# sourceMappingURL=app-graph-builder-J5YHAGNI.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 { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, SettingsAction, type PluginContext } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: REGISTRY_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: REGISTRY_PLUGIN,\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: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n disposition: 'menu',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: REGISTRY_PLUGIN,\n connector: (node) =>\n Rx.make((get) =>\n 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: REGISTRY_PLUGIN,\n properties: {\n label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],\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: REGISTRY_PLUGIN }],\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: REGISTRY_PLUGIN }],\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: REGISTRY_PLUGIN }],\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: REGISTRY_PLUGIN }],\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: `${REGISTRY_PLUGIN}/actions`,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: `${REGISTRY_PLUGIN}/load-by-url`,\n data: async () => {},\n properties: {\n label: ['load by url label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--cloud-arrow-down--regular',\n disabled: true,\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/plugins`,\n connector: (node) =>\n Rx.make((get) =>\n 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": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "SettingsAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "REGISTRY_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "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", "meta", "replaceAll", "name"]
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// packages/plugins/plugin-registry/src/meta.ts
|
|
2
|
-
var REGISTRY_PLUGIN = "dxos.org/plugin/registry";
|
|
3
|
-
var REGISTRY_ID = "!dxos:plugin-registry";
|
|
4
|
-
var REGISTRY_KEY = "plugin-registry";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: REGISTRY_PLUGIN,
|
|
7
|
-
name: "Plugins"
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
REGISTRY_PLUGIN,
|
|
12
|
-
REGISTRY_ID,
|
|
13
|
-
REGISTRY_KEY,
|
|
14
|
-
meta
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-ISC56E5F.mjs.map
|
|
@@ -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';\n\nexport const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';\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: REGISTRY_PLUGIN,\n name: 'Plugins',\n};\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,kBAAkB;AAKxB,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIJ;EACJK,MAAM;AACR;",
|
|
6
|
-
"names": ["REGISTRY_PLUGIN", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name"]
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REGISTRY_ID
|
|
3
|
-
} from "./chunk-ISC56E5F.mjs";
|
|
4
|
-
|
|
5
|
-
// packages/plugins/plugin-registry/src/capabilities/intent-resolver.ts
|
|
6
|
-
import { contributes, SettingsAction, createResolver, LayoutAction, Capabilities, createIntent } 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-AQJNBUT3.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 contributes,\n SettingsAction,\n createResolver,\n LayoutAction,\n Capabilities,\n createIntent,\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,aACAC,gBACAC,gBACAC,cACAC,cACAC,oBACK;AAIP,IAAA,0BAAe,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": ["contributes", "SettingsAction", "createResolver", "LayoutAction", "Capabilities", "createIntent", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "SettingsAction", "OpenPluginRegistry", "resolve", "intents", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "REGISTRY_ID"]
|
|
7
|
-
}
|