@dxos/plugin-registry 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/cli/index.mjs +1 -188
- package/dist/lib/browser/cli/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +5 -45
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +35 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1 -188
- package/dist/lib/node-esm/cli/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +5 -45
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +37 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +1 -0
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → RegistryPlugin.node.d.ts} +2 -1
- package/dist/types/src/RegistryPlugin.node.d.ts.map +1 -0
- package/dist/types/src/RegistryPlugin.test.d.ts +2 -0
- package/dist/types/src/RegistryPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +7 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +1 -2
- package/dist/types/src/cli/index.d.ts.map +1 -1
- package/dist/types/src/{cli/commands → commands}/disable.d.ts +2 -2
- package/dist/types/src/commands/disable.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/enable.d.ts +2 -2
- package/dist/types/src/commands/enable.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/list.d.ts +7 -0
- package/dist/types/src/commands/list.d.ts.map +1 -0
- package/dist/types/src/commands/util.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +12 -1
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +23 -20
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginItem.d.ts +14 -1
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginList.d.ts +7 -2
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +23 -20
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts +8 -0
- package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/CommunityRegistry/index.d.ts +2 -0
- package/dist/types/src/containers/CommunityRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -1
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -1
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +5 -1
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -0
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
- package/dist/types/src/hooks/use-community-plugins.d.ts +16 -0
- package/dist/types/src/hooks/use-community-plugins.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open-plugin-registry.d.ts +1 -1
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -1
- package/dist/types/src/storage.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +22 -20
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +12 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -25
- package/src/{cli/plugin.ts → RegistryPlugin.node.ts} +2 -0
- package/src/RegistryPlugin.test.ts +24 -0
- package/src/RegistryPlugin.tsx +9 -3
- package/src/capabilities/app-graph-builder.ts +61 -17
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +49 -24
- package/src/capabilities/state.ts +38 -0
- package/src/cli/index.ts +1 -2
- package/src/components/PluginDetail/PluginDetail.stories.tsx +2 -1
- package/src/components/PluginDetail/PluginDetail.tsx +27 -5
- package/src/components/PluginList/PluginItem.tsx +71 -8
- package/src/components/PluginList/PluginList.stories.tsx +1 -1
- package/src/components/PluginList/PluginList.tsx +8 -3
- package/src/containers/CommunityRegistry/CommunityRegistry.tsx +181 -0
- package/src/containers/CommunityRegistry/index.ts +5 -0
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +2 -1
- package/src/containers/PluginArticle/PluginArticle.tsx +47 -2
- package/src/containers/PluginRegistry/PluginRegistry.tsx +6 -2
- package/src/containers/index.ts +1 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-auto-tags.ts +52 -0
- package/src/hooks/use-community-plugins.ts +35 -0
- package/src/index.ts +5 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/open-plugin-registry.ts +1 -1
- package/src/translations.ts +5 -2
- package/src/types.ts +26 -1
- package/dist/types/src/cli/commands/disable.d.ts.map +0 -1
- package/dist/types/src/cli/commands/enable.d.ts.map +0 -1
- package/dist/types/src/cli/commands/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/list.d.ts +0 -7
- package/dist/types/src/cli/commands/list.d.ts.map +0 -1
- package/dist/types/src/cli/commands/util.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/cli/storage.d.ts.map +0 -1
- /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/util.d.ts +0 -0
- /package/dist/types/src/{cli/storage.d.ts → storage.d.ts} +0 -0
- /package/src/{cli/commands → commands}/disable.ts +0 -0
- /package/src/{cli/commands → commands}/enable.ts +0 -0
- /package/src/{cli/commands → commands}/index.ts +0 -0
- /package/src/{cli/commands → commands}/list.ts +0 -0
- /package/src/{cli/commands → commands}/util.ts +0 -0
- /package/src/{cli/storage.ts → storage.ts} +0 -0
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { Plugin as Plugin4 } from "@dxos/app-framework";
|
|
3
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
-
import { meta } from "#meta";
|
|
5
|
-
|
|
6
|
-
// src/cli/commands/index.ts
|
|
7
|
-
import * as Command4 from "@effect/cli/Command";
|
|
8
|
-
|
|
9
|
-
// src/cli/commands/disable.ts
|
|
10
|
-
import * as Args from "@effect/cli/Args";
|
|
11
|
-
import * as Command from "@effect/cli/Command";
|
|
12
|
-
import * as Console from "effect/Console";
|
|
13
|
-
import * as Effect2 from "effect/Effect";
|
|
14
|
-
import { Plugin } from "@dxos/app-framework";
|
|
15
|
-
import { CommandConfig } from "@dxos/cli-util";
|
|
16
|
-
import { invariant } from "@dxos/invariant";
|
|
17
|
-
|
|
18
|
-
// src/cli/storage.ts
|
|
1
|
+
// src/storage.ts
|
|
19
2
|
import * as FileSystem from "@effect/platform/FileSystem";
|
|
20
3
|
import * as Path from "@effect/platform/Path";
|
|
21
4
|
import * as Effect from "effect/Effect";
|
|
@@ -42,177 +25,7 @@ var saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }) {
|
|
|
42
25
|
const encoded = Yaml.stringify(enabled);
|
|
43
26
|
yield* fs.writeFileString(pluginsPath, encoded);
|
|
44
27
|
});
|
|
45
|
-
|
|
46
|
-
// src/cli/commands/disable.ts
|
|
47
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/disable.ts";
|
|
48
|
-
var handler = Effect2.fn(function* ({ id }) {
|
|
49
|
-
const { json, profile } = yield* CommandConfig;
|
|
50
|
-
const manager = yield* Plugin.Service;
|
|
51
|
-
const plugins = manager.getPlugins();
|
|
52
|
-
const plugin2 = plugins.find((p) => p.meta.id === id);
|
|
53
|
-
invariant(plugin2, `Plugin not found: ${id}`, {
|
|
54
|
-
F: __dxlog_file,
|
|
55
|
-
L: 22,
|
|
56
|
-
S: this,
|
|
57
|
-
A: [
|
|
58
|
-
"plugin",
|
|
59
|
-
"`Plugin not found: ${id}`"
|
|
60
|
-
]
|
|
61
|
-
});
|
|
62
|
-
const core = manager.getCore();
|
|
63
|
-
invariant(!core.includes(id), `Cannot disable core plugin: ${id}`, {
|
|
64
|
-
F: __dxlog_file,
|
|
65
|
-
L: 25,
|
|
66
|
-
S: this,
|
|
67
|
-
A: [
|
|
68
|
-
"!core.includes(id)",
|
|
69
|
-
"`Cannot disable core plugin: ${id}`"
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
const disabled = yield* manager.disable(id);
|
|
73
|
-
invariant(disabled, `Failed to disable plugin: ${id}`, {
|
|
74
|
-
F: __dxlog_file,
|
|
75
|
-
L: 28,
|
|
76
|
-
S: this,
|
|
77
|
-
A: [
|
|
78
|
-
"disabled",
|
|
79
|
-
"`Failed to disable plugin: ${id}`"
|
|
80
|
-
]
|
|
81
|
-
});
|
|
82
|
-
const enabledPlugins = manager.getEnabled();
|
|
83
|
-
yield* saveEnabledPlugins({
|
|
84
|
-
profile,
|
|
85
|
-
enabled: [
|
|
86
|
-
...enabledPlugins
|
|
87
|
-
]
|
|
88
|
-
});
|
|
89
|
-
if (json) {
|
|
90
|
-
yield* Console.log(JSON.stringify({
|
|
91
|
-
id,
|
|
92
|
-
enabled: false
|
|
93
|
-
}, null, 2));
|
|
94
|
-
} else {
|
|
95
|
-
yield* Console.log(`Plugin "${plugin2.meta.name ?? id}" disabled.`);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
var disable = Command.make("disable", {
|
|
99
|
-
id: Args.text({
|
|
100
|
-
name: "id"
|
|
101
|
-
}).pipe(Args.withDescription("The ID of the plugin to disable."))
|
|
102
|
-
}, handler).pipe(Command.withDescription("Disable a plugin."));
|
|
103
|
-
|
|
104
|
-
// src/cli/commands/enable.ts
|
|
105
|
-
import * as Args2 from "@effect/cli/Args";
|
|
106
|
-
import * as Command2 from "@effect/cli/Command";
|
|
107
|
-
import * as Console2 from "effect/Console";
|
|
108
|
-
import * as Effect3 from "effect/Effect";
|
|
109
|
-
import { Plugin as Plugin2 } from "@dxos/app-framework";
|
|
110
|
-
import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
|
|
111
|
-
import { invariant as invariant2 } from "@dxos/invariant";
|
|
112
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/enable.ts";
|
|
113
|
-
var handler2 = Effect3.fn(function* ({ id }) {
|
|
114
|
-
const { json, profile } = yield* CommandConfig2;
|
|
115
|
-
const manager = yield* Plugin2.Service;
|
|
116
|
-
const plugins = manager.getPlugins();
|
|
117
|
-
const plugin2 = plugins.find((p) => p.meta.id === id);
|
|
118
|
-
invariant2(plugin2, `Plugin not found: ${id}`, {
|
|
119
|
-
F: __dxlog_file2,
|
|
120
|
-
L: 22,
|
|
121
|
-
S: this,
|
|
122
|
-
A: [
|
|
123
|
-
"plugin",
|
|
124
|
-
"`Plugin not found: ${id}`"
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
const enabled = yield* manager.enable(id);
|
|
128
|
-
invariant2(enabled, `Failed to enable plugin: ${id}`, {
|
|
129
|
-
F: __dxlog_file2,
|
|
130
|
-
L: 25,
|
|
131
|
-
S: this,
|
|
132
|
-
A: [
|
|
133
|
-
"enabled",
|
|
134
|
-
"`Failed to enable plugin: ${id}`"
|
|
135
|
-
]
|
|
136
|
-
});
|
|
137
|
-
const enabledPlugins = manager.getEnabled();
|
|
138
|
-
yield* saveEnabledPlugins({
|
|
139
|
-
profile,
|
|
140
|
-
enabled: [
|
|
141
|
-
...enabledPlugins
|
|
142
|
-
]
|
|
143
|
-
});
|
|
144
|
-
if (json) {
|
|
145
|
-
yield* Console2.log(JSON.stringify({
|
|
146
|
-
id,
|
|
147
|
-
enabled: true
|
|
148
|
-
}, null, 2));
|
|
149
|
-
} else {
|
|
150
|
-
yield* Console2.log(`Plugin "${plugin2.meta.name ?? id}" enabled.`);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
var enable = Command2.make("enable", {
|
|
154
|
-
id: Args2.text({
|
|
155
|
-
name: "id"
|
|
156
|
-
}).pipe(Args2.withDescription("The ID of the plugin to enable."))
|
|
157
|
-
}, handler2).pipe(Command2.withDescription("Enable a plugin."));
|
|
158
|
-
|
|
159
|
-
// src/cli/commands/list.ts
|
|
160
|
-
import * as Command3 from "@effect/cli/Command";
|
|
161
|
-
import * as Console3 from "effect/Console";
|
|
162
|
-
import * as Effect4 from "effect/Effect";
|
|
163
|
-
import { Plugin as Plugin3 } from "@dxos/app-framework";
|
|
164
|
-
import { CommandConfig as CommandConfig3, printList } from "@dxos/cli-util";
|
|
165
|
-
|
|
166
|
-
// src/cli/commands/util.ts
|
|
167
|
-
import { FormBuilder } from "@dxos/cli-util";
|
|
168
|
-
var printPlugin = (plugin2) => {
|
|
169
|
-
const status = plugin2.core ? "core" : plugin2.enabled ? "enabled" : "disabled";
|
|
170
|
-
return FormBuilder.make({
|
|
171
|
-
title: plugin2.name
|
|
172
|
-
}).pipe(FormBuilder.set("id", plugin2.id), FormBuilder.set("status", status), FormBuilder.build);
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
// src/cli/commands/list.ts
|
|
176
|
-
var handler3 = Effect4.fn(function* () {
|
|
177
|
-
const { json } = yield* CommandConfig3;
|
|
178
|
-
const manager = yield* Plugin3.Service;
|
|
179
|
-
const plugins = manager.getPlugins();
|
|
180
|
-
const enabled = manager.getEnabled();
|
|
181
|
-
const core = manager.getCore();
|
|
182
|
-
const formattedPlugins = plugins.map((plugin2) => {
|
|
183
|
-
const isEnabled = enabled.includes(plugin2.meta.id);
|
|
184
|
-
const isCore = core.includes(plugin2.meta.id);
|
|
185
|
-
return {
|
|
186
|
-
id: plugin2.meta.id,
|
|
187
|
-
name: plugin2.meta.name ?? plugin2.meta.id,
|
|
188
|
-
enabled: isEnabled,
|
|
189
|
-
core: isCore
|
|
190
|
-
};
|
|
191
|
-
});
|
|
192
|
-
if (json) {
|
|
193
|
-
yield* Console3.log(JSON.stringify(formattedPlugins, null, 2));
|
|
194
|
-
} else {
|
|
195
|
-
const formatted = formattedPlugins.map(printPlugin);
|
|
196
|
-
yield* Console3.log(printList(formatted));
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
var list = Command3.make("list", {}, handler3).pipe(Command3.withDescription("List all available plugins."));
|
|
200
|
-
|
|
201
|
-
// src/cli/commands/index.ts
|
|
202
|
-
var plugin = Command4.make("plugin").pipe(Command4.withDescription("Manage plugins."), Command4.withSubcommands([
|
|
203
|
-
enable,
|
|
204
|
-
disable,
|
|
205
|
-
list
|
|
206
|
-
]));
|
|
207
|
-
|
|
208
|
-
// src/cli/plugin.ts
|
|
209
|
-
var RegistryPlugin = Plugin4.define(meta).pipe(AppPlugin.addCommandModule({
|
|
210
|
-
commands: [
|
|
211
|
-
plugin
|
|
212
|
-
]
|
|
213
|
-
}), Plugin4.make);
|
|
214
28
|
export {
|
|
215
|
-
RegistryPlugin,
|
|
216
29
|
loadEnabledPlugins,
|
|
217
30
|
saveEnabledPlugins
|
|
218
31
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport
|
|
5
|
-
"mappings": ";AAIA,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../../src/storage.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Path from '@effect/platform/Path';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG } from '@dxos/client-protocol';\n\n// TODO(wittjosiah): Factor out to app-framework?\n\nconst PluginsSchema = Schema.Array(Schema.String);\n\n/** CLI-only: path to plugins/<profile>.yml (sibling to profile/). */\nconst getPluginsConfigPath = (profile: string) => `${DX_CONFIG}/plugins/${profile}.yml`;\n\n/**\n * Load enabled plugins from plugins/<profile>.yml (sibling to profile/).\n * Returns the list of enabled plugin IDs, or an empty array if the file doesn't exist.\n */\nexport const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: string }) {\n const fs = yield* FileSystem.FileSystem;\n const pluginsPath = getPluginsConfigPath(profile);\n\n const content = yield* fs\n .readFileString(pluginsPath)\n .pipe(Effect.catchTag('SystemError', () => Effect.succeed('[]')));\n\n const raw = Yaml.parse(content);\n const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(\n Effect.catchAll(() => Effect.succeed([] as string[])),\n );\n\n return parsed;\n});\n\n/**\n * Save enabled plugins to plugins/<profile>.yml.\n */\nexport const saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }: { profile: string; enabled: string[] }) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const pluginsPath = getPluginsConfigPath(profile);\n yield* fs.makeDirectory(path.dirname(pluginsPath), { recursive: true });\n const encoded = Yaml.stringify(enabled);\n yield* fs.writeFileString(pluginsPath, encoded);\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,gBAAgB;AAC5B,YAAYC,UAAU;AACtB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,YAAYC,UAAU;AAEtB,SAASC,iBAAiB;AAI1B,IAAMC,gBAAuBC,aAAaC,aAAM;AAGhD,IAAMC,uBAAuB,CAACC,YAAoB,GAAGL,SAAAA,YAAqBK,OAAAA;AAMnE,IAAMC,qBAA4BC,UAAG,WAAW,EAAEF,QAAO,GAAuB;AACrF,QAAMG,KAAK,OAAkBb;AAC7B,QAAMc,cAAcL,qBAAqBC,OAAAA;AAEzC,QAAMK,UAAU,OAAOF,GACpBG,eAAeF,WAAAA,EACfG,KAAYC,gBAAS,eAAe,MAAaC,eAAQ,IAAA,CAAA,CAAA;AAE5D,QAAMC,MAAWC,WAAMN,OAAAA;AACvB,QAAMO,SAAS,OAAcC,qBAAcjB,aAAAA,EAAec,OAAO,CAAA,CAAE,EAAEH,KAC5DO,gBAAS,MAAaL,eAAQ,CAAA,CAAE,CAAA,CAAA;AAGzC,SAAOG;AACT,CAAA;AAKO,IAAMG,qBAA4Bb,UAAG,WAAW,EAAEF,SAASgB,QAAO,GAA0C;AACjH,QAAMb,KAAK,OAAkBb;AAC7B,QAAM2B,OAAO,OAAY1B;AACzB,QAAMa,cAAcL,qBAAqBC,OAAAA;AACzC,SAAOG,GAAGe,cAAcD,KAAKE,QAAQf,WAAAA,GAAc;IAAEgB,WAAW;EAAK,CAAA;AACrE,QAAMC,UAAeC,eAAUN,OAAAA;AAC/B,SAAOb,GAAGoB,gBAAgBnB,aAAaiB,OAAAA;AACzC,CAAA;",
|
|
6
|
+
"names": ["FileSystem", "Path", "Effect", "Schema", "Yaml", "DX_CONFIG", "PluginsSchema", "Array", "String", "getPluginsConfigPath", "profile", "loadEnabledPlugins", "fn", "fs", "pluginsPath", "content", "readFileString", "pipe", "catchTag", "succeed", "raw", "parse", "parsed", "decodeUnknown", "catchAll", "saveEnabledPlugins", "enabled", "path", "makeDirectory", "dirname", "recursive", "encoded", "stringify", "writeFileString"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
|
|
1
4
|
// src/meta.ts
|
|
2
5
|
import { pinnedWorkspaceId } from "@dxos/app-toolkit";
|
|
3
6
|
import { trim } from "@dxos/util";
|
|
@@ -15,51 +18,8 @@ var meta = {
|
|
|
15
18
|
`
|
|
16
19
|
};
|
|
17
20
|
|
|
18
|
-
// src/
|
|
19
|
-
|
|
20
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
21
|
-
import { AppGraphBuilder, OperationHandler, ReactSurface } from "#capabilities";
|
|
22
|
-
import { meta as meta3 } from "#meta";
|
|
23
|
-
|
|
24
|
-
// src/translations.ts
|
|
25
|
-
import { meta as meta2 } from "#meta";
|
|
26
|
-
var translations = [
|
|
27
|
-
{
|
|
28
|
-
"en-US": {
|
|
29
|
-
[meta2.id]: {
|
|
30
|
-
"plugin.name": "Registry",
|
|
31
|
-
"details.label": "Details",
|
|
32
|
-
"home-page.label": "Website",
|
|
33
|
-
"source.label": "Source",
|
|
34
|
-
"plugin-registry.label": "Plugin Registry",
|
|
35
|
-
"all-plugins.label": "All",
|
|
36
|
-
"installed-plugins.label": "Enabled",
|
|
37
|
-
"recommended-plugins.label": "Recommended",
|
|
38
|
-
"labs-plugins.label": "Labs",
|
|
39
|
-
"community-plugins.label": "Community",
|
|
40
|
-
"load-by-url.label": "Load from URL",
|
|
41
|
-
"load-by-url-dialog.title": "Load Plugin from URL",
|
|
42
|
-
"plugin-url.label": "Plugin URL",
|
|
43
|
-
"load-plugin.label": "Load Plugin",
|
|
44
|
-
"loading.label": "Loading...",
|
|
45
|
-
"coming-soon.label": "Coming soon!",
|
|
46
|
-
"open-plugin-registry.label": "Open plugin registry",
|
|
47
|
-
"settings.label": "Settings"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
// src/RegistryPlugin.tsx
|
|
54
|
-
var RegistryPlugin = Plugin.define(meta3).pipe(AppPlugin.addAppGraphModule({
|
|
55
|
-
activate: AppGraphBuilder
|
|
56
|
-
}), AppPlugin.addOperationHandlerModule({
|
|
57
|
-
activate: OperationHandler
|
|
58
|
-
}), AppPlugin.addSurfaceModule({
|
|
59
|
-
activate: ReactSurface
|
|
60
|
-
}), AppPlugin.addTranslationsModule({
|
|
61
|
-
translations
|
|
62
|
-
}), Plugin.make);
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var RegistryPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
63
23
|
export {
|
|
64
24
|
REGISTRY_ID,
|
|
65
25
|
REGISTRY_KEY,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { pinnedWorkspaceId } from '@dxos/app-toolkit';\nimport { trim } from '@dxos/util';\n\nexport const REGISTRY_ID = pinnedWorkspaceId('dxos:plugin-registry');\nexport const REGISTRY_KEY = 'plugin-registry';\n\n// TODO(wittjosiah): Should this be a special separator or use the standard path separator?\nconst CATEGORY_SEPARATOR = '>';\n\n/** Build a registry category node ID. */\nexport const registryCategoryId = (category: string): string => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;\n\n/** Qualified graph path to a specific plugin node. */\nexport const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/${pluginId}`;\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.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": ";
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport * from './meta';\nexport const RegistryPlugin = Plugin.lazy(meta, () => import('#plugin'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { pinnedWorkspaceId } from '@dxos/app-toolkit';\nimport { trim } from '@dxos/util';\n\nexport const REGISTRY_ID = pinnedWorkspaceId('dxos:plugin-registry');\nexport const REGISTRY_KEY = 'plugin-registry';\n\n// TODO(wittjosiah): Should this be a special separator or use the standard path separator?\nconst CATEGORY_SEPARATOR = '>';\n\n/** Build a registry category node ID. */\nexport const registryCategoryId = (category: string): string => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;\n\n/** Qualified graph path to a specific plugin node. */\nexport const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/${pluginId}`;\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.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": ";AAIA,SAASA,cAAc;;;ACCvB,SAASC,yBAAyB;AAClC,SAASC,YAAY;AAEd,IAAMC,cAAcF,kBAAkB,sBAAA;AACtC,IAAMG,eAAe;AAG5B,IAAMC,qBAAqB;AAGpB,IAAMC,qBAAqB,CAACC,aAA6B,GAAGH,YAAAA,GAAeC,kBAAAA,GAAqBE,QAAAA;AAGhG,IAAMC,gBAAgB,CAACC,aAA6B,QAAQN,WAAAA,IAAeM,QAAAA;AAE3E,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaX;;;;AAIf;;;ADlBO,IAAMY,iBAAiBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "pinnedWorkspaceId", "trim", "REGISTRY_ID", "REGISTRY_KEY", "CATEGORY_SEPARATOR", "registryCategoryId", "category", "getPluginPath", "pluginId", "meta", "id", "name", "description", "RegistryPlugin", "Plugin", "lazy", "meta"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":3282,"imports":[{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":941,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/storage.ts":{"bytes":6158,"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"@effect/platform/Path","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true}],"format":"esm"},"src/cli/index.ts":{"bytes":376,"imports":[{"path":"src/storage.ts","kind":"import-statement","original":"../storage"}],"format":"esm"},"src/translations.ts":{"bytes":3690,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2006},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["REGISTRY_ID","REGISTRY_KEY","RegistryPlugin","getPluginPath","meta","registryCategoryId"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":111},"src/meta.ts":{"bytesInOutput":640}},"bytes":942},"dist/lib/browser/cli/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3163},"dist/lib/browser/cli/index.mjs":{"imports":[{"path":"@effect/platform/FileSystem","kind":"import-statement","external":true},{"path":"@effect/platform/Path","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"yaml","kind":"import-statement","external":true},{"path":"@dxos/client-protocol","kind":"import-statement","external":true}],"exports":["loadEnabledPlugins","saveEnabledPlugins"],"entryPoint":"src/cli/index.ts","inputs":{"src/storage.ts":{"bytesInOutput":1230},"src/cli/index.ts":{"bytesInOutput":0}},"bytes":1338},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1724},"dist/lib/browser/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":1048}},"bytes":1140}}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/translations.ts
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
var translations = [
|
|
4
|
+
{
|
|
5
|
+
"en-US": {
|
|
6
|
+
[meta.id]: {
|
|
7
|
+
"plugin.name": "Registry",
|
|
8
|
+
"details.label": "Details",
|
|
9
|
+
"home-page.label": "Website",
|
|
10
|
+
"source.label": "Source",
|
|
11
|
+
"plugin-registry.label": "Plugin Registry",
|
|
12
|
+
"plugin-settings.label": "Plugin Settings",
|
|
13
|
+
"official-plugins.label": "Official",
|
|
14
|
+
"installed-plugins.label": "Enabled",
|
|
15
|
+
"recommended-plugins.label": "Recommended",
|
|
16
|
+
"labs-plugins.label": "Labs",
|
|
17
|
+
"community-plugins.label": "Community",
|
|
18
|
+
"load-by-url.label": "Load from URL",
|
|
19
|
+
"load-by-url-dialog.title": "Load Plugin from URL",
|
|
20
|
+
"plugin-url.label": "Plugin URL",
|
|
21
|
+
"load-plugin.label": "Load Plugin",
|
|
22
|
+
"loading.label": "Loading...",
|
|
23
|
+
"coming-soon.label": "Coming soon!",
|
|
24
|
+
"open-plugin-registry.label": "Open plugin registry",
|
|
25
|
+
"install.label": "Install",
|
|
26
|
+
"installing.label": "Installing\u2026",
|
|
27
|
+
"uninstall.label": "Uninstall"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
export {
|
|
33
|
+
translations
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'Registry',\n 'details.label': 'Details',\n 'home-page.label': 'Website',\n 'source.label': 'Source',\n 'plugin-registry.label': 'Plugin Registry',\n 'plugin-settings.label': 'Plugin Settings',\n 'official-plugins.label': 'Official',\n 'installed-plugins.label': 'Enabled',\n 'recommended-plugins.label': 'Recommended',\n 'labs-plugins.label': 'Labs',\n 'community-plugins.label': 'Community',\n 'load-by-url.label': 'Load from URL',\n 'load-by-url-dialog.title': 'Load Plugin from URL',\n 'plugin-url.label': 'Plugin URL',\n 'load-plugin.label': 'Load Plugin',\n 'loading.label': 'Loading...',\n 'coming-soon.label': 'Coming soon!',\n 'open-plugin-registry.label': 'Open plugin registry',\n 'install.label': 'Install',\n 'installing.label': 'Installing…',\n 'uninstall.label': 'Uninstall',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,EAAE,GAAG;QACT,eAAe;QACf,iBAAiB;QACjB,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,yBAAyB;QACzB,0BAA0B;QAC1B,2BAA2B;QAC3B,6BAA6B;QAC7B,sBAAsB;QACtB,2BAA2B;QAC3B,qBAAqB;QACrB,4BAA4B;QAC5B,oBAAoB;QACpB,qBAAqB;QACrB,iBAAiB;QACjB,qBAAqB;QACrB,8BAA8B;QAC9B,iBAAiB;QACjB,oBAAoB;QACpB,mBAAmB;MACrB;IACF;EACF;;",
|
|
6
|
+
"names": ["meta", "translations", "id"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import { Plugin as Plugin4 } from "@dxos/app-framework";
|
|
5
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
-
import { meta } from "#meta";
|
|
7
|
-
|
|
8
|
-
// src/cli/commands/index.ts
|
|
9
|
-
import * as Command4 from "@effect/cli/Command";
|
|
10
|
-
|
|
11
|
-
// src/cli/commands/disable.ts
|
|
12
|
-
import * as Args from "@effect/cli/Args";
|
|
13
|
-
import * as Command from "@effect/cli/Command";
|
|
14
|
-
import * as Console from "effect/Console";
|
|
15
|
-
import * as Effect2 from "effect/Effect";
|
|
16
|
-
import { Plugin } from "@dxos/app-framework";
|
|
17
|
-
import { CommandConfig } from "@dxos/cli-util";
|
|
18
|
-
import { invariant } from "@dxos/invariant";
|
|
19
|
-
|
|
20
|
-
// src/cli/storage.ts
|
|
3
|
+
// src/storage.ts
|
|
21
4
|
import * as FileSystem from "@effect/platform/FileSystem";
|
|
22
5
|
import * as Path from "@effect/platform/Path";
|
|
23
6
|
import * as Effect from "effect/Effect";
|
|
@@ -44,177 +27,7 @@ var saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }) {
|
|
|
44
27
|
const encoded = Yaml.stringify(enabled);
|
|
45
28
|
yield* fs.writeFileString(pluginsPath, encoded);
|
|
46
29
|
});
|
|
47
|
-
|
|
48
|
-
// src/cli/commands/disable.ts
|
|
49
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/disable.ts";
|
|
50
|
-
var handler = Effect2.fn(function* ({ id }) {
|
|
51
|
-
const { json, profile } = yield* CommandConfig;
|
|
52
|
-
const manager = yield* Plugin.Service;
|
|
53
|
-
const plugins = manager.getPlugins();
|
|
54
|
-
const plugin2 = plugins.find((p) => p.meta.id === id);
|
|
55
|
-
invariant(plugin2, `Plugin not found: ${id}`, {
|
|
56
|
-
F: __dxlog_file,
|
|
57
|
-
L: 22,
|
|
58
|
-
S: this,
|
|
59
|
-
A: [
|
|
60
|
-
"plugin",
|
|
61
|
-
"`Plugin not found: ${id}`"
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
const core = manager.getCore();
|
|
65
|
-
invariant(!core.includes(id), `Cannot disable core plugin: ${id}`, {
|
|
66
|
-
F: __dxlog_file,
|
|
67
|
-
L: 25,
|
|
68
|
-
S: this,
|
|
69
|
-
A: [
|
|
70
|
-
"!core.includes(id)",
|
|
71
|
-
"`Cannot disable core plugin: ${id}`"
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
const disabled = yield* manager.disable(id);
|
|
75
|
-
invariant(disabled, `Failed to disable plugin: ${id}`, {
|
|
76
|
-
F: __dxlog_file,
|
|
77
|
-
L: 28,
|
|
78
|
-
S: this,
|
|
79
|
-
A: [
|
|
80
|
-
"disabled",
|
|
81
|
-
"`Failed to disable plugin: ${id}`"
|
|
82
|
-
]
|
|
83
|
-
});
|
|
84
|
-
const enabledPlugins = manager.getEnabled();
|
|
85
|
-
yield* saveEnabledPlugins({
|
|
86
|
-
profile,
|
|
87
|
-
enabled: [
|
|
88
|
-
...enabledPlugins
|
|
89
|
-
]
|
|
90
|
-
});
|
|
91
|
-
if (json) {
|
|
92
|
-
yield* Console.log(JSON.stringify({
|
|
93
|
-
id,
|
|
94
|
-
enabled: false
|
|
95
|
-
}, null, 2));
|
|
96
|
-
} else {
|
|
97
|
-
yield* Console.log(`Plugin "${plugin2.meta.name ?? id}" disabled.`);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
var disable = Command.make("disable", {
|
|
101
|
-
id: Args.text({
|
|
102
|
-
name: "id"
|
|
103
|
-
}).pipe(Args.withDescription("The ID of the plugin to disable."))
|
|
104
|
-
}, handler).pipe(Command.withDescription("Disable a plugin."));
|
|
105
|
-
|
|
106
|
-
// src/cli/commands/enable.ts
|
|
107
|
-
import * as Args2 from "@effect/cli/Args";
|
|
108
|
-
import * as Command2 from "@effect/cli/Command";
|
|
109
|
-
import * as Console2 from "effect/Console";
|
|
110
|
-
import * as Effect3 from "effect/Effect";
|
|
111
|
-
import { Plugin as Plugin2 } from "@dxos/app-framework";
|
|
112
|
-
import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
|
|
113
|
-
import { invariant as invariant2 } from "@dxos/invariant";
|
|
114
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/enable.ts";
|
|
115
|
-
var handler2 = Effect3.fn(function* ({ id }) {
|
|
116
|
-
const { json, profile } = yield* CommandConfig2;
|
|
117
|
-
const manager = yield* Plugin2.Service;
|
|
118
|
-
const plugins = manager.getPlugins();
|
|
119
|
-
const plugin2 = plugins.find((p) => p.meta.id === id);
|
|
120
|
-
invariant2(plugin2, `Plugin not found: ${id}`, {
|
|
121
|
-
F: __dxlog_file2,
|
|
122
|
-
L: 22,
|
|
123
|
-
S: this,
|
|
124
|
-
A: [
|
|
125
|
-
"plugin",
|
|
126
|
-
"`Plugin not found: ${id}`"
|
|
127
|
-
]
|
|
128
|
-
});
|
|
129
|
-
const enabled = yield* manager.enable(id);
|
|
130
|
-
invariant2(enabled, `Failed to enable plugin: ${id}`, {
|
|
131
|
-
F: __dxlog_file2,
|
|
132
|
-
L: 25,
|
|
133
|
-
S: this,
|
|
134
|
-
A: [
|
|
135
|
-
"enabled",
|
|
136
|
-
"`Failed to enable plugin: ${id}`"
|
|
137
|
-
]
|
|
138
|
-
});
|
|
139
|
-
const enabledPlugins = manager.getEnabled();
|
|
140
|
-
yield* saveEnabledPlugins({
|
|
141
|
-
profile,
|
|
142
|
-
enabled: [
|
|
143
|
-
...enabledPlugins
|
|
144
|
-
]
|
|
145
|
-
});
|
|
146
|
-
if (json) {
|
|
147
|
-
yield* Console2.log(JSON.stringify({
|
|
148
|
-
id,
|
|
149
|
-
enabled: true
|
|
150
|
-
}, null, 2));
|
|
151
|
-
} else {
|
|
152
|
-
yield* Console2.log(`Plugin "${plugin2.meta.name ?? id}" enabled.`);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
var enable = Command2.make("enable", {
|
|
156
|
-
id: Args2.text({
|
|
157
|
-
name: "id"
|
|
158
|
-
}).pipe(Args2.withDescription("The ID of the plugin to enable."))
|
|
159
|
-
}, handler2).pipe(Command2.withDescription("Enable a plugin."));
|
|
160
|
-
|
|
161
|
-
// src/cli/commands/list.ts
|
|
162
|
-
import * as Command3 from "@effect/cli/Command";
|
|
163
|
-
import * as Console3 from "effect/Console";
|
|
164
|
-
import * as Effect4 from "effect/Effect";
|
|
165
|
-
import { Plugin as Plugin3 } from "@dxos/app-framework";
|
|
166
|
-
import { CommandConfig as CommandConfig3, printList } from "@dxos/cli-util";
|
|
167
|
-
|
|
168
|
-
// src/cli/commands/util.ts
|
|
169
|
-
import { FormBuilder } from "@dxos/cli-util";
|
|
170
|
-
var printPlugin = (plugin2) => {
|
|
171
|
-
const status = plugin2.core ? "core" : plugin2.enabled ? "enabled" : "disabled";
|
|
172
|
-
return FormBuilder.make({
|
|
173
|
-
title: plugin2.name
|
|
174
|
-
}).pipe(FormBuilder.set("id", plugin2.id), FormBuilder.set("status", status), FormBuilder.build);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// src/cli/commands/list.ts
|
|
178
|
-
var handler3 = Effect4.fn(function* () {
|
|
179
|
-
const { json } = yield* CommandConfig3;
|
|
180
|
-
const manager = yield* Plugin3.Service;
|
|
181
|
-
const plugins = manager.getPlugins();
|
|
182
|
-
const enabled = manager.getEnabled();
|
|
183
|
-
const core = manager.getCore();
|
|
184
|
-
const formattedPlugins = plugins.map((plugin2) => {
|
|
185
|
-
const isEnabled = enabled.includes(plugin2.meta.id);
|
|
186
|
-
const isCore = core.includes(plugin2.meta.id);
|
|
187
|
-
return {
|
|
188
|
-
id: plugin2.meta.id,
|
|
189
|
-
name: plugin2.meta.name ?? plugin2.meta.id,
|
|
190
|
-
enabled: isEnabled,
|
|
191
|
-
core: isCore
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
if (json) {
|
|
195
|
-
yield* Console3.log(JSON.stringify(formattedPlugins, null, 2));
|
|
196
|
-
} else {
|
|
197
|
-
const formatted = formattedPlugins.map(printPlugin);
|
|
198
|
-
yield* Console3.log(printList(formatted));
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
var list = Command3.make("list", {}, handler3).pipe(Command3.withDescription("List all available plugins."));
|
|
202
|
-
|
|
203
|
-
// src/cli/commands/index.ts
|
|
204
|
-
var plugin = Command4.make("plugin").pipe(Command4.withDescription("Manage plugins."), Command4.withSubcommands([
|
|
205
|
-
enable,
|
|
206
|
-
disable,
|
|
207
|
-
list
|
|
208
|
-
]));
|
|
209
|
-
|
|
210
|
-
// src/cli/plugin.ts
|
|
211
|
-
var RegistryPlugin = Plugin4.define(meta).pipe(AppPlugin.addCommandModule({
|
|
212
|
-
commands: [
|
|
213
|
-
plugin
|
|
214
|
-
]
|
|
215
|
-
}), Plugin4.make);
|
|
216
30
|
export {
|
|
217
|
-
RegistryPlugin,
|
|
218
31
|
loadEnabledPlugins,
|
|
219
32
|
saveEnabledPlugins
|
|
220
33
|
};
|