@dxos/plugin-registry 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934

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.
Files changed (192) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/RegistryPlugin.mjs +27 -0
  3. package/dist/lib/neutral/RegistryPlugin.mjs.map +7 -0
  4. package/dist/lib/{browser/cli/index.mjs → neutral/RegistryPlugin.node.mjs} +29 -95
  5. package/dist/lib/neutral/RegistryPlugin.node.mjs.map +7 -0
  6. package/dist/lib/neutral/chunk-A6F6X6M4.mjs +31 -0
  7. package/dist/lib/neutral/chunk-A6F6X6M4.mjs.map +7 -0
  8. package/dist/lib/neutral/chunk-XK2JMH3H.mjs +33 -0
  9. package/dist/lib/neutral/chunk-XK2JMH3H.mjs.map +7 -0
  10. package/dist/lib/neutral/index.mjs +23 -0
  11. package/dist/lib/neutral/index.mjs.map +7 -0
  12. package/dist/lib/neutral/meta.json +1 -0
  13. package/dist/lib/neutral/open-plugin-registry-II735N76.mjs +15 -0
  14. package/dist/lib/neutral/open-plugin-registry-II735N76.mjs.map +7 -0
  15. package/dist/lib/neutral/plugin.mjs +18 -0
  16. package/dist/lib/neutral/plugin.mjs.map +7 -0
  17. package/dist/lib/neutral/translations.mjs +67 -0
  18. package/dist/lib/neutral/translations.mjs.map +7 -0
  19. package/dist/types/src/RegistryPlugin.d.ts +1 -0
  20. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  21. package/dist/types/src/{cli/plugin.d.ts → RegistryPlugin.node.d.ts} +2 -1
  22. package/dist/types/src/RegistryPlugin.node.d.ts.map +1 -0
  23. package/dist/types/src/RegistryPlugin.test.d.ts +2 -0
  24. package/dist/types/src/RegistryPlugin.test.d.ts.map +1 -0
  25. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/dev-plugin-loader.d.ts +11 -0
  27. package/dist/types/src/capabilities/dev-plugin-loader.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/index.d.ts +11 -1
  29. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  31. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  33. package/dist/types/src/capabilities/settings.d.ts +14 -0
  34. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  35. package/dist/types/src/{cli/commands → commands}/disable.d.ts +2 -2
  36. package/dist/types/src/commands/disable.d.ts.map +1 -0
  37. package/dist/types/src/{cli/commands → commands}/enable.d.ts +2 -2
  38. package/dist/types/src/commands/enable.d.ts.map +1 -0
  39. package/dist/types/src/commands/index.d.ts.map +1 -0
  40. package/dist/types/src/commands/list.d.ts +7 -0
  41. package/dist/types/src/commands/list.d.ts.map +1 -0
  42. package/dist/types/src/commands/util.d.ts.map +1 -0
  43. package/dist/types/src/components/DisableDependentsAlert/DisableDependentsAlert.d.ts +24 -0
  44. package/dist/types/src/components/DisableDependentsAlert/DisableDependentsAlert.d.ts.map +1 -0
  45. package/dist/types/src/components/DisableDependentsAlert/index.d.ts +2 -0
  46. package/dist/types/src/components/DisableDependentsAlert/index.d.ts.map +1 -0
  47. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +63 -6
  48. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -1
  49. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +55 -24
  50. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts +20 -0
  52. package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts.map +1 -0
  53. package/dist/types/src/components/PluginFailureBadge/index.d.ts +2 -0
  54. package/dist/types/src/components/PluginFailureBadge/index.d.ts.map +1 -0
  55. package/dist/types/src/components/PluginList/PluginItem.d.ts +29 -2
  56. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -1
  57. package/dist/types/src/components/PluginList/PluginList.d.ts +18 -3
  58. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -1
  59. package/dist/types/src/components/PluginList/PluginList.stories.d.ts +55 -20
  60. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts +18 -0
  62. package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts.map +1 -0
  63. package/dist/types/src/components/RegistrySettings/index.d.ts +2 -0
  64. package/dist/types/src/components/RegistrySettings/index.d.ts.map +1 -0
  65. package/dist/types/src/components/index.d.ts +3 -0
  66. package/dist/types/src/components/index.d.ts.map +1 -1
  67. package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts +20 -0
  68. package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts.map +1 -0
  69. package/dist/types/src/containers/BaseRegistryArticle/index.d.ts +2 -0
  70. package/dist/types/src/containers/BaseRegistryArticle/index.d.ts.map +1 -0
  71. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -1
  72. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -1
  73. package/dist/types/src/containers/PublicRegistryArticle/PublicRegistryArticle.d.ts +8 -0
  74. package/dist/types/src/containers/PublicRegistryArticle/PublicRegistryArticle.d.ts.map +1 -0
  75. package/dist/types/src/containers/PublicRegistryArticle/index.d.ts +2 -0
  76. package/dist/types/src/containers/PublicRegistryArticle/index.d.ts.map +1 -0
  77. package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts +14 -0
  78. package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts.map +1 -0
  79. package/dist/types/src/containers/RegistryArticle/index.d.ts +2 -0
  80. package/dist/types/src/containers/RegistryArticle/index.d.ts.map +1 -0
  81. package/dist/types/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.d.ts +13 -0
  82. package/dist/types/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.d.ts.map +1 -0
  83. package/dist/types/src/containers/RegistrySettingsContainer/index.d.ts +2 -0
  84. package/dist/types/src/containers/RegistrySettingsContainer/index.d.ts.map +1 -0
  85. package/dist/types/src/containers/index.d.ts +3 -1
  86. package/dist/types/src/containers/index.d.ts.map +1 -1
  87. package/dist/types/src/hooks/index.d.ts +5 -0
  88. package/dist/types/src/hooks/index.d.ts.map +1 -0
  89. package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
  90. package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
  91. package/dist/types/src/hooks/use-disable-confirmation.d.ts +19 -0
  92. package/dist/types/src/hooks/use-disable-confirmation.d.ts.map +1 -0
  93. package/dist/types/src/hooks/use-registry-plugins.d.ts +15 -0
  94. package/dist/types/src/hooks/use-registry-plugins.d.ts.map +1 -0
  95. package/dist/types/src/hooks/use-update-available.d.ts +18 -0
  96. package/dist/types/src/hooks/use-update-available.d.ts.map +1 -0
  97. package/dist/types/src/index.d.ts +1 -1
  98. package/dist/types/src/index.d.ts.map +1 -1
  99. package/dist/types/src/meta.d.ts +2 -0
  100. package/dist/types/src/meta.d.ts.map +1 -1
  101. package/dist/types/src/operations/index.d.ts +1 -1
  102. package/dist/types/src/operations/index.d.ts.map +1 -1
  103. package/dist/types/src/operations/open-plugin-registry.d.ts +1 -1
  104. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -1
  105. package/dist/types/src/plugin.d.ts +4 -0
  106. package/dist/types/src/plugin.d.ts.map +1 -0
  107. package/dist/types/src/storage.d.ts.map +1 -0
  108. package/dist/types/src/translations.d.ts +54 -20
  109. package/dist/types/src/translations.d.ts.map +1 -1
  110. package/dist/types/src/types.d.ts +30 -1
  111. package/dist/types/src/types.d.ts.map +1 -1
  112. package/dist/types/tsconfig.tsbuildinfo +1 -1
  113. package/package.json +47 -34
  114. package/src/{cli/plugin.ts → RegistryPlugin.node.ts} +2 -0
  115. package/src/RegistryPlugin.test.ts +24 -0
  116. package/src/RegistryPlugin.tsx +11 -4
  117. package/src/capabilities/app-graph-builder.ts +68 -17
  118. package/src/capabilities/dev-plugin-loader.ts +39 -0
  119. package/src/capabilities/index.ts +3 -1
  120. package/src/capabilities/operation-handler.ts +1 -1
  121. package/src/capabilities/react-surface.tsx +88 -38
  122. package/src/capabilities/settings.ts +34 -0
  123. package/src/components/DisableDependentsAlert/DisableDependentsAlert.tsx +69 -0
  124. package/src/components/DisableDependentsAlert/index.ts +5 -0
  125. package/src/components/PluginDetail/PluginDetail.stories.tsx +3 -2
  126. package/src/components/PluginDetail/PluginDetail.tsx +203 -15
  127. package/src/components/PluginFailureBadge/PluginFailureBadge.tsx +68 -0
  128. package/src/components/PluginFailureBadge/index.ts +5 -0
  129. package/src/components/PluginList/PluginItem.tsx +113 -11
  130. package/src/components/PluginList/PluginList.stories.tsx +1 -1
  131. package/src/components/PluginList/PluginList.tsx +32 -4
  132. package/src/components/RegistrySettings/RegistrySettings.tsx +120 -0
  133. package/src/components/RegistrySettings/index.ts +5 -0
  134. package/src/components/index.ts +3 -0
  135. package/src/containers/BaseRegistryArticle/BaseRegistryArticle.tsx +178 -0
  136. package/src/containers/BaseRegistryArticle/index.ts +5 -0
  137. package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +6 -3
  138. package/src/containers/PluginArticle/PluginArticle.tsx +360 -10
  139. package/src/containers/PublicRegistryArticle/PublicRegistryArticle.tsx +192 -0
  140. package/src/containers/PublicRegistryArticle/index.ts +5 -0
  141. package/src/containers/RegistryArticle/RegistryArticle.tsx +53 -0
  142. package/src/containers/RegistryArticle/index.ts +5 -0
  143. package/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.tsx +59 -0
  144. package/src/containers/RegistrySettingsContainer/index.ts +5 -0
  145. package/src/containers/index.ts +3 -1
  146. package/src/hooks/index.ts +8 -0
  147. package/src/hooks/use-auto-tags.ts +51 -0
  148. package/src/hooks/use-disable-confirmation.ts +58 -0
  149. package/src/hooks/use-registry-plugins.ts +29 -0
  150. package/src/hooks/use-update-available.ts +31 -0
  151. package/src/index.ts +1 -1
  152. package/src/meta.ts +5 -0
  153. package/src/operations/index.ts +1 -1
  154. package/src/operations/open-plugin-registry.ts +1 -1
  155. package/src/plugin.ts +11 -0
  156. package/src/translations.ts +44 -4
  157. package/src/types.ts +33 -1
  158. package/dist/lib/browser/cli/index.mjs.map +0 -7
  159. package/dist/lib/browser/index.mjs +0 -71
  160. package/dist/lib/browser/index.mjs.map +0 -7
  161. package/dist/lib/browser/meta.json +0 -1
  162. package/dist/lib/node-esm/cli/index.mjs +0 -221
  163. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  164. package/dist/lib/node-esm/index.mjs +0 -73
  165. package/dist/lib/node-esm/index.mjs.map +0 -7
  166. package/dist/lib/node-esm/meta.json +0 -1
  167. package/dist/types/src/cli/commands/disable.d.ts.map +0 -1
  168. package/dist/types/src/cli/commands/enable.d.ts.map +0 -1
  169. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  170. package/dist/types/src/cli/commands/list.d.ts +0 -7
  171. package/dist/types/src/cli/commands/list.d.ts.map +0 -1
  172. package/dist/types/src/cli/commands/util.d.ts.map +0 -1
  173. package/dist/types/src/cli/index.d.ts +0 -3
  174. package/dist/types/src/cli/index.d.ts.map +0 -1
  175. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  176. package/dist/types/src/cli/storage.d.ts.map +0 -1
  177. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +0 -14
  178. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +0 -1
  179. package/dist/types/src/containers/PluginRegistry/index.d.ts +0 -2
  180. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +0 -1
  181. package/src/cli/index.ts +0 -6
  182. package/src/containers/PluginRegistry/PluginRegistry.tsx +0 -94
  183. package/src/containers/PluginRegistry/index.ts +0 -5
  184. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  185. /package/dist/types/src/{cli/commands → commands}/util.d.ts +0 -0
  186. /package/dist/types/src/{cli/storage.d.ts → storage.d.ts} +0 -0
  187. /package/src/{cli/commands → commands}/disable.ts +0 -0
  188. /package/src/{cli/commands → commands}/enable.ts +0 -0
  189. /package/src/{cli/commands → commands}/index.ts +0 -0
  190. /package/src/{cli/commands → commands}/list.ts +0 -0
  191. /package/src/{cli/commands → commands}/util.ts +0 -0
  192. /package/src/{cli/storage.ts → storage.ts} +0 -0
@@ -1,221 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/cli/plugin.ts
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
21
- import * as FileSystem from "@effect/platform/FileSystem";
22
- import * as Path from "@effect/platform/Path";
23
- import * as Effect from "effect/Effect";
24
- import * as Schema from "effect/Schema";
25
- import * as Yaml from "yaml";
26
- import { DX_CONFIG } from "@dxos/client-protocol";
27
- var PluginsSchema = Schema.Array(Schema.String);
28
- var getPluginsConfigPath = (profile) => `${DX_CONFIG}/plugins/${profile}.yml`;
29
- var loadEnabledPlugins = Effect.fn(function* ({ profile }) {
30
- const fs = yield* FileSystem.FileSystem;
31
- const pluginsPath = getPluginsConfigPath(profile);
32
- const content = yield* fs.readFileString(pluginsPath).pipe(Effect.catchTag("SystemError", () => Effect.succeed("[]")));
33
- const raw = Yaml.parse(content);
34
- const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(Effect.catchAll(() => Effect.succeed([])));
35
- return parsed;
36
- });
37
- var saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }) {
38
- const fs = yield* FileSystem.FileSystem;
39
- const path = yield* Path.Path;
40
- const pluginsPath = getPluginsConfigPath(profile);
41
- yield* fs.makeDirectory(path.dirname(pluginsPath), {
42
- recursive: true
43
- });
44
- const encoded = Yaml.stringify(enabled);
45
- yield* fs.writeFileString(pluginsPath, encoded);
46
- });
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
- export {
217
- RegistryPlugin,
218
- loadEnabledPlugins,
219
- saveEnabledPlugins
220
- };
221
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/cli/plugin.ts", "../../../../src/cli/commands/index.ts", "../../../../src/cli/commands/disable.ts", "../../../../src/cli/storage.ts", "../../../../src/cli/commands/enable.ts", "../../../../src/cli/commands/list.ts", "../../../../src/cli/commands/util.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nimport { plugin } from './commands';\n\nexport const RegistryPlugin = Plugin.define(meta).pipe(\n AppPlugin.addCommandModule({\n commands: [plugin],\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { disable } from './disable';\nimport { enable } from './enable';\nimport { list } from './list';\n\nexport const plugin: Command.Command<any, any, any, any> = Command.make('plugin').pipe(\n Command.withDescription('Manage plugins.'),\n Command.withSubcommands([enable, disable, list]),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig } from '@dxos/cli-util';\nimport { invariant } from '@dxos/invariant';\n\nimport { saveEnabledPlugins } from '../storage';\n\nexport const handler = Effect.fn(function* ({ id }: { id: string }) {\n const { json, profile } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const plugin = plugins.find((p: Plugin.Plugin) => p.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n\n const core = manager.getCore();\n invariant(!core.includes(id), `Cannot disable core plugin: ${id}`);\n\n const disabled = yield* manager.disable(id);\n invariant(disabled, `Failed to disable plugin: ${id}`);\n\n // Save enabled plugins to storage\n const enabledPlugins = manager.getEnabled();\n yield* saveEnabledPlugins({ profile, enabled: [...enabledPlugins] });\n\n if (json) {\n yield* Console.log(JSON.stringify({ id, enabled: false }, null, 2));\n } else {\n yield* Console.log(`Plugin \"${plugin.meta.name ?? id}\" disabled.`);\n }\n});\n\nexport const disable = Command.make(\n 'disable',\n {\n id: Args.text({ name: 'id' }).pipe(Args.withDescription('The ID of the plugin to disable.')),\n },\n handler,\n).pipe(Command.withDescription('Disable a plugin.'));\n", "//\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", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig } from '@dxos/cli-util';\nimport { invariant } from '@dxos/invariant';\n\nimport { saveEnabledPlugins } from '../storage';\n\nexport const handler = Effect.fn(function* ({ id }: { id: string }) {\n const { json, profile } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const plugin = plugins.find((p: Plugin.Plugin) => p.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n\n const enabled = yield* manager.enable(id);\n invariant(enabled, `Failed to enable plugin: ${id}`);\n\n // Save enabled plugins to storage\n const enabledPlugins = manager.getEnabled();\n yield* saveEnabledPlugins({ profile, enabled: [...enabledPlugins] });\n\n if (json) {\n yield* Console.log(JSON.stringify({ id, enabled: true }, null, 2));\n } else {\n yield* Console.log(`Plugin \"${plugin.meta.name ?? id}\" enabled.`);\n }\n});\n\nexport const enable = Command.make(\n 'enable',\n {\n id: Args.text({ name: 'id' }).pipe(Args.withDescription('The ID of the plugin to enable.')),\n },\n handler,\n).pipe(Command.withDescription('Enable a plugin.'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig, printList } from '@dxos/cli-util';\n\nimport { type FormattedPlugin, printPlugin } from './util';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const enabled = manager.getEnabled();\n const core = manager.getCore();\n\n const formattedPlugins: FormattedPlugin[] = plugins.map((plugin: Plugin.Plugin) => {\n const isEnabled = enabled.includes(plugin.meta.id);\n const isCore = core.includes(plugin.meta.id);\n return {\n id: plugin.meta.id,\n name: plugin.meta.name ?? plugin.meta.id,\n enabled: isEnabled,\n core: isCore,\n };\n });\n\n if (json) {\n yield* Console.log(JSON.stringify(formattedPlugins, null, 2));\n } else {\n const formatted = formattedPlugins.map(printPlugin);\n yield* Console.log(printList(formatted));\n }\n});\n\nexport const list = Command.make('list', {}, handler).pipe(Command.withDescription('List all available plugins.'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FormBuilder } from '@dxos/cli-util';\n\nexport type FormattedPlugin = {\n id: string;\n name: string;\n enabled: boolean;\n core: boolean;\n};\n\n/**\n * Pretty prints a plugin with ANSI colors.\n */\nexport const printPlugin = (plugin: FormattedPlugin) => {\n const status = plugin.core ? 'core' : plugin.enabled ? 'enabled' : 'disabled';\n return FormBuilder.make({ title: plugin.name }).pipe(\n FormBuilder.set('id', plugin.id),\n FormBuilder.set('status', status),\n FormBuilder.build,\n );\n};\n"],
5
- "mappings": ";;;AAIA,SAASA,UAAAA,eAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;;;ACHrB,YAAYC,cAAa;;;ACAzB,YAAYC,UAAU;AACtB,YAAYC,aAAa;AACzB,YAAYC,aAAa;AACzB,YAAYC,aAAY;AAExB,SAASC,cAAc;AACvB,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;;;ACP1B,YAAYC,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,GAAGC,SAAAA,YAAqBD,OAAAA;AAMnE,IAAME,qBAA4BC,UAAG,WAAW,EAAEH,QAAO,GAAuB;AACrF,QAAMI,KAAK,OAAkBC;AAC7B,QAAMC,cAAcP,qBAAqBC,OAAAA;AAEzC,QAAMO,UAAU,OAAOH,GACpBI,eAAeF,WAAAA,EACfG,KAAYC,gBAAS,eAAe,MAAaC,eAA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F,SAAAA,CAAAA;EAC/B;AACF,CAAA;AAEO,IAAMG,OAAeC,cAAK,QAAQ,CAAC,GAAG7B,QAAAA,EAAS8B,KAAaC,yBAAgB,6BAAA,CAAA;;;AJ9B5E,IAAMC,SAAsDC,cAAK,QAAA,EAAUC,KACxEC,yBAAgB,iBAAA,GAChBC,yBAAgB;EAACC;EAAQC;EAASC;CAAK,CAAA;;;ADD1C,IAAMC,iBAAiBC,QAAOC,OAAOC,IAAAA,EAAMC,KAChDC,UAAUC,iBAAiB;EACzBC,UAAU;IAACC;;AACb,CAAA,GACAP,QAAOQ,IAAI;",
6
- "names": ["Plugin", "AppPlugin", "meta", "Command", "Args", "Command", "Console", "Effect", "Plugin", "CommandConfig", "invariant", "FileSystem", "Path", "Effect", "Schema", "Yaml", "DX_CONFIG", "PluginsSchema", "Array", "String", "getPluginsConfigPath", "profile", "DX_CONFIG", "loadEnabledPlugins", "fn", "fs", "FileSystem", "pluginsPath", "content", "readFileString", "pipe", "catchTag", "succeed", "raw", "parse", "parsed", "decodeUnknown", "catchAll", "saveEnabledPlugins", "enabled", "path", "Path", "makeDirectory", "dirname", "recursive", "encoded", "stringify", "writeFileString", "handler", "fn", "id", "json", "profile", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "plugin", "find", "p", "meta", "invariant", "core", "getCore", "includes", "disabled", "disable", "enabledPlugins", "getEnabled", "saveEnabledPlugins", "enabled", "log", "JSON", "stringify", "name", "make", "text", "pipe", "withDescription", "Args", "Command", "Console", "Effect", "Plugin", "CommandConfig", "invariant", "handler", "fn", "id", "json", "profile", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "plugin", "find", "p", "meta", "invariant", "enabled", "enable", "enabledPlugins", "getEnabled", "saveEnabledPlugins", "log", "JSON", "stringify", "name", "make", "text", "pipe", "withDescription", "Command", "Console", "Effect", "Plugin", "CommandConfig", "printList", "FormBuilder", "printPlugin", "plugin", "status", "core", "enabled", "FormBuilder", "make", "title", "name", "pipe", "set", "id", "build", "handler", "fn", "json", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "enabled", "getEnabled", "core", "getCore", "formattedPlugins", "map", "plugin", "isEnabled", "includes", "meta", "id", "isCore", "name", "log", "JSON", "stringify", "formatted", "printPlugin", "printList", "list", "make", "pipe", "withDescription", "plugin", "make", "pipe", "withDescription", "withSubcommands", "enable", "disable", "list", "RegistryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addCommandModule", "commands", "plugin", "make"]
7
- }
@@ -1,73 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/meta.ts
4
- import { pinnedWorkspaceId } from "@dxos/app-toolkit";
5
- import { trim } from "@dxos/util";
6
- var REGISTRY_ID = pinnedWorkspaceId("dxos:plugin-registry");
7
- var REGISTRY_KEY = "plugin-registry";
8
- var CATEGORY_SEPARATOR = ">";
9
- var registryCategoryId = (category) => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;
10
- var getPluginPath = (pluginId) => `root/${REGISTRY_ID}/${pluginId}`;
11
- var meta = {
12
- id: "org.dxos.plugin.registry",
13
- name: "Plugins",
14
- description: trim`
15
- Plugin management system for discovering, installing, and configuring workspace extensions.
16
- Browse available plugins and customize your workspace capabilities.
17
- `
18
- };
19
-
20
- // src/RegistryPlugin.tsx
21
- import { Plugin } from "@dxos/app-framework";
22
- import { AppPlugin } from "@dxos/app-toolkit";
23
- import { AppGraphBuilder, OperationHandler, ReactSurface } from "#capabilities";
24
- import { meta as meta3 } from "#meta";
25
-
26
- // src/translations.ts
27
- import { meta as meta2 } from "#meta";
28
- var translations = [
29
- {
30
- "en-US": {
31
- [meta2.id]: {
32
- "plugin.name": "Registry",
33
- "details.label": "Details",
34
- "home-page.label": "Website",
35
- "source.label": "Source",
36
- "plugin-registry.label": "Plugin Registry",
37
- "all-plugins.label": "All",
38
- "installed-plugins.label": "Enabled",
39
- "recommended-plugins.label": "Recommended",
40
- "labs-plugins.label": "Labs",
41
- "community-plugins.label": "Community",
42
- "load-by-url.label": "Load from URL",
43
- "load-by-url-dialog.title": "Load Plugin from URL",
44
- "plugin-url.label": "Plugin URL",
45
- "load-plugin.label": "Load Plugin",
46
- "loading.label": "Loading...",
47
- "coming-soon.label": "Coming soon!",
48
- "open-plugin-registry.label": "Open plugin registry",
49
- "settings.label": "Settings"
50
- }
51
- }
52
- }
53
- ];
54
-
55
- // src/RegistryPlugin.tsx
56
- var RegistryPlugin = Plugin.define(meta3).pipe(AppPlugin.addAppGraphModule({
57
- activate: AppGraphBuilder
58
- }), AppPlugin.addOperationHandlerModule({
59
- activate: OperationHandler
60
- }), AppPlugin.addSurfaceModule({
61
- activate: ReactSurface
62
- }), AppPlugin.addTranslationsModule({
63
- translations
64
- }), Plugin.make);
65
- export {
66
- REGISTRY_ID,
67
- REGISTRY_KEY,
68
- RegistryPlugin,
69
- getPluginPath,
70
- meta,
71
- registryCategoryId
72
- };
73
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/RegistryPlugin.tsx", "../../../src/translations.ts"],
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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, OperationHandler, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\n\nimport { translations } from './translations';\n\nexport const RegistryPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\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 'all-plugins.label': 'All',\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 'settings.label': 'Settings',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;AAKA,SAASA,yBAAyB;AAClC,SAASC,YAAY;AAEd,IAAMC,cAAcC,kBAAkB,sBAAA;AACtC,IAAMC,eAAe;AAG5B,IAAMC,qBAAqB;AAGpB,IAAMC,qBAAqB,CAACC,aAA6B,GAAGH,YAAAA,GAAeC,kBAAAA,GAAqBE,QAAAA;AAGhG,IAAMC,gBAAgB,CAACC,aAA6B,QAAQP,WAAAA,IAAeO,QAAAA;AAE3E,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;ACvBA,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,iBAAiBC,kBAAkBC,oBAAoB;AAChE,SAASC,QAAAA,aAAY;;;ACFrB,SAASC,QAAAA,aAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,MAAKC,EAAE,GAAG;QACT,eAAe;QACf,iBAAiB;QACjB,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,qBAAqB;QACrB,2BAA2B;QAC3B,6BAA6B;QAC7B,sBAAsB;QACtB,2BAA2B;QAC3B,qBAAqB;QACrB,4BAA4B;QAC5B,oBAAoB;QACpB,qBAAqB;QACrB,iBAAiB;QACjB,qBAAqB;QACrB,8BAA8B;QAC9B,kBAAkB;MACpB;IACF;EACF;;;;ADpBK,IAAMC,iBAAiBC,OAAOC,OAAOC,KAAAA,EAAMC,KAChDC,UAAUC,kBAAkB;EAAEC,UAAUC;AAAgB,CAAA,GACxDH,UAAUI,0BAA0B;EAAEF,UAAUG;AAAiB,CAAA,GACjEL,UAAUM,iBAAiB;EAAEJ,UAAUK;AAAa,CAAA,GACpDP,UAAUQ,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cb,OAAOc,IAAI;",
6
- "names": ["pinnedWorkspaceId", "trim", "REGISTRY_ID", "pinnedWorkspaceId", "REGISTRY_KEY", "CATEGORY_SEPARATOR", "registryCategoryId", "category", "getPluginPath", "pluginId", "meta", "id", "name", "description", "trim", "Plugin", "AppPlugin", "AppGraphBuilder", "OperationHandler", "ReactSurface", "meta", "meta", "translations", "meta", "id", "RegistryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "make"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"src/meta.ts":{"bytes":3364,"imports":[{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3359,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/RegistryPlugin.tsx":{"bytes":2609,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":557,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/RegistryPlugin.tsx","kind":"import-statement","original":"./RegistryPlugin"}],"format":"esm"},"src/cli/storage.ts":{"bytes":6251,"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/commands/disable.ts":{"bytes":6472,"imports":[{"path":"@effect/cli/Args","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/cli/storage.ts","kind":"import-statement","original":"../storage"}],"format":"esm"},"src/cli/commands/enable.ts":{"bytes":5826,"imports":[{"path":"@effect/cli/Args","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/cli/storage.ts","kind":"import-statement","original":"../storage"}],"format":"esm"},"src/cli/commands/util.ts":{"bytes":2004,"imports":[{"path":"@dxos/cli-util","kind":"import-statement","external":true}],"format":"esm"},"src/cli/commands/list.ts":{"bytes":4966,"imports":[{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"src/cli/commands/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"src/cli/commands/index.ts":{"bytes":1598,"imports":[{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"src/cli/commands/disable.ts","kind":"import-statement","original":"./disable"},{"path":"src/cli/commands/enable.ts","kind":"import-statement","original":"./enable"},{"path":"src/cli/commands/list.ts","kind":"import-statement","original":"./list"}],"format":"esm"},"src/cli/plugin.ts":{"bytes":1555,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"src/cli/commands/index.ts","kind":"import-statement","original":"./commands"}],"format":"esm"},"src/cli/index.ts":{"bytes":544,"imports":[{"path":"src/cli/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"src/cli/storage.ts","kind":"import-statement","original":"./storage"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4448},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["REGISTRY_ID","REGISTRY_KEY","RegistryPlugin","getPluginPath","meta","registryCategoryId"],"entryPoint":"src/index.ts","inputs":{"src/meta.ts":{"bytesInOutput":640},"src/index.ts":{"bytesInOutput":0},"src/RegistryPlugin.tsx":{"bytesInOutput":518},"src/translations.ts":{"bytesInOutput":910}},"bytes":2396},"dist/lib/node-esm/cli/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13863},"dist/lib/node-esm/cli/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"@effect/cli/Args","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"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},{"path":"@effect/cli/Args","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@effect/cli/Command","kind":"import-statement","external":true},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true},{"path":"@dxos/cli-util","kind":"import-statement","external":true}],"exports":["RegistryPlugin","loadEnabledPlugins","saveEnabledPlugins"],"entryPoint":"src/cli/index.ts","inputs":{"src/cli/plugin.ts":{"bytesInOutput":258},"src/cli/commands/index.ts":{"bytesInOutput":196},"src/cli/commands/disable.ts":{"bytesInOutput":1828},"src/cli/storage.ts":{"bytesInOutput":1230},"src/cli/commands/enable.ts":{"bytesInOutput":1633},"src/cli/commands/list.ts":{"bytesInOutput":1133},"src/cli/commands/util.ts":{"bytesInOutput":317},"src/cli/index.ts":{"bytesInOutput":0}},"bytes":7104}}}
@@ -1 +0,0 @@
1
- {"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/disable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO;QAAsC,MAAM;2MAuB9D,CAAC;AAEH,eAAO,MAAM,OAAO;;EAMgC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/enable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO;QAAsC,MAAM;2MAoB9D,CAAC;AAEH,eAAO,MAAM,MAAM;;EAMgC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAM/C,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAGtD,CAAC"}
@@ -1,7 +0,0 @@
1
- import * as Command from '@effect/cli/Command';
2
- import * as Effect from 'effect/Effect';
3
- import { Plugin } from '@dxos/app-framework';
4
- import { CommandConfig } from '@dxos/cli-util';
5
- export declare const handler: () => Effect.Effect<void, never, Plugin.Service | CommandConfig>;
6
- export declare const list: Command.Command<"list", Plugin.Service | CommandConfig, never, {}>;
7
- //# sourceMappingURL=list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAa,MAAM,gBAAgB,CAAC;AAI1D,eAAO,MAAM,OAAO,kEAyBlB,CAAC;AAEH,eAAO,MAAM,IAAI,oEAAiG,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/util.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,eAAe,2CAOlD,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './plugin';
2
- export * from './storage';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/cli/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO7C,eAAO,MAAM,cAAc,4BAK1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/cli/storage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAaxC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;aAAgD,MAAM;sHAcnF,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;aAAyD,MAAM;aAAW,MAAM,EAAE;4GAO/G,CAAC"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { type Plugin } from '@dxos/app-framework';
3
- export type PluginRegistryProps = {
4
- id: string;
5
- plugins: Plugin.Plugin[];
6
- };
7
- export declare const PluginRegistry: React.ForwardRefExoticComponent<Omit<PluginRegistryProps, "className"> & {
8
- classNames?: import("@dxos/ui-types").ClassNameValue;
9
- } & {
10
- className?: string;
11
- children?: React.ReactNode;
12
- role?: string;
13
- } & React.RefAttributes<HTMLDivElement>>;
14
- //# sourceMappingURL=PluginRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/containers/PluginRegistry/PluginRegistry.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAclD,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;wCAgE1B,CAAC"}
@@ -1,2 +0,0 @@
1
- export { PluginRegistry as default } from './PluginRegistry';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/PluginRegistry/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
package/src/cli/index.ts DELETED
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './plugin';
6
- export * from './storage';
@@ -1,94 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { useAtomValue } from '@effect-atom/atom-react';
6
- import * as Effect from 'effect/Effect';
7
- import React, { useCallback, useMemo } from 'react';
8
-
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/operations';
14
- import { ScrollArea } from '@dxos/react-ui';
15
- import { composable, composableProps } from '@dxos/ui-theme';
16
-
17
- import { PluginList } from '#components';
18
- import { getPluginPath } from '#meta';
19
-
20
- const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>
21
- a.localeCompare(b);
22
-
23
- export type PluginRegistryProps = {
24
- id: string;
25
- plugins: Plugin.Plugin[];
26
- };
27
-
28
- export const PluginRegistry = composable<HTMLDivElement, PluginRegistryProps>(
29
- ({ id, plugins: pluginsProp, ...props }, forwardedRef) => {
30
- const manager = usePluginManager();
31
- const { invoke, invokePromise } = useOperationInvoker();
32
- const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);
33
- const enabled = useAtomValue(manager.enabled);
34
- const allSettings = useCapabilities(AppCapabilities.Settings);
35
-
36
- // TODO(wittjosiah): Factor out to an intent?
37
- const handleChange = useCallback(
38
- (id: string, enabled: boolean) =>
39
- Effect.gen(function* () {
40
- if (enabled) {
41
- yield* manager.enable(id);
42
- } else {
43
- yield* manager.disable(id);
44
- }
45
-
46
- yield* invoke(ObservabilityOperation.SendEvent, {
47
- name: 'plugins.toggle',
48
- properties: {
49
- plugin: id,
50
- enabled,
51
- },
52
- });
53
- }).pipe(runAndForwardErrors),
54
- [invoke, manager],
55
- );
56
-
57
- const handleClick = useCallback(
58
- (pluginId: string) =>
59
- invokePromise(LayoutOperation.Open, {
60
- subject: [getPluginPath(pluginId)],
61
- pivotId: id,
62
- positioning: 'end',
63
- }),
64
- [invokePromise, id],
65
- );
66
-
67
- const hasSettings = useCallback(
68
- (pluginId: string) => allSettings.some((s) => s.prefix === pluginId),
69
- [allSettings],
70
- );
71
-
72
- const handleSettings = useCallback(
73
- (pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),
74
- [invokePromise],
75
- );
76
-
77
- return (
78
- <ScrollArea.Root {...composableProps(props)} orientation='vertical' ref={forwardedRef}>
79
- <ScrollArea.Viewport>
80
- <PluginList
81
- plugins={plugins}
82
- enabled={enabled}
83
- onClick={handleClick}
84
- onChange={handleChange}
85
- hasSettings={hasSettings}
86
- onSettings={handleSettings}
87
- />
88
- </ScrollArea.Viewport>
89
- </ScrollArea.Root>
90
- );
91
- },
92
- );
93
-
94
- PluginRegistry.displayName = 'PluginRegistry';
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export { PluginRegistry as default } from './PluginRegistry';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes